Message Boards Message Boards

0
|
1648 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

How to constrain a mechanical component to be vertical at all times using the Multibody library?

Posted 7 months ago

As suggested by the title, I'm using the Modelica.Mechanics.Multibody library, and I need to constrain a component such that it must remain vertical.

The mechanical system is a beam, hinged at top to the ground so it can oscillate like a pendulum, and at its bottom it holds a body. As shown in the figure below, the body, represented by the sphere, is housed within a cavity of the beam, and it's coupled to it via two relative Fixed Translation parts and a Revolute Joint in between them, depicted as a red cylinder. A wall of the cavity has been removed so the components can be seen in the screenshot.

enter image description here

As written, the boundary conditions are such that I need to keep the upper relative Fixed Translation part vertical. Rotation will happen at the revolute joint because the beam tilts as it oscillates like a pendulum.

How to set this constraint? I tried using the constraints given in the Mechanics.Multibody package, but the documentation hasn't been useful and my efforts failed.

The overall system is this

enter image description here

The components that couple the mass to the bottom of the beam are shown within the black rectangle. The component called beam1 is just a fancy combination of BodyBox components from the MultiBody package:

enter image description here

Any help will be highly appreciated.

Regards,

Fabián

POSTED BY: Fabián Peña
4 Replies
Posted 6 months ago

Hello Ankit,

Thank you for your kind answer again.

The strategy you propose does exactly what I need. The tilt angle of the pendulum is measured and the value it's used to drive the component that must remain vertical.

It's a simple solution!

Thank you very much!

Cheers,

Fabián

POSTED BY: Fabián Peña
Posted 6 months ago

How about this model?

model KeepVertical
  Modelica.Blocks.Math.Gain gain1(k = -1) annotation(Placement(visible = true, transformation(origin = {50, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Sensors.RelativeAngles relativeAngles1 annotation(Placement(visible = true, transformation(origin = {80, -40}, extent = {{-10, 10}, {10, -10}}, rotation = 0)));
  Modelica.Mechanics.Rotational.Sources.Position position1 annotation(Placement(visible = true, transformation(origin = {14.21, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Parts.Body body(r_0.start = {0.0, 2, 0.0}) annotation(Placement(visible = true, transformation(origin = {-80, -120}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  inner Modelica.Mechanics.MultiBody.World world annotation(Placement(visible = true, transformation(origin = {-120, 80}, extent = {{-10, -10}, {10, 10}}, rotation = -360)));
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation1(r = {0.0, -1, 0.0}) annotation(Placement(visible = true, transformation(origin = {-80, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation2(r = {0.0, -1, 0.0}) annotation(Placement(visible = true, transformation(origin = {-80, -80}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute2(phi.start = 0.174532925199433, useAxisFlange = false) annotation(Placement(visible = true, transformation(origin = {-80, 40}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));
  Modelica.Mechanics.MultiBody.Parts.Body body1(r_0.start = {0.0, 2, 0.0}) annotation(Placement(visible = true, transformation(origin = {-40, 60}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute3(useAxisFlange = true) annotation(Placement(visible = true, transformation(origin = {-40, -10}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation3(r = {0.0, -0.5, 0.0}) annotation(Placement(visible = true, transformation(origin = {-40, 20}, extent = {{-10, 10}, {10, -10}}, rotation = 270)));
equation
  connect(fixedTranslation2.frame_b, body.frame_a) annotation(Line(visible = true, origin = {-80, -100}, points = {{0, 10}, {0, -10}}, color = {95, 95, 95}, thickness = 0.5));
  connect(world.frame_b, revolute2.frame_a) annotation(Line(visible = true, origin = {-90, 70}, points = {{-20, 10}, {10, 10}, {10, -20}}, color = {95, 95, 95}, thickness = 0.5));
  connect(revolute2.frame_b, fixedTranslation1.frame_a) annotation(Line(visible = true, origin = {-80, 20}, points = {{0, 10}, {0, -10}}, color = {95, 95, 95}, thickness = 0.5));
  connect(fixedTranslation2.frame_a, fixedTranslation1.frame_b) annotation(Line(visible = true, origin = {-80, -40}, points = {{0, -30}, {0, 30}}, color = {95, 95, 95}, thickness = 0.5));
  connect(fixedTranslation1.frame_b, revolute3.frame_b) annotation(Line(visible = true, points = {{-20, 2.912}, {-20, -27.088}, {20, -27.088}, {20, -7.088}}, color = {95, 95, 95}, thickness = 0.5, origin = {-60, -12.912}));
  connect(fixedTranslation3.frame_a, body1.frame_a) annotation(Line(visible = true, origin = {-40, 40}, points = {{0, -10}, {0, 10}}, color = {95, 95, 95}, thickness = 0.5));
  connect(revolute3.frame_a, fixedTranslation3.frame_b) annotation(Line(visible = true, origin = {-40, 5}, points = {{0, -5}, {0, 5}}, color = {95, 95, 95}, thickness = 0.5));
  connect(world.frame_b, relativeAngles1.frame_b) annotation(Line(visible = true, origin = {43.879, 40}, points = {{-153.879, 40}, {56.121, 40}, {56.121, -80}, {46.121, -80}}, color = {95, 95, 95}, thickness = 0.5));
  connect(gain1.u, relativeAngles1.angles[3]) annotation(Line(visible = true, origin = {74, -16.333}, points = {{-12, 6.333}, {6, 6.333}, {6, -12.667}}, color = {0, 0, 127}));
  connect(revolute3.axis, position1.flange) annotation(Line(visible = true, origin = {-12.895, -10}, points = {{-17.105, 0}, {17.105, 0}}));
  connect(position1.phi_ref, gain1.y) annotation(Line(visible = true, origin = {32.605, -10}, points = {{-6.395, 0}, {6.395, 0}}, color = {0, 0, 127}));
  connect(revolute3.frame_b, relativeAngles1.frame_a) annotation(Line(visible = true, origin = {-3.333, -33.333}, points = {{-36.667, 13.333}, {-36.667, -6.667}, {73.333, -6.667}}, color = {95, 95, 95}, thickness = 0.5));
  annotation(uses(Modelica(version = "4.0.0")), Diagram(coordinateSystem(extent = {{-240, -143.033}, {210, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10})));
end KeepVertical;
POSTED BY: Updating Name
Posted 6 months ago

Hello Ankit,

Thank you very much for your kind reply.

I checked the solution you proposed, and saw that the angle between the frames in the revolute joint is fixed with an angle source. This configuration makes the joint rigid, forcing the components connected to it rotate together. However, it does not keep one of the components vertical. By vertical, I mean parallel to the gravitational field.

I see now that my original post was not clear enough. I hope the requirement is better described with this screenshot:

enter image description here

Any help will be highly appreciated.

Cheers,

Fabián

POSTED BY: Fabián Peña

You could set the "useAxisFlange" option to "true" and provide it with an angle source.

model KeepVertical
  Modelica.Mechanics.MultiBody.Parts.Body body(r_0.start = {0.0, 2, 0.0}) annotation(Placement(visible = true, transformation(origin = {90, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  inner Modelica.Mechanics.MultiBody.World world annotation(Placement(visible = true, transformation(origin = {-120, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute1(useAxisFlange = true) annotation(Placement(visible = true, transformation(origin = {0, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.Rotational.Sources.Position position1 annotation(Placement(visible = true, transformation(origin = {-20, -0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Sources.Constant const annotation(Placement(visible = true, transformation(origin = {-80, -0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation1(r = {0.0, 1, 0.0}) annotation(Placement(visible = true, transformation(origin = {-50, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation2(r = {0.0, 1, 0.0}) annotation(Placement(visible = true, transformation(origin = {50, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute2(useAxisFlange = false, phi.start = 0.0174532925199433) annotation(Placement(visible = true, transformation(origin = {-82.531, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(position1.flange, revolute1.axis) annotation(Line(visible = true, origin = {-3.333, -10}, points = {{-6.667, 10}, {3.333, 10}, {3.333, -20}}));
  connect(const.y, position1.phi_ref) annotation(Line(visible = true, origin = {-50.5, -0}, points = {{-18.5, -0}, {18.5, 0}}, color = {0, 0, 127}));
  connect(fixedTranslation1.frame_b, revolute1.frame_a) annotation(Line(visible = true, origin = {-25, -40}, points = {{-15, 0}, {15, 0}}, color = {95, 95, 95}, thickness = 0.5));
  connect(revolute1.frame_b, fixedTranslation2.frame_a) annotation(Line(visible = true, origin = {25, -40}, points = {{-15, 0}, {15, 0}}, color = {95, 95, 95}, thickness = 0.5));
  connect(fixedTranslation2.frame_b, body.frame_a) annotation(Line(visible = true, origin = {70, -40}, points = {{-10, 0}, {10, 0}}, color = {95, 95, 95}, thickness = 0.5));
  connect(world.frame_b, revolute2.frame_a) annotation(Line(visible = true, origin = {-101.265, -40}, points = {{-8.735, 0}, {8.735, 0}}, color = {95, 95, 95}, thickness = 0.5));
  connect(revolute2.frame_b, fixedTranslation1.frame_a) annotation(Line(visible = true, origin = {-66.265, -40}, points = {{-6.265, 0}, {6.265, 0}}, color = {95, 95, 95}, thickness = 0.5));
  annotation(uses(Modelica(version = "4.0.0")), Diagram(coordinateSystem(extent = {{-150, -100}, {138.043, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10})));
end KeepVertical;
POSTED BY: Ankit Naik
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract