idirectional DC-DC Converter crashes during mode transition (charging to discharging) due to infinite di/dt

Ce sujet a été définitivement fermé et transféré vers MATLAB Answers


Hi everyone,
I am building a microgrid model in Simulink and I am hitting a brick wall during a specific weather transient event.
The Setup:
  • I have a 48V battery connected to a 200V DC Bus via a Bidirectional DC-DC Converter.
  • The DC Bus has a constant 1500W load, supported by Wind and Solar sources.
  • The converter uses cascaded PI controllers (Outer Voltage Loop, Inner Current Loop) to generate a PWM duty cycle via a Relational Operator and Triangle Wave (10 kHz).
  • The powergui is set to Discrete with a sample time of 1e-5.
The Problem:For the first 14.9 seconds, the Wind and Solar easily supply the load, and the excess power is pushed into the battery. The battery is charging (current is flowing in reverse).
At exactly t = 15.0 seconds, the wind and solar drop. The battery must instantly reverse current flow to discharge and support the 1500W load. At this exact millisecond, the simulation aborts. Scopes show a massive, instantaneous current spike as the current tries to reverse direction, causing the math solver to fail.
What I Have Already Tried:
  1. Swapped to modern Discrete PID blocks with Anti-Windup (Clamping) to prevent integrator explosion.
  2. Lowered the PI gains significantly to stop the controller from aggressively overreacting.
  3. Disabled zero-crossing detection on the PID blocks.
  4. Capped the maximum Duty Cycle at 0.85 to prevent infinite voltage commands.
I have attached a screenshot of my control loop and the scope showing the crash at 15.0s. Any advice or guidance on power electronics best practices in Simulink would be greatly appreciated!