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