PDF

Battery Pack Discharge Control with Thermal Analysis
Introduction
Thermal management is important in battery modeling. This example computes the temperature distribution in a battery pack during a 4C discharge. To ensure a constant output power and prevent extreme battery usage condition, the multiphysics model is coupled to a control diagram in Simulink. There, the current is automatically adjusted based on output power and the battery voltage. The maximum temperature in the battery pack is also monitored.
Note: This models requires licenses for both the Battery Design Module and LiveLink™ for Simulink®.
Model Definition
The COMSOL model includes the electrochemical analysis of a battery cell coupled to a 3D thermal analysis of the battery stack. For a detailed description of the battery pack and the underlying COMSOL model, see the Thermal Distribution in a Pack of Cylindrical Batteries tutorial in the Battery Design Module Application Library.
The control system implemented in Simulink ensures a constant usage power and prevents possible battery damage. The control system consists of a PI controller to adjust the battery usage power to 180 W. The applied current in the battery is limited to a minimum value of 16.1 A and is stopped when the voltage reaches a minimum value of 12 V.
The cosimulation with COMSOL Multiphysics and Simulink is set up by exporting a COMSOL Cosimulation file from the COMSOL model and then adding this file to the COMSOL Cosimulation block in the Simulink simulation diagram. The input of the block consists of the applied current, provided by Simulink. The block has three outputs: the stack voltage, the temperature in the middle cell, and the power usage.
Figure 1 shows the full simulation diagram in Simulink.
Figure 1: Battery control diagram.
Results and Discussion
Figure 2 below shows the temperature in the battery stack. The maximum temperature is located in the middle of the stack, which corresponds to the third cell in the COMSOL model.
Figure 2: Temperature distribution in battery stack.
Figure 3 below shows the voltage of battery during usage. The voltage drops rapidly when the battery is fully charged and almost discharged; these are the regions that can cause most damage. Because it is not recommended to leave the battery in this region the applied current is cut when the voltage is below 10.2 V.
Figure 3: Voltage in battery stack.
Figure 4 below shows the applied voltage to ensure a usage power of 180 W. The current keep decreasing as the battery get discharged. The current is limited to 16 A to not damage the battery; this limit is reached after almost 700 s at full power. When the minimum allowed voltage is reached, the current is cut, here around 860 s.
Figure 4: Electric current in battery stack.
Figure 5 shows the usage power provided by the battery. You can notice the response time to reach full power caused by the PID controller, which is about 50 sec. Once the current is restricted to its maximum value, the usage power can no longer be enforced to a constant value and starts to drop until the current is cut.
Figure 5: Battery power.
Figure 6 shows the variation of the temperature in the third cell of the COMSOL model, which is used as output of the COMSOL Cosimulation block. The temperature keeps increasing until the power starts to drop, but the rise suddenly before the current is cut.
Figure 6: Maximum temperature in battery stack.
Setting Up the Cosimulation
Follow the workflow below to set up the cosimulation with COMSOL Multiphysics and Simulink:
1
2
3
4
5
6
Application Library path: LiveLink_for_Simulink/Tutorials/battery_control_thermal
Modeling Instructions — COMSOL Desktop
Start this tutorial by opening the model Thermal Distribution in a Pack of Cylindrical Batteries from the Battery Design Module Application Library.
From the File menu, choose Open.
From the Application Libraries root, browse to the folder Battery_Design_Module/Thermal_Management and double-click the file lumped_li_battery_pack_6s2p.mph.
Global Definitions
Battery Parameters
1
In the Model Builder window, under Global Definitions click Battery Parameters.
2
In the Settings window for Parameters, locate the Parameters section.
3
Component 1 (comp1)
In the Model Builder window, expand the Component 1 (comp1) node.
Definitions (comp1)
E_OCP (int1)
1
In the Model Builder window, expand the Component 1 (comp1)>Definitions node, then click E_OCP (int1).
2
In the Settings window for Interpolation, locate the Definition section.
3
Click Import.
dEdT (int2)
1
In the Model Builder window, click dEdT (int2).
2
In the Settings window for Interpolation, locate the Definition section.
3
Click Import.
Lumped Battery (lb)
1
In the Model Builder window, under Component 1 (comp1) click Lumped Battery (lb).
2
In the Settings window for Lumped Battery, locate the Operation Mode section.
3
In the Iapp text field, type Iapp.
Lumped Battery 2 (lb2)
1
In the Model Builder window, under Component 1 (comp1) click Lumped Battery 2 (lb2).
2
In the Settings window for Lumped Battery, locate the Operation Mode section.
3
In the Iapp text field, type Iapp.
Lumped Battery 3 (lb3)
1
In the Model Builder window, expand the Study 1 node, then click Component 1 (comp1)>Lumped Battery 3 (lb3).
2
In the Settings window for Lumped Battery, locate the Operation Mode section.
3
In the Iapp text field, type Iapp.
Study 1
Step 1: Time Dependent
1
In the Model Builder window, under Study 1 click Step 1: Time Dependent.
2
In the Settings window for Time Dependent, locate the Study Settings section.
3
From the Time unit list, choose s.
4
In the Output times text field, type 0 1e3.
Solution 1 (sol1)
1
In the Model Builder window, expand the Study 1>Solver Configurations node.
2
Right-click Study 1>Solver Configurations>Solution 1 (sol1) and choose Solution>Update.
Save the COMSOL Model
1
From the File menu, choose Save As.
2
Browse to a suitable folder, enter the filename battery_control_thermal.mph, and then click Save.
Exporting the Cosimulation File
In the following configure the cosimulation, and export the file for cosimulation that will be loaded into Simulink.
Global Definitions
Cosimulation for Simulink 1
1
In the Study toolbar, click  Cosimulation for Simulink.
2
In the Settings window for Cosimulation for Simulink, locate the Filename section.
3
In the Filename text field, type battery_control_thermal.
4
Locate the Inputs section. Click  Add.
5
6
Locate the Outputs section. In the table, enter the following settings:
7
Locate the Study section. Find the Store solution subsection. Clear the According to study step settings check box.
8
Locate the Image section. Click Set from Graphics WindowThis sets the current temperature plot (if a solution is available) as the thumbnail used for the COMSOL Cosimulation block inside Simulink.
9
Click  Export.
Modeling Instructions — Simulink
Once you have created the COMSOL model and saved the cosimulation file you can start Simulink to continue with the setup there.
1
2
In MATLAB enter the command mphapplicationlibraries to start the GUI for viewing models from the LiveLink for Simulink application library.
3
4
The included COMSOL Cosimulation block is already configured with a cosimulation file based on the model from the COMSOL Application Library and ready to run. If you want to run the simulation directly, go to Step 7 below. Else, if you want to use the model file and cosimulation file you have created by following the steps in the section Modeling Instructions — COMSOL Desktop, you can continue with Step 5 below.
5
6
Note: In case the folder path of the file for cosimulation for Simulink is not set in MATLAB enter the full filename.
For this simulation the stop time is set to 30 s and the communication step size is set to 10 s.
7
Postrocessing the Solution in the COMSOL Desktop
Once you have run the simulation in Simulink you can postprocess the computed solution stored in the COMSOL model, for instance the steps below show how to generate an animation the temperature distribution on the battery pack.
1
mphlaunch
This will start a COMSOL Desktop with the model used to run the cosimulation.
2
In the Model Builder, expand the Results node, and select the Temperature node.
3
In the Temperature (ht) toolbar, click Animation, and choose Player.
Note: Close the COMSOL Desktop before running a new simulation in Simulink.