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

Implemented FreeWheel #4004

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions Modelica/Mechanics/Rotational/Components/FreeWheel.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
within Modelica.Mechanics.Rotational.Components;
model FreeWheel "Ideal freewheel"
extends Modelica.Mechanics.Rotational.Interfaces.PartialCompliant;

SI.AngularVelocity w_rel(start=0)
"Relative angular velocity (= der(phi_rel))";
Boolean free(start=false) "Indicates freewheeling";

parameter SI.Torque tauRes=1e-5 "Residual friction coefficient";
parameter SI.AngularVelocity wRes=1e-5 "Residual relative velocity coefficient";

protected
Real s(start=0, final unit="1") "Auxilliary variable";
constant SI.AngularVelocity unitAngularVelocity=1;
constant SI.Torque unitTorque=1;

equation
w_rel = der(phi_rel);
free = w_rel >= 0;
w_rel = -s*unitAngularVelocity*(if free then 1 else tauRes/unitTorque);
tau = -s*unitTorque*(if free then wRes/unitAngularVelocity else 1);

annotation (
Icon(graphics={
Rectangle(
lineColor={64,64,64},
fillColor={192,192,192},
fillPattern=FillPattern.HorizontalCylinder,
extent={{-100,-10},{-30,10}}),
Rectangle(
lineColor={64,64,64},
fillColor={255,255,255},
fillPattern=FillPattern.HorizontalCylinder,
extent={{-30,-60},{-10,60}}),
Rectangle(
lineColor={64,64,64},
fillColor={255,255,255},
fillPattern=FillPattern.HorizontalCylinder,
extent={{10,-60},{30,60}}),
Rectangle(
lineColor={64,64,64},
fillColor={192,192,192},
fillPattern=FillPattern.HorizontalCylinder,
extent={{30,-10},{100,10}}),
Rectangle(
lineColor={64,64,64},
extent={{-30,-60},{-10,60}}),
Rectangle(
lineColor={64,64,64},
extent={{10,-60},{30,60}}),
Polygon(
points={{-10,30},{50,0},{-10,-30},{-10,30}},
fillPattern=FillPattern.Solid),
Text(extent={{-152,60},{148,100}},
textString="%name",
textColor={0,0,255})}),
Diagram(graphics={
Polygon(
points={{-4,70},{0,80},{4,70},{-4,70}},
lineColor={128,128,128},
fillColor={128,128,128},
fillPattern=FillPattern.Solid),
Line(
points={{0,80},{0,-80}},
color={128,128,128}),
Line(
points={{-80,0},{80,0}},
color={128,128,128}),
Polygon(
points={{70,4},{80,0},{70,-4},{70,4}},
lineColor={128,128,128},
fillColor={128,128,128},
fillPattern=FillPattern.Solid),
Line(
points={{-70,-20},{0,0},{20,70}},
thickness=0.5),
Text(
extent={{60,-10},{80,-20}},
textColor={128,128,128},
textString="w_rel"),
Text(
extent={{-20,80},{-10,70}},
textColor={128,128,128},
textString="tau"),
Text(
extent={{20,60},{40,50}},
textColor={128,128,128},
textString="wRes"),
Text(
extent={{-60,-20},{-40,-30}},
textColor={128,128,128},
textString="tauRes")}),
Documentation(info="<html>
<p>
An idealized model of a&nbsp;freewheel. Compared to
<a href=\"modelica://Modelica.Mechanics.Rotational.Components.OneWayClutch\">OneWayClutch</a>
it is modeled in a&nbsp;simplified way referring to
<a href=\"Modelica.Electrical.Analog.Ideal.IdealDiode\">an&nbsp;idealized
model of electrical diode</a>.
This means in particular that there exist two cases indicated
by the variable <code>free</code> and distinguished as follows.
</p>
<ul>
<li>
<code>flange_a</code> is driving (<code>free&nbsp;= false</code>): torque is
transferred with a&nbsp;residual difference <code>wRes</code> of relative angular
velocity of the flanges.
</li>
<li>
<code>flange_b</code> is driving (<code>free&nbsp;= true</code>): the flanges move
independently except a&nbsp;residual friction torque <code>tauRes</code>.</li>
</ul>
</html>"));
end FreeWheel;
1 change: 1 addition & 0 deletions Modelica/Mechanics/Rotational/Components/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Fixed
Inertia
Disc
Coupling
FreeWheel
Spring
Damper
SpringDamper
Expand Down
43 changes: 43 additions & 0 deletions Modelica/Mechanics/Rotational/Examples/DemoFreeWheel.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
within Modelica.Mechanics.Rotational.Examples;
model DemoFreeWheel "Demonstrate freewheel"
extends Modelica.Icons.Example;
Modelica.Mechanics.Rotational.Components.FreeWheel freeWheel
annotation (Placement(transformation(extent={{0,-10},{20,10}})));
Modelica.Mechanics.Rotational.Components.Inertia inertia1(J=1)
annotation (Placement(transformation(extent={{-30,-10},{-10,10}})));
Modelica.Mechanics.Rotational.Components.Inertia inertia2(J=1,
phi(start=0, fixed=true),
w(start=0, fixed=true))
annotation (Placement(transformation(extent={{30,-10},{50,10}})));
Modelica.Mechanics.Rotational.Sources.LinearSpeedDependentTorque torqueLoad(
tau_nominal=-5,
TorqueDirection=false,
w_nominal=1) annotation (Placement(transformation(extent={{80,-10},{60,10}})));
Modelica.Mechanics.Rotational.Sources.Speed speed(exact=true)
annotation (Placement(transformation(extent={{-60,-10},{-40,10}})));
Modelica.Blocks.Sources.Sine signalSpeed(amplitude=5, f=5) annotation (Placement(transformation(extent={{-90,-10},{-70,10}})));
equation
connect(freeWheel.flange_b, inertia2.flange_a)
annotation (Line(points={{20,0},{30,0}}, color={0,0,0}));
connect(torqueLoad.flange, inertia2.flange_b) annotation (Line(points={{60,0},{50,0}}, color={0,0,0}));
connect(inertia1.flange_a, speed.flange)
annotation (Line(points={{-30,0},{-40,0}}, color={0,0,0}));
connect(inertia1.flange_b, freeWheel.flange_a)
annotation (Line(points={{-10,0},{0,0}}, color={0,0,0}));
connect(signalSpeed.y, speed.w_ref) annotation (Line(points={{-69,0},{-62,0}}, color={0,0,127}));
annotation (experiment(
Interval=0.001,
Tolerance=1e-06,
StopTime=1),
Documentation(info="<html>
<p>
Demonstration of an ideal freewheel:
The inertia <code>inertia1</code> is driven with a&nbsp;prescribed sinusoidal velocity.
Load inertia <code>inertia2</code> is coupled to <code>inertia1</code> by an ideal
freewheel. <code>inertia2</code> is accelerated as long as its <code>flange_a</code>
is driven. When freewheeling occurs, i.e.
<code>inertia2.w</code>&nbsp;&ge; <code>inertia1.w</code>, a&nbsp;velocity dependent
load torque decelerates <code>inertia2.w</code>.
</p>
</html>"));
end DemoFreeWheel;
1 change: 1 addition & 0 deletions Modelica/Mechanics/Rotational/Examples/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ EddyCurrentBrake
GenerationOfFMUs
OneWayClutch
OneWayClutchDisengaged
DemoFreeWheel
Utilities
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
time
inertia1.w
inertia2.w
freeWheel.w_rel
freeWheel.tau
33 changes: 32 additions & 1 deletion ModelicaTest/Rotational.mo
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,25 @@ they were not deleted yet.")}));
offset=0,
startTime=0.75)
annotation (Placement(transformation(extent={{60,-230},{40,-210}})));
Modelica.Mechanics.Rotational.Components.FreeWheel freeWheel
annotation (Placement(transformation(extent={{-50,-268},{-30,-248}})));
Modelica.Mechanics.Rotational.Components.Inertia inertia21(
J=1,
phi(start=0, fixed=true),
w(start=0, fixed=true))
annotation (Placement(transformation(extent={{-20,-268},{0,-248}})));
Modelica.Mechanics.Rotational.Sources.LinearSpeedDependentTorque
linearSpeedDependentTorque1(
tau_nominal=-5,
TorqueDirection=false,
w_nominal=1)
annotation (Placement(transformation(extent={{30,-268},{10,-248}})));
Modelica.Mechanics.Rotational.Sources.Speed speed1(exact=true)
annotation (Placement(transformation(extent={{-110,-268},{-90,-248}})));
Modelica.Mechanics.Rotational.Components.Inertia inertia22(J=1)
annotation (Placement(transformation(extent={{-80,-268},{-60,-248}})));
Modelica.Blocks.Sources.Sine sine8(amplitude=5, f=5)
annotation (Placement(transformation(extent={{-140,-268},{-120,-248}})));
equation
connect(inertia.flange_b, idealGear.flange_a) annotation (Line(
points={{-60,90},{-50,90}}));
Expand Down Expand Up @@ -1139,7 +1158,19 @@ they were not deleted yet.")}));
annotation (Line(points={{-119,-220},{-112,-220}}, color={0,0,127}));
connect(step.y, torque2.tau)
annotation (Line(points={{39,-220},{32,-220}}, color={0,0,127}));
annotation (experiment(StopTime=0.9), Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-180,-240},{180,160}})));
connect(freeWheel.flange_b, inertia21.flange_a)
annotation (Line(points={{-30,-258},{-20,-258}}, color={0,0,0}));
connect(linearSpeedDependentTorque1.flange, inertia21.flange_b)
annotation (Line(points={{10,-258},{0,-258}}, color={0,0,0}));
connect(inertia22.flange_a, speed1.flange)
annotation (Line(points={{-80,-258},{-90,-258}}, color={0,0,0}));
connect(inertia22.flange_b, freeWheel.flange_a)
annotation (Line(points={{-60,-258},{-50,-258}}, color={0,0,0}));
connect(sine8.y, speed1.w_ref)
annotation (Line(points={{-119,-258},{-112,-258}}, color={0,0,127}));
annotation (experiment(StopTime=0.9), Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-180,
-280},{180,160}})),
Icon(coordinateSystem(extent={{-180,-280},{180,160}})));
end AllComponents;

model TestBearingConversion
Expand Down