foxBMS
1.4.1
The foxBMS Battery Management System API Documentation
|
Source file for handling redundancy between redundant cell voltage and cell temperature measurements. More...
#include "redundancy.h"
#include "bms.h"
#include "database.h"
#include "diag.h"
#include "foxmath.h"
#include "os.h"
#include "plausibility.h"
Go to the source code of this file.
Functions | |
static bool | MRC_MeasurementUpdatedAtLeastOnce (uint32_t timestamp, uint32_t previousTimestamp) |
Check timestamp if measurement has been updated at least once. More... | |
static STD_RETURN_TYPE_e | MRC_MeasurementUpdatedRecently (uint32_t timestamp, uint32_t previousTimestamp, uint32_t timeInterval) |
Check timestamp if measurement has been updated recently. More... | |
static bool | MRC_ValidateCellVoltageMeasurement (DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltageBase, DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltageRedundancy0) |
Function to validate results of cell voltage measurement. More... | |
static bool | MRC_ValidateCellTemperatureMeasurement (DATA_BLOCK_CELL_TEMPERATURE_s *pCellTemperatureBase, DATA_BLOCK_CELL_TEMPERATURE_s *pCellTemperatureRedundancy0) |
Function to validate results of cell temperature measurement. More... | |
static void | MRC_ValidateCurrentMeasurement (DATA_BLOCK_CURRENT_SENSOR_s *pTableCurrentSensor) |
Function to validate results of current measurement. More... | |
static void | MRC_ValidateStringVoltageMeasurement (DATA_BLOCK_CURRENT_SENSOR_s *pTableCurrentSensor, DATA_BLOCK_CELL_VOLTAGE_s *pTableCellVoltage) |
Function to validate results of string voltage measurement. More... | |
static void | MRC_ValidateBatteryVoltageMeasurement (void) |
Function to validate HV battery voltage measurement. More... | |
static void | MRC_ValidateHighVoltageBusMeasurement (DATA_BLOCK_CURRENT_SENSOR_s *pTableCurrentSensor) |
Function to validate results of high voltage measurement and calculate battery voltage and high voltage bus voltage. More... | |
static void | MRC_ValidatePowerMeasurement (DATA_BLOCK_CURRENT_SENSOR_s *pTableCurrentSensor) |
Function to validate results of power measurement. More... | |
static STD_RETURN_TYPE_e | MRC_CalculateCellVoltageMinMaxAverage (const DATA_BLOCK_CELL_VOLTAGE_s *const pValidatedVoltages, DATA_BLOCK_MIN_MAX_s *pMinMaxAverageValues) |
Function calculates minimum, maximum and average cell voltages. More... | |
static STD_RETURN_TYPE_e | MRC_CalculateCellTemperatureMinMaxAverage (DATA_BLOCK_CELL_TEMPERATURE_s *pValidatedTemperatures, DATA_BLOCK_MIN_MAX_s *pMinMaxAverageValues) |
Function calculates minimum, maximum and average cell temperatures. More... | |
static STD_RETURN_TYPE_e | MRC_ValidateCellVoltage (DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltageBase, DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltageRedundancy0, DATA_BLOCK_CELL_VOLTAGE_s *pValidatedVoltages) |
Function compares cell voltage measurements from base measurement with one redundant measurement and writes result in pValidatedVoltages. More... | |
static STD_RETURN_TYPE_e | MRC_UpdateCellVoltageValidation (DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltage, DATA_BLOCK_CELL_VOLTAGE_s *pValidatedVoltages) |
Function updates validated cell voltage measurement with data from a single measurement source. This can be the case if no redundancy is used at all or if one or more of the redundant measurements are not working properly. More... | |
static STD_RETURN_TYPE_e | MRC_ValidateCellTemperature (DATA_BLOCK_CELL_TEMPERATURE_s *pCelltemperatureBase, DATA_BLOCK_CELL_TEMPERATURE_s *pCelltemperatureRedundancy0, DATA_BLOCK_CELL_TEMPERATURE_s *pValidatedTemperatures) |
Function compares cell temperature measurements from base measurement with one redundant measurement and writes result in pValidatedTemperatures. More... | |
static STD_RETURN_TYPE_e | MRC_UpdateCellTemperatureValidation (DATA_BLOCK_CELL_TEMPERATURE_s *pCellTemperature, DATA_BLOCK_CELL_TEMPERATURE_s *pValidatedTemperature) |
Function updates validated cell temperature measurement with data from a single measurement source. This can be the case if no redundancy is used at all or if one or more of the redundant measurements are not working properly. More... | |
STD_RETURN_TYPE_e | MRC_Initialize (void) |
Function to initalize redundancy module. More... | |
STD_RETURN_TYPE_e | MRC_ValidateAfeMeasurement (void) |
Function to validate the measurement between redundant measurement values for cell voltage and cell temperature. More... | |
STD_RETURN_TYPE_e | MRC_ValidatePackMeasurement (void) |
Function to validate the measurements of pack values (string values, pack values) More... | |
Variables | |
static MRC_STATE_s | mrc_state |
static DATA_BLOCK_MIN_MAX_s | mrc_tableMinimumMaximumValues = {.header.uniqueId = DATA_BLOCK_ID_MIN_MAX} |
static DATA_BLOCK_CELL_VOLTAGE_s | mrc_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE} |
static DATA_BLOCK_CELL_TEMPERATURE_s | mrc_tableCellTemperatures = {.header.uniqueId = DATA_BLOCK_ID_CELL_TEMPERATURE} |
static DATA_BLOCK_PACK_VALUES_s | mrc_tablePackValues = {.header.uniqueId = DATA_BLOCK_ID_PACK_VALUES} |
Source file for handling redundancy between redundant cell voltage and cell temperature measurements.
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 redundancy.c.
|
static |
Function calculates minimum, maximum and average cell temperatures.
[in] | pValidatedTemperatures | validated temperatures from base and/or redundant measurements |
[out] | pMinMaxAverageValues | calculated cell temperature min/max/average values |
Definition at line 831 of file redundancy.c.
|
static |
Function calculates minimum, maximum and average cell voltages.
[in] | pValidatedVoltages | validated voltages from base and/or redundant measurements |
[out] | pMinMaxAverageValues | calculated cell voltage min/max/average values |
Definition at line 773 of file redundancy.c.
STD_RETURN_TYPE_e MRC_Initialize | ( | void | ) |
Function to initalize redundancy module.
< bitmask if current is valid. 0->valid, 1->invalid
< bitmask if voltage is valid. 0->valid, 1->invalid
< bitmask if voltage is valid. 0->valid, 1->invalid
< bitmask if power is valid. 0->valid, 1->invalid
Definition at line 1088 of file redundancy.c.
|
static |
Check timestamp if measurement has been updated at least once.
[in] | timestamp | timestamp of last measurement update |
[in] | previousTimestamp | timestamp of previously updated measurement |
Definition at line 243 of file redundancy.c.
|
static |
Check timestamp if measurement has been updated recently.
[in] | timestamp | timestamp of last measurement update |
[in] | previousTimestamp | timestamp of previously updated measurement |
[in] | timeInterval | in systicks (type: uint32_t) |
Definition at line 254 of file redundancy.c.
|
static |
Function updates validated cell temperature measurement with data from a single measurement source. This can be the case if no redundancy is used at all or if one or more of the redundant measurements are not working properly.
[in] | pCellTemperature | cell temperature measurement |
[out] | pValidatedTemperature | validated temperature values |
Definition at line 1071 of file redundancy.c.
|
static |
Function updates validated cell voltage measurement with data from a single measurement source. This can be the case if no redundancy is used at all or if one or more of the redundant measurements are not working properly.
[in] | pCellVoltage | cell voltage measurement |
[out] | pValidatedVoltages | validated voltage values |
Definition at line 974 of file redundancy.c.
STD_RETURN_TYPE_e MRC_ValidateAfeMeasurement | ( | void | ) |
Function to validate the measurement between redundant measurement values for cell voltage and cell temperature.
Definition at line 1113 of file redundancy.c.
|
static |
Function to validate HV battery voltage measurement.
Definition at line 639 of file redundancy.c.
|
static |
Function compares cell temperature measurements from base measurement with one redundant measurement and writes result in pValidatedTemperatures.
[in] | pCelltemperatureBase | base cell temperature measurement |
[in] | pCelltemperatureRedundancy0 | redundant cell temperature measurement |
[out] | pValidatedTemperatures | validated temperatures from redundant measurement values |
Definition at line 991 of file redundancy.c.
|
static |
Function to validate results of cell temperature measurement.
[in] | pCellTemperatureBase | base cell temperature measurement |
[in] | pCellTemperatureRedundancy0 | redundant cell temperature measurement |
Definition at line 399 of file redundancy.c.
|
static |
Function compares cell voltage measurements from base measurement with one redundant measurement and writes result in pValidatedVoltages.
[in] | pCellVoltageBase | base cell voltage measurement |
[in] | pCellVoltageRedundancy0 | redundant cell voltage measurement |
[out] | pValidatedVoltages | validated voltages from redundant measurement values |
Definition at line 894 of file redundancy.c.
|
static |
Function to validate results of cell voltage measurement.
[in] | pCellVoltageBase | base cell voltage measurement |
[in] | pCellVoltageRedundancy0 | redundant cell voltage measurement |
Definition at line 272 of file redundancy.c.
|
static |
Function to validate results of current measurement.
[in] | pTableCurrentSensor | pointer to current measurements |
Definition at line 525 of file redundancy.c.
|
static |
Function to validate results of high voltage measurement and calculate battery voltage and high voltage bus voltage.
[in] | pTableCurrentSensor | pointer current sensor high voltage measurements |
Definition at line 679 of file redundancy.c.
STD_RETURN_TYPE_e MRC_ValidatePackMeasurement | ( | void | ) |
Function to validate the measurements of pack values (string values, pack values)
Definition at line 1154 of file redundancy.c.
|
static |
Function to validate results of power measurement.
[in] | pTableCurrentSensor | pointer to power/current measurements |
Definition at line 713 of file redundancy.c.
|
static |
Function to validate results of string voltage measurement.
[in] | pTableCurrentSensor | pointer current sensor high voltage measurements |
[in] | pTableCellVoltage | pointer to cell voltage measurements |
Definition at line 574 of file redundancy.c.
|
static |
state of the redundancy module
Definition at line 78 of file redundancy.c.
|
static |
local copies of database tables
Definition at line 73 of file redundancy.c.
|
static |
local copies of database tables
Definition at line 72 of file redundancy.c.
|
static |
local copies of database tables
Definition at line 71 of file redundancy.c.
|
static |
local copies of database tables
Definition at line 74 of file redundancy.c.