foxBMS  1.1.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 "general.h"
#include "database.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
 

Macros

#define MRC_CURRENT_MEASUREMENT_PERIOD_TIMEOUT_ms   (250u)
 
#define MRC_MIC_MEASUREMENT_PERIOD_TIMEOUT_ms   (250u)
 
#define MRC_CURRENT_SENSOR_MEASUREMENT_TIMEOUT_ms   (300u)
 
#define MRC_ALLOWED_NUMBER_OF_INVALID_CELL_VOLTAGES   (5u)
 

Typedefs

typedef struct MRC_STATE MRC_STATE_s
 

Functions

STD_RETURN_TYPE_e MRC_ValidateMicMeasurement (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
2020-07-31 (date of last update)
Prefix
MRC

Definition in file redundancy.h.

Macro Definition Documentation

◆ MRC_ALLOWED_NUMBER_OF_INVALID_CELL_VOLTAGES

#define MRC_ALLOWED_NUMBER_OF_INVALID_CELL_VOLTAGES   (5u)

If both, the current sensor and the MIC 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 110 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 73 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 100 of file redundancy.h.

◆ MRC_MIC_MEASUREMENT_PERIOD_TIMEOUT_ms

#define MRC_MIC_MEASUREMENT_PERIOD_TIMEOUT_ms   (250u)

Maximum time between MIC 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 MIC measurement and MIC 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 87 of file redundancy.h.

Typedef Documentation

◆ MRC_STATE_s

typedef struct MRC_STATE MRC_STATE_s

This structure contains all the variables relevant for the redundancy state machine.

Function Documentation

◆ MRC_ValidateMicMeasurement()

STD_RETURN_TYPE_e MRC_ValidateMicMeasurement ( 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 1069 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 1102 of file redundancy.c.

Here is the call graph for this function: