diff --git a/PlanarMechanics/Examples/ControlledCraneCrab.mo b/PlanarMechanics/Examples/ControlledCraneCrab.mo index f6313c15..da735073 100644 --- a/PlanarMechanics/Examples/ControlledCraneCrab.mo +++ b/PlanarMechanics/Examples/ControlledCraneCrab.mo @@ -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( @@ -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=" diff --git a/PlanarMechanics/Examples/CraneCrab.mo b/PlanarMechanics/Examples/CraneCrab.mo index 6262ed9b..17f03cd2 100644 --- a/PlanarMechanics/Examples/CraneCrab.mo +++ b/PlanarMechanics/Examples/CraneCrab.mo @@ -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), diff --git a/PlanarMechanics/Examples/CraneCrabTo3D.mo b/PlanarMechanics/Examples/CraneCrabTo3D.mo index d72ad8a2..3575f506 100644 --- a/PlanarMechanics/Examples/CraneCrabTo3D.mo +++ b/PlanarMechanics/Examples/CraneCrabTo3D.mo @@ -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}, diff --git a/PlanarMechanics/Examples/InvertedCraneCrab.mo b/PlanarMechanics/Examples/InvertedCraneCrab.mo index 04834a6c..43f40a46 100644 --- a/PlanarMechanics/Examples/InvertedCraneCrab.mo +++ b/PlanarMechanics/Examples/InvertedCraneCrab.mo @@ -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}}, @@ -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=" diff --git a/PlanarMechanics/Examples/KinematicLoop.mo b/PlanarMechanics/Examples/KinematicLoop.mo index ecdc5c39..983a2137 100644 --- a/PlanarMechanics/Examples/KinematicLoop.mo +++ b/PlanarMechanics/Examples/KinematicLoop.mo @@ -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}}, diff --git a/PlanarMechanics/Examples/KinematicLoop_DynamicStateSelection.mo b/PlanarMechanics/Examples/KinematicLoop_DynamicStateSelection.mo index 53c210a7..76d96aea 100644 --- a/PlanarMechanics/Examples/KinematicLoop_DynamicStateSelection.mo +++ b/PlanarMechanics/Examples/KinematicLoop_DynamicStateSelection.mo @@ -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=" diff --git a/PlanarMechanics/GearComponents/Examples/SpurGear.mo b/PlanarMechanics/GearComponents/Examples/SpurGear.mo index 1bb27074..14e7287b 100644 --- a/PlanarMechanics/GearComponents/Examples/SpurGear.mo +++ b/PlanarMechanics/GearComponents/Examples/SpurGear.mo @@ -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}}, diff --git a/PlanarMechanics/GearComponents/Examples/Utilities/RigidNoLossPlanetary.mo b/PlanarMechanics/GearComponents/Examples/Utilities/RigidNoLossPlanetary.mo index aec4f121..02c40a5d 100644 --- a/PlanarMechanics/GearComponents/Examples/Utilities/RigidNoLossPlanetary.mo +++ b/PlanarMechanics/GearComponents/Examples/Utilities/RigidNoLossPlanetary.mo @@ -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}}, @@ -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}}, @@ -163,7 +163,7 @@ 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}}, @@ -171,7 +171,7 @@ equation 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}}, diff --git a/PlanarMechanics/Joints/Prismatic.mo b/PlanarMechanics/Joints/Prismatic.mo index 494d862b..fe3745f9 100644 --- a/PlanarMechanics/Joints/Prismatic.mo +++ b/PlanarMechanics/Joints/Prismatic.mo @@ -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( diff --git a/PlanarMechanics/Joints/Revolute.mo b/PlanarMechanics/Joints/Revolute.mo index 8275be30..1e8f9dca 100644 --- a/PlanarMechanics/Joints/Revolute.mo +++ b/PlanarMechanics/Joints/Revolute.mo @@ -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( diff --git a/PlanarMechanics/Resources/Scripts/Conversion/ConvertFromPlanarMechanics_2_0_0.mos b/PlanarMechanics/Resources/Scripts/Conversion/ConvertFromPlanarMechanics_2_0_0.mos index 3a20f236..16b4357a 100644 --- a/PlanarMechanics/Resources/Scripts/Conversion/ConvertFromPlanarMechanics_2_0_0.mos +++ b/PlanarMechanics/Resources/Scripts/Conversion/ConvertFromPlanarMechanics_2_0_0.mos @@ -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"); diff --git a/PlanarMechanics/UsersGuide/ReleaseNotes.mo b/PlanarMechanics/UsersGuide/ReleaseNotes.mo index 7456d23f..2d3607d6 100644 --- a/PlanarMechanics/UsersGuide/ReleaseNotes.mo +++ b/PlanarMechanics/UsersGuide/ReleaseNotes.mo @@ -40,31 +40,43 @@ It is not backwards compatible to previous library versions. -

Deleted parameters:

+

Deleted parameters (conversion script is provided):

+ +

Renamed parameters (conversion script is provided):

+ diff --git a/PlanarMechanics/VehicleComponents/Examples/TwoTrackWithDifferentialGear.mo b/PlanarMechanics/VehicleComponents/Examples/TwoTrackWithDifferentialGear.mo index 09013dae..f4d25544 100644 --- a/PlanarMechanics/VehicleComponents/Examples/TwoTrackWithDifferentialGear.mo +++ b/PlanarMechanics/VehicleComponents/Examples/TwoTrackWithDifferentialGear.mo @@ -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}}, diff --git a/PlanarMechanicsTest/Sensors.mo b/PlanarMechanicsTest/Sensors.mo index 7b1d34ba..f9e9132d 100644 --- a/PlanarMechanicsTest/Sensors.mo +++ b/PlanarMechanicsTest/Sensors.mo @@ -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; @@ -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)); @@ -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)); @@ -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)); diff --git a/PlanarMechanicsTest/Sources.mo b/PlanarMechanicsTest/Sources.mo index 0b1407d5..afcea403 100644 --- a/PlanarMechanicsTest/Sources.mo +++ b/PlanarMechanicsTest/Sources.mo @@ -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)); @@ -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}}, @@ -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}},