-
Notifications
You must be signed in to change notification settings - Fork 21
/
battery16cellBMS.cfg
132 lines (116 loc) · 4.8 KB
/
battery16cellBMS.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
[files]
logfile = '/batdat/log'
summaryfile = '/batdat/summary'
errfile = '/batdat/baterrlog'
alarmfile = '/home/pi/data/alarmlog'
hoursummaryfile = '/batdat/hoursummary'
daysummaryfile = '/batdat/daysummary'
monthsummaryfile = '/batdat/monthsummary'
yearsummaryfile = '/batdat/yearsummary'
[logging]
data = "self.printtime+batdata.vbat+batdata.vdelta \
+batdata.iall+batdata.soctxt+batdata.socadjtxt+str(batdata.pip.rawdat)"
[battery]
name = 'My Battery'
numcells = 16
capacity = 180
overvoltage = 3.600
undervoltage = 2.900
ahloss = -0.005
vreset = 51.5 # voltage to reset DOD counter
ireset = 5.0 # current to reset DOD counter
ilowcurrent = 9.0 # C/50 lowcurrent voltage logging current
[Interfaces]
pip = 'pip(92931710100542)' # number in brackets is SN of PIP)
bms = 'bms(LH-SP15S001-P15S-30A)' # string in brackets is harware name, from read command 05
[Ports]
pipport = '/dev/ttyU*' # where to look for pipport
bmsport = '/dev/ttyO*' # 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"]'
v16 = 'self.bms.rawdat["V16"]'
vbat = 'self.bms.rawdat["V16"]'
[CurrentInputs]
iin1 = 'self.bms.rawdat["Ibat"]'
iin2 = 'self.pip.rawdat["PVI"]'
iin3 = 'self.current[0]-self.current[1]'
[TemperatureInputs]
tin1='self.bms.rawdat["T1"]'
tin2='self.bms.rawdat["T2"]'
[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'
balf16 = 'self.bms.rawdat["Bal"] >> 15 & 1'
[Status]
chargestate = "self.pip.rawdat['ChgStat']"
[sampling]
sampletime = 10
samplesav = 1
[calibrate]
currentgain = [-0.01, -1.2, 1.0]
currentoffset = [-0.2, -0.3, 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, 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, 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, 0.0]
[alarms]
# each alarm has five attributes, the first is the alarm initialisation code
# if the second attribute test is true and the alarm has not been triggered
# the third attribute will be executed
# if the fourth attribute is true and the alarm has been triggered
# the fith attribute will be executed
overv = ['batdata.pip.setparamnoerror("PCVV55.2")', \
'self.test=batdata.maxcellv>3.60', \
'batdata.pip.setparamnoerror("PCVV53.6")', \
'self.test=batdata.maxcellv<3.40', \
'batdata.pip.setparamnoerror("PCVV55.2")']
underv = ['batdata.pip.setparamnoerror("PSDV48.0")', \
'self.test=batdata.mincellv<2.90', \
'batdata.pip.setparamnoerror("PSDV51.2")', \
'self.test=batdata.mincellv>3.20', \
'batdata.pip.setparamnoerror("PSDV48.0")']
#swapinverter = ['batdata.pi.gpio.setup(7, batdata.pi.gpio.OUT, initial = 1) \nbatdata.pi.gpio.setup(11, 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)']
#float = ['batdata.pip.setparamnoerror("PBFT55.2")', \
# 'self.test=batdata.batvoltsav[16]>55.1 and batdata.currentav[0]>-3.6', \
# 'batdata.pip.setparamnoerror("PBFT53.6")', \
# 'self.test=localtime().tm_hour==0', \
# 'batdata.pip.setparamnoerror("PBFT55.2")']
# makes charge voltage high enough to reset SOC counter on Monday
#resetSOC = ['batdata.pip.setparamnoerror("PCVV55.3")', \
# 'self.test=localtime().tm_wday==0', \
# 'batdata.pip.setparamnoerror("PCVV55.2")', \
# 'self.test=summary["current"]["dod"][-1]==0', \
# 'batdata.pip.setparamnoerror("PCVV55.3")']