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

Implementation and test of UnwrapAngle (angle tracking observer) #3914

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

AHaumer
Copy link
Contributor

@AHaumer AHaumer commented Dec 13, 2021

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 AHaumer added enhancement New feature or enhancement L: Blocks Issue addresses Modelica.Blocks labels Dec 13, 2021
@AHaumer AHaumer self-assigned this Dec 13, 2021
@AHaumer AHaumer requested review from dietmarw and GallLeo December 13, 2021 16:30
@beutlich beutlich removed their request for review December 13, 2021 21:36
Copy link
Contributor

@tobolar tobolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disregarding the implementation itself, my comments here:

  1. It is great to have such a block.
  2. IMO, the documentation is leaned too close to electrics. Maybe better to write it in a general way, just like e.g. WrapAngle do.
  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.)
  4. A bit odd to use an element (Rotator) from Electrical within Blocks. But I understand it is needed here.
  5. Example DemoATO shall be renamed to not include an abbreviation. ATO is not explained. (And yes, I have no clue what it is.)

@AHaumer
Copy link
Contributor Author

AHaumer commented Dec 15, 2021

@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 AHaumer requested a review from tobolar December 15, 2021 16:50
Copy link
Member

@dietmarw dietmarw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit torn here. I really dislike the "shopping" for the Rotator of a base component from deep within another domain library. So ideally I would see the Rotator (and also the other phasor blocks) into Blocks.Math. But this would automatically mean this extension being pushed towards the next MAJOR version. And who knows when that is going to happen.

Alternatively one could accept the "dirty" implementation for the 4.x series but create a 5.0.0 ticket at the same time where the move of those blocks will be executed.

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

@AHaumer
Copy link
Contributor Author

AHaumer commented Apr 27, 2023

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

@dietmarw
Copy link
Member

dietmarw commented May 4, 2023

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

@christiankral
Copy link
Contributor

christiankral commented May 10, 2023

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
Copy link
Contributor

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.

Replaced angles phi and phi' by u and y
@tobolar
Copy link
Contributor

tobolar commented Jan 17, 2024

@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
Copy link
Contributor

tobolar commented Jan 17, 2024

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

Me too.

* Icon: use common color of "signal" line and delete "w"

* Documentation: minor corrections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement L: Blocks Issue addresses Modelica.Blocks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants