Hi everyone,
I’m currently building a battery charger simulation in PLECS and I’m stuck with the battery modeling / CCCV charging curve part.
What I want to achieve
I want to simulate a CCCV charging process (Constant Current → Constant Voltage) for a LiFePO4 battery pack using a boost converter. The goal is to reproduce the typical charging curve:
-
CC phase: battery current stays constant while battery voltage rises
-
CV phase: battery voltage stays constant while current tapers down
My setup so far
-
Boost converter (switch + diode + inductor + output capacitor)
-
Cascaded control structure:
-
Outer loop: Voltage PI controller → generates current reference
-
Inner loop: Current PI controller → controls PWM duty (triangle comparator)
-
I currently regulate the inductor current in the inner loop (because that’s what I tuned the current loop with). Battery voltage is measured at the output.
The problem
Even though the converter + PI loops “work” in the sense that the circuit runs, I cannot get a proper CCCV behavior:
-
Sometimes the battery voltage starts too high or behaves strangely
-
The current reference from the voltage controller sometimes seems wrong / too small
-
I get oscillations or unrealistic voltage spikes at startup
-
The simulated “SOC increase” is extremely slow (charging would take hours in real time), so I tried time-scaling (capacity scaling), but then the battery model throws parameter errors or becomes unstable
I’m using the PLECS Li-ion R-only model (resistor-only battery model) because I want to keep it simple, generating a CCCV curve for LiFePO4.
Thanks a lot!
Boost_Converter_Regelung_Bat_neu.plecs (99.9 KB)