Skip to content

Implemented FreeWheel - #4004

Open
AHaumer wants to merge 26 commits into
modelica:masterfrom
AHaumer:FreeWheel
Open

AHaumer wants to merge 26 commits into
modelica:masterfrom
AHaumer:FreeWheel

Conversation

@AHaumer

@AHaumer AHaumer commented Jun 26, 2022

Copy link
Copy Markdown
Contributor

As mentioned in #3977:
I see that we have a rather sophisticated Mechanics.Rotational.Components.OneWayClutch, but no simple ideal freewheel (like the Electrical.Analog.Ideal.Diode). We could introduce such a component for usage e.g. in bicycle models.

@AHaumer AHaumer added enhancement New feature or enhancement L: Mechanics.Rotational Issue addresses Modelica.Mechanics.Rotational labels Jun 26, 2022
@AHaumer AHaumer self-assigned this Jun 26, 2022
@AHaumer
AHaumer enabled auto-merge June 26, 2022 16:48

@christiankral christiankral left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@AHaumer Please check the following changes and re-invite me for a review afterwards.

  1. I added SI units the parameters in 8c6ba79
  2. I updated the documentation of the example in 73078a6

@AHaumer
AHaumer requested a review from christiankral July 4, 2022 16:57

@beutlich beutlich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • The new model is missing in ModelicaTest.Rotational.AllComponents.
  • The new example misses the required file Modelica/Resources/Reference/Modelica/Mechanics/Rotational/Examples/DemoFreeWheel/comparisonSignals.txt

@AHaumer
AHaumer requested a review from beutlich July 5, 2022 06:29

@beutlich beutlich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • The new model is missing in ModelicaTest.Rotational.AllComponents.
  • The new example misses the required file Modelica/Resources/Reference/Modelica/Mechanics/Rotational/Examples/DemoFreeWheel/comparisonSignals.txt

@tobolar tobolar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any reason to not extend from Modelica.Mechanics.Rotational.Interfaces.PartialCompliantWithRelativeStates as e.g. Rotational.Components.Clutch does?

@AHaumer
AHaumer requested review from beutlich and tobolar July 29, 2022 16:17
…alCompliant

Thus, the sign convention of phi_rel (and w_rel) established for "rotational" components is assured.
Note: doing so, the sign of w_rel and tau changes - compared to the original implementation.
@tobolar

tobolar commented Aug 3, 2022

Copy link
Copy Markdown
Contributor

Is there any reason to not extend from Modelica.Mechanics.Rotational.Interfaces.PartialCompliantWithRelativeStates as e.g. Rotational.Components.Clutch does?

With 7e6f667, the freewheel extends now from Mechanics.Rotational.Interfaces.PartialCompliant (without the state selection since it could be problematic). Thus, the sign convention of phi_rel (and w_rel) established for all rotational components is assured now. Consequently, the sign of w_rel and tau changes - compared to the original implementation. The example models work fine.

@dietmarw
dietmarw removed their request for review September 5, 2022 13:03
@beutlich
beutlich removed their request for review September 24, 2022 10:20
@christiankral

Copy link
Copy Markdown
Contributor

@tobolar Would the following wording make it better on your opinion:

parameter Real(final unit="rad/N/m/s") residualAngularVelocity =1e-5 "Residual angular velocity coefficient (free = false)";
...
  w_rel = s*unitTorque         *(if free then 1 else residualAngularVelocity);

@tobolar

tobolar commented Nov 8, 2022

Copy link
Copy Markdown
Contributor

Would the following wording make it better on your opinion:..

Sounds good. The following could be a reasonable implementation now:

parameter Real residualFriction=1e-5 "Residual friction coefficient (if free = true)";
parameter Real residualAngularVelocity=1e-5 "Residual angular velocity coefficient (if free = false)";
...
w_rel = s*unitAngularVelocity * (if free then 1 else residualAngularVelocity);
tau   = s*unitTorque          * (if free then residualFriction else 1);

The documentation shall be modified then:

free = false: flange_a is driving ...
...
tau = w_rel / residualAngularVelocity;

Regarding the two equations for tauin the documentation (where neither unitAngularVelocity nor unitTorque is used), the correct units of the two parameters shall be:

  • residualFriction (unit="N.s")
  • residualAngularVelocity (unit="1/N/s")

but it seems to be strange since one could, in general, expect both friction and a coefficient being unitless.

@christiankral

christiankral commented Nov 15, 2022

Copy link
Copy Markdown
Contributor
w_rel = s*unitAngularVelocity * (if free then 1 else residualAngularVelocity);
tau   = s*unitTorque          * (if free then residualFriction else 1);

On my understanding the units of the proposed equations are not correct. They shall rather be:

parameter residualFriction (unit="N.m.s")=1e-5 "Residual friction coefficient (if free = true)";
parameter residualAngularVelocity (unit="1/N/m/s")=1e-5 "Residual angular velocity coefficient (if free = false)";
w_rel = s*unitTorque          * (if free then 1 else residualAngularVelocity);
tau   = s*unitAngularVelocity * (if free then residualFriction else 1);

Note, that I swaped unitTorque and unitAngularVelocity in the two equations.

@christiankral

Copy link
Copy Markdown
Contributor
  • residualFriction (unit="N.s")
  • residualAngularVelocity (unit="1/N/s")

@tobolar As we deal with torques (not forces) the units shall rather be N.m.s and 1/N/m/s, isn't is?

@christiankral

Copy link
Copy Markdown
Contributor

Alternatively we could consider the unit rad, but I am not sure if this makes sense.

parameter residualFriction (unit="N.m.s/rad")=1e-5 "Residual friction coefficient (if free = true)";
parameter residualAngularVelocity (unit="rad/N/m/s")=1e-5 "Residual angular velocity coefficient (if free = false)";

@tobolar

tobolar commented Nov 16, 2022

Copy link
Copy Markdown
Contributor

@christiankral
IMO, one would expect regarding a mechanical component:

  1. "friction coefficient" (mu overall in MSL) is generally a unitless quantity,
  2. and so is probably also with "angular velocity coefficient".

This is why I tend to have no units. Optionally, we schould think again of changing "residualFriction" name and description. Not sure if this also holds for residualAngularVelocity.

@HansOlsson

Copy link
Copy Markdown
Contributor

Note that unitless can mean two different things:

  • A variable without a specified unit.
  • A variable with unit="1", also known as dimensionless.

To me the friction coefficient should be of the second kind for translational friction, but I notice that often in MSL it is of the first kind. (And it is generally not possible to deduce its unit because it appears as mu*cgeo where the geometric coefficient also is without unit.)

For rotational friction it is not clear to me if mu or cgeo should handle the conversion between force and torque.

@tobolar

tobolar commented Nov 16, 2022

Copy link
Copy Markdown
Contributor

@HansOlsson Need to open a new issue?
(See Sec. 2.3.3 Dimensions of quantities of the BIPM: The International System of Units – 9th edition (2019) - probably you know it already. )

@HansOlsson

Copy link
Copy Markdown
Contributor

@HansOlsson Need to open a new issue?

Possibly. You decide.

@christiankral

Copy link
Copy Markdown
Contributor

@HansOlsson Is using unitAngularVelocity and unitTorque still "state of the art" in how we handle the diode and freewheel implementation?

@AHaumer
AHaumer disabled auto-merge September 12, 2025 16:16
@beutlich
beutlich removed their request for review September 15, 2025 04:51
@christiankral

Copy link
Copy Markdown
Contributor

The freewheel model and example look OK on my opinion.

I think the parameter names and units are fine. @HansOlsson do you agree?

@HansOlsson

Copy link
Copy Markdown
Contributor

@HansOlsson Is using unitAngularVelocity and unitTorque still "state of the art" in how we handle the diode and freewheel implementation?

Yes. We are working on better solutions, but not yet.

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: Mechanics.Rotational Issue addresses Modelica.Mechanics.Rotational

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants