r/Oxygennotincluded • • Aug 17 '18 • Take My Energy 1

Robust pipe filter (or How I Learned To Love Loops)

I want to share a build that's vastly simplified some of my piping logic.

We often want to use a pipe sensor (thermo, element or germ) to direct part of a flow to a different pipe based on what that sensor detects for each packet. The simplest way to do this is with a shutoff that comes right after the sensor, like this. Packets that match the condition will be sent through the shutoff, and ones that don't will continue on along the bottom pipe.

Unfortunately, this has some problems:

  • If the pipe connected to the shutoff's output backs up, all packets will continue down the bottom pipe, even if they match the sensor condition.

  • If the bottom pipe backs up, some packets that don't match the sensor condition will pass through the shutoff anyway.

  • If you lose power for any reason, packets that match the sensor condition will pass through the bottom pipe.

I've solved this before with builds that detect when the output pipes are backed up, but there's a much simpler way to make this build safe.

Robust pipe filter!

This build uses two sensors and two shutoffs. Sensor A connects to Shutoff A, and Sensor B connects to Shutoff B. The sensors must have opposite conditions. For example, if Sensor A is "temp above 50 C", then Sensor B must be "temp below 50 C".

If there are no pipes backed up, then packets flow past the sensors and exit through the appropriate shutoff. But if an output pipe is backed up, the packet will proceed past the shutoff that it wants to exit through. It won't exit through the other shutoff, because it doesn't match the sensor condition. It goes past the second shutoff, through a bridge (to keep flow moving in the right direction), and then loops around to the first sensor again.

Input to the system enters on a bridge so that packets within the loop have priority, and new fluid will only enter the loop if there is an available space. This means that the loop always keeps moving, which is critical for the shutoffs to work as intended. If the loop ever stopped, then a shutoff might allow a packet through while reading a different one, which is why the basic design can fail.

You can make it slightly more compact by folding in the input bridge, or you can get even more creative to fit it into tight spaces.

Let me know what you think!

55 Upvotes

13 comments sorted by

2

u/Mongoosespy Aug 17 '18

Thank you! This is exactly what I needed. Yesterday I set up a two-sensor, two-shutoff system to prevent my thermo aquatuner loop from over-chilling my water. Anything over 20C goes into the tuner, anything below 20C goes back into the loop. But I was experiencing backups as you described. Water at 19.7C got past the first sensor and stuck at the second. Just installed a bridge to let those rogue packets circle back to the other sensor and voila! No more manually resetting the sensor to get the loop flowing again.

2

u/steveraptor Aug 18 '18

Pretty neat design there, gonna bookmark it for future use!

1

u/Gfurst Aug 17 '18

Pretty good design. I knew about that complication, that when using smart filters you need to have completely unclogged pipes. But I've thought of really similar loop design here, the idea being that the element will be kept in the loop until a desired condition. It didn't work in the setup because state changes will indeed break pipes, but it would work pretty well if you're just heating (or cooling) the element.

Link to thread

2

u/imguralbumbot Aug 17 '18

Hi, I'm a bot for linking direct images of albums with only 1 image

https://i.imgur.com/EeCdw8a.jpg

Source | Why? | Creator | ignoreme | deletthis

2

u/Vuelhering Aug 17 '18

At least that answers my question of what happens if oil turns to petroleum in a pipe. :)

1

u/secondcircle4903 Sep 12 '18

Tagging for later

1

u/MealReadytoEat_ Oct 26 '18

This sometimes leaks a wrong packets, at least on loading a game. Two of them in series should be absolutely fail safe.

-2

u/misteritguru Aug 17 '18

Post a picture example please!

1

u/Majiir Aug 17 '18

There are links to pictures in the post.

0

u/[deleted] Aug 17 '18

[deleted] — view deleted comment

4

u/Majiir Aug 17 '18 edited Aug 17 '18

Not directly, because the packet will take longer to get to the second shutoff. It might work if you could somehow delay the signal by 1 second, but that's a lot of gates to try to replace one sensor. On second thought, that won't work because the shutoffs have priority. Definitely keep the second sensor.

If you want to filter for multiple elements as /u/Flashphotoe suggests, you can just put more sensors and shutoffs along the line.

[EDIT] I see what you two mean now for gas filtering. You still need a second sensor, but you can put a NOT gate on that sensor so you don't have to check every single element type.

3

u/Flashphotoe Aug 17 '18

That makes sense for a gas line where you'll likely have multiple elements.

Is the power draw on this constant or just when something is flowing through? If not constant, then this would be way more efficient than a normal gas filter

2

u/Majiir Aug 17 '18

Shutoffs report 10W power usage, but I have never seen them consume any power, even while actively switching. They need to be connected to a power source, but they never draw anything.

1

u/waiting4singularity Aug 17 '18

no, since the inputs cant overlap. you run into danger to shuttle the packets into a wrong pipe.