foxBMS  1.6.0
The foxBMS Battery Management System API Documentation
plausibility.c File Reference

plausibility checks for cell voltage and cell temperatures More...

#include "plausibility.h"
#include "battery_system_cfg.h"
#include "diag.h"
#include "foxmath.h"
#include <stdint.h>
Include dependency graph for plausibility.c:

Go to the source code of this file.

Functions

STD_RETURN_TYPE_e PL_CheckStringVoltage (int32_t voltageAfe_mV, int32_t voltageCurrentSensor_mV)
 Pack voltage plausibility check between LTC and current sensor values. More...
 
STD_RETURN_TYPE_e PL_CheckCellVoltage (int16_t baseCellVoltage, int16_t redundancy0CellVoltage, int16_t *pCellVoltage)
 Cell voltage plausibility check between two redundant cell voltage measurement values. More...
 
STD_RETURN_TYPE_e PL_CheckCelltemperature (int16_t baseCelltemperature, int16_t redundancy0Celltemperature, int16_t *pCelltemperature)
 Cell temperature plausibility check between two redundant cell temperature measurement values. More...
 
STD_RETURN_TYPE_e PL_CheckVoltageSpread (DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltages, DATA_BLOCK_MIN_MAX_s *pMinMaxAverageValues)
 Cell voltage spread plausibility check. More...
 
STD_RETURN_TYPE_e PL_CheckTemperatureSpread (DATA_BLOCK_CELL_TEMPERATURE_s *pCellTemperatures, DATA_BLOCK_MIN_MAX_s *pMinMaxAverageValues)
 Cell temperature spread plausibility check. More...
 

Detailed Description

plausibility checks for cell voltage and cell temperatures

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-02-24 (date of creation)
Updated
2023-10-12 (date of last update)
Version
v1.6.0
Prefix
PL

Definition in file plausibility.c.

Function Documentation

◆ PL_CheckCelltemperature()

STD_RETURN_TYPE_e PL_CheckCelltemperature ( int16_t  baseCelltemperature,
int16_t  redundancy0Celltemperature,
int16_t *  pCelltemperature 
)

Cell temperature plausibility check between two redundant cell temperature measurement values.

Parameters
[in]baseCelltemperaturecell temperature from base measurement
[in]redundancy0Celltemperaturecell temperature from redundant measurement
[out]pCelltemperatureoutput cell temperature after plausibility check
Returns
STD_OK if cell voltage valid, otherwise STD_NOT_OK

Definition at line 106 of file plausibility.c.

◆ PL_CheckCellVoltage()

STD_RETURN_TYPE_e PL_CheckCellVoltage ( int16_t  baseCellVoltage,
int16_t  redundancy0CellVoltage,
int16_t *  pCellVoltage 
)

Cell voltage plausibility check between two redundant cell voltage measurement values.

Parameters
[in]baseCellVoltagecell voltage from base measurement
[in]redundancy0CellVoltagecell voltage from redundant measurement
[out]pCellVoltageoutput cell voltage after plausibility check
Returns
STD_OK if cell voltage valid, otherwise STD_NOT_OK

Definition at line 88 of file plausibility.c.

◆ PL_CheckStringVoltage()

STD_RETURN_TYPE_e PL_CheckStringVoltage ( int32_t  voltageAfe_mV,
int32_t  voltageCurrentSensor_mV 
)

Pack voltage plausibility check between LTC and current sensor values.

Parameters
voltageAfe_mVpack voltage measured by AFE
voltageCurrentSensor_mVpack voltage measured by current sensor
Returns
STD_OK if pack voltage valid, otherwise STD_NOT_OK

Definition at line 76 of file plausibility.c.

◆ PL_CheckTemperatureSpread()

STD_RETURN_TYPE_e PL_CheckTemperatureSpread ( DATA_BLOCK_CELL_TEMPERATURE_s pCellTemperatures,
DATA_BLOCK_MIN_MAX_s pMinMaxAverageValues 
)

Cell temperature spread plausibility check.

Parameters
[in,out]pCellTemperaturespointer to cell temperature database entry
[in]pMinMaxAverageValuespointer to minimum/maximum/average database entry
Returns
STD_OK if no issue detected, otherwise STD_NOT_OK

Definition at line 157 of file plausibility.c.

Here is the call graph for this function:

◆ PL_CheckVoltageSpread()

STD_RETURN_TYPE_e PL_CheckVoltageSpread ( DATA_BLOCK_CELL_VOLTAGE_s pCellVoltages,
DATA_BLOCK_MIN_MAX_s pMinMaxAverageValues 
)

Cell voltage spread plausibility check.

Parameters
[in,out]pCellVoltagespointer to cell voltage database entry
[in]pMinMaxAverageValuespointer to minimum/maximum/average database entry
Returns
STD_OK if no issue detected, otherwise STD_NOT_OK

Definition at line 125 of file plausibility.c.

Here is the call graph for this function: