foxBMS  1.4.1
The foxBMS Battery Management System API Documentation
sof_trapezoid_cfg.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2022, 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 2022-10-27 (date of last update)
47  * @version v1.4.1
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 #include "general.h"
60 
61 #include "battery_cell_cfg.h"
62 
63 /*========== Macros and Definitions =========================================*/
64 
65 /**
66  * Maximum current in mA in charge direction that a string can sustain.
67  * Normally set once for the specific battery cell from data sheet
68  */
69 #define SOF_STRING_CURRENT_CONTINUOUS_CHARGE_mA ((float)BC_CURRENT_MAX_CHARGE_MOL_mA)
70 
71 /**
72  * Maximum current in mA in discharge direction that a string can deliver.
73  * Normally set once for the specific battery cell from data sheet.
74  */
75 #define SOF_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA ((float)BC_CURRENT_MAX_DISCHARGE_MOL_mA)
76 
77 /**
78  * Current in mA that the string should be able to discharge when in
79  * limp home mode, i.e., something noncritical went wrong but it should be able
80  * to drive home. The value is chosen by the system engineer.
81  */
82 #define SOF_STRING_CURRENT_LIMP_HOME_mA (20000.00f)
83 
84 /**
85  * Cold temperature in deci °C where the derating of maximum discharge
86  * current starts, i.e., below this temperature battery pack should not deliver
87  * full discharge current.
88  */
89 #define SOF_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC (BC_TEMPERATURE_MIN_DISCHARGE_MOL_ddegC)
90 
91 /**
92  * Cold temperature in deci °C where the derating of maximum discharge
93  * current is fully applied, i.e., below this temperature battery pack should
94  * not deliver any current in discharge direction.
95  */
96 #define SOF_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC (BC_TEMPERATURE_MIN_DISCHARGE_MSL_ddegC)
97 
98 /**
99  * Cold temperature in deci °C where the derating of maximum charge current
100  * starts, i.e., below this temperature battery pack should not deliver full
101  * charge current.
102  */
103 #define SOF_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC (BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC)
104 
105 /**
106  * Cold temperature in deci °C where the derating of maximum charge current
107  * is fully applied, i.e., below this temperature battery pack should not
108  * deliver any current in charge direction.
109  */
110 #define SOF_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC (BC_TEMPERATURE_MIN_CHARGE_MSL_ddegC)
111 
112 /**
113  * Hot temperature in deci °C where the derating of maximum discharge
114  * current starts, i.e., above this temperature battery pack should not deliver
115  * full discharge current.
116  */
117 #define SOF_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC (BC_TEMPERATURE_MAX_DISCHARGE_MOL_ddegC)
118 
119 /**
120  * Hot temperature in deci °C where the derating of maximum discharge
121  * current is fully applied, i.e., above this temperature battery pack should
122  * not deliver any current in discharge direction.
123  */
124 #define SOF_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC (BC_TEMPERATURE_MAX_DISCHARGE_MSL_ddegC)
125 
126 /**
127  * Hot temperature in deci °C where the derating of maximum charge current
128  * starts, i.e., above this temperature battery pack should not deliver full
129  * charge current.
130  */
131 #define SOF_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC (BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC)
132 
133 /**
134  * Hot temperature in deci °C where the derating of maximum charge current
135  * is fully applied, i.e., above this temperature battery pack should not
136  * deliver any current in charge direction.
137  */
138 #define SOF_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC (BC_TEMPERATURE_MAX_CHARGE_MSL_ddegC)
139 
140 /**
141  * Above this voltage value battery pack should not be exposed to full current in charge direction.
142  */
143 #define SOF_VOLTAGE_CUTOFF_CHARGE_mV (BC_VOLTAGE_MAX_MOL_mV)
144 
145 /**
146  * Above this voltage value battery pack should not be exposed to any current in charge direction.
147  */
148 #define SOF_VOLTAGE_LIMIT_CHARGE_mV (BC_VOLTAGE_MAX_RSL_mV)
149 
150 /**
151  * Below this voltage value battery pack should not deliver full current in discharge direction.
152  */
153 #define SOF_VOLTAGE_CUTOFF_DISCHARGE_mV (BC_VOLTAGE_MIN_MOL_mV)
154 
155 /**
156  * Below this voltage value battery pack should not deliver any current in discharge direction.
157  */
158 #define SOF_VOLTAGE_LIMIT_DISCHARGE_mV (BC_VOLTAGE_MIN_RSL_mV)
159 
160 /**
161  * structure for configuration of SoF Calculation
162  */
163 typedef struct {
164  /** Current derating limits @{ */
168  /**@}*/
169 
170  /** Low temperature derating limits @{ */
175  /**@}*/
176 
177  /** High temperature derating limits @{ */
182  /**@}*/
183 
184  /** Cell voltage derating limits @{ */
189  /**@}*/
190 } SOF_CONFIG_s;
191 
192 /*========== Extern Constant and Variable Declarations ======================*/
193 
194 /**
195  * Configuration values for the SOF window of the recommended battery current
196  */
198 
199 /*========== Extern Function Prototypes =====================================*/
200 
201 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
202 
203 #endif /* FOXBMS__SOF_TRAPEZOID_CFG_H_ */
Configuration of the battery cell (e.g., minimum and maximum cell voltage)
General macros and definitions for the whole platform.
const SOF_CONFIG_s sof_recommendedCurrent
float maximumDischargeCurrent_mA
float maximumChargeCurrent_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
int16_t limitHighTemperatureDischarge_ddegC
int16_t limitLowTemperatureDischarge_ddegC
int16_t cutoffLowTemperatureCharge_ddegC
int16_t cutoffLowTemperatureDischarge_ddegC
int16_t cutoffUpperCellVoltage_mV