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 5 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
77 changes: 77 additions & 0 deletions Modelica/Mechanics/Rotational/Components/FreeWheel.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
within Modelica.Mechanics.Rotational.Components;
model FreeWheel "Ideal freewheel"
extends Modelica.Mechanics.Rotational.Interfaces.PartialTwoFlanges;
SI.AngularVelocity w_rel(start=0) "Relative angular velocity (= flange_a.w - flange_b.w)";
SI.Torque tau "Torque between flanges (= flange_a.tau)";
Boolean free( start=false) "Indicates freewheeling";
Real s(start=0) "Auxilliary variable";
parameter SI.Torque tauRes=1e-5 "Residual friction coefficient";
parameter SI.AngularVelocity wRes=1e-5 "Residual relative speed coefficient";
protected
constant SI.AngularVelocity unit_w=1;
constant SI.Torque unit_tau=1;
equation
w_rel = der(flange_a.phi) - der(flange_b.phi);
tau = flange_a.tau;
tau = -flange_b.tau;
free = w_rel <= 0;
w_rel = s*unit_w*(if free then 1 else tauRes/unit_tau);
tau = s*unit_tau*(if free then wRes/unit_w 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}}),
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),
Text(
extent={{70,-10},{80,-20}},
textColor={128,128,128},
textString="w"), Text(
extent={{-20,80},{-10,70}},
textColor={128,128,128},
textString="tau"),Line(
points={{-70,-20},{0,0},{20,70}},
thickness=0.5), 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>
The ideal freewheel can be considered as a mechanical diode:
</p>
<ul>
<li>flange_a driving: Torque is transfer with a residual difference of angular veolcity of the flanges.</li>
<li>flange_b driving: The flanges move independently except a residual friction torque.</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
44 changes: 44 additions & 0 deletions Modelica/Mechanics/Rotational/Examples/DemoFreeWheel.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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 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
linearSpeedDependentTorque(
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.Mechanics.Rotational.Components.Inertia inertia1(J=1)
annotation (Placement(transformation(extent={{-30,-10},{-10,10}})));
Modelica.Blocks.Sources.Sine sine(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(linearSpeedDependentTorque.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(sine.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:
Inertia1 is driven with a prescribed sinusoidal speed. Inertia2 is coupled to inertia1 by an ideal freewheel.
Inertia2 is accelerated as long as flange_a is driven. When freewheeling occurs a speed dependent torque decelerates inertia2.
</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