ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Continuous angle for rectangular to polar

Open AHaumer opened this issue 10 months ago • 0 comments

According to the discussion in #4363, we should have an eye how the angle (and - if possible - the angular velocity) of a phasor given as rectangular representation can be obtained. Preferably the angle should be continuous, a wrap in the interval [0, 2*pi) or (-pi, +pi] can be done easily. Using the function atan2 is not the best idea: The result is wrapped in the interval (-pi, +pi] and a "step" from -pi to +pi or vice versa isn't a step but a ramp depending on the output interval. This of course is not desired for regression testing. The solution could be a Phase Locked Loop / Angle Tracking Observer as suggested in #3914. We could discuss here and post a test implementation. @casella @christiankral @dietmarw and all other Modelicans you're invited to give your opinion. Additonal reading could be: Masoud Karimi-Ghartemani, Enhanced Phase-Locked Loop Structures for Power and Energy Applications and a Tutorial at PowerSim by the same author.

AHaumer avatar Mar 06 '25 19:03 AHaumer