Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model issues detected by unit checking ThreePhaseTwoLevel_PWM #4054

Closed
HansOlsson opened this issue Nov 1, 2022 · 0 comments · Fixed by #4152
Closed

Model issues detected by unit checking ThreePhaseTwoLevel_PWM #4054

HansOlsson opened this issue Nov 1, 2022 · 0 comments · Fixed by #4152
Assignees
Labels
L: Electrical.PowerConverters Issue addresses Modelica.Electrical.PowerConverters
Milestone

Comments

@HansOlsson
Copy link
Contributor

Might add more later, but a first one is that Modelica.Electrical.PowerConverters.DCAC.Control.SVPWM used in Modelica.Electrical.PowerConverters.Examples.DCAC.PolyphaseTwoLevel.ThreePhaseTwoLevel_PWM has incorrect start-value for t0 (not only wrong unit - but wrong value).

The relevant parts are:

 discrete Real t0(start=samplePeriod, fixed=true) "Relative time spans of vectors a, b, and 0";
algorithm
  when sampleTrigger then
     t0=max(1-ta-tb,0);
   end when;
...
   elseif (time - T0)/samplePeriod < (t0/4) then
...

It is clear from both of the latter two equations as well as the description that t0 should have unit="1", as it is a relative time-span.
That is not consistent with the start-value samplePeriod, and I would guess that a better start-value is 1.

(I would also prefer rewriting the elseif-conditions as elseif time < T0+samplePeriod*(t0/4) then since that is one of the forms that is discussed for time-events.)
Note that this will only matter in weird cases, as it is only used after startTime and before the first triggering of sampleTrigger.

(This is in addition to all the other related issues with PR.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Electrical.PowerConverters Issue addresses Modelica.Electrical.PowerConverters
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants