ModelicaStandardLibrary
ModelicaStandardLibrary copied to clipboard
Implementation and test of UnwrapAngle (angle tracking observer)
In Simulink a block UnwrapAngle exists, in Modelica it's missing. I'm pretty sure that this is a block used in many applications, here is a robust implementation (angle tracking observer) of this functionality.
@tobolar
- Thanks - I've missed that for a long time. Keep in mind that the output approximates the desired angle with a firstOrder.
- Do you have a suggestion? Of course, I'm trapped in my field of expertise ;-)
- Yes, the second output is w = d phi / dt. Just can't change the name of the output y (which is phi in fact).
- We could switch to a calculation using Complex. Would you prefer that)
- ATO = Angle Tracking Observer. Resolved.
@AHaumer One minor thing, the documentation of
Rotator
says: "Rotates a space phasor (voltage or current) input u by the angle in negative mathematical direction." but the images shows the rotation happening in positive (anti-clockwise) direction. So which one is it?
I hope I don't mix it up now but it seems to be consistent: angle is measured from (alfa, beta) - coordinate system to (d, q) - coordinate system, and the image explains that angle has to be subtracted from the input's argument (i.e. rotate the input to obtain it's representation in the new coordinate system).
@AHaumer I still think you mix things up. The negative mathematical direction is clockwise. The arrow that is shown in the documentation is pointing anti-clockwise (i.e., positive direction) whilst the icon shows clockwise (i.e., negative direction). Now the main confusion here is that what is rotated is not the actual signal but the signal with regard to its reference coordinate system.
I suggest changing the formulation so it says:
"Rotates a space phasor (voltage or current) input u
by the angle
in positive mathematical direction. This is achieved by rotating the rotating reference by the negative value of angle angle
. This block represents the transformation of one space phasor u from one rotating reference (coordinate) frame into another where the space phasor is y
. The output reference frame leads the input reference frame by angle angle
.
(changes in bold)
Now this should be a different ticket really.
I suggest changing the formulation so it says: "Rotates a space phasor (voltage or current) input
u
by theangle
in positive mathematical direction. This is achieved by rotating the rotating reference by the negative value of angleangle
. This block represents the transformation of one space phasor u from one rotating reference (coordinate) frame into another where the space phasor isy
. The output reference frame leads the input reference frame by angleangle
.(changes in bold)
I think it's a good idea to improve the documentation of the Rotator
model. If we do so, the wording (voltage or current) shall be changed to (e. g., voltage or current), as the transformation works also for flux phasors, etc. We should perform these changes in a different ticket.
3. The output
w
is useful, and shall probably be renamed to "dy", "der_y", "y_der", or something like that. (Also delete that string from the icon completely.)
I agree that der_y
(my preference) might be a more meaningful name for the angular velocity.
@AHaumer Regarding example Modelica.Blocks.Examples.DemoUnwrapAngle
, why is it necessary to have components from the Mechanics.Rotational
package? It works all fine also without it.
I agree that der_y (my preference) might be a more meaningful name for the angular velocity.
Me too.