Issue regarding active cell balancing control of Lib using MPC in casADi

25 views
Skip to first unread message

Ali Arshad

unread,
Mar 25, 2023, 3:09:18 AM3/25/23
to CasADi
Hi everyone,

To start with the problem, I transcribed it using multiple shooting method and solved the OCP in open loop configuration. The results were fine and I obtained the optimal trajectory of the control variable. However, when I tried to solve the same problem using MPC, I did not have any success. After few iterations a couple of states in the state vector yield Nan. I tried to cater the issue by reducing the step size, and I also switched from Euler discretization to RK-4, however, there was no success. I have also noticed that the divergence of states is faster when I use RK-4 as compared to Euler discretization. I also tried to change the step size from 6s to 0.1s (for open loop OCP I used step size of 6s), but the MPC did not converge.

Some details regarding the system:
1. Number of states=4
2. Prediction horizon=3000 s (with open loop I choose no. of discretization steps N=500, and step size of 6s)
3. Number of control inputs is 1 

PS. I am a bit new to CasADi. Do let me know if I need to share more details
Reply all
Reply to author
Forward
0 new messages