-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGFG Controller.ic10
81 lines (63 loc) · 1.75 KB
/
GFG Controller.ic10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# GFG Controller
# The GFG needs to be placed in the back of a 3x2x1 BOX
# with powered vents placed on the opposite side
# the Acttive Heating Vent needs to be placed inside of the box
# The Cooling Vent can be placed on either side but 2 lines of code need to be adapted
# on line 32
# The GFG can be connected to a battery charge reader (eg a memor unity) and will only run
# from lowCharge to highCharge
# if not connected the GFG will run permanently
# Constants
define cHighCharge 0.5
define cLowCharge 0.2
define cLowPressure 20
define cHighPressure 160
define cMinTemp 290
# Device aliases
alias dGenerator d0
alias dVentHeat d1
alias dVentCool d2
alias dGasSensor d3
alias dChargeReader d4
# variables
alias vCharge r15
alias vTemp r14
alias vPressure r13
# Set constants
loop:
yield
s dVentHeat Mode 1
# Mode 1 (IN) if Active Vent is placed outside of gfg box (Eg on Europa)
s dVentCool Mode 1
#s dVentCool PressureInternal 1000
s dVentCool PressureExternal 0
# Mode 0 if a Powered Vent is placed inside of GFG Box (EG with a cooling pipeline on other planets)
# Cooling Pipeline in this case should have a maximum of 20C
#s dVentCool Mode 0
#s dVentCool PressureExternal cHighPressure
s dVentHeat PressureExternal 0
l vTemp dGasSensor Temperature
l vPressure dGasSensor Pressure
slt r1 vPressure cLowPressure
sgt r0 vTemp cMinTemp
or r0 r1 r0
s dVentCool On r0
sgt r0 vPressure cHighPressure
sgt r1 vTemp 293 # greater than 20C
or r0 r0 r1
s dVentHeat On r0
# if no ChargeReader is set we let the gfg run permanently
bdns dChargeReader activate
l vCharge dChargeReader Setting
s db Setting vCharge
# activate check
bge vCharge cHighCharge deactivate
ble vCharge cLowCharge activate
yield
j loop
activate:
s dGenerator On 1
j loop
deactivate:
s dGenerator On 0
j loop