foxBMS
1.1.0
The foxBMS Battery Management System API Documentation
|
SOE module responsible for calculation of SOE. More...
#include "soe_counting.h"
#include "battery_cell_cfg.h"
#include "battery_system_cfg.h"
#include "soe_counting_cfg.h"
#include "bms.h"
#include "database.h"
#include "foxmath.h"
#include "fram.h"
Go to the source code of this file.
Data Structures | |
struct | SOE_STATE |
Macros | |
#define | MAXIMUM_SOE_PERC (100.0f) |
#define | MINIMUM_SOE_PERC (0.0f) |
Typedefs | |
typedef struct SOE_STATE | SOE_STATE_s |
Functions | |
static uint32_t | SOE_GetStringEnergyFromSoePercentage (float stringSoe_perc) |
calculates string energy in Wh from passed SOE in percentage More... | |
static float | SOE_GetStringSoePercentageFromEnergy (uint32_t energy_Wh) |
calculates string SOE in percentage from passed string energy in Wh More... | |
static void | SOE_RecalibrateViaLookupTable (DATA_BLOCK_SOX_s *pSoeValues) |
initializes database and FRAM SOE values via lookup table (average, min and max). More... | |
static float | SOE_GetFromVoltage (int16_t voltage_mV) |
look-up table for SOE initialization More... | |
static void | SOE_SetValue (DATA_BLOCK_SOX_s *pSoeValues, float soeMinimumValue_perc, float soeMaximumValue_perc, float soeAverageValue_perc, uint8_t stringNumber) |
sets SOE value with a parameter between 0.0 and 100.0. More... | |
static void | SOE_CheckDatabaseSoePercentageLimits (DATA_BLOCK_SOX_s *pTableSoe, uint8_t stringNumber) |
Check if all database SOE percentage values are within [0.0, 100.0] Limits SOE values to limit values if outside of this range. More... | |
void | SOE_Init (DATA_BLOCK_SOX_s *pSoeValues, bool ec_present, uint8_t stringNumber) |
initializes startup state-of-energy (SOE) related values More... | |
void | SOE_Calculation (DATA_BLOCK_SOX_s *pSoeValues) |
periodically called algorithm to calculate state-of-energy (SOE) More... | |
Variables | |
static SOE_STATE_s | soe_state |
static DATA_BLOCK_CURRENT_SENSOR_s | soe_tableCurrentSensor = {.header.uniqueId = DATA_BLOCK_ID_CURRENT_SENSOR} |
SOE module responsible for calculation of SOE.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Definition in file soe_counting.c.
#define MAXIMUM_SOE_PERC (100.0f) |
defines for maximum and minimum SOE
Definition at line 81 of file soe_counting.c.
#define MINIMUM_SOE_PERC (0.0f) |
Definition at line 82 of file soe_counting.c.
typedef struct SOE_STATE SOE_STATE_s |
This structure contains all the variables relevant for the SOX.
void SOE_Calculation | ( | DATA_BLOCK_SOX_s * | pSoeValues | ) |
periodically called algorithm to calculate state-of-energy (SOE)
[out] | pSoeValues | pointer to SOE database entry |
Definition at line 355 of file soe_counting.c.
|
static |
Check if all database SOE percentage values are within [0.0, 100.0] Limits SOE values to limit values if outside of this range.
[in,out] | pTableSoe | pointer to database struct with SOE values |
[in] | stringNumber | string that is checked |
Definition at line 285 of file soe_counting.c.
|
static |
look-up table for SOE initialization
[in] | voltage_mV | cell voltage of battery cell |
Definition at line 208 of file soe_counting.c.
|
static |
calculates string energy in Wh from passed SOE in percentage
[in] | stringSoe_perc | string SOE in percentage [0.0, 100.0] |
Definition at line 179 of file soe_counting.c.
|
static |
calculates string SOE in percentage from passed string energy in Wh
[in] | energy_Wh | string energy in Wh |
Definition at line 168 of file soe_counting.c.
void SOE_Init | ( | DATA_BLOCK_SOX_s * | pSoeValues, |
bool | ec_present, | ||
uint8_t | stringNumber | ||
) |
initializes startup state-of-energy (SOE) related values
[out] | pSoeValues | pointer to SOE database entry |
[in] | ec_present | true if current sensor EC message received, false otherwise |
[in] | stringNumber | string addressed |
Definition at line 311 of file soe_counting.c.
|
static |
initializes database and FRAM SOE values via lookup table (average, min and max).
[out] | pSoeValues | pointer to SOE database entry |
Definition at line 191 of file soe_counting.c.
|
static |
sets SOE value with a parameter between 0.0 and 100.0.
limits the SOE value to 0.0 respectively 100.0 if a value outside of the allowed SOE range is passed. Updates local fram and database struct but does NOT write them
[out] | pSoeValues | pointer to SOE database enty |
[in] | soeMinimumValue_perc | SOE min value to set |
[in] | soeMaximumValue_perc | SOE max value to set |
[in] | soeAverageValue_perc | SOE average value to set |
[in] | stringNumber | string addressed |
Definition at line 241 of file soe_counting.c.
|
static |
contains the state of the SOE estimation
Definition at line 89 of file soe_counting.c.
|
static |
local copies of database tables
Definition at line 100 of file soe_counting.c.