-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.py
93 lines (83 loc) · 2.18 KB
/
settings.py
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
82
83
84
85
86
87
88
89
90
91
92
93
from pint import UnitRegistry
from utils import config_file_path
# Instantiate a common units registry
UR = UnitRegistry(autoconvert_offset_to_baseunit=True)
UR.load_definitions(config_file_path('pint.txt'))
# Specify order and name of data columns
DATA_SPEC = (
'date',
'temperature_C',
'pH',
'supply_tank_L',
'nutrients_mL'
)
PH_CONFIG = {
'temperature': {
# 'value': 25 * UR.degC
'device_id': '28-0517b11b28ff'
},
'adc': {
'i2c_busn': 1,
'i2c_addr': 0x4F,
'v_ref': 2.5 * UR.V,
'v_off': 1.251 * UR.V,
'filter_samples': 256
},
'calibration': {
'temperature': 24 * UR.degC,
'points': (
{'ph': 4.0 * UR.pH, 'v': 1.426 * UR.V},
{'ph': 7.0 * UR.pH, 'v': 1.250 * UR.V}
)
}
}
SUPPLY_TANK_CONFIG = {
'adc': {
'i2c_busn': 1,
'i2c_addr': 0x48,
'channel': 2,
'fsr': 1024 * UR.mV,
'sps': 64
},
'calibration': {
'pressure_offset': 26.5 * UR.cmH2O,
'points': (
{'pressure': 0 * UR.cmH2O, 'volume': 0 * UR.L},
{'pressure': 70 * UR.cmH2O, 'volume': 300 * UR.L}
)
}
}
SOLUTION_TANK_CONFIG = {
'gpio_float_switch': 22,
'float_switch_state_when_full': 0
}
PUMP_X_CONFIG = {
'gpio_sleep': 17,
'gpio_step': 27,
'wake_up_time': 1 * UR.ms,
'max_frequency': 1 * UR.Hz,
'step_angle': 1.8 * UR.deg,
'steps_per_volume': 1050 / UR.mL,
'microsteps': 16
}
PUMP_Y_CONFIG = {
'gpio_sleep': 5,
'gpio_step': 6,
'wake_up_time': 1 * UR.ms,
'max_frequency': 1 * UR.Hz,
'step_angle': 1.8 * UR.deg,
'steps_per_volume': 1050 / UR.mL,
'microsteps': 16
}
CONTROLLER_CONFIG = {
'temperature_device_id': '28-0517b11b28ff',
'valid_ph_temperature_range': (5 * UR.degC, 40 * UR.degC),
'valid_ph_range': (4 * UR.pH, 8 * UR.pH),
'valid_supply_tank_volume_range': (0 * UR.L, 325 * UR.L),
'nutrients_concentration_per_ph': 1.65 * UR.mL / UR.L / UR.pH,
'pump_volume_limits': (2.5 * UR.mL, 25 * UR.mL),
'desired_ph': 6.5 * UR.pH,
'solution_volume': 60 * UR.L,
'proportional_k': 0.5,
'iteration_period': 15 * UR.min
}