I have a 1 RC model of a battery which has a total capacity of 5Ah, (1 Hour of charge with a 5A current should fill it up), I am using a 2A source so it should take around 2.5 hrs.
I also have a buck converter that has a switching frequency of 1 Mhz, a supply volatge of 20V and a constant current supply (using a PI controller) of 2A.
So when I am joining the two circuits, its essentially becoming a simulation of step 1 microsecond and total steps accounting to 2.5 hrs. How can i decrease the total runtime, besides scaling down the capacity?
Hi Sagnik,
Yes, this is always a challenge when working with charging applications where you need to simulate hours of operation while the converters are switching at high frequencies. Have a look at Electrical Equivalent Implementation of Lithium-Ion Batteries | Plexim . In that example, the simulation is divided into two configurations:
-
A fully digital controller with the plant modeled as a fully switching converter.
The purpose of this setup is to validate that the digital controller operates correctly in a fully switched model. -
An average model of the converter with a continuous controller.
This configuration is used to verify that the controller performs as expected across the entire state of charge (SOC) range.
The associated documentation also describes the battery modeling approach and the average modeling of the buck converter, which is assumed to operate only in continuous conduction mode (CCM).
That said, the model can be further improved. Some potential enhancements include:
-
Extending the average model to operate in both CCM and DCM.
- Updating the implementation, since the current version only supports CCM operation for the DC/DC converter.
-
Replacing the existing average model with the “Chopper (High-Side Switch)” library component. This would allow you to model the entire system within a single configuration, as the Power Module devices support both fully switched and average model implementations (see Chopper (High-Side Switch) — PLECS 5.0 Documentation ). This approach also naturally supports both CCM and DCM operation.
Hope this helps.