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

Bug in a component: Modelica.Electrical.Machines.Sensors.HallSensor #4030

Closed
ankitnaik177 opened this issue Sep 14, 2022 · 4 comments · Fixed by #4031
Closed

Bug in a component: Modelica.Electrical.Machines.Sensors.HallSensor #4030

ankitnaik177 opened this issue Sep 14, 2022 · 4 comments · Fixed by #4031
Assignees
Labels
L: Electrical.Machines Issue addresses Modelica.Electrical.Machines
Milestone

Comments

@ankitnaik177
Copy link

The block Modelica.Electrical.Machines.Sensors.HallSensor has an error. It uses rem() but it really should be mod().

The hall sensor should always be between 0 and 2*pi — no matter the direction of travel. The electrical angle of a motor is always in that range — as soon as you reach 2 Pi you wrap back to zero and if you pass zero in the negative direction, you wrap to 2 pi. Note that if the angle is negative, the HallSensor gives a nonsensical output.

@dietmarw dietmarw added the L: Electrical.Machines Issue addresses Modelica.Electrical.Machines label Sep 14, 2022
@dietmarw
Copy link
Member

@AHaumer To me, it looks like that @ankitnaik177 is right. Taking the example Modelica.Electrical.Machines.Examples.SynchronousMachines.SMPM_NoLoad and letting the machine run backwards will create the following angle outputs for the original HallSensor(Rem) and a modified using mod
image

AHaumer added a commit to AHaumer/ModelicaStandardLibrary that referenced this issue Sep 14, 2022
@dietmarw dietmarw added this to the MSL4.1.0 milestone Sep 15, 2022
@dietmarw
Copy link
Member

dietmarw commented Sep 15, 2022

@AHaumer How severe do you reckon this fault is? Does it justify backporting to 4.0.x branch?

@AHaumer
Copy link
Contributor

AHaumer commented Sep 15, 2022

To be honest: the difference between the two variants is 2*pi - so I wouldn't care for backporting.

@dietmarw
Copy link
Member

OK. In that case, I'll remove the "bug" label from #4031.

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

Successfully merging a pull request may close this issue.

3 participants