foxBMS  1.4.1
The foxBMS Battery Management System API Documentation
lg_inr18650mj1.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 lg_inr18650mj1.h
44  * @author foxBMS Team
45  * @date 2017-11-07 (date of creation)
46  * @updated 2022-10-27 (date of last update)
47  * @version v1.4.1
48  * @ingroup BATTERY_CELL_CONF
49  * @prefix BC
50  *
51  * @brief Configuration of the battery cell (e.g., minimum and maximum cell voltage)
52  *
53  * This files contains basic macros of the battery cell in order to derive needed inputs
54  * in other parts of the software. These macros are all depended on the hardware.
55  *
56  */
57 
58 #ifndef FOXBMS__LG_INR18650MJ1_H_
59 #define FOXBMS__LG_INR18650MJ1_H_
60 
61 /*========== Includes =======================================================*/
62 #include "general.h"
63 
64 /*========== Macros and Definitions =========================================*/
65 /**
66  * @ingroup CONFIG_BATTERY_CELL
67  * Maximum temperature limit during discharge.
68  * When maximum safety limit (MSL) is violated, error state is requested and
69  * contactors will open. When recommended safety limit (RSL) or maximum
70  * operating limit (MOL) is violated, the respective flag will be set.
71  * @ptype int
72  * @unit deci °C
73  * @{
74  */
75 #define BC_TEMPERATURE_MAX_DISCHARGE_MSL_ddegC (600)
76 #define BC_TEMPERATURE_MAX_DISCHARGE_RSL_ddegC (550)
77 #define BC_TEMPERATURE_MAX_DISCHARGE_MOL_ddegC (500)
78 /**@}*/
79 
80 /**
81  * @ingroup CONFIG_BATTERY_CELL
82  * Minimum temperature limit during discharge.
83  * When maximum safety limit (MSL) is violated, error state is requested and
84  * contactors will open. When recommended safety limit (RSL) or maximum
85  * operating limit (MOL) is violated, the respective flag will be set.
86  * @ptype int
87  * @unit deci °C
88  * @{
89  */
90 #define BC_TEMPERATURE_MIN_DISCHARGE_MSL_ddegC (-200)
91 #define BC_TEMPERATURE_MIN_DISCHARGE_RSL_ddegC (-150)
92 #define BC_TEMPERATURE_MIN_DISCHARGE_MOL_ddegC (-100)
93 /**@}*/
94 
95 /**
96  * @ingroup CONFIG_BATTERY_CELL
97  * Maximum temperature limit during charge.
98  * When maximum safety limit (MSL) is violated, error state is requested and
99  * contactors will open. When recommended safety limit (RSL) or maximum
100  * operating limit (MOL) is violated, the respective flag will be set.
101  * @ptype int
102  * @unit deci °C
103  * @{
104  */
105 #define BC_TEMPERATURE_MAX_CHARGE_MSL_ddegC (450)
106 #define BC_TEMPERATURE_MAX_CHARGE_RSL_ddegC (400)
107 #define BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC (350)
108 /**@}*/
109 
110 /**
111  * @ingroup CONFIG_BATTERY_CELL
112  * Minimum temperature limit during discharge.
113  * When maximum safety limit (MSL) is violated, error state is requested and
114  * contactors will open. When recommended safety limit (RSL) or maximum
115  * operating limit (MOL) is violated, the respective flag will be set.
116  * @ptype int
117  * @unit deci °C
118  * @{
119  */
120 #define BC_TEMPERATURE_MIN_CHARGE_MSL_ddegC (0)
121 #define BC_TEMPERATURE_MIN_CHARGE_RSL_ddegC (0)
122 #define BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC (0)
123 /**@}*/
124 
125 /**
126  * @ingroup CONFIG_BATTERY_CELL
127  * Maximum cell voltage limit.
128  * When maximum safety limit (MSL) is violated, error state is requested and
129  * contactors will open. When recommended safety limit (RSL) or maximum
130  * operating limit (MOL) is violated, the respective flag will be set.
131  * @ptype int
132  * @unit mV
133  * @{
134  */
135 #define BC_VOLTAGE_MAX_MSL_mV (4200u)
136 #define BC_VOLTAGE_MAX_RSL_mV (4150u)
137 #define BC_VOLTAGE_MAX_MOL_mV (4100u)
138 /**@}*/
139 
140 /**
141  * @ingroup CONFIG_LG
142  * nominal cell voltage according to data sheet
143  * @ptype int
144  * @unit mV
145  */
146 #define BC_VOLTAGE_NOMINAL_mV (3650u)
147 /**
148  * @ingroup CONFIG_BATTERY_CELL
149  * Minimum cell voltage limit.
150  * When maximum safety limit (MSL) is violated, error state is requested and
151  * contactors will open. When recommended safety limit (RSL) or maximum
152  * operating limit (MOL) is violated, the respective flag will be set.
153  * @ptype int
154  * @unit mV
155  * @{
156  */
157 #define BC_VOLTAGE_MIN_MSL_mV (2000u)
158 #define BC_VOLTAGE_MIN_RSL_mV (2050u)
159 #define BC_VOLTAGE_MIN_MOL_mV (2100u)
160 /**@}*/
161 
162 /**
163  * @ingroup CONFIG_BATTERY_CELL
164  * Deep-discharge cell voltage limit.
165  * If this voltage limit is violated, the cell is faulty. The BMS won't allow
166  * a closing of the contactors until this cell is replaced. a replacement of
167  * the cell is confirmed by sending the respective CAN debug message
168  * @ptype int
169  * @unit mV
170  */
171 #define BC_VOLTAGE_DEEP_DISCHARGE_mV (BC_VOLTAGE_MIN_MSL_mV - 100u)
172 
173 /**
174  * @ingroup CONFIG_BATTERY_CELL
175  * Maximum discharge current limit.
176  * When maximum safety limit (MSL) is violated, error state is requested and
177  * contactors will open. When recommended safety limit (RSL) or maximum
178  * operating limit (MOL) is violated, the respective flag will be set.
179  * @ptype int
180  * @unit mA
181  * @{
182  */
183 #define BC_CURRENT_MAX_DISCHARGE_MSL_mA (10000u)
184 #define BC_CURRENT_MAX_DISCHARGE_RSL_mA (9500u)
185 #define BC_CURRENT_MAX_DISCHARGE_MOL_mA (9000u)
186 /**@}*/
187 
188 /**
189  * @ingroup CONFIG_BATTERY_CELL
190  * Maximum charge current limit.
191  * When maximum safety limit (MSL) is violated, error state is requested and
192  * contactors will open. When recommended safety limit (RSL) or maximum
193  * operating limit (MOL) is violated, the respective flag will be set.
194  * @ptype int
195  * @unit mA
196  * @{
197  */
198 #define BC_CURRENT_MAX_CHARGE_MSL_mA (10000u)
199 #define BC_CURRENT_MAX_CHARGE_RSL_mA (9500u)
200 #define BC_CURRENT_MAX_CHARGE_MOL_mA (9000u)
201 /**@}*/
202 
203 /**
204  * @brief the cell capacity used for SOC calculation, in this case Ah counting
205  * @ptype int
206  * @unit mAh
207  */
208 #define BC_CAPACITY_mAh (3500u)
209 
210 #if BC_VOLTAGE_MIN_MSL_mV < BC_VOLTAGE_DEEP_DISCHARGE_mV
211 #error "Configuration error! - Maximum safety limit for under voltage can't be lower than deep-discharge limit"
212 #endif
213 
214 /** structure for lookup table */
215 typedef struct {
216  const int16_t voltage_mV; /*!< cell voltage in mV */
217  const float value; /*!< corresponding value, can be SOC/SOE in % or capacity/energy */
218 } BC_LUT_s;
219 
220 /*========== Extern Constant and Variable Declarations ======================*/
221 extern uint16_t bc_lginr18650mj1SocLutLength;
222 extern const BC_LUT_s bc_lginr18650mj1SocLut[];
223 
224 extern uint16_t bc_lginr18650mj1SoeLutLength;
225 extern const BC_LUT_s bc_lginr18650mj1SoeLut[];
226 
227 /*========== Extern Function Prototypes =====================================*/
228 
229 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
230 
231 #endif /* FOXBMS__LG_INR18650MJ1_H_ */
General macros and definitions for the whole platform.
uint16_t bc_lginr18650mj1SocLutLength
uint16_t bc_lginr18650mj1SoeLutLength
const BC_LUT_s bc_lginr18650mj1SocLut[]
const BC_LUT_s bc_lginr18650mj1SoeLut[]