-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbatterymike.cfg
146 lines (129 loc) · 5.46 KB
/
batterymike.cfg
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
[files]
logfile = '/home/pi/data/log'
summaryfile = '/home/pi/data/summary'
errfile = '/home/pi/data/baterrlog'
alarmfile = '/home/pi/data/alarmlog'
hoursummaryfile = '/home/pi/data/hoursummary'
daysummaryfile = '/home/pi/data/daysummary'
monthsummaryfile = '/home/pi/data/monthsummary'
yearsummaryfile = '/home/pi/data/yearsummary'
[logging]
data = "self.printtime+batdata.vbat+batdata.vdelta \
+batdata.iall+batdata.soctxt+batdata.socadjtxt+str(batdata.pip.rawdat)+str(batdata.pip2.rawdat)"
[battery]
name = 'Mikes'
numcells = 15
capacity = 200
maxchargerate = 50
targetsoc = 0.95 # target maximum SOC
minsocdif=0.03
float = 50.2
bulk = 52.2
overvoltage = 3.650
undervoltage = 2.900
ahloss = 0.29498831864316155
vreset = 51.8 # voltage to reset DOD counter
ireset = 5.0 # current to reset DOD counter
ilowcurrent = 10.0 # C/20 lowcurrent voltage logging current
[DemandManager]
socfeedback = 1.0 # multiplier for SOC difference feedback
currentfeedback = 0.70 # multiplier for current diffenence feedback
[Inverters]
numinverters = 2 # number of phisical inverters
turnonslave = 3000.0 # power output to turn slave inverter on
minruntime = 1800.0 # mimimum runtime of slave inverter in seconds
[Interfaces]
pip = 'pip(92931710100542)' # number in brackets is SN of PIP)
pip2 = 'pip(92931712101484)' # number in brackets is SN of PIP)
bms = 'bms(SP15S001-L15S-30A)' # string in brackets is harware name, from read command 05
pi = 'pi' # add raspberry pi
[Ports]
pipport = '/dev/ttyU*' # where to look for pipport
bmsport = '/dev/ttyU*' # where to look for bmsport
[VoltageInputs]
v01 = 'self.bms.rawdat["V01"]'
v02 = 'self.bms.rawdat["V02"]'
v03 = 'self.bms.rawdat["V03"]'
v04 = 'self.bms.rawdat["V04"]'
v05 = 'self.bms.rawdat["V05"]'
v06 = 'self.bms.rawdat["V06"]'
v07 = 'self.bms.rawdat["V07"]'
v08 = 'self.bms.rawdat["V08"]'
v09 = 'self.bms.rawdat["V09"]'
v10 = 'self.bms.rawdat["V10"]'
v11 = 'self.bms.rawdat["V11"]'
v12 = 'self.bms.rawdat["V12"]'
v13 = 'self.bms.rawdat["V13"]'
v14 = 'self.bms.rawdat["V14"]'
v15 = 'self.bms.rawdat["V15"]'
vinv = 'self.pip2.rawdat["BV"]'
[CurrentInputs]
iin1 = 'self.pip.rawdat["PVI"]'
iin2 = 'self.pip2.rawdat["PVI"]'
iin3 = 'self.pip.rawdat["BOutI"]'
iin4 = 'self.pip.rawdat["BInI"]'
iin5 = 'self.pip2.rawdat["BOutI"]'
iin6 = 'self.pip2.rawdat["BInI"]'
iin7 = 'self.current[2]+self.current[3]+self.current[4]+self.current[5]'
iin8 = 'self.current[0]+self.current[1]'
iin9 = 'self.current[6]-self.current[7]'
[TemperatureInputs]
tin1 = 'self.bms.rawdat["T2"]'
tin2 = 'self.bms.rawdat["T1"]'
[BalanceFlags]
balf01 = 'self.bms.rawdat["Bal"] & 1'
balf02 = 'self.bms.rawdat["Bal"] >> 1 & 1'
balf03 = 'self.bms.rawdat["Bal"] >> 2 & 1'
balf04 = 'self.bms.rawdat["Bal"] >> 3 & 1'
balf05 = 'self.bms.rawdat["Bal"] >> 4 & 1'
balf06 = 'self.bms.rawdat["Bal"] >> 5 & 1'
balf07 = 'self.bms.rawdat["Bal"] >> 6 & 1'
balf08 = 'self.bms.rawdat["Bal"] >> 7 & 1'
balf09 = 'self.bms.rawdat["Bal"] >> 8 & 1'
balf10 = 'self.bms.rawdat["Bal"] >> 9 & 1'
balf11 = 'self.bms.rawdat["Bal"] >> 10 & 1'
balf12 = 'self.bms.rawdat["Bal"] >> 11 & 1'
balf13 = 'self.bms.rawdat["Bal"] >> 12 & 1'
balf14 = 'self.bms.rawdat["Bal"] >> 13 & 1'
balf15 = 'self.bms.rawdat["Bal"] >> 14 & 1'
[Status]
chargestate1 = "self.pip.rawdat['ChgStat']"
chargestate2 = "self.pip2.rawdat['ChgStat']"
[sampling]
sampletime = 10
samplesav = 1
[calibrate]
currentgain = [-1.0, -1.0, 1.0, -1.0, 1.0, -1.0 ,1.0, 1.0, 1.0]
currentoffset = [-0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
batvgain = 1
measured = [0.0, 3.0, 6.0, 9.0, 12.0, 15.0, 18.0, 21.0, 24.0, 27.0, 30.0, 33.0, 36.0, 39.0, 42.0, 45.0, 45.0]
displayed = [0.0, 3.0, 6.0, 9.0, 12.0, 15.0, 18.0, 21.0, 24.0, 27.0, 30.0, 33.0, 36.0, 39.0, 42.0, 45.0, 45.0]
measureddelta = [ 0.0, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000]
displayeddelta = [ 0.0, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000]
delta = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
[alarms]
overv = ['batdata.pip.setparamnoerror("PCVV" +str(config["battery"]["bulk"]))', \
'self.test=batdata.maxcellv>3.60', \
'batdata.pip.setparamnoerror("PCVV" +str(config["battery"]["float"]))', \
'self.test=batdata.maxcellv<3.40', \
'batdata.pip.setparamnoerror("PCVV" +str(config["battery"]["bulk"]))']
underv = ['batdata.pip.setparamnoerror("PSDV46.0")', \
'self.test=batdata.mincellv<2.90', \
'batdata.pip.setparamnoerror("PSDV48.0")', \
'self.test=batdata.mincellv>3.20', \
'batdata.pip.setparamnoerror("PSDV46.0")']
waterheater = ['batdata.pi.gpio.setup(15, batdata.pi.gpio.OUT, initial = 1)', \
'self.test=batdata.batpwr1hrav*-1000/batdata.batvoltsav[-1] - batdata.socadj+10 > 0 and localtime().tm_min==5', \
'batdata.pi.gpio.output(15,False)', \
'self.test=batdata.batpwr1hrav*-1000/batdata.batvoltsav[-1] - batdata.socadj+20 < 0 and localtime().tm_min==35', \
'batdata.pi.gpio.output(15,True)']
swapinverter = ['batdata.pi.gpio.setup(11, batdata.pi.gpio.OUT, initial = 1) \nbatdata.pi.gpio.setup(13, batdata.pi.gpio.OUT, initial = 0)', \
'self.test=localtime().tm_hour==18', \
'batdata.pi.swapinverter(on=7,off=11)', \
'self.test=localtime().tm_hour==6', \
'batdata.pi.swapinverter(on=11,off=7)']
acoverload = ['pass', \
'self.test=batdata.pip.acloadav+batdata.pip2.acloadav>config["Inverters"]["turnonslave"]', \
'batdata.pi.allinvon((11,13))', \
'self.test=batdata.pip.timeoverload==0.0', \
'batdata.pi.restoreinverters()']