foxBMS  1.5.0
The foxBMS Battery Management System API Documentation
sof_trapezoid_cfg.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file sof_trapezoid_cfg.h
44  * @author foxBMS Team
45  * @date 2020-10-07 (date of creation)
46  * @updated 2023-02-03 (date of last update)
47  * @version v1.5.0
48  * @ingroup APPLICATION_CONFIGURATION
49  * @prefix SOF
50  *
51  * @brief Header for SOF configuration
52  *
53  */
54 
55 #ifndef FOXBMS__SOF_TRAPEZOID_CFG_H_
56 #define FOXBMS__SOF_TRAPEZOID_CFG_H_
57 
58 /*========== Includes =======================================================*/
59 
60 #include "battery_cell_cfg.h"
61 
62 #include <math.h>
63 #include <stdint.h>
64 
65 /*========== Macros and Definitions =========================================*/
66 
67 /**
68  * Maximum current in mA in charge direction that a string can sustain.
69  * Normally set once for the specific battery cell from data sheet
70  */
71 #define SOF_STRING_CURRENT_CONTINUOUS_CHARGE_mA ((float_t)BC_CURRENT_MAX_CHARGE_MOL_mA)
72 
73 /**
74  * Maximum current in mA in discharge direction that a string can deliver.
75  * Normally set once for the specific battery cell from data sheet.
76  */
77 #define SOF_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA ((float_t)BC_CURRENT_MAX_DISCHARGE_MOL_mA)
78 
79 /**
80  * Current in mA that the string should be able to discharge when in
81  * limp home mode, i.e., something noncritical went wrong but it should be able
82  * to drive home. The value is chosen by the system engineer.
83  */
84 #define SOF_STRING_CURRENT_LIMP_HOME_mA (20000.00f)
85 
86 /**
87  * Cold temperature in deci &deg;C where the derating of maximum discharge
88  * current starts, i.e., below this temperature battery pack should not deliver
89  * full discharge current.
90  */
91 #define SOF_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC (BC_TEMPERATURE_MIN_DISCHARGE_MOL_ddegC)
92 
93 /**
94  * Cold temperature in deci &deg;C where the derating of maximum discharge
95  * current is fully applied, i.e., below this temperature battery pack should
96  * not deliver any current in discharge direction.
97  */
98 #define SOF_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC (BC_TEMPERATURE_MIN_DISCHARGE_MSL_ddegC)
99 
100 /**
101  * Cold temperature in deci &deg;C where the derating of maximum charge current
102  * starts, i.e., below this temperature battery pack should not deliver full
103  * charge current.
104  */
105 #define SOF_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC (BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC)
106 
107 /**
108  * Cold temperature in deci &deg;C where the derating of maximum charge current
109  * is fully applied, i.e., below this temperature battery pack should not
110  * deliver any current in charge direction.
111  */
112 #define SOF_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC (BC_TEMPERATURE_MIN_CHARGE_MSL_ddegC)
113 
114 /**
115  * Hot temperature in deci &deg;C where the derating of maximum discharge
116  * current starts, i.e., above this temperature battery pack should not deliver
117  * full discharge current.
118  */
119 #define SOF_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC (BC_TEMPERATURE_MAX_DISCHARGE_MOL_ddegC)
120 
121 /**
122  * Hot temperature in deci &deg;C where the derating of maximum discharge
123  * current is fully applied, i.e., above this temperature battery pack should
124  * not deliver any current in discharge direction.
125  */
126 #define SOF_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC (BC_TEMPERATURE_MAX_DISCHARGE_MSL_ddegC)
127 
128 /**
129  * Hot temperature in deci &deg;C where the derating of maximum charge current
130  * starts, i.e., above this temperature battery pack should not deliver full
131  * charge current.
132  */
133 #define SOF_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC (BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC)
134 
135 /**
136  * Hot temperature in deci &deg;C where the derating of maximum charge current
137  * is fully applied, i.e., above this temperature battery pack should not
138  * deliver any current in charge direction.
139  */
140 #define SOF_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC (BC_TEMPERATURE_MAX_CHARGE_MSL_ddegC)
141 
142 /**
143  * Above this voltage value battery pack should not be exposed to full current in charge direction.
144  */
145 #define SOF_VOLTAGE_CUTOFF_CHARGE_mV (BC_VOLTAGE_MAX_MOL_mV)
146 
147 /**
148  * Above this voltage value battery pack should not be exposed to any current in charge direction.
149  */
150 #define SOF_VOLTAGE_LIMIT_CHARGE_mV (BC_VOLTAGE_MAX_RSL_mV)
151 
152 /**
153  * Below this voltage value battery pack should not deliver full current in discharge direction.
154  */
155 #define SOF_VOLTAGE_CUTOFF_DISCHARGE_mV (BC_VOLTAGE_MIN_MOL_mV)
156 
157 /**
158  * Below this voltage value battery pack should not deliver any current in discharge direction.
159  */
160 #define SOF_VOLTAGE_LIMIT_DISCHARGE_mV (BC_VOLTAGE_MIN_RSL_mV)
161 
162 /**
163  * structure for configuration of SoF Calculation
164  */
165 typedef struct {
166  /** Current derating limits @{ */
170  /**@}*/
171 
172  /** Low temperature derating limits @{ */
177  /**@}*/
178 
179  /** High temperature derating limits @{ */
184  /**@}*/
185 
186  /** Cell voltage derating limits @{ */
191  /**@}*/
192 } SOF_CONFIG_s;
193 
194 /*========== Extern Constant and Variable Declarations ======================*/
195 
196 /**
197  * Configuration values for the SOF window of the recommended battery current
198  */
200 
201 /*========== Extern Function Prototypes =====================================*/
202 
203 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
204 #ifdef UNITY_UNIT_TEST
205 #endif
206 
207 #endif /* FOXBMS__SOF_TRAPEZOID_CFG_H_ */
Configuration of the battery cell (e.g., minimum and maximum cell voltage)
const SOF_CONFIG_s sof_recommendedCurrent
float_t maximumChargeCurrent_mA
float_t limpHomeCurrent_mA
int16_t limitLowTemperatureCharge_ddegC
int16_t limitLowerCellVoltage_mV
int16_t limitUpperCellVoltage_mV
int16_t cutoffHighTemperatureDischarge_ddegC
int16_t cutoffHighTemperatureCharge_ddegC
int16_t limitHighTemperatureCharge_ddegC
int16_t cutoffLowerCellVoltage_mV
float_t maximumDischargeCurrent_mA
int16_t limitHighTemperatureDischarge_ddegC
int16_t limitLowTemperatureDischarge_ddegC
int16_t cutoffLowTemperatureCharge_ddegC
int16_t cutoffLowTemperatureDischarge_ddegC
int16_t cutoffUpperCellVoltage_mV