ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Implementation and test of UnwrapAngle (angle tracking observer)

Open AHaumer opened this issue 3 years ago • 7 comments

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.

AHaumer avatar Dec 13 '21 11:12 AHaumer

@tobolar

  1. Thanks - I've missed that for a long time. Keep in mind that the output approximates the desired angle with a firstOrder.
  2. Do you have a suggestion? Of course, I'm trapped in my field of expertise ;-)
  3. Yes, the second output is w = d phi / dt. Just can't change the name of the output y (which is phi in fact).
  4. We could switch to a calculation using Complex. Would you prefer that)
  5. ATO = Angle Tracking Observer. Resolved.

AHaumer avatar Dec 15 '21 16:12 AHaumer

@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 avatar Apr 27 '23 17:04 AHaumer

@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.

dietmarw avatar May 04 '23 15:05 dietmarw

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)

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.

christiankral avatar May 10 '23 17:05 christiankral

3. The output wis 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.

christiankral avatar May 10 '23 17:05 christiankral

@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.

tobolar avatar Jan 17 '24 10:01 tobolar

I agree that der_y (my preference) might be a more meaningful name for the angular velocity.

Me too.

tobolar avatar Jan 17 '24 10:01 tobolar