ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Default parameters of power converter devices

Open AHaumer opened this issue 9 months ago • 5 comments

Power converter models of Modelica.Electrical.{Analog, PolyPhase, PowerConverters} typically use three parameters: parameter SI.Resistance Ron(final min=0) = 1e-5 "Forward state-on differential resistance (closed resistance)"; parameter SI.Conductance Goff(final min=0) = 1e-5 "Backward state-off conductance (opened conductance)"; parameter SI.Voltage Vknee(final min=0) = 0 "Forward threshold voltage"; Some examples at least with some tools revealed numerical problems using those default parameters. Changing the parameters to parameter SI.Resistance Ron(final min=0) = 1e-4 "Forward state-on differential resistance (closed resistance)"; parameter SI.Conductance Goff(final min=0) = 1e-4 "Backward state-off conductance (opened conductance)"; parameter SI.Voltage Vknee(final min=0) = 0 "Forward threshold voltage"; helped to overcome those numerical problems. These default parameters for nearly ideal diodes, thyristors and gto-thyristors (this model also covers igbts, transistors, mosfets) stem from early days of Modelica.Analog from Christoph Clauss (who unfortunately is no longer active). When implementing PolyPhase and PowerConverters we took the default parameters from Analog. I'm afraid there are a lot of user models out there that rely on the default parameters. If the system's voltage level is rather high (some 100 V) changing Ron and Goff won't make a big dfference. Simulating small systems at a voltage level let's assume 6 V - ok here we see a rather strong influence. Therefore it's questionable to change the default parameters which would change the results of user models. @casella @christiankral @dietmarw what's your opinion? Well we could compare the results for some examples. See also discussion in #4517 and PRs #4562 (discussion in #4559), #4563 and #4572.

AHaumer avatar Mar 06 '25 15:03 AHaumer

Hm... I'm not super-confident with changing such defaults; and I'm not sure that it will provide such a dramatic improvement in general. But we will have time before 4.2.0.

HansOlsson avatar Mar 06 '25 16:03 HansOlsson

For MSL4.2.0 I don't think it is an issue and can be investigated thoroughly. However I'm quite worried by the last minute changes you propose in the linked issues and PRs so close to an RC.

dietmarw avatar Mar 06 '25 17:03 dietmarw

Reporting here @AHaumer's comment in #4559 for completeness:

I'm not aware of other PowerConverter models that are numerically too challenging. The default parameters (Ron and Goff) for nearly ideal diodes, thyristors and gto-thyristors (this model also covers igbts, transistors, mosfets) stem from early days of Modelica.Analog from Christoph Clauss (who unfortunately is no longer active). When implementing PolyPhase and PowerConverters we took the default parameters from Analog. I'm afraid there are a lot of user models out there that rely on the default parameters. If the system's voltage level is rather high (some 100 V) changing Ron and Goff won't make a big dfference. Simulating small systems at a voltage level let's assume 6 V - ok here we see a rather strong influence. Same or even worse for the threshold voltage Vknee (which by default is 0 but for a typical Si-diode about 0.7 V). Therefore it's questionable to change the default parameters which would change the results of user models. BTW what does "numerically fragile" mean? I'm pretty sure some enhancements in the solver of a tool also solves the problem.

casella avatar Mar 07 '25 11:03 casella

However I'm quite worried by the last minute changes you propose in the linked issues and PRs so close to an RC.

@dietmarw let me recap the whole story here:

  • the original issue triggering the linked PRs is #4559. This is a MSL 4.0.0->4.1.0 regression. MAP-Lib rules call for regression testing by tool vendors (other than Dassault, since currently MA's internal regression testing is performed by LTX using Dymola, so it's kind of built-in the process) all the way up the tagging of the RC. And of course if you do regression testing and a regression shows up, you definitely try to fix it. That's not a last-minute hack, it's built in the process. This is done by PR #4562.
  • @AHaumer, the library officer, notices that there are is another example cases in the MSL which is nearly identical from the point of view of what caused #4559 (issues with diodes in the power converter), and proposes to apply the same change there for safety, that's PR #4563. This seems pretty reasonable and safe to me. Besides, as @maltelenz notes here, this solves numerical issues that WSM historically had with this MSL example case. Seems to me a no brainer to get this in 4.1.0, even as a last-minute thing
  • As we now finally understand that ideal-diode-based power converters can be numerically problematic at low voltage, as @AHaumer explains above, we have a hint to solve #4517, which was discussed in January during MAP-Lib meetings as a problematic model, for reasons that were not understood back then. Dymola 2025x, which we currently use for MAP-Lib reference result generation and internal regression testing, is no longer able to simulate IMC_InverterDrive 4.1.0 with Tolerance = 1e-7, so it won't be able to generate the reference results anymore. Technically, we don't have a regression, because we can still use the reference generated by earlier versions of Dymola for MSL 4.0.0. But I'd say this is almost a regression, so it would be worth fixing it.

Most importantly, the three pull requests only deal with example models and are purely local to them. No impact on user models going from MSL 4.0.0 to 4.1.0.

As to #4562 and #4563, I really see no reason to worry. Local changes to example models only, resolving a regression with OMC and long-standing problems with WSL.

As to #4572, I'm also in favour of it, because it replaces an example model which is clearly numerically probematic with many tools for one reason or another with one that is clearly more numerically robust. Even if the results are a bit different, I don't think that is a problem: this is just an example model to demonstrate the use of inverter models coupled with machine models, the exact behaviour of internal variables doesn't really matter, as long as the simulation makes sense.

Of course changing the defaults in the libary model is a completely different story, but it's never been the intention to do that as a last-minute fix.

casella avatar Mar 07 '25 12:03 casella

I agree with @casella

As long as we do not change the parameters of the library models, modifying the example parameters is OK from my point of view.

The default parameters Ron = 1E-5 and Goff = 1E-5 work nicely for (reference) voltages around 1V and (reference) currents around 1A. If the appication changes to 100V and 1A the parameters shall change to Ron = 1E-5 * 100 = 1E-3 and Goff = 1E-5 / 100 = 1E-7. So it makes sense to pick application specific parameters.

christiankral avatar May 23 '25 20:05 christiankral