foxBMS - Unit Tests
1.3.0
The foxBMS Unit Tests API Documentation
|
Header fileS for handling redundancy between redundant cell voltage and cell temperature measurements. More...
Go to the source code of this file.
Data Structures | |
struct | MRC_STATE_s |
Macros | |
#define | MRC_CURRENT_MEASUREMENT_PERIOD_TIMEOUT_ms (250u) |
#define | MRC_AFE_MEASUREMENT_PERIOD_TIMEOUT_ms (250u) |
#define | MRC_CURRENT_SENSOR_MEASUREMENT_TIMEOUT_ms (300u) |
#define | MRC_ALLOWED_NUMBER_OF_INVALID_CELL_VOLTAGES (5u) |
Header fileS 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.h.
#define MRC_AFE_MEASUREMENT_PERIOD_TIMEOUT_ms (250u) |
Maximum time between AFE measurements before the redundancy module raises an error because a measurement is not updated anymore.
The redundancy module will wait a maximum of this time for new values from the base AFE measurement and AFE redundant measurements. If no new values are updated from both measurement sources within this timeframe it will validate the measurement values it has up to this point if possible.
Definition at line 88 of file redundancy.h.
#define MRC_ALLOWED_NUMBER_OF_INVALID_CELL_VOLTAGES (5u) |
If both, the current sensor and the AFE measurement have no valid values we try to construct the string voltage by replacing invalid cell voltage measurements with the average cell voltage in this string. The result of this estimation will be flagged as invalid if more than the number of allowed invalid cell voltages are detected. The result will be markes as valid if less then this number of cells are detected as invalid.
Definition at line 111 of file redundancy.h.
#define MRC_CURRENT_MEASUREMENT_PERIOD_TIMEOUT_ms (250u) |
Maximum time between measurements before the redundancy module raises an error because a measurement is not updated anymore.
The redundancy module will wait a maximum of this time for new current values. If no new values are updated within this timeframe it will invalidate the measurement values.
Definition at line 74 of file redundancy.h.
#define MRC_CURRENT_SENSOR_MEASUREMENT_TIMEOUT_ms (300u) |
Maximum time between current sensor high voltage, current and power measurements before the redundancy module raises an error because a measurement is not updated anymore.
The redundancy module will wait a maximum of this time for new values from the current sensor. If no new values are updated within this timeframe it will validate the measurement values it has up to this point if possible.
Definition at line 101 of file redundancy.h.
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 1087 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 1112 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 1153 of file redundancy.c.
STD_RETURN_TYPE_e TEST_MRC_CalculateCellTemperatureMinMaxAverage | ( | DATA_BLOCK_CELL_TEMPERATURE_s * | pValidatedTemperatures, |
DATA_BLOCK_MIN_MAX_s * | pMinMaxAverageValues | ||
) |
STD_RETURN_TYPE_e TEST_MRC_CalculateCellVoltageMinMaxAverage | ( | DATA_BLOCK_CELL_VOLTAGE_s * | pValidatedVoltages, |
DATA_BLOCK_MIN_MAX_s * | pMinMaxAverageValues | ||
) |
bool TEST_MRC_MeasurementUpdatedAtLeastOnce | ( | uint32_t | timestamp, |
uint32_t | previousTimestamp | ||
) |
STD_RETURN_TYPE_e TEST_MRC_MeasurementUpdatedRecently | ( | uint32_t | timestamp, |
uint32_t | previousTimestamp, | ||
uint32_t | timeInterval | ||
) |
STD_RETURN_TYPE_e TEST_MRC_UpdateCellTemperatureValidation | ( | DATA_BLOCK_CELL_TEMPERATURE_s * | pCellTemperature, |
DATA_BLOCK_CELL_TEMPERATURE_s * | pValidatedTemperature | ||
) |
STD_RETURN_TYPE_e TEST_MRC_UpdateCellVoltageValidation | ( | DATA_BLOCK_CELL_VOLTAGE_s * | pCellvoltage, |
DATA_BLOCK_CELL_VOLTAGE_s * | pValidatedVoltages | ||
) |
void TEST_MRC_ValidateBatteryVoltageMeasurement | ( | void | ) |
STD_RETURN_TYPE_e TEST_MRC_ValidateCellTemperature | ( | DATA_BLOCK_CELL_TEMPERATURE_s * | pCelltemperatureBase, |
DATA_BLOCK_CELL_TEMPERATURE_s * | pCelltemperatureRedundancy0, | ||
DATA_BLOCK_CELL_TEMPERATURE_s * | pValidatedTemperatures | ||
) |
bool TEST_MRC_ValidateCellTemperatureMeasurement | ( | DATA_BLOCK_CELL_TEMPERATURE_s * | pCellTemperatureBase, |
DATA_BLOCK_CELL_TEMPERATURE_s * | pCellTemperatureRedundancy0 | ||
) |
STD_RETURN_TYPE_e TEST_MRC_ValidateCellVoltage | ( | DATA_BLOCK_CELL_VOLTAGE_s * | pCellvoltageBase, |
DATA_BLOCK_CELL_VOLTAGE_s * | pCellvoltageRedundancy0, | ||
DATA_BLOCK_CELL_VOLTAGE_s * | pValidatedVoltages | ||
) |
bool TEST_MRC_ValidateCellVoltageMeasurement | ( | DATA_BLOCK_CELL_VOLTAGE_s * | pCellVoltageBase, |
DATA_BLOCK_CELL_VOLTAGE_s * | pCellVoltageRedundancy0 | ||
) |
void TEST_MRC_ValidateCurrentMeasurement | ( | DATA_BLOCK_CURRENT_SENSOR_s * | pTableCurrentSensor | ) |
void TEST_MRC_ValidateHighVoltageMeasurement | ( | DATA_BLOCK_CURRENT_SENSOR_s * | pTableCurrentSensor | ) |
void TEST_MRC_ValidatePowerMeasurement | ( | DATA_BLOCK_CURRENT_SENSOR_s * | pTableCurrentSensor | ) |
void TEST_MRC_ValidateStringVoltageMeasurement | ( | DATA_BLOCK_CURRENT_SENSOR_s * | pTableCurrentSensor, |
DATA_BLOCK_CELL_VOLTAGE_s * | pTableCellVoltage | ||
) |