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

Rename flange_a in Prismatic and Revolute joints #220

Merged
merged 5 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions PlanarMechanics/Examples/ControlledCraneCrab.mo
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ equation
points={{-20,30},{0,30}},
color={95,95,95},
thickness=0.5));
connect(prismatic.flange_a, force.flange) annotation (Line(
connect(prismatic.axis, force.flange) annotation (Line(
points={{-30,40},{-30,40},{-30,70},{-20,70}},
color={0,127,0}));
connect(prismatic.frame_b, revolute.frame_a) annotation (Line(
Expand All @@ -80,7 +80,7 @@ equation
points={{-10,-10},{-10,-20}},
color={95,95,95},
thickness=0.5));
connect(revolute.flange_a, angleSensor.flange) annotation (Line(
connect(revolute.axis, angleSensor.flange) annotation (Line(
points={{0,0},{0,0},{20,0}}));
annotation (experiment(StopTime=3),
Documentation(revisions="<html>
Expand Down
5 changes: 2 additions & 3 deletions PlanarMechanics/Examples/CraneCrab.mo
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ equation
points={{-20,30},{0,30}},
color={95,95,95},
thickness=0.5));
connect(damper1D.flange_b, prismatic.flange_a)
annotation (Line(points={{-20,60},{-20,40},{-30,40}},
color={0,127,0}));
connect(damper1D.flange_b, prismatic.axis)
annotation (Line(points={{-20,60},{-20,40},{-30,40}}, color={0,127,0}));
connect(damper1D.flange_a, prismatic.support)
annotation (Line(points={{-40,60},{-40,40},{-36,40}}, color={0,127,0}));
annotation (experiment(StopTime=10),
Expand Down
5 changes: 2 additions & 3 deletions PlanarMechanics/Examples/CraneCrabTo3D.mo
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ equation
points={{40,30},{60,30}},
color={95,95,95},
thickness=0.5));
connect(damper1D.flange_b, prismatic.flange_a)
annotation (Line(points={{40,60},{40,40},{30,40}},
color={0,127,0}));
connect(damper1D.flange_b, prismatic.axis)
annotation (Line(points={{40,60},{40,40},{30,40}}, color={0,127,0}));
connect(body3D.frame_a, prismatic3D.frame_b) annotation (Line(
points={{-10,-30},{-10,-50},{-20,-50}},
color={95,95,95},
Expand Down
11 changes: 4 additions & 7 deletions PlanarMechanics/Examples/InvertedCraneCrab.mo
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,12 @@ equation
color={95,95,95},
thickness=0.5));
connect(ramp.y, firstOrder.u) annotation (Line(
points={{67.4,0},{64.7,0},{64.7,0},{63.2,
0}},
points={{67.4,0},{64.7,0},{64.7,0},{63.2,0}},
color={0,0,127}));
connect(firstOrder.y, inverseBlockConstraints.u2) annotation (Line(
points={{49.4,0},{47.8,0},{47.8,0},{46.2,
0},{46.2,0},{43,0}},
points={{49.4,0},{47.8,0},{47.8,0},{46.2,0},{46.2,0},{43,0}},
color={0,0,127}));

connect(revolute.flange_a, angleSensor.flange)
connect(revolute.axis, angleSensor.flange)
annotation (Line(points={{0,0},{0,0},{8,0}}));
connect(revolute.frame_b, fixedTranslation.frame_a) annotation (Line(
points={{-10,-10},{-10,-20}},
Expand All @@ -87,7 +84,7 @@ equation
points={{-20,30},{0,30}},
color={95,95,95},
thickness=0.5));
connect(force.flange, prismatic.flange_a) annotation (Line(
connect(force.flange, prismatic.axis) annotation (Line(
points={{-20,70},{-30,70},{-30,40}},
color={0,127,0}));
annotation (Documentation(revisions="<html>
Expand Down
2 changes: 1 addition & 1 deletion PlanarMechanics/Examples/KinematicLoop.mo
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ equation
points={{20,60},{-40,60}},
color={95,95,95},
thickness=0.5));
connect(springDamper1D.flange_b, prismatic1.flange_a)
connect(springDamper1D.flange_b, prismatic1.axis)
annotation (Line(points={{20,90},{30,90},{30,70}}, color={0,127,0}));
connect(prismatic1.frame_b, revolute3.frame_a) annotation (Line(
points={{40,60},{80,60},{80,50}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ equation
points={{40,60},{80,60},{80,50}},
color={95,95,95},
thickness=0.5));
connect(springDamper1D.flange_b, prismatic1.flange_a)
connect(springDamper1D.flange_b, prismatic1.axis)
annotation (Line(points={{20,90},{30,90},{30,70}}, color={0,127,0}));
annotation (experiment(StopTime=6),
Documentation(revisions="<html>
Expand Down
9 changes: 4 additions & 5 deletions PlanarMechanics/GearComponents/Examples/SpurGear.mo
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ model SpurGear "Rigid spur gear"
annotation (Placement(transformation(extent={{20,60},{40,80}})));
equation
connect(gearA_Bearing.frame_b, gearA.frame_a)
annotation (Line(
annotation (Line(
points={{-40,0},{-20,0},{-20,20}},
color={95,95,95},
thickness=0.5));
connect(constantSpeed.flange, gearA_Bearing.flange_a)
annotation (Line(
points={{-80,20},{-50,20},{-50,10}}));
connect(constantSpeed.flange, gearA_Bearing.axis)
annotation (Line(points={{-80,20},{-50,20},{-50,10}}));
connect(fixed_A.frame, gearA_Bearing.frame_a) annotation (Line(
points={{-70,-42},{-70,0},{-60,0}},
color={95,95,95},
thickness=0.5));
connect(constantTorque.flange, gearB_Bearing.flange_a) annotation (Line(
connect(constantTorque.flange, gearB_Bearing.axis) annotation (Line(
points={{-80,48},{50,48},{50,10}}));
connect(gearwheelExternal.frame_a, gearA_Bearing.frame_b) annotation (Line(
points={{-10,0},{-40,0}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ equation
points={{-80,30},{-80,10},{-70,10}},
color={95,95,95},
thickness=0.5));
connect(bearing_Sun.flange_a, flange_Sun) annotation (Line(
connect(bearing_Sun.axis, flange_Sun) annotation (Line(
points={{-60,0},{-60,0},{-60,-10},{-100,-10},{-100,0}}));
connect(bearing_Carrier.frame_b, carrierAngle.frame_a) annotation (Line(
points={{-50,-40},{-40,-40}},
Expand All @@ -145,13 +145,13 @@ equation
points={{-70,40},{-80,40},{-80,30}},
color={95,95,95},
thickness=0.5));
connect(bearing_Ring.flange_a, flange_Ring) annotation (Line(
connect(bearing_Ring.axis, flange_Ring) annotation (Line(
points={{-60,50},{-60,60},{-100,60}}));
connect(planet.frame_a, bearing_Planet.frame_b) annotation (Line(
points={{72,40},{48,40},{48,-40},{40,-40}},
color={95,95,95},
thickness=0.5));
connect(sun.flange_a, bearing_Sun.flange_a) annotation (Line(
connect(sun.flange_a, bearing_Sun.axis) annotation (Line(
points={{-40,-10},{-60,-10},{-60,0}}));
connect(bearing_Sun.frame_b, sunPlanet.frame_a) annotation (Line(
points={{-50,10},{0,10}},
Expand All @@ -163,15 +163,15 @@ equation
points={{-50,40},{0,40}},
color={95,95,95},
thickness=0.5));
connect(ring.flange_a, bearing_Ring.flange_a) annotation (Line(
connect(ring.flange_a, bearing_Ring.axis) annotation (Line(
points={{-40,60},{-60,60},{-60,50}}));
connect(sunPlanet.heatPort, internalHeatPort) annotation (Line(
points={{0,0},{60,0},{60,-60},{-90,-60},{-90,-80},{-100,-80}},
color={191,0,0}));
connect(planetRing.heatPort, internalHeatPort) annotation (Line(
points={{20,30},{60,30},{60,-60},{-90,-60},{-90,-80},{-100,-80}},
color={191,0,0}));
connect(bearing_Carrier.flange_a, carrier.flange_a) annotation (Line(
connect(bearing_Carrier.axis, carrier.flange_a) annotation (Line(
points={{-60,-30},{-60,-26},{70,-26}}));
connect(planarWorld.MBFrame_a,frameVisualisation) annotation (Line(
points={{60,-80},{0,-80},{0,-100}},
Expand Down
11 changes: 6 additions & 5 deletions PlanarMechanics/Joints/Prismatic.mo
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ model Prismatic "A prismatic joint"
final parameter Real e[2](each final unit="1") = Modelica.Math.Vectors.normalizeWithAssert(r)
"Unit vector in direction of r";

Modelica.Mechanics.Translational.Interfaces.Flange_a flange_a(f = f, s = s) if useFlange
annotation (
Placement(transformation(extent={{-10,-110},{10,-90}})));
Modelica.Mechanics.Translational.Interfaces.Flange_a axis(
f=f,
s=s) if useFlange
"1-dim. translational flange that drives the joint"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));

Modelica.Mechanics.Translational.Interfaces.Flange_b support if useFlange
"1-dim. translational flange of the drive support (assumed to be fixed in the world frame, NOT in the joint)"
annotation (Placement(transformation(extent={{10,10},{-10,-10}}, rotation=180,
origin={-60,-100})));
annotation (Placement(transformation(extent={{-70,-110},{-50,-90}})));

parameter SI.Length zPosition = planarWorld.defaultZPosition
"Position z of the prismatic joint box" annotation (Dialog(
Expand Down
11 changes: 5 additions & 6 deletions PlanarMechanics/Joints/Revolute.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ model Revolute "A revolute joint"
parameter StateSelect stateSelect=StateSelect.default
"Priority to use phi and w as states" annotation(HideResult=true,Dialog(tab="Advanced"));

Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a(phi = phi, tau = t) if useFlange annotation (
Placement(transformation(extent={{-10,-110},{10,-90}})));

Modelica.Mechanics.Rotational.Interfaces.Flange_a axis(
phi=phi,
tau=t) if useFlange "1-dim. rotational flange that drives the joint"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
Modelica.Mechanics.Rotational.Interfaces.Flange_b support if useFlange
"1-dim. rotational flange of the drive support (assumed to be fixed in the world frame, NOT in the joint)"
annotation (Placement(transformation(extent={{-10,10},{10,-10}},
rotation=180,
origin={-60,-100})));
annotation (Placement(transformation(extent={{-70,-110},{-50,-90}})));

parameter SI.Length zPosition = planarWorld.defaultZPosition
"Position z of cylinder representing the joint axis" annotation (Dialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ convertClass("PlanarMechanics.Utilities.Functions.atan3b",
"Modelica.Math.atan3")
// No conversion for PlanarMechanics.Utilities.Functions.atan3b_der
// and PlanarMechanics.Utilities.Functions.atan3b_dder

// Issue 169
convertElement({"PlanarMechanics.Joints.Prismatic",
"PlanarMechanics.Joints.Revolute"},
"flange_a", "axis");
26 changes: 19 additions & 7 deletions PlanarMechanics/UsersGuide/ReleaseNotes.mo
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,43 @@ It is <strong>not</strong> backwards compatible to previous library versions.
</li>
</ul>

<p>Deleted parameters:</p>
<p>Deleted parameters (conversion script is provided):</p>
<ul>
<li>
<a href=\"modelica://PlanarMechanics.Sources.RelativeForce\">Sources.RelativeForce</a>:
diameter
<code>diameter</code>
</li>
<li>
<a href=\"modelica://PlanarMechanics.Sources.WorldForce\">Sources.WorldForce</a>:
diameter
<code>diameter</code>
</li>
<li>
<a href=\"modelica://PlanarMechanics.Sources.QuadraticSpeedDependentForce\">Sources.QuadraticSpeedDependentForce</a>:
diameter
<code>diameter</code>
</li>
<li>
<a href=\"modelica://PlanarMechanics.Sensors.CutForce\">Sensors.CutForce</a>:
forceDiameter
<code>forceDiameter</code>
</li>
<li>
<a href=\"modelica://PlanarMechanics.Sensors.CutForceAndTorque\">Sensors.CutForceAndTorque</a>:
forceDiameter, torqueDiameter
<code>forceDiameter</code>, <code>torqueDiameter</code>
</li>
<li>
<a href=\"modelica://PlanarMechanics.Sensors.CutTorque\">Sensors.CutTorque</a>:
torqueDiameter
<code>torqueDiameter</code>
</li>
</ul>

<p>Renamed parameters (conversion script is provided):</p>
<ul>
<li>
<a href=\"modelica://PlanarMechanics.Joints.Prismatic\">Joints.Prismatic</a>:
<code>flange_a</code> renamed to <code>axis</code>.
</li>
<li>
<a href=\"modelica://PlanarMechanics.Joints.Revolute\">Joints.Revolute</a>:
<code>flange_a</code> renamed to <code>axis</code>.
</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ equation
points={{-40,20},{-40,12},{-30,12}},
color={95,95,95},
thickness=0.5));
connect(torque.flange, revolute2.flange_a) annotation (Line(
connect(torque.flange, revolute2.axis) annotation (Line(
points={{-10,40},{-10,30},{-30,30}}));
connect(revolute.flange_a, revolute2.flange_a) annotation (Line(
connect(revolute.axis, revolute2.axis) annotation (Line(
points={{30,30},{30,30},{-30,30}}));
connect(revolute.frame_a, rightTrail.frame_a) annotation (Line(
points={{40,40},{40,50}},
Expand Down
8 changes: 4 additions & 4 deletions PlanarMechanicsTest/Sensors.mo
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ Expected results:
points={{20,80},{0,80},{0,-20},{10,-20}},
color={95,95,95},
thickness=0.5));
connect(constantTorque.flange, revolute1.flange_a) annotation (Line(points={{-70,-60},{-60,-60},{-60,-30}}, color={0,0,0}));
connect(constantTorque.flange, revolute1.axis) annotation (Line(points={{-70,-60},{-60,-60},{-60,-30}}, color={0,0,0}));

annotation (experiment(StopTime=1));
end AbsoluteAccCentrifugalAcc;
Expand Down Expand Up @@ -451,7 +451,7 @@ Expected results:
points={{-80,0},{-76,0},{-76,-30},{68,-30},{68,-10}},
color={95,95,95},
thickness=0.5));
connect(damper.flange_b, revolute.flange_a) annotation (Line(points={{-20,40},{-20,20},{-30,20},{-30,10}}));
connect(damper.flange_b, revolute.axis) annotation (Line(points={{-20,40},{-20,20},{-30,20},{-30,10}}));
connect(revolute.support,damper. flange_a) annotation (Line(points={{-36,10},{-36,20},{-40,20},{-40,40}}));
annotation (
experiment(StopTime=3));
Expand Down Expand Up @@ -516,7 +516,7 @@ Expected results:
points={{0,0},{10,0}},
color={95,95,95},
thickness=0.5));
connect(damper.flange_b, revolute.flange_a) annotation (Line(points={{30,40},{30,20},{20,20},{20,10}}));
connect(damper.flange_b, revolute.axis) annotation (Line(points={{30,40},{30,20},{20,20},{20,10}}));
connect(revolute.support,damper. flange_a) annotation (Line(points={{14,10},{14,20},{10,20},{10,40}}));
annotation (
experiment(StopTime=3));
Expand Down Expand Up @@ -602,7 +602,7 @@ Expected results:
connect(signalVec3.y,worldForce. force) annotation (Line(
points={{-39,-40},{-22,-40}},
color={0,0,127}));
connect(damper.flange_b, revolute.flange_a) annotation (Line(points={{40,40},{40,20},{30,20},{30,10}}));
connect(damper.flange_b, revolute.axis) annotation (Line(points={{40,40},{40,20},{30,20},{30,10}}));
connect(revolute.support,damper. flange_a) annotation (Line(points={{24,10},{24,20},{20,20},{20,40}}));
annotation (
experiment(StopTime=3));
Expand Down
6 changes: 3 additions & 3 deletions PlanarMechanicsTest/Sources.mo
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ package Sources "Test models for PlanarMechanics.Sources"
points={{20,20},{30,20},{30,50},{40,50}},
color={95,95,95},
thickness=0.5));
connect(damper.flange_b, revolute.flange_a) annotation (Line(points={{-10,90},{-10,70},{-20,70},{-20,60}}));
connect(damper.flange_b, revolute.axis) annotation (Line(points={{-10,90},{-10,70},{-20,70},{-20,60}}));
connect(revolute.support, damper.flange_a) annotation (Line(points={{-26,60},{-26,70},{-30,70},{-30,90}}));
annotation (
experiment(StopTime=3));
Expand Down Expand Up @@ -177,7 +177,7 @@ package Sources "Test models for PlanarMechanics.Sources"
points={{10,-40},{20,-40},{20,20},{30,20}},
color={95,95,95},
thickness=0.5));
connect(damper.flange_b, revolute.flange_a) annotation (Line(points={{-20,60},{-20,40},{-30,40},{-30,30}}));
connect(damper.flange_b, revolute.axis) annotation (Line(points={{-20,60},{-20,40},{-30,40},{-30,30}}));
connect(revolute.support, damper.flange_a) annotation (Line(points={{-36,30},{-36,40},{-40,40},{-40,60}}));
connect(fixedRotated.frame, force_inFrameResolve.frame_resolve) annotation (Line(
points={{-50,-80},{0,-80}},
Expand Down Expand Up @@ -257,7 +257,7 @@ package Sources "Test models for PlanarMechanics.Sources"
connect(signalVec3.y, force_inWorld.force) annotation (Line(points={{-39,-40},{-30,-40},{-30,-10},{-12,-10}}, color={0,0,127}));
connect(signalVec3.y, force_inFrameA.force) annotation (Line(points={{-39,-40},{-12,-40}}, color={0,0,127}));
connect(signalVec3.y, force_inFrameResolve.force) annotation (Line(points={{-39,-40},{-30,-40},{-30,-70},{-12,-70}}, color={0,0,127}));
connect(damper.flange_b, revolute.flange_a) annotation (Line(points={{-20,60},{-20,40},{-30,40},{-30,30}}));
connect(damper.flange_b, revolute.axis) annotation (Line(points={{-20,60},{-20,40},{-30,40},{-30,30}}));
connect(revolute.support, damper.flange_a) annotation (Line(points={{-36,30},{-36,40},{-40,40},{-40,60}}));
connect(fixedRotated.frame, force_inFrameResolve.frame_resolve) annotation (Line(
points={{-40,-80},{0,-80}},
Expand Down