foxBMS  1.6.0
The foxBMS Battery Management System API Documentation
redundancy.h File Reference

Header fileS for handling redundancy between redundant cell voltage and cell temperature measurements. More...

#include "database.h"
#include <stdint.h>
Include dependency graph for redundancy.h:
This graph shows which files directly or indirectly include this file:

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)
 

Functions

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...
 

Detailed Description

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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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:

  • ″This product uses parts of foxBMS®″
  • ″This product includes parts of foxBMS®″
  • ″This product is derived from foxBMS®″
Author
foxBMS Team
Date
2020-07-31 (date of creation)
Updated
2023-10-12 (date of last update)
Version
v1.6.0
Prefix
MRC

Definition in file redundancy.h.

Macro Definition Documentation

◆ MRC_AFE_MEASUREMENT_PERIOD_TIMEOUT_ms

#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 89 of file redundancy.h.

◆ MRC_ALLOWED_NUMBER_OF_INVALID_CELL_VOLTAGES

#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 112 of file redundancy.h.

◆ MRC_CURRENT_MEASUREMENT_PERIOD_TIMEOUT_ms

#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 75 of file redundancy.h.

◆ MRC_CURRENT_SENSOR_MEASUREMENT_TIMEOUT_ms

#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 102 of file redundancy.h.

Function Documentation

◆ MRC_Initialize()

STD_RETURN_TYPE_e MRC_Initialize ( void  )

Function to initalize redundancy module.

Returns
STD_OK if module has been initialized successfully, otherwise STD_NOT_OK

< 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 1078 of file redundancy.c.

◆ MRC_ValidateAfeMeasurement()

STD_RETURN_TYPE_e MRC_ValidateAfeMeasurement ( void  )

Function to validate the measurement between redundant measurement values for cell voltage and cell temperature.

Returns
STD_OK if measurement has been validated successfully, otherwise i.e. if no new values have been measured since the last call STD_NOT_OK

Definition at line 1103 of file redundancy.c.

Here is the call graph for this function:

◆ MRC_ValidatePackMeasurement()

STD_RETURN_TYPE_e MRC_ValidatePackMeasurement ( void  )

Function to validate the measurements of pack values (string values, pack values)

Returns
STD_OK if measurement has been validated successfully, otherwise i.e. if no new values have been measured since the last call STD_NOT_OK

Definition at line 1144 of file redundancy.c.

Here is the call graph for this function: