Jump to content

pipe package counter w/ new automation elements


Recommended Posts

Functionality of the signal counter has been changed, this is not working anymore.

TL;DR: The final version is under the "The Final Gas Version" section

Ever wanted to deliver 1169 kg of a liquid or a gas to a certain location? No!? Ok, but let me still continue writing this..
However, if you want to do it or would like to see how i tried to solve it: here is the package counter i am using.


Before the recent automation update

Spoiler

 

...it was quite a hassle to do this. I personally used the cheap version of a counter, namely the filter, to determine how much i want to sent and limited the flow to 1kg with a valve (see spoiler 1). It is a simple system but it has several flaws. The problem with it was that you have to add a specific offset in the filter and the outcome sometimes still varied a bit.

Spoiler

image.thumb.png.32afeed6c9fe7e67f835372ad9f089b1.png

image.thumb.png.0f77f65fd9b625f1dfd3d4beded92d6d.png

The good old atmo sensor as the early version of the switch.


 

 

With the new automation update
...we were provided with several really useful utilities. Specifically the signal counter opens new possibilities for this. I tried some methods to count, for example with the new timer sensor set to 1 Hz. But this is still not reliable since it just assumes or guesses how much already went down the pipe.

Using the pipe element sensor instead, you can count the real number of packages without random variations. For this method you have to split the pipe, so you only have packages in every second tile. Otherwise the sensor will not know the difference between a package that is not moving or ten packages in a row, which means: it does only count once for the first change of elements. I tried versions were you count on both alternating routes but this also leads to a continuous signal. Maybe you can do it with several splits, but i guess this can and will lead to overlapping signals at some point and therefor one package will not be recognized. So i build the following package counter.

20200308182851_1.thumb.jpg.86c8e3da92fb910e2bc3ae647f98f39a.jpg

This is the base version and a bit rudimentary but it works perfectly. The two signal counters on the right side can be ignored, they are the internal counter and should not be touched. Both signal counters on the left side are used to set the amount you want to send. In  this circuit it was X X 0. So you could send up to 990 kg. But i thought this is not enough since you want higher numbers and also, more specifically, the single digits.

 

The Final Gas Version (so far)
...contains counters for one and thousand and ribbons to keep it small. The following picture shows how it looks like, when it is finished sending 1169 kg of hydrogen (8 gas reservoirs with 7*150+119). Overlays and requirements are in the next spoiler.

How it works:
You can start and reset the apparatus with the switch (red box). I added a filter to delay the start so you can safely handle the switch without it accidentally going off. When the switch is turned off, you can set your four digits with the left signal counters (yellow box) like this X X X X kg. Then you can turn it on and it will run until the amount is reached. While it is running, you can technically still change the number in segments that have not been triggered but i would not recommend it.
You can also increase the target amount when it is already finished but has not been reset. Just change the number in the specific segment and it will continue and send the rest that is missing. Keep in mind that you should change numbers in signal counters via the little arrows since keyboard input sometimes does not work properly without resetting.
After you initiated it you can just leave it alone; you only have to reset it before you want to send a new batch.

The power consumption of this system is 10 Watt since only the shutoff needs power. When the power cuts off, it simply stops delivering/counting and continues once the power is back.
You can even pause the delivery by shutting off the shutoff power.

package_counter.thumb.jpg.3bef5a38e8e4fc4529baeb4b9141ad99.jpg

 

Spoiler

Automation overlay
I tried to make it a bit more compact. But you can still move some of the lower parts a bit more to the right side. You can ignore the automation wiring in the bottom left corner. These are parts of a currently disconnected counter that measures how long it takes to move 1169kg. Without this you can hook up the gas shutoff directly to the memory toggle like in the picture above.

image.thumb.png.b4e9e5e61e4cbfdfa1bf5b6b2c751bbf.png

a bit more compact version:

 

image.thumb.png.5af4960301ba189cc3a6b45cd402b1a6.png

For anyone who wants to know about the counter. It is build like this to make sure that it only runs when the gas is allowed to run. It stops when the shutoff turns off and will be reset when you reset the whole circuit. This version does not check for power cut on the shutoff though.

image.thumb.png.583cf4963c80e89033d5cd21934d8fa1.png

 

Gas pipes
To make it count correctly, the system needs to be fed with full packages. I made sure of that by using a buffer tank. With the new automation feature for tanks you can hook them up to the pumps and set the high threshold to something like 60%. This makes sure, that the tanks are never completely full and and the system does not backlog to the sensor. The right bridge prevents gas from flowing in the wrong direction and the left bridge makes sure that the overflow always moves prior to the feeding pipe.

image.thumb.png.1ae51eed1c7c22ab1deb354a659eabe1.png

 

Buffer Tank Automation
Always implement switches, so you can turn things off for yourself for construction etc.

The pumps stop when the tank is at 60% and start again at 50%. This way there is always both: enough space in the loop and enough resources for full packages (provided your pumps do not run dry).

image.thumb.png.8efb3451a42fd3aff73e0c9fcc98bfba.png

 

Liquid Pipe Version
It basically works the same way with liquids, but you need to limit the flow to 1 kg. Otherwise you will send X X X X 0 instead of X X X X since liquids are ten times the mass in pipes. Therefore you need some minor changes which are shown in the overlays in the next spoiler.

image.thumb.png.5215bc6df954cba09949a4d9ba0a0f72.png

Spoiler

Automation Overlay

image.thumb.png.65fa5b875c85b6789b0e0968fea5656e.png

 

Pipe Overlay
The valve is set to 9000 overflow, so only 1kg will ever move up to the sensor. You have to make sure that these 9kg are also always prior to the feeding pipe.

image.thumb.png.1a960f05f4bbae4dae03c88f841b721c.png

 

Limitations
The only downside of this method is the limited flow. Gas pipes are only halved to 0.5 kg/s which bearable. On the other hand liquid pipes are reduced to the same flow but this is 1/20 of its original capacity.
So i tried some methods where the liquids are counted in two separated systems, 10kg and 1kg packages for the single digits. But they did not work because the signal for shutting off the first shutoff takes so long with the additional necessary logic elements, that it releases one package more than wanted. This leads to "reignition" of the circuit and it basically runs again and again.

This is just the point were i stopped for now. Maybe i will try to complete it later. However, feel free to criticize or improve it.

Spoiler

Pipe Overlay
I tried to combine the 10kg inlet right of the element sensor together with the 1kg inlet in two separated systems.

image.thumb.png.1a6b3bb51df8d7a8762f3e19710e8788.png

 

Automation Overlay
Of course, this is not finished yet. The change to the bottom part to handle the 10kg shutoff works correctly so far but the signal takes too long to disable it. I guess i have to build in a shortcut somewhere.

image.thumb.png.2e8b3b565c63d57caa7135178065b53d.png

 

At this point i just want to add my recent suggestion here in the forum. It is basically a electric cabinet that would reduce the size of these huge circuits to really small 2x4 boxes.

 

You don't have to reduce the liquid flow at all.

You can split the stream and merge it again counting on both lines at the same time provided both lines have equal length. Like this where it splits directly off a shut off valve to close the stream when the desired number of packets is reached for example, and then merged again with a valve or bridge. Either works.

image.thumb.png.79eb440176b45e3df771499d9bebc67a.png

Now you can't connect the sensors together as that will just make a fully green or fully red signal so you need to have positive edge detectors that can output a single pulse whenever the input goes green. Traditionally you'd need an AND gate and a NOT gate for that but the counter can actually do that job as well. Set the counter to 1. Connect the output to reset and you have a positive edge detector. Like this. 

image.thumb.png.99ff5a129d68a5ff679c7fbd9cdbbcfc.png

Then you just connect the outputs to your counter array.

Also, logic gates work directly with ribbons. If you connect a ribbon to both inputs of a logic gate it works as 4 separate logic gates of that type with each line of the ribbon.

That position edge is good to know, i will try that out because it will double the speed. I mentioned the problem with the double element sensor input and that it did not work when i tried it. But i did not know that signal counters are capable of delivering the correct signal.

I am reducing the liquid flow because this version is otherwise only capable to deliver numbers like XXXX0. I cannot setup the last digit when i send 10kg packages.

2 minutes ago, stoeberhai said:

I am reducing the liquid flow because this version is otherwise only capable to deliver numbers like XXXX0. I cannot setup the last digit when i send 10kg packages.

Well, if you know it's 10kg packages then just set up a dummy counter to display the last digit.

I do not really know what you mean by that. The problem is i cannot deliver numbers where the first digit isn't 0 like 269 or 554. Only 270 or 550, for example, since the base of the pipe is 10kg not 1. More specifically, in these cases it would even be 2700kg and 5500kg instead. Therefor i limit it to 1kg to be able to send any number. It works, but quite slowly compared to the usual capacity of the liquid pipes.
 

I tried the edge counting and the counting itself works very good. However it basically creates the other problem i mentioned. Only this time the other way around because the inputs spam so fast, that the conditions for ending the sequence are set back to false before the signal reaches the shutoff memory toggle and it just keeps flowing infinitely. At this point i have to add a shortcut for a instant shutdown i guess.

Spoiler
7 hours ago, stoeberhai said:

Limitations

 

The only downside of this method is the limited flow. Gas pipes are only halved to 0.5 kg/s which bearable. On the other hand liquid pipes are reduced to the same flow but this is 1/20 of its original capacity.
So i tried some methods where the liquids are counted in two separated systems, 10kg and 1kg packages for the single digits. But they did not work because the signal for shutting off the first shutoff takes so long with the additional necessary logic elements, that it releases one package more than wanted. This leads to "reignition" of the circuit and it basically runs again and again.

(...)

The change to the bottom part to handle the 10kg shutoff works correctly so far but the signal takes too long to disable it. I guess i have to build in a shortcut somewhere.

 

 

What you mean with the ribbon logic is this below!?

image.png.028ab57b5ee417dc5acdb6de785e4246.png

I didn't use that so far but i could reduce the left part from three to one AND with a dummy, maybe that reduces the travel time sufficiently. I have to change a bit though, literally, since i'm not simply asking for "all 4 bits true".

 

Let me point out one point that seems to be a circuit problem.
If the target value is a value containing "0", for example "1103" kg, this circuit probably will not work properly.
This is because the reset signal of the lower signal counter is unintentionally released by "0".

Coincidentally, I was making a counter of the same concept almost at the same time.
At that time, I encountered the exact same problem and solved it, so I was able to come up with the problem of this circuit.
If you like, please for reference.

Spoiler

 

I am sorry if I am overstepping.
 

Automation in ONI is unfortunately slow and often cumbersome to work with. If you want a precise counter then water clock counters are far superior in speed and accuracy.

This simple set up will achieve the desired result in far less space.

image.thumb.png.1cf709a1147756b421987d88e7d04309.png

It uses two packet splitter loops with a valve that sets the packet size and an output either via the vent or the shut off valve as needed.

image.png.da86cc1fb7a048004b6aa87eccccde9d.png

image.png.e10899f4f94ed0076bdda5704cae90a2.png

In the water clock counter the valve is set to 200g/s because for best possible precision you want 100g/s per tile in the counter.

Here's the entire automation.

image.thumb.png.9623d775e1ee7032ae43139fafbac188.png

The hydrosensor sets how many packets are allowed through with a precisely 4 packet delay. So if you want 171 1kg packets through, you set the hydrosensor to 16.7kg.

The switch is the reset. You can add a decimal counter read out if you like but it's hardly necessary.

Save file included at the bottom of the post.

9 hours ago, stoeberhai said:

I do not really know what you mean by that.

What I mean is that I hardly see any circumstance where counting the precise kg is necessary. Even in rocket refuelling rounding up to the nearest 10kg full packet is fine. But I constructed the above counter to allow for any packet size you set the loop valve to.  

packet counter.sav

2 hours ago, kbn said:

Let me point out one point that seems to be a circuit problem.
If the target value is a value containing "0", for example "1103" kg, this circuit probably will not work properly.
This is because the reset signal of the lower signal counter is unintentionally released by "0".

True, i totally forgot to test zeros inside the target numbers. The concept of the counter is the same, checking from left to right. And since zero releases a true it thinks that the next digit to the right can already be counted. I have to change the OR's to AND's like in your version. Thank you!

 

26 minutes ago, Saturnus said:

What I mean is that I hardly see any circumstance where counting the precise kg is necessary. Even in rocket refuelling rounding up to the nearest 10kg full packet is fine. But I constructed the above counter to allow for any packet size you set the loop valve to.  

I know. That's why i answered my first question with no. I just wanted to build something.

Ok after some more testing: It actually is working with zeros. Maybe it is a bit wonky in some situations, i don't know.

Spoiler

20200310155420_1.thumb.jpg.1b7a45f1d227fff760d9275121dbd728.jpg20200310155710_1.thumb.jpg.9f84d23b522ece7780eeb59b94c08b52.jpg

 

Right now i was testing the AND Version. So far it runs in the same problem again: one package to many is released and it restarts everything. I'm not sure how i can solve this problem at the moment, but it appears in almost every case other than the one i posted.

image.thumb.png.8e808be22d12eb17f003d94c08d9a282.png

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...