foxBMS - Unit Tests  1.5.0
The foxBMS Unit Tests API Documentation
soc_counting.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file soc_counting.c
44  * @author foxBMS Team
45  * @date 2020-10-07 (date of creation)
46  * @updated 2023-02-03 (date of last update)
47  * @version v1.5.0
48  * @ingroup APPLICATION
49  * @prefix SOC
50  *
51  * @brief SOC module responsible for calculation of SOC
52  *
53  */
54 
55 /*========== Includes =======================================================*/
56 #include "general.h"
57 
58 #include "soc_counting.h"
59 
60 #include "bms.h"
61 #include "database.h"
62 #include "foxmath.h"
63 #include "fram.h"
64 
65 #include <math.h>
66 #include <stdbool.h>
67 #include <stdint.h>
68 
69 /*========== Macros and Definitions =========================================*/
70 /** This structure contains all the variables relevant for the SOX */
71 typedef struct {
72  bool socInitialized; /*!< true if the initialization has passed, false otherwise */
73  bool sensorCcUsed[BS_NR_OF_STRINGS]; /*!< bool if coulomb counting functionality from current sensor is used */
74  float_t ccScalingAverage[BS_NR_OF_STRINGS]; /*!< current sensor offset scaling for average SOC */
75  float_t ccScalingMinimum[BS_NR_OF_STRINGS]; /*!< current sensor offset scaling value for minimum SOC */
76  float_t ccScalingMaximum[BS_NR_OF_STRINGS]; /*!< current sensor offset scaling value for maximum SOC */
77  uint32_t previousTimestamp[BS_NR_OF_STRINGS]; /*!< timestamp buffer to check if current/CC data has been updated */
78 } SOC_STATE_s;
79 
80 /** Maximum SOC in percentage */
81 #define SOC_MAXIMUM_SOC_perc (100.0f)
82 /** Minimum SOC in percentage */
83 #define SOC_MINIMUM_SOC_perc (0.0f)
84 
85 /*========== Static Constant and Variable Definitions =======================*/
86 /** state variable for SOC module */
88  .socInitialized = false,
89  .sensorCcUsed = {GEN_REPEAT_U(false, GEN_STRIP(BS_NR_OF_STRINGS))},
90  .ccScalingAverage = {GEN_REPEAT_U(0.0f, GEN_STRIP(BS_NR_OF_STRINGS))},
91  .ccScalingMinimum = {GEN_REPEAT_U(0.0f, GEN_STRIP(BS_NR_OF_STRINGS))},
92  .ccScalingMaximum = {GEN_REPEAT_U(0.0f, GEN_STRIP(BS_NR_OF_STRINGS))},
93  .previousTimestamp = {GEN_REPEAT_U(0u, GEN_STRIP(BS_NR_OF_STRINGS))},
94 };
95 
96 /** local copies of database tables */
97 /**@{*/
99 /**@}*/
100 
101 /*========== Extern Constant and Variable Definitions =======================*/
102 
103 /*========== Static Function Prototypes =====================================*/
104 
105 /**
106  * @brief calculates string SOC in percentage from passed string charge in As
107  * @param[in] charge_As charge in As
108  * @return returns corresponding string SOC in percentage [0.0, 100.0]
109  */
110 static float_t SOC_GetStringSocPercentageFromCharge(uint32_t charge_As);
111 
112 /**
113  * @brief initializes database and FRAM SOC values via lookup table (average,
114  * minimum and maximum).
115  * @param[out] pTableSoc pointer to database enty with SOC values
116  */
117 static void SOC_RecalibrateViaLookupTable(DATA_BLOCK_SOX_s *pTableSoc);
118 
119 /**
120  * @brief sets SOC value with a parameter between 0.0 and 100.0.
121  * @details limits the SOE value to 0.0 respectively 100.0 if a value outside
122  * of the allowed SOE range is passed. Updates local fram and database
123  * struct but does *NOT* write them
124  * @param[out] pTableSoc pointer to SOC database entry
125  * @param[in] socMinimumValue_perc SOC min value to set
126  * @param[in] socMaximumValue_perc SOC max value to set
127  * @param[in] socAverageValue_perc SOC average value to set
128  * @param[in] stringNumber addressed string
129  */
130 static void SOC_SetValue(
131  DATA_BLOCK_SOX_s *pTableSoc,
132  float_t socMinimumValue_perc,
133  float_t socMaximumValue_perc,
134  float_t socAverageValue_perc,
135  uint8_t stringNumber);
136 
137 /**
138  * @brief Check if all database SOC percentage values are within [0.0, 100.0]
139  * Limits SOC values to limit values if outside of this range.
140  * @param[in,out] pTableSoc pointer to database struct with SOC values
141  * @param[in] stringNumber string that is checked
142  */
143 static void SOC_CheckDatabaseSocPercentageLimits(DATA_BLOCK_SOX_s *pTableSoc, uint8_t stringNumber);
144 
145 /**
146  * @brief Set SOC-related values in non-volatile memory
147  * @param[in] pTableSoc pointer to database struct with SOC values
148  * @param[in] stringNumber addressed string
149  */
150 static void SOC_UpdateNvmValues(DATA_BLOCK_SOX_s *pTableSoc, uint8_t stringNumber);
151 
152 /*========== Static Function Implementations ================================*/
153 static float_t SOC_GetStringSocPercentageFromCharge(uint32_t charge_As) {
154  const float_t charge_mAs = (float_t)charge_As * UNIT_CONVERSION_FACTOR_1000_FLOAT;
156 }
157 
159  FAS_ASSERT(pTableSoc != NULL_PTR);
160  DATA_BLOCK_MIN_MAX_s tableMinMaxCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_MIN_MAX};
161  DATA_READ_DATA(&tableMinMaxCellVoltages);
162 
163  for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) {
164  SOC_SetValue(
165  pTableSoc,
166  SE_GetStateOfChargeFromVoltage(tableMinMaxCellVoltages.minimumCellVoltage_mV[s]),
167  SE_GetStateOfChargeFromVoltage(tableMinMaxCellVoltages.maximumCellVoltage_mV[s]),
168  SE_GetStateOfChargeFromVoltage(tableMinMaxCellVoltages.averageCellVoltage_mV[s]),
169  s);
170  }
172 }
173 
174 static void SOC_SetValue(
175  DATA_BLOCK_SOX_s *pTableSoc,
176  float_t socMinimumValue_perc,
177  float_t socMaximumValue_perc,
178  float_t socAverageValue_perc,
179  uint8_t stringNumber) {
180  FAS_ASSERT(pTableSoc != NULL_PTR);
181  /* Set database values */
182  pTableSoc->averageSoc_perc[stringNumber] = socAverageValue_perc;
183  pTableSoc->minimumSoc_perc[stringNumber] = socMinimumValue_perc;
184  pTableSoc->maximumSoc_perc[stringNumber] = socMaximumValue_perc;
185 
186  if (soc_state.sensorCcUsed[stringNumber] == true) {
187  /* Current sensor database entry is read before the call of SOC_SetValue */
188  float_t ccOffset_perc =
190 
191 #if BS_POSITIVE_DISCHARGE_CURRENT == false
192  ccOffset_perc *= (-1.0f);
193 #endif /* BS_POSITIVE_DISCHARGE_CURRENT == false */
194 
195  /* Recalibrate scaling values */
196  soc_state.ccScalingAverage[stringNumber] = pTableSoc->averageSoc_perc[stringNumber] + ccOffset_perc;
197  soc_state.ccScalingMinimum[stringNumber] = pTableSoc->minimumSoc_perc[stringNumber] + ccOffset_perc;
198  soc_state.ccScalingMaximum[stringNumber] = pTableSoc->maximumSoc_perc[stringNumber] + ccOffset_perc;
199  }
200 
201  /* Limit SOC values to [0.0, 100.0] */
202  SOC_CheckDatabaseSocPercentageLimits(pTableSoc, stringNumber);
203 
204  /* Update non-volatile memory values */
205  SOC_UpdateNvmValues(pTableSoc, stringNumber);
206 
208 }
209 
210 static void SOC_CheckDatabaseSocPercentageLimits(DATA_BLOCK_SOX_s *pTableSoc, uint8_t stringNumber) {
211  FAS_ASSERT(pTableSoc != NULL_PTR);
212  FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS);
213 
214  if (pTableSoc->averageSoc_perc[stringNumber] > SOC_MAXIMUM_SOC_perc) {
215  pTableSoc->averageSoc_perc[stringNumber] = SOC_MAXIMUM_SOC_perc;
216  }
217  if (pTableSoc->averageSoc_perc[stringNumber] < SOC_MINIMUM_SOC_perc) {
218  pTableSoc->averageSoc_perc[stringNumber] = SOC_MINIMUM_SOC_perc;
219  }
220  if (pTableSoc->minimumSoc_perc[stringNumber] > SOC_MAXIMUM_SOC_perc) {
221  pTableSoc->minimumSoc_perc[stringNumber] = SOC_MAXIMUM_SOC_perc;
222  }
223  if (pTableSoc->minimumSoc_perc[stringNumber] < SOC_MINIMUM_SOC_perc) {
224  pTableSoc->minimumSoc_perc[stringNumber] = SOC_MINIMUM_SOC_perc;
225  }
226  if (pTableSoc->maximumSoc_perc[stringNumber] > SOC_MAXIMUM_SOC_perc) {
227  pTableSoc->maximumSoc_perc[stringNumber] = SOC_MAXIMUM_SOC_perc;
228  }
229  if (pTableSoc->maximumSoc_perc[stringNumber] < SOC_MINIMUM_SOC_perc) {
230  pTableSoc->maximumSoc_perc[stringNumber] = SOC_MINIMUM_SOC_perc;
231  }
232 }
233 
234 static void SOC_UpdateNvmValues(DATA_BLOCK_SOX_s *pTableSoc, uint8_t stringNumber) {
235  FAS_ASSERT(pTableSoc != NULL_PTR);
236  FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS);
237  fram_soc.averageSoc_perc[stringNumber] = pTableSoc->averageSoc_perc[stringNumber];
238  fram_soc.minimumSoc_perc[stringNumber] = pTableSoc->minimumSoc_perc[stringNumber];
239  fram_soc.maximumSoc_perc[stringNumber] = pTableSoc->maximumSoc_perc[stringNumber];
240 }
241 
242 /*========== Extern Function Implementations ================================*/
243 
244 void SE_InitializeStateOfCharge(DATA_BLOCK_SOX_s *pSocValues, bool ccPresent, uint8_t stringNumber) {
245  FAS_ASSERT(pSocValues != NULL_PTR);
246  FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS);
248 
250 
251  if (ccPresent == true) {
252  soc_state.sensorCcUsed[stringNumber] = true;
253 
254  float_t scalingOffset_perc =
256 
257  if (soc_tableCurrentSensor.currentCounter_As[stringNumber] < 0) {
258  scalingOffset_perc *= (-1.0f);
259  }
260 
261 #if BS_POSITIVE_DISCHARGE_CURRENT == false
262  scalingOffset_perc *= (-1.0f);
263 #endif /* BS_POSITIVE_DISCHARGE_CURRENT == false */
264 
265  soc_state.ccScalingAverage[stringNumber] = fram_soc.averageSoc_perc[stringNumber] + scalingOffset_perc;
266  soc_state.ccScalingMinimum[stringNumber] = fram_soc.minimumSoc_perc[stringNumber] + scalingOffset_perc;
267  soc_state.ccScalingMaximum[stringNumber] = fram_soc.maximumSoc_perc[stringNumber] + scalingOffset_perc;
268  } else {
270  soc_state.sensorCcUsed[stringNumber] = false;
271  }
272 
273  pSocValues->averageSoc_perc[stringNumber] = fram_soc.averageSoc_perc[stringNumber];
274  pSocValues->minimumSoc_perc[stringNumber] = fram_soc.minimumSoc_perc[stringNumber];
275  pSocValues->maximumSoc_perc[stringNumber] = fram_soc.maximumSoc_perc[stringNumber];
276 
277  SOC_CheckDatabaseSocPercentageLimits(pSocValues, stringNumber);
278 
279  /* Alternatively, SOC can be initialized with {V,SOC} lookup table if available */
280  /* with the function SOC_Init_Lookup_Table() */
281 
282  soc_state.socInitialized = true;
283 }
284 
285 /* INCLUDE MARKER FOR THE DOCUMENTATION; DO NOT MOVE cc-documentation-start-include */
287  /* INCLUDE MARKER FOR THE DOCUMENTATION; DO NOT MOVE cc-documentation-stop-include */
288  FAS_ASSERT(pSocValues != NULL_PTR);
289  bool continueFunction = true;
290  if (soc_state.socInitialized == false) {
291  /* Exit if SOC not initialized yet */
292  continueFunction = false;
293  }
294 
295  if (continueFunction == true) {
296  /* Read current sensor entry for coulomb/current counting or CC recalibration */
298 
300  /* Recalibrate SOC via LUT */
301  SOC_RecalibrateViaLookupTable(pSocValues);
302  } else {
303  for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) {
304  if (soc_state.sensorCcUsed[s] == false) {
305  /* check if current measurement has been updated */
307  float_t timeStep_s =
309  1000.0f;
310 
311  if (timeStep_s > 0.0f) {
312  /* Current in charge direction negative means SOC increasing --> BAT naming, not ROB */
313 
314  float_t deltaSOC_perc = (((float_t)soc_tableCurrentSensor.current_mA[s] * timeStep_s) /
316  100.0f / 1000.0f; /* ((mA) * 1s) / 1As) * 100% */
317 
318 #if BS_POSITIVE_DISCHARGE_CURRENT == false
319  deltaSOC_perc *= (-1.0f);
320 #endif /* BS_POSITIVE_DISCHARGE_CURRENT == false */
321 
322  pSocValues->averageSoc_perc[s] = pSocValues->averageSoc_perc[s] - deltaSOC_perc;
323  pSocValues->minimumSoc_perc[s] = pSocValues->minimumSoc_perc[s] - deltaSOC_perc;
324  pSocValues->maximumSoc_perc[s] = pSocValues->maximumSoc_perc[s] - deltaSOC_perc;
325 
326  /* Limit SOC calculation to 0% respectively 100% */
328 
329  /* Update values in non-volatile memory */
330  SOC_UpdateNvmValues(pSocValues, s);
331  }
333  } /* end check if current measurement has been updated */
334  /* update the variable for the next check */
335  } else {
336  /* check if cc measurement has been updated */
338  float_t deltaSoc_perc =
340 
341 #if BS_POSITIVE_DISCHARGE_CURRENT == false
342  deltaSoc_perc *= (-1.0f);
343 #endif /* BS_POSITIVE_DISCHARGE_CURRENT == false */
344 
345  pSocValues->averageSoc_perc[s] = soc_state.ccScalingAverage[s] - deltaSoc_perc;
346  pSocValues->minimumSoc_perc[s] = soc_state.ccScalingMinimum[s] - deltaSoc_perc;
347  pSocValues->maximumSoc_perc[s] = soc_state.ccScalingMaximum[s] - deltaSoc_perc;
348 
349  /* Limit SOC values to [0.0, 100.0] */
351 
352  /* Update values in non-volatile memory */
353  SOC_UpdateNvmValues(pSocValues, s);
354 
356  } /* end check if cc measurement has been updated */
357  }
358  }
359  /* Update database and FRAM value */
361  }
362  }
363 }
364 
365 extern float_t SE_GetStateOfChargeFromVoltage(int16_t voltage_mV) {
366  float_t soc_perc = 0.50f;
367 
368  /* Variables for interpolating LUT value */
369  uint16_t between_high = 0;
370  uint16_t between_low = 0;
371 
372  /* Cell voltages are inserted in LUT in descending order -> start with 1 as we do not want to extrapolate. */
373  for (uint16_t i = 1u; i < bc_stateOfChargeLookupTableLength; i++) {
374  if (voltage_mV < bc_stateOfChargeLookupTable[i].voltage_mV) {
375  between_low = i + 1u;
376  between_high = i;
377  }
378  }
379 
380  /* Interpolate between LUT values, but do not extrapolate LUT! */
381  if (!(((between_high == 0u) && (between_low == 0u)) || /* cell voltage > maximum LUT voltage */
382  (between_low >= bc_stateOfChargeLookupTableLength))) { /* cell voltage < minimum LUT voltage */
383  soc_perc = MATH_LinearInterpolation(
384  (float_t)bc_stateOfChargeLookupTable[between_low].voltage_mV,
385  bc_stateOfChargeLookupTable[between_low].value,
386  (float_t)bc_stateOfChargeLookupTable[between_high].voltage_mV,
387  bc_stateOfChargeLookupTable[between_high].value,
388  (float_t)voltage_mV);
389  } else if ((between_low >= bc_stateOfChargeLookupTableLength)) {
390  /* LUT SOE values are in descending order: cell voltage < minimum LUT voltage */
391  soc_perc = SOC_MINIMUM_SOC_perc;
392  } else {
393  /* cell voltage > maximum LUT voltage */
394  soc_perc = 100.0f;
395  }
396  return soc_perc;
397 }
398 
399 /*========== Externalized Static Function Implementations (Unit Test) =======*/
400 #ifdef UNITY_UNIT_TEST
401 #endif
uint16_t bc_stateOfChargeLookupTableLength
const BC_LUT_s bc_stateOfChargeLookupTable[]
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
BMS_CURRENT_FLOW_STATE_e BMS_GetBatterySystemState(void)
Returns current battery system state (charging/discharging, resting or in relaxation phase)
Definition: bms.c:1586
bms driver header
@ BMS_AT_REST
Definition: bms.h:76
Database module header.
#define DATA_READ_DATA(...)
Definition: database.h:86
@ DATA_BLOCK_ID_MIN_MAX
Definition: database_cfg.h:81
@ DATA_BLOCK_ID_CURRENT_SENSOR
Definition: database_cfg.h:82
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
Definition: fassert.h:250
float_t MATH_LinearInterpolation(const float_t x1, const float_t y1, const float_t x2, const float_t y2, const float_t x_interpolate)
Linear inter-/extrapolates a third point according to two given points.
Definition: foxmath.c:84
math library for often used math functions
#define UNIT_CONVERSION_FACTOR_1000_FLOAT
Definition: foxmath.h:78
#define UNIT_CONVERSION_FACTOR_100_FLOAT
Definition: foxmath.h:77
FRAM_RETURN_TYPE_e FRAM_ReadData(FRAM_BLOCK_ID_e blockId)
Reads a variable from the FRAM.
Definition: fram.c:211
FRAM_RETURN_TYPE_e FRAM_WriteData(FRAM_BLOCK_ID_e blockId)
Writes a variable to the FRAM.
Definition: fram.c:133
Header for the driver for the FRAM module.
FRAM_SOC_s fram_soc
Definition: fram_cfg.c:71
@ FRAM_BLOCK_ID_SOC
Definition: fram_cfg.h:106
#define NULL_PTR
Null pointer.
Definition: fstd_types.h:77
General macros and definitions for the whole platform.
#define GEN_REPEAT_U(x, n)
Macro that helps to generate a series of literals (for array initializers).
Definition: general.h:250
#define GEN_STRIP(x)
Definition: general.h:261
void SE_CalculateStateOfCharge(DATA_BLOCK_SOX_s *pSocValues)
periodically called algorithm to calculate state-of-charge (SOC)
Definition: soc_counting.c:286
void SE_InitializeStateOfCharge(DATA_BLOCK_SOX_s *pSocValues, bool ccPresent, uint8_t stringNumber)
initializes startup SOC-related values like lookup from nonvolatile ram at startup
Definition: soc_counting.c:244
float_t SE_GetStateOfChargeFromVoltage(int16_t voltage_mV)
look-up table for SOC initialization
Definition: soc_counting.c:365
static float_t SOC_GetStringSocPercentageFromCharge(uint32_t charge_As)
calculates string SOC in percentage from passed string charge in As
Definition: soc_counting.c:153
static SOC_STATE_s soc_state
Definition: soc_counting.c:87
static void SOC_UpdateNvmValues(DATA_BLOCK_SOX_s *pTableSoc, uint8_t stringNumber)
Set SOC-related values in non-volatile memory.
Definition: soc_counting.c:234
#define SOC_MINIMUM_SOC_perc
Definition: soc_counting.c:83
static void SOC_RecalibrateViaLookupTable(DATA_BLOCK_SOX_s *pTableSoc)
initializes database and FRAM SOC values via lookup table (average, minimum and maximum).
Definition: soc_counting.c:158
static void SOC_SetValue(DATA_BLOCK_SOX_s *pTableSoc, float_t socMinimumValue_perc, float_t socMaximumValue_perc, float_t socAverageValue_perc, uint8_t stringNumber)
sets SOC value with a parameter between 0.0 and 100.0.
Definition: soc_counting.c:174
static DATA_BLOCK_CURRENT_SENSOR_s soc_tableCurrentSensor
Definition: soc_counting.c:98
static void SOC_CheckDatabaseSocPercentageLimits(DATA_BLOCK_SOX_s *pTableSoc, uint8_t stringNumber)
Check if all database SOC percentage values are within [0.0, 100.0] Limits SOC values to limit values...
Definition: soc_counting.c:210
#define SOC_MAXIMUM_SOC_perc
Definition: soc_counting.c:81
Header for SOC module, responsible for calculation of SOC.
#define SOC_STRING_CAPACITY_As
#define SOC_STRING_CAPACITY_mAs
uint32_t timestampCurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:219
int32_t current_mA[BS_NR_OF_STRINGS]
Definition: database_cfg.h:215
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:214
int32_t currentCounter_As[BS_NR_OF_STRINGS]
Definition: database_cfg.h:227
uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:230
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:122
int16_t averageCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:164
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:162
int16_t maximumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:167
int16_t minimumCellVoltage_mV[BS_NR_OF_STRINGS]
Definition: database_cfg.h:165
float_t minimumSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:512
float_t maximumSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:513
float_t averageSoc_perc[BS_NR_OF_STRINGS]
Definition: database_cfg.h:511
float_t maximumSoc_perc[BS_NR_OF_STRINGS]
Definition: fram_cfg.h:142
float_t averageSoc_perc[BS_NR_OF_STRINGS]
Definition: fram_cfg.h:143
float_t minimumSoc_perc[BS_NR_OF_STRINGS]
Definition: fram_cfg.h:141
float_t ccScalingMinimum[BS_NR_OF_STRINGS]
Definition: soc_counting.c:75
bool socInitialized
Definition: soc_counting.c:72
uint32_t previousTimestamp[BS_NR_OF_STRINGS]
Definition: soc_counting.c:77
bool sensorCcUsed[BS_NR_OF_STRINGS]
Definition: soc_counting.c:73
float_t ccScalingAverage[BS_NR_OF_STRINGS]
Definition: soc_counting.c:74
float_t ccScalingMaximum[BS_NR_OF_STRINGS]
Definition: soc_counting.c:76