Actions

Difference between revisions of "Temperature independent fuel mixing"

From Unofficial Stationeers Wiki

m
(complete rewrite)
Line 1: Line 1:
When fuel is mixed in a Pipe Gas Mixer, the obtained ratio can be wrong if the gases had different temperatures. By using volume pumps and some logic circuits, the correct 2:1 fuel mix can still be obtained without waiting for the temperature to equalize.
+
Making fuel with a 33:67 setting on the gas mixer when the incoming O2 and H2 have different temperatures will result in an incorrect mix.  
  
This setup measures the total fuel pressure and the ratio of oxygen in the fuel mixture, these values are then multiplied to calculate the partial oxygen pressure which is directly linked to the amount of moles of oxygen in the mixture. This also gives control over the total pressure (which is tripple the partial pressure in a 2:1 mixture) which helps with safety. Volatiles are added automatically whenever the ratio of oxygen in the fuel mix becomes too high.  
+
Instead of waiting for the temperatures to equalize, one can build a circuit that calculates the correct setting for the gas mixer to make perfect fuel. The fuel will really be perfect because the gas mixer allows decimal values, so it's incredibly accurate. Just don't forget that making hot fuel will lead to explosions, but if it should happen please enjoy the strongest and most perfect explosion possible.
  
If so desired, one can add a single logic processer to this setup to let the player insert the desired total pressure instead. Simply replace the B2 memory with 1 math multiplier (B2a) and 1 memory (B2b), then have B2a multiply the desired total pressure (set with B2b) with the desired oxygen ratio (B5), and let B1 compare B2a vs. A3 instead. New wires must also be added to connect all these parts together.
+
'''Components needed:'''
 +
*3 logic I/O (2 readers, 1 writer)
 +
*5 logic processor (all math)
 +
*3 logic memory
 +
*2 pipe analyzer
 +
*1 gas mixer
  
A problem with this setup is that it will continue to add oxygen even if the volatile storage is empty, which will ruin the fuel ratio. This can be fixed either by adding a valve (infront of the volume pumps so it doesn't blow the pipe) for manual control of the oxygen flow, or by adding circuits to shut it off.
 
Another issue is that tweaking the memory values while the system is running can cause the fuel tank to overpressurize and burst, keep suspects with screwdrivers away from the area.
 
  
'''Components'''
+
'''Build:'''
* Gas pipes
 
* Gas storage
 
* Wires
 
*4 Logic I/O
 
*3 Logic Processor
 
*2 Logic Memory
 
*2 Volume pumps
 
*1 Pipe Analyzer (requires electrum)
 
  
[[File:Temperature independent fuel mixing.jpg|thumb|Example of how to place the circuit in a location where it's easy to blow it up]]
+
On the gas mixer, connect O2 to input 1 (side) and H2 to input 2 (top)
'''Setup'''
 
#Connect volume pumps from O2/H2 respectively leading towards the fuel side
 
#Connect the pipe analyzer on the fuel side
 
#Optional: Use a Power Area Control or Transformer to isolate the logical components to their own network. This also makes it easy to shut off the system.
 
#Place logical components
 
  
*A1: Reader for pipe analyzer, total pressure (in KPa)
+
*2 pipe analyzers
*A2: Reader for pipe analyzer, ratioOxygen (between 0 and 1)
+
**On the O2 and H2 sides
*A3: Math multiplier, A1*A2 (this is the partial oxygen pressure in the fuel tank)
+
*2 logic readers
 +
**T.o = Temperature on the pure oxygen side
 +
**T.v = Temperature on the pure volatiles side
 +
*2 math and 1 memory unit to calculate T.o/(2*T.v)
 +
**A = 2*T.v
 +
**B = T.o/A
 +
*2 math and 1 memory unit to calculate the ratio of oxygen (result between 0 and 1)
 +
**C = B+1
 +
**D = B/C
 +
*1 math and 1 memory to get a final value between 0 and 100, the range that the gas mixer wants
 +
**result = 100*D
 +
*1 logic writer to send the result to the gas mixer
 +
**The gas mixer will accept decimal values, so the mix will be a perfect 2:1 mix of H2 and O2
  
*B1: Compare, B2 vs. A3, greater
 
*B2: Memory, 2000 (desired partial oxygen pressure, 3x this will be the total pressure)
 
*B3: Writer for Oxygen volume pump, on
 
  
*B4: Compare, A2 vs. B5, greater
+
'''Additional:'''
*B5: Memory, 0.334 (use Labeller to set this value)
+
*Use a PAC or Transformer to put this circuit on it's own data network
*B6: Writer for Volatiles volume pump, on
+
*The circuit will require 180W on standby and 280W while mixing fuel
  
'''Notes'''
 
*Don't mix fuel near critical infrastructure.
 
*For safety, set the desired partial oxygen pressure to 2000 max, the total pressure will be tripple this value in kPa.
 
*If the system runs out of volatiles, the fuel mix will still be fed oxygen.
 
*If the system runs out of oxygen, the system will stop adding volatiles.
 
*Give volume pumps a 1:2 ratio on their values, this reduces errors in the fuel mix when the system is rebalancing.
 
*Power use 120 W on standby
 
  
'''Using an IC 10'''
 
  
If an IC 10 is used to control the fuel mixing, the formula PV=nRT can be used to manipulate the setting on the volume pumps to get a 2:1 ratio directly with maximum flow. This will speed up the fuel making considerably, but some fine tuning is still needed afterwards. The required formula can made by setting up one expression for H2 and one for O2, solve both for n, then combine the two expressions and cancel out R. We know that twice the amount of H2 is needed, that will introduce a multiple of 1/2 for the volatiles side, the expression will become:
 
  
n=PV/(RT) -> 1/2 * PV/T (volatiles) = PV/T (oxygen)
 
  
1/2 * P(H2)*V(H2)/T(H2) = P(O2)*V(O2)/T(O2)
+
'''The fun math part that everyone will read'''
  
solve for the volume ratio, since that is what the volume pumps can control, the pressure and temperature are known because they can easily be measured
+
The ideal gas law and the chemical formula will be used to find a temperature dependent equation
 
+
*PV=nRT
V(O2)/V(H2) = P(H2)/T(H2) * T(O2)/P(O2) * 1/2
+
*1 O2 + 2 H2 -> products
 
+
We want one expression for oxygen and another for volatiles, .o and .v will be used to indicate if it's oxygen or volatiles
When the volume ratio is above 1, set the Oxygen volume pump to 100 L and the Volatiles volume pump to 100/ratio
+
*oxygen: P.o*V.o = n.o*R*T.o
 
+
*volatiles: P.v*V.v = n.v*R*T.v
When the volume ratio is below 1, set the Volatiles volume pump to 100 L and the Oxygen volume pump to 100*ratio
+
The chemical formula tells us how n.o and n.v are related, n.v is twice the value of n.o, so we can remove the .o and .v by replacing them with n again
 
+
*n.o = n
The volume pump can only take integers between 0 and 100, decimals will not be accepted, so rounding might be necessary. This will create a small error in the fuel mix, so some fine tuning is necessary to get a perfect 2:1 mix.
+
*n.v = 2n
 +
Now we will use this to solve both expressions for n
 +
*oxygen: n = P.o*V.o / (R*T.o)
 +
*volatiles: n = 1/2 * P.v*V.v / (R*T.v)
 +
Combine the expressions
 +
*P.o*V.o / (R*T.o) = 1/2 * P.v*V.v / (R*T.v)
 +
We now cancel R from both sides. We can also remove P.o and P.v because the gas mixer is already compensating for differences in incoming pressures so we don't have to deal with that, this leaves us with
 +
*V.o/T.o = 1/2 * V.v/T.v
 +
The gas mixer can only influence the volume, not the temperature, so we will solve for the volume ratio
 +
*V.o/V.v = T.o/(2*T.v)
 +
The V.o/V.v ratio has no unit, it's just a number. So we can replace it with the settings on the gas mixer, because the value itself is unchanged from doing that
 +
*1) Ratio.o/Ratio.v = T.o/(2*T.v)
 +
This is our first equation.<br>
 +
We now have two unknowns, Ratio.o and Ratio.v, and one equation. The gas mixer can give us another equation, looking at the input values of it tells us that it accepts values between 0 and 100 percent, it even takes decimal values if the Labeler is used which is great, it means there won't be any rounding errors in the fuel, it will be a perfect 1:2 ratio.
 +
*2) Ratio.o + Ratio.v = 100% = 1
 +
Two equations, two unknowns. This can be solved.<br>
 +
It doesn't really matter if we choose Ratio.o or Ratio.v, the only effect from this is to determine which pipe goes where on the gas mixer. Let's use oxygen on input 1 and volatiles on input 2. That means we should calculate Ratio.o, so lets remove Ratio.v via substitution
 +
*Ratio.v = 1 - Ratio.o
 +
now substitute this into the first equation
 +
*Ratio.o/(1-Ratio.o) = T.o/(2*T.v)
 +
After some algebra we get
 +
*Ratio.o = T.o/(2*T.v) / (1 + T.o/(2*T.v))
 +
To make it easier to look at, lets substitute T.o/(2*T.v) for k
 +
*Ratio.o = k / (1 + k)
 +
However, the gas mixer demands values between 0 and 100, so we must multiply with 100 to get the correct range
 +
*gas mixer setting = 100 * T.o/(2*T.v) / (1 + T.o/(2*T.v))
 +
This is our final equation and what the circuit will calculate. This result will be sent to the gas mixer. And as mentioned above, this equation expects the O2 pipe to be connected to input 1.

Revision as of 07:19, 12 April 2021

Making fuel with a 33:67 setting on the gas mixer when the incoming O2 and H2 have different temperatures will result in an incorrect mix.

Instead of waiting for the temperatures to equalize, one can build a circuit that calculates the correct setting for the gas mixer to make perfect fuel. The fuel will really be perfect because the gas mixer allows decimal values, so it's incredibly accurate. Just don't forget that making hot fuel will lead to explosions, but if it should happen please enjoy the strongest and most perfect explosion possible.

Components needed:

  • 3 logic I/O (2 readers, 1 writer)
  • 5 logic processor (all math)
  • 3 logic memory
  • 2 pipe analyzer
  • 1 gas mixer


Build:

On the gas mixer, connect O2 to input 1 (side) and H2 to input 2 (top)

  • 2 pipe analyzers
    • On the O2 and H2 sides
  • 2 logic readers
    • T.o = Temperature on the pure oxygen side
    • T.v = Temperature on the pure volatiles side
  • 2 math and 1 memory unit to calculate T.o/(2*T.v)
    • A = 2*T.v
    • B = T.o/A
  • 2 math and 1 memory unit to calculate the ratio of oxygen (result between 0 and 1)
    • C = B+1
    • D = B/C
  • 1 math and 1 memory to get a final value between 0 and 100, the range that the gas mixer wants
    • result = 100*D
  • 1 logic writer to send the result to the gas mixer
    • The gas mixer will accept decimal values, so the mix will be a perfect 2:1 mix of H2 and O2


Additional:

  • Use a PAC or Transformer to put this circuit on it's own data network
  • The circuit will require 180W on standby and 280W while mixing fuel



The fun math part that everyone will read

The ideal gas law and the chemical formula will be used to find a temperature dependent equation

  • PV=nRT
  • 1 O2 + 2 H2 -> products

We want one expression for oxygen and another for volatiles, .o and .v will be used to indicate if it's oxygen or volatiles

  • oxygen: P.o*V.o = n.o*R*T.o
  • volatiles: P.v*V.v = n.v*R*T.v

The chemical formula tells us how n.o and n.v are related, n.v is twice the value of n.o, so we can remove the .o and .v by replacing them with n again

  • n.o = n
  • n.v = 2n

Now we will use this to solve both expressions for n

  • oxygen: n = P.o*V.o / (R*T.o)
  • volatiles: n = 1/2 * P.v*V.v / (R*T.v)

Combine the expressions

  • P.o*V.o / (R*T.o) = 1/2 * P.v*V.v / (R*T.v)

We now cancel R from both sides. We can also remove P.o and P.v because the gas mixer is already compensating for differences in incoming pressures so we don't have to deal with that, this leaves us with

  • V.o/T.o = 1/2 * V.v/T.v

The gas mixer can only influence the volume, not the temperature, so we will solve for the volume ratio

  • V.o/V.v = T.o/(2*T.v)

The V.o/V.v ratio has no unit, it's just a number. So we can replace it with the settings on the gas mixer, because the value itself is unchanged from doing that

  • 1) Ratio.o/Ratio.v = T.o/(2*T.v)

This is our first equation.
We now have two unknowns, Ratio.o and Ratio.v, and one equation. The gas mixer can give us another equation, looking at the input values of it tells us that it accepts values between 0 and 100 percent, it even takes decimal values if the Labeler is used which is great, it means there won't be any rounding errors in the fuel, it will be a perfect 1:2 ratio.

  • 2) Ratio.o + Ratio.v = 100% = 1

Two equations, two unknowns. This can be solved.
It doesn't really matter if we choose Ratio.o or Ratio.v, the only effect from this is to determine which pipe goes where on the gas mixer. Let's use oxygen on input 1 and volatiles on input 2. That means we should calculate Ratio.o, so lets remove Ratio.v via substitution

  • Ratio.v = 1 - Ratio.o

now substitute this into the first equation

  • Ratio.o/(1-Ratio.o) = T.o/(2*T.v)

After some algebra we get

  • Ratio.o = T.o/(2*T.v) / (1 + T.o/(2*T.v))

To make it easier to look at, lets substitute T.o/(2*T.v) for k

  • Ratio.o = k / (1 + k)

However, the gas mixer demands values between 0 and 100, so we must multiply with 100 to get the correct range

  • gas mixer setting = 100 * T.o/(2*T.v) / (1 + T.o/(2*T.v))

This is our final equation and what the circuit will calculate. This result will be sent to the gas mixer. And as mentioned above, this equation expects the O2 pipe to be connected to input 1.