-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs
305 lines (241 loc) · 11.4 KB
/
docs
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
The software allows the logging of the following items:
Date
Time
Temperature
Battery charge
Battery volts
Charge/discharge current
Shunt % load
Power
Turbine RPM
Maximum and minimum power in the last hour and day
Event flags (inverter on/off etc)
The record generated looks like this:
20-11-12 13:19:00 E:0 L:0 S:0 F:9 D:0 T:18.73 C:931 V:26.16 A:-0.24 P:-6 R:0 r:0 H:-6 Y:276 h:-6 y:-1345 I:1234 O:1203
Date & Time
E: - error ON/OFF
L: - load ON/OFF
S: - shunt ON/OFF
F: - event flags
DISPLAY 0 - manual request for display
OVERVOLT 1 - volts greater than Max
UNDERVOLT 2 - volts less than Min
MANUALON 3 - inverter turned on manually
MANUALOFF 4 - inverter turned off manually
CHARGED 5 - inverter turned on in auto mode when at 100%
DISCHARGED 6 - inverter turned off in auto mode when at Min Charge
SHUNTON 7 - shunt load threshold exceeded
SHUNTOFF 8 - dropped below shunt load threshold
MARKTIME 9 - regular 1 minute interval report
NEWHOURMAX 10 - new hour maximum recorded
NEWDAYMAX 11 - new day maximum recorded
NEWHOURMIN 12 - new hour minimum recorded
NEWDAYMIN 13 - new day minimum recorded
LEAKADJUST 14 - charge level adjusted by 1% to allow for leakage
LOG_IDLEADJUST 15 - charge level adjusted to allow for the idle current of the controller, inverter etc
D: - dump % load
T: - temperature
C: - charge in amp-hrs
V: - volts
A: - amps
P: - power
R: - rpm
r: - max RPM in last hour
H: - hour max power
Y: - day max power
h: - hour min power
y: - day min power
I: - incoming charge total
O: - outgoing charge total
The User Interface.
There are a total of 8 screens, split between information display and setup
First info screen
+--------------------+
|Volts vv.vv |
|Charge cccc amp-hrs |
|Power pppp watts|
|Current aaa.aa amps|
+--------------------+
vv.vv - voltage to within 20mV
cccc - charge in amp-hrs
pppp - power - may be -ve
aaa.aa - current to within 0.24amps (depends on shunt resistor value) - may be -ve
All these values are averaged over 10 readings (about 2 seconds)
Second info screen
+--------------------+
|Dump ss % |
|Speed rrr RPM |
|Temp tt.tt deg |
|HH:MM:SS DD-MM-YY |
+--------------------+
ss - PWM ratio to dump (shunt) load up to 100%
rrr - RPM
tt.tt - termperature in degree C - may be -ve
HH:MM:SS DD-MM-YY - time and date
Third info screen
+--------------------+
|Max/Min/Total |
|Hr HHHH Day DDDD |
|Hr hhhh Day dddd |
|In iiiii Out ooooo |
+--------------------+
HHHH - max power in last hour
DDDD - max power in last day
hhhh - min power in last hour
dddd - min power in last day
iiiii - total amp-hrs in over lifetime of system
ooooo - total amp-hrs out over lifetime of system
First config screen
+--------------------+
| System vx.x-y |
|Voltage VV |
|Calibrate vv.vv |
|HH:MM:SS DD-MM-YY |
+--------------------+
x.x-y - git tag version number + number of commits beyond tag
VV - system voltage in 6v steps
vv.vv - measured voltage for calibration
HH:MM:SS DD-MM-YY - time and date that can be adjusted!
Second setup screen Voltage
+--------------------+
| Voltage |
|Min nn.nn Max xx.xx |
|Float ff.ff |
|Absorb aa.aa |
+--------------------+
nn.nn - low voltage at which inverter will be turned off (1)
xx.xx - high voltage at which inverter will be turned on (1)
ff.ff - float voltage when battery bank 100% fully changed
aa.aa - max voltage when battery bank is 90-100% charged
(1) only if Control/Inverter is set to 'yes' or 'auto'
Third setup screen Battery
+--------------------+
| Battery |
|Bank Size bbbb |
|Min mmmm Max xxxx |
|Cycle cc Sync ssss |
+--------------------+
bbbb - battery bank size in amp-hrs
mmmm - value to discharge bank to if Control/Inverter is set to Auto
xxxx - value to charge to when not going to do a float charge
cc - number of times for a normal charge cycle before doing a float charge
ssss - charge level adjustable to match the actual battery bank
Forth setup screen
+--------------------+
| Miscellaneous |
|Shunt ssss Poles pp |
|Leak ll Idle ii.ii |
|Time ttt Date ddd |
+--------------------+
ssss - shunt conductance in Siemens (mhos)
pp - number of magnetic poles on generator (for rpm calcs)
ll - number of days for self discharge to reduce charge by 1%
ii.ii - current (in amps) of all the control systems
ttt - time adjustment in seconds per day to correct bad crystal oscillator
ddd - US date format on/off
Fifth screen
+--------------------+
| Control |
|Inverter iii |
|Override ooo |
|RPMsafe sss Max mmm |
+--------------------+
iii - one of off/on/auto to determine what control of an inverter is required (if any)
ooo - if Inverter is Yes or Auto then manually turn on/off
sss - safe value of RPMs to stop turnbibne without burning it out!
mmm - max RPM before shutdown
There are 5 buttons. Up, Down, Left, Right and Centre
At startup, the monitor screens are displayed in a carousel with an interval of about 5 seconds.
Press Centre to cancel the carousel or press Up/Down to move between monitor screens
Press Left/Right to move between setup screens.
When on a setup screen, press Centre to enter screen edit mode. This allows the Up/Down/Left/Right keys to move between the fields on the screen.
When in screen edit mode, press both Left and Right together to get back to moving between screens or press Centre to get to field edit mode.
When in field edit mode, Up/Down change the value. Some values have intellegent increments (eg. if over 100 then move in 10's, if over 1000 then 100's).
When in field edit mode, Left aborts any changes, Right sets the default for this field and Centre saves the value.
Some fields also have extra facilities, such as calibrate - this not only changes the scaling factor to allow the voltage measurement to track, it
also runs the 1-wire auto zero algorithm on the current sensor. For this reason the calibration must be done with no load or charging occuring.
A few general notes:
The controller relies on charge counting to see what the level of charge is in the batteries. This requires that the user manually synchronises
the controller with the batteries from time to time. A couple of methods are used to try and keep the charge tracking accurate.
The leakage (self discharge) can be programmed by the number of days for 1% discharge. The default is 7 days.
During a discharge, the charge recorded is adjusted by the ratio of the total charge/discharge tracking registers. eg if the totals registers
show a 92% efficiency then a 100amp hr discharge will be recorded as 108 amp-hrs to account for the cyclic losses.
The charging control is based on a 3 stage charge such that
Less than 90% in the batteries then bulk charge where the shunt load is only operated if the Max voltage is exceeded.
90% to 100% in the batteries then absorb mode is used where the shunt load starts to come in at float voltage but clamps to the absorb voltage max.
100% in the batteries and float mode is used where the voltage is clamped to between 99% and 100% of the float voltage by the shunt load.
The voltage is temperature compensated at a rate of 5mV per degree Celsius.
The shunt load is a PWM output at about 900Hz with opto isolators which in my case drives 4 automotive 160amp MOSFETS in parallel, although the load
itself is only 80amps so far!!
The SD card operations all try and minimise the chance of data corruption. Generally the card is written to once a minute so if the card is popped
out then hopefully its not in the middle of a data write!! When its put back in then the sense line is used to re-open the current log file (or a
new one is created if there isn't one).
Next comes the serial interface. I run this via a wireless router (a TPLink 1043ND) that runs OpenWRT software and has the ACM driver
loaded. I can ssh into the router and run picocom to get log info back from the controller or I can even reprogram it using the following command
line on the router:
socat tcp-l:54321,reuseaddr,fork file:/dev/ttyACM0,raw,echo=0,nonblock,waitlock=/var/run/tty0.lock,b115200
and the following line on my server/development box
avrdude -p atmega2560 -c stk500v2 -P net:tplink:54321 -U flash:w:images/ardmega-turbine.hex
Here is the (very basic) help output
>> ?
>>cal del dir type disk dcs inv log date time find config<<
The first few commands are associated with the storage of data on the SD card. I've used command name familiar with DOS/Windows users rather than
my preferred Linux (Unix) names!!
cal - run the calibration routine - make sure no charge or discharge is occuring first!
del - delete a file
dir - directory listing
type - display a file (end early with ESC)
disk - disk info, such as SD card manufacturer, free space, space used
dcs - this initialises the dis/charge registers to allow the total charge going in and out of the battery bank to be tracked. The ratio of these
values is also used to determine the charge cycle efficiency.
inv - toggle the invert on or off
log - toggle the logging on/off. Handy if you don't want a display messed up with a log line in the middle of it
date - set the date as dd/mm/yy
time - set the time as hh:mm:ss. The date & time get lost on a restart as the Arduino has no real time clock. The values do get saved to EEPROM
once per hour so at least any adjustments aren't too onerous!
find - like type but it only outputs lines that contain the string defined (cf. Unix grep). The number of days to look back by can be defined
with a minus sign. eg. "find -3 F:10" will look over the past 3 days to find log entries where a new hourly maximum power was logged (the flag
value of 10 means that!!).
config - displays some of the config.
The log info is stored in a FAT32 file system, one file per day.
Some examples:
>> dir
log-120909.txt 83953
log-120910.txt 166269
log-120911.txt 152866
log-120912.txt 161104
log-120913.txt 169106
log-120914.txt 161370
log-120915.txt 161857
log-120916.txt 159198
log-120917.txt 157831
log-120918.txt 187603
log-120919.txt 159092
log-120920.txt 161236
log-120921.txt 166901
log-120922.txt 167691
log-120923.txt 175498
log-120924.txt 184436
log-120925.txt 164924
log-120926.txt 187281
>> find -2 F:10
24-09-12 04:49:39 E:0 L:0 S:0 F:10 D:0 T:2.89 C:928 V:27.98 A:10.22 P:285 R:0 r:0 H:34 Y:497 h:20 y:-13 I:437 O:359
24-09-12 04:54:23 E:0 L:0 S:0 F:10 D:0 T:2.95 C:928 V:27.99 A:11.05 P:309 R:0 r:0 H:2609 Y:2609 h:20 y:-13 I:437 O:359
26-09-12 17:11:15 E:0 L:0 S:0 F:10 D:0 T:15.83 C:923 V:26.20 A:0.22 P:5 R:0 r:0 H:12 Y:12 h:-51 y:-51 I:453 O:374
>> config
System voltage 24, inverter control Yes
Voltage limits 22.00 - 29.00
Float Absorb 27.40 - 28.00
Charge limits 800 - 1000
>> disk
manuf: 1d
oem: AD
prod: SD
rev: 10
serial: 4b3
date: 2/12
size: 3747MB
copy: 0
wr.pr.: 0/0
format: 0
free: 3915522048/0