-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbattery4cell.cfg
86 lines (75 loc) · 3.32 KB
/
battery4cell.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
# *****BATTERY LOGGER CONFIG FILE*****
# Copyright (C) 2014 Simon Richard Matthews
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
[files]
interface = 'from getatod import Raw'
alarms = 'from alarmsnull import Alarms'
# logfile is location and name of file used for logging all data
logfile = '/dev/null'
# errfile is location and name of error log
errfile = 'data/errorlog'
# summaryfile is location and name of a summary of the data
summaryfile = 'summary'
# hoursummaryfile is the location of the hourly summary file
hoursummaryfile = '/dev/null'
# daysummaryfile is the location and name of daily summary file
daysummaryfile = '/dev/null'
# monthsummaryfile is the location and name of monthly summary file
monthsummaryfile = '/dev/null'
# yearsummaryfile is the location and name of yearly summary file
yearsummaryfile = '/dev/null'
[battery]
name = 'My'
numcells = 4
capacity = 360
# coulomb losses in battery expressed as offset current
# subtracted from battery current to get adjusted ah count
ahloss = 0.1
vreset = 13.8 # voltage to reset DOD counter
ireset = 9.0 # current to reset DOD counter
ilowcurrent = 7.2 # C/50 lowcurrent voltage logging current
[AtoDs]
atod0 = 'AtoD.ADS1115(address=0x48)'
atod1 = 'AtoD.ADS1115(address=0x49)'
[VoltageInputs]
v1 = 'atod0.read_adc(0, gain=2)*0.06250197'
v2 = 'atod0.read_adc(1, gain=2)*0.06250197'
v3 = 'atod0.read_adc(2, gain=2)*0.06250197'
v4 = 'atod0.read_adc(3, gain=2)*0.06250197'
[CurrentInputs]
iin1 = 'atod1.read_adc_difference(0, gain=16)'
iin2 = 'atod1.read_adc_difference(3, gain=16)'
iin3 = 'self.current[0] - self.current[1]'
[sampling]
# sampletime is time between samples in seconds
sampletime = 1.002
# samplesav is number of samples in running average
samplesav = 10
[calibrate]
batvgain = 14.33333 # resistor divider gain (2.49+33.2)/2.49
ibatoffset = 0.0 # 0 offset current in amps
ibatgain = 2.666667 # 200/75 gain to multiply AtoD output in mV to A
iinoffset = 0.0 # 0 offset current in amps
iingain = 2.666667 # 200/75 gain to multiply AtoD output in mV to A
pcurrent = 0 # parasitic current in A not measured (battery monitor power)
delta = [0.0, 0.0, 0.0, 0.0]
measured = [0.0, 3.0, 6.0, 9.0, 12.0]
displayed = [0.0, 3.0, 6.0, 9.0, 12.0]
measureddelta = [ 0.0, 3.000, 3.000, 3.000, 3.000]
displayeddelta = [ 0.0, 3.000, 3.000, 3.000, 3.000]
[alarms]
# each alarm has five attributes, the first is the alarm initialisation code
# if the second attribute test is true the third attribute will be executed
# if the fourth attribute is true the fith attribute will be executed
alarm = ['GPIO.setup("P8_10", GPIO.OUT)', 'test=minvolts<2.8 or maxvolts>3.60', 'GPIO.output("P8_10", GPIO.HIGH)', \
'test=minvolts>2.9 and maxvolts<3.59', 'GPIO.output("P8_10", GPIO.LOW)']