Add precision_gas_mixer_H2_N2O.asm

This commit is contained in:
Ivor Barhansky 2024-07-30 10:57:44 +00:00
parent 9de5f886cb
commit 6924b3837d

View File

@ -0,0 +1,86 @@
# H2/N2O 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 H2N20Analyser d0
alias PumpN20 d1
alias PumpH2 d2
# ----------Change desired values here-------------
# Currently set for H2/N2O fuel mix.
# If you adujst the max tank pressure then you must
#...modify the the settings below that accordingly.
define N2ORatio 0.50 #Set desired N2O ratio
define H2Ratio 0.50 #Set desired H2 ratio
define MaxPres 700 #Set desired tank pressure
define MaxH2Pres 680 #Keep below MaxPres
define MinTransPres 650 #Keep below MaxH2Pres
define MinPres 600 # Set tank minimum pressure
define PumpHighSetting 10.0 #H2Pump max setting
#--------------------------------------------------
alias N2O r0 #Ratio
alias H2 r1 #Ratio
alias Pres r2 #Pressure
alias H2PumpSetting r3
alias CurrentN2OSetting r4
alias CurrentH2Setting r5
alias LowH2Setting r6
checkN2O:
s H2N20Analyser On 1
l H2PumpSetting PumpH2 Setting
mul CurrentN2OSetting H2PumpSetting 0.75
s PumpN20 Setting CurrentN2OSetting
l N2O H2N20Analyser RatioNitrousOxide
blt N2O N2ORatio n2OPumpON
bgt N2O N2ORatio n2OPumpOFF
j checkH2
checkH2:
l Pres H2N20Analyser Pressure
bge Pres MinTransPres setLOW
blt Pres MinTransPres setHIGH
resumePresCheck:
l Pres H2N20Analyser Pressure
bge Pres MaxH2Pres h2PumpOFF
h2RatioCheck:
l H2 H2N20Analyser RatioVolatiles
blt H2 H2Ratio h2PumpON
bgt H2 H2Ratio h2PumpOFF
j checkN2O
n2OPumpON:
s PumpN20 On 1
j checkH2
n2OPumpOFF:
s PumpN20 On 0
j checkH2
h2PumpON:
s PumpH2 On 1
j checkN2O
h2PumpOFF:
s PumpH2 On 0
j checkN2O
pumpsOFF:
s PumpN20 On 0
s PumpH2 On 0
j checkN2O
setLOW:
abs CurrentH2Setting PumpHighSetting
mul LowH2Setting CurrentH2Setting 0.5
s PumpH2 Setting LowH2Setting
j resumePresCheck
setHIGH:
s PumpH2 Setting PumpHighSetting
j resumePresCheck