Skip to content

Commit

Permalink
Update furnace scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsso committed Jul 31, 2021
1 parent 0e85bf4 commit ec355e8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
18 changes: 9 additions & 9 deletions myps/test-scripts/factory/furnace/furnace.myps
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# greater than the hot source temperature then wackiness will certainly occurr!
# (I may change this point in the future)
furnace = d0
tankC = d0
tankH = d1
nCPump = d2
nHPump = d3
tankC = d1
tankH = d2
nCPump = d3
nHPump = d4
nIAnalyzer = d5

# Constants
Expand Down Expand Up @@ -43,9 +43,9 @@ def kDH = 0.06
# (a) the removal of gas from the furnace,
# (b) the transfer of cold CO2 (i.e. removal from source)
# (c) the transfer of hot CO2
def ERRORF = 0.1
def ERRORC = 0.1
def ERRORH = 0.1
def ERRORF = 0.5
def ERRORC = 0.5
def ERRORH = 0.5

db.Setting = -1
loop:
Expand Down Expand Up @@ -124,8 +124,8 @@ loop:
eHPrev = eH

# (f.4) Set housing to current progress (total error / initial error)
progress = ((eF - ERRORF) + (eC - ERRORC) + (eH - ERRORH)) / eTotal0
db.Setting = progress # set progress
eTotal = (eF + eC + eH) / eTotal0
db.Setting = 1 - eTotal # set progress

# (f.5) Set rates from control values, and loop if any error is above limit
FNotDone = (eF > ERRORF)
Expand Down
10 changes: 6 additions & 4 deletions myps/test-scripts/factory/furnace/starter.myps
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ progressDisp = d5
def BLUE = 0
def GREEN = 2

tTDisp.On = 0
tTDisp.On = 0
progressDisp.On = 0
tTDisp.Color = GREEN
tTDisp.Color = GREEN
pTDisp.Color = GREEN
progressDisp.Color = BLUE
progressDisp.Mode = 1

loop:
yield()
Expand All @@ -39,3 +37,7 @@ loop:
pTDisp.On = 0
tTDisp.On = 0
progressDisp.On = 0
else:
tTDisp.On = 0
pTDisp.On = 0
progressDisp.On = 0
13 changes: 11 additions & 2 deletions myps/test-scripts/factory/furnace/validator.myps
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ def AdvancedFurnace = 545937711
def vF = 1000
def R = 8.31446261815324

# (NOTE: ADJUST PER SETUP)
# Source volume-mole factor
def nCfactor = (6100) / 6000
def nHfactor = (6100) / 6000

def GREEN = 2
def BLUE = 0
def RED = 4
Expand All @@ -26,12 +31,16 @@ def ErrorPMax = -4 # if target pressure > maximum (60,000)
def ErrorCMoles = -5 # if cold source doesn't have enough moles
def ErrorHMoles = -6 # if hot source doesn't have enough moles

db.Setting = 0
loop:
yield()
targetCode = inputControl.Setting
tT = (targetCode % 1000) * 10
pT = trunc(targetCode / 1000) * 100

tTStagingDisp.Setting = tT
pTStagingDisp.Setting = pT

tC = tankC.Temperature
tH = tankH.Temperature

Expand Down Expand Up @@ -63,11 +72,11 @@ loop:
nHI = nI * (tC - tI) / (tC - tH)
nCI = nI - nHI

if nCI > tankC.TotalMoles:
if nCI > nCfactor * tankC.TotalMoles:
db.Setting = ErrorCMoles
tTStagingDisp.Color = GRAY
pTStagingDisp.Color = GRAY
if nHI > tankH.TotalMoles:
if nHI > nHfactor * tankH.TotalMoles:
db.Setting = ErrorHMoles
tTStagingDisp.Color = GRAY
pTStagingDisp.Color = GRAY
Expand Down

0 comments on commit ec355e8

Please sign in to comment.