Stationeers-IC10/precision_gas_mixer_H2_O2.asm

86 lines
1.9 KiB
NASM

# H2/O2 Volume Pump Gas Mixer
# Uses 2 Volume pumps instead of a gas mixer
# No need to worry about temperatures throwing...
#...mix ratios off. -Prevents Over pressure.
# You will need 1 Pipe Analyser and 2 Volume pumps.
alias H2o2Analyser d0
alias O2Pump d1
alias H2Pump d2
# ----------Change desired values here-------------
# Currently set for H2/o2 fuel mix.
# If you adujst the max tank pressure then you must
#...modify the the settings below that accordingly.
define O2Ratio 0.34#Set desired O2 ratio
define H2Ratio 0.66 #Set desired H2 ratio
define MaxPres 20000 #Set desired tank pressure
define MaxH2Pres 19800 #Keep below MaxPres
define MinTransPres 19500 #Keep below MaxH2Pres
define MinPres 19000 # Set tank minimum pressure
define PumpHighSetting 10.0 #H2Pump max setting
#--------------------------------------------------
alias O2 r0 #Ratio
alias H2 r1 #Ratio
alias Pres r2 #Pressure
alias H2PumpSetting r3
alias CurrentO2Setting r4
alias CurrentH2Setting r5
alias LowH2Setting r6
checkO2:
s H2o2Analyser On 1
l H2PumpSetting H2Pump Setting
mul CurrentO2Setting H2PumpSetting 0.75
s O2Pump Setting CurrentO2Setting
l O2 H2o2Analyser RatioOxygen
blt O2 O2Ratio o2PumpON
bgt O2 O2Ratio o2PumpOFF
j checkH2
checkH2:
l Pres H2o2Analyser Pressure
bge Pres MinTransPres setLOW
blt Pres MinTransPres setHIGH
resumePresCheck:
l Pres H2o2Analyser Pressure
bge Pres MaxH2Pres h2PumpOFF
H2RatioCheck:
l H2 H2o2Analyser RatioVolatiles
blt H2 H2Ratio h2PumpON
bgt H2 H2Ratio h2PumpOFF
j checkO2
o2PumpON:
s O2Pump On 1
j checkH2
o2PumpOFF:
s O2Pump On 0
j checkH2
h2PumpON:
s H2Pump On 1
j checkO2
h2PumpOFF:
s H2Pump On 0
j checkO2
pumpsOFF:
s O2Pump On 0
s H2Pump On 0
j checkO2
setLOW:
abs CurrentH2Setting PumpHighSetting
mul LowH2Setting CurrentH2Setting 0.5
s H2Pump Setting LowH2Setting
j resumePresCheck
setHIGH:
s H2Pump Setting PumpHighSetting
j resumePresCheck