Battery Management using Simulink & Stateflow
Joshni-infant SAVARIMUTHU
on 4 Aug 2022
Latest activity Reply by Joshni-infant SAVARIMUTHU
on 5 Aug 2022
Hello,
I am designing a battery model and its control to undergo cyclic charge and discharge.
The battery model is created by using a simscape electrical battery block (Table-based).
The control is modeled using Stateflow. The statflow chart takes SOC values as inputs and provide current values as outputs. By default, the battery will be at rest and no current is drawn at that state (I=0A). And then based on the SOC % of the battery, it goes to charge (3A current) or discharge (-3A current) state. I have defined the controls as follows.
- If the battery has SOC >= 50%, it has to discharge. If the battery has SOC < 50%, it has to charge.
- While discharging, if the battery reaches 0% SOC, it goes to rest.
- While charging, if the battery reaches 100% SOC, it goes to rest.
I have defined initial SOC as 50%.
When I run the simulation, the battery started to discharge as per the condition provided in the stateflow chart.
I = -3
But the battery has not come to rest state after reaching 0% S0C.
I am getting a warning that,
At time 1944.017100, one or more assertions are triggered. State of charge must be greater than or equal to zero. The assertion comes from: Block path: Example_cell_model/Battery (Table-Based)1Assert location: o (location information is protected)
I don't understand why the battery has not came back to rest state.
Do anyone has any idea for the cause of this problem and how to resolve it?




Thanks in advance.
1 Comment
Time DescendingI have resolved the issue by replacing the transient conditions as follows.
Discharge to rest - SOC <= 0.01
Charge to rest - SOC >= 1
Also, i've removed the conditions SOC==1 and SOC == 0 for transitions from Rest to discharge and Rest to charge respectively as it seems to be redundant.
It worked well and i've got the expected results. 


Sign in to participate