From bda8c0ba405aa71bd1ccaa758b351c7897d486de Mon Sep 17 00:00:00 2001 From: Maximilian Kormann Date: Thu, 11 May 2023 14:30:34 +0200 Subject: [PATCH] Add failing test for Rotational Friction --- ModelicaTest/Rotational.mo | 48 +++++++++++++++++++++++++++++++++++ ModelicaTest/Translational.mo | 4 +-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/ModelicaTest/Rotational.mo b/ModelicaTest/Rotational.mo index f2b4211f05..9b9d8b28c1 100644 --- a/ModelicaTest/Rotational.mo +++ b/ModelicaTest/Rotational.mo @@ -1623,6 +1623,54 @@ they were not deleted yet.")})); annotation (experiment(StopTime=1.1)); end TestFriction; + model TestFrictionPosition + extends Modelica.Icons.Example; + + parameter Real fric=155.9218; + Modelica.Mechanics.Rotational.Sources.Position position(exact=true) + annotation (Placement(transformation(extent={{-10,30},{10,50}}))); + + Modelica.Blocks.Sources.Sine sine( + amplitude=0.1, + f=1, + phase=0.78539816339745, + offset=0.5) annotation (Placement(transformation(extent={{-70,30},{-50,50}}))); + + Modelica.Mechanics.Rotational.Components.BearingFriction bearingFriction(tau_pos=[0,5; 100,5], + peak=1.001) + annotation (Placement(transformation(extent={{46,30},{66,50}}))); + Modelica.Mechanics.Rotational.Sources.Torque torque + annotation (Placement(transformation(extent={{-10,-50},{10,-30}}))); + Modelica.Blocks.Sources.Sine sine1( + amplitude=25, + f=1, + phase=0.78539816339745, + offset=0.5) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); + Modelica.Mechanics.Rotational.Components.BearingFriction bearingFriction1(tau_pos=[0,5; 100,5], peak=1.001) + annotation (Placement(transformation(extent={{46,-50},{66,-30}}))); + Modelica.Mechanics.Rotational.Components.Inertia inertia(J=1, w(start=-2, fixed=true)) + annotation (Placement(transformation(extent={{74,-50},{94,-30}}))); + Modelica.Mechanics.Rotational.Sources.Position position1(exact=true) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Blocks.Sources.Sine sine2( + amplitude=0.3, + f=1, + phase=0.78539816339745, + offset=0.5) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + Modelica.Mechanics.Rotational.Components.BearingFriction bearingFriction2(tau_pos=[0,5; 100,5], peak=1.001) + annotation (Placement(transformation(extent={{46,-10},{66,10}}))); + equation + + connect(sine.y, position.phi_ref) annotation (Line(points={{-49,40},{-12,40}}, color={0,0,127})); + connect(position.flange, bearingFriction.flange_a) annotation (Line(points={{10,40},{48,40},{48,40},{46,40}}, color={0,0,0})); + connect(sine1.y, torque.tau) annotation (Line(points={{-49,-40},{-12,-40}}, color={0,0,127})); + connect(torque.flange, bearingFriction1.flange_a) annotation (Line(points={{10,-40},{46,-40}}, color={0,0,0})); + connect(bearingFriction1.flange_b, inertia.flange_a) annotation (Line(points={{66,-40},{74,-40}}, color={0,0,0})); + connect(sine2.y, position1.phi_ref) annotation (Line(points={{-49,0},{-12,0}}, color={0,0,127})); + connect(position1.flange, bearingFriction2.flange_a) annotation (Line(points={{10,0},{46,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + end TestFrictionPosition; + model TestBraking extends Modelica.Icons.Example; Modelica.Mechanics.Rotational.Components.Inertia inertia1( diff --git a/ModelicaTest/Translational.mo b/ModelicaTest/Translational.mo index 57739e73dd..d278f28245 100644 --- a/ModelicaTest/Translational.mo +++ b/ModelicaTest/Translational.mo @@ -314,7 +314,7 @@ extends Modelica.Icons.ExamplesPackage; experiment(StopTime=2)); end Vehicles; - model Friction + model TestFrictionPosition extends Modelica.Icons.Example; parameter Real fric=155.9218; @@ -382,5 +382,5 @@ extends Modelica.Icons.ExamplesPackage; connect(sine2.y, position1.s_ref) annotation (Line(points={{-49,0},{-12,0}}, color={0,0,127})); connect(position1.flange, supportFriction2.flange_a) annotation (Line(points={{10,0},{46,0}}, color={0,127,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); - end Friction; + end TestFrictionPosition; end Translational;