How to resolve "Derivative is infinite or NaN" error in MMC simulation with equivalent submodule circuit?

I am building an MMC simulation from scratch using equivalent circuits based on the simplified arm circuit shown in Figure below. My implementation uses a submodule equivalent circuit with multiple instances (4 submodules) as shown in my screenshot.

However, I’m encountering a “Derivative is infinite or NaN” error during simulation. The error appears to be related to my submodule circuit implementation, particularly around the time 1.0.0 seconds.

This error message indicates that your system contains a positive (unstable) feedback loop that involves a physical circuit. Here is a very simple example of such a system:


PositiveFeedbackSystem.plecs (6.1 KB)
A positively charged capacitor will produce a current that will charge the capacitor even more until the voltage becomes infinite. At this point, the simulation stops with an error.

From your screenshot it seems to me that the polarity of Am1 inside your submodule is wrong. The way you have connected it, a current flowing out of the submodule will charge the capacitor.

Hello
Do you have a model of the MMC without equivalent circuits? I’m interested in controlling the MMC inverter and sorting the capacitor charge. Please share If possible