Skip to content
LIBRARY
examples.FourBar2.md

examples.FourBar2

Four-bar linkage closed with a cut joint.

This mechanism is another instance of a 4-bar linkage, this time with 6 revolute joints, 1 prismatic joint and 4 bodies.

We show two different ways of modeling this mechanism, first using a cut joint, and later using a much more efficient joint assembly.

In order to simulate this mechanism using a cut joint, the user must 2. Use the iscut=true keyword argument to one of the Revolute joints to indicate that the joint is a cut joint. A cut joint behaves similarly to a regular joint, but it introduces fewer constraints in order to avoid the otherwise over-constrained system resulting from closing the kinematic loop. While almost any joint can be chosen as the cut joint, it might be worthwhile experimenting with this choice in order to get an efficient representation. In this example, cutting j5 produces an 8-dimensional state realization, while all other joints result in a 17-dimensional state.

  1. Increase the statePriority of the joint j1 above the default joint priority 4. This encourages the model compiler to choose the joint coordinate of j1 as state variable. The joint coordinate of j1 is the only coordinate that uniquely determines the configuration of the mechanism. The choice of any other joint coordinate would lead to a singular representation in at least one configuration of the mechanism. The joint j1 is the revolute joint located in the origin, see the animation below where this joint is made larger than the others.

To drive the mechanism, we set the initial velocity of the joint j1 to some non-zero value.

Usage

MultibodyComponents.examples.FourBar2()

Behavior

Source

dyad
"""
Four-bar linkage closed with a cut joint.

This mechanism is another instance of a 4-bar linkage, this time with 6 revolute joints, 1 prismatic joint and 4 bodies.

We show two different ways of modeling this mechanism, first using a cut joint, and later using a much more efficient joint assembly.

In order to simulate this mechanism using a cut joint, the user must
1. Use the `iscut=true` keyword argument to one of the `Revolute` joints to indicate that the joint is a cut joint. A cut joint behaves similarly to a regular joint, but it introduces fewer constraints in order to avoid the otherwise over-constrained system resulting from closing the kinematic loop. While almost any joint can be chosen as the cut joint, it might be worthwhile experimenting with this choice in order to get an efficient representation. In this example, cutting `j5` produces an 8-dimensional state realization, while all other joints result in a 17-dimensional state.
2. Increase the `statePriority` of the joint `j1` above the default joint priority 4. This encourages the model compiler to choose the joint coordinate of `j1` as state variable. The joint coordinate of `j1` is the only coordinate that uniquely determines the configuration of the mechanism. The choice of any other joint coordinate would lead to a singular representation in at least one configuration of the mechanism. The joint `j1` is the revolute joint located in the origin, see the animation below where this joint is made larger than the others.


To drive the mechanism, we set the initial velocity of the joint j1 to some non-zero value.
"""
example component FourBar2
  world = MultibodyComponents.World(default_body_diameter = 0.06, axis_radius = 0.01) {}
  j1 = MultibodyComponents.Revolute(n = [1, 0, 0], w(initial = 5.235987755982989), radius = 0.1, statePriority = 5) {}
  j2 = MultibodyComponents.Prismatic(n = [1, 0, 0], s(initial = -0.2)) {}
  b1 = MultibodyComponents.BodyShape(r = [0, 0.5, 0.1]) {}
  b2 = MultibodyComponents.BodyShape(r = [0, 0.2, 0]) {}
  b3 = MultibodyComponents.BodyShape(r = [-1, 0.3, 0.1]) {}
  rev = MultibodyComponents.Revolute(n = [0, 1, 0]) {}
  rev1 = MultibodyComponents.Revolute() {}
  j3 = MultibodyComponents.Revolute(n = [1, 0, 0]) {}
  j4 = MultibodyComponents.Revolute(n = [0, 1, 0]) {}
  j5 = MultibodyComponents.Revolute(n = [0, 0, 1], iscut = true) {}
  b0 = MultibodyComponents.FixedTranslation(r = [1.2, 0, 0], radius = 0) {}
relations
  connect(j2.frame_b, b2.frame_a)
  connect(j1.frame_b, b1.frame_a)
  connect(rev.frame_a, b2.frame_b)
  connect(rev.frame_b, rev1.frame_a)
  connect(rev1.frame_b, b3.frame_a)
  connect(world.frame_b, j1.frame_a)
  connect(b1.frame_b, j3.frame_a)
  connect(j3.frame_b, j4.frame_a)
  connect(j4.frame_b, j5.frame_a)
  connect(j5.frame_b, b3.frame_b)
  connect(b0.frame_a, world.frame_b)
  connect(b0.frame_b, j2.frame_a)
end
Flattened Source
dyad
"""
Four-bar linkage closed with a cut joint.

This mechanism is another instance of a 4-bar linkage, this time with 6 revolute joints, 1 prismatic joint and 4 bodies.

We show two different ways of modeling this mechanism, first using a cut joint, and later using a much more efficient joint assembly.

In order to simulate this mechanism using a cut joint, the user must
1. Use the `iscut=true` keyword argument to one of the `Revolute` joints to indicate that the joint is a cut joint. A cut joint behaves similarly to a regular joint, but it introduces fewer constraints in order to avoid the otherwise over-constrained system resulting from closing the kinematic loop. While almost any joint can be chosen as the cut joint, it might be worthwhile experimenting with this choice in order to get an efficient representation. In this example, cutting `j5` produces an 8-dimensional state realization, while all other joints result in a 17-dimensional state.
2. Increase the `statePriority` of the joint `j1` above the default joint priority 4. This encourages the model compiler to choose the joint coordinate of `j1` as state variable. The joint coordinate of `j1` is the only coordinate that uniquely determines the configuration of the mechanism. The choice of any other joint coordinate would lead to a singular representation in at least one configuration of the mechanism. The joint `j1` is the revolute joint located in the origin, see the animation below where this joint is made larger than the others.


To drive the mechanism, we set the initial velocity of the joint j1 to some non-zero value.
"""
example component FourBar2
  world = MultibodyComponents.World(default_body_diameter = 0.06, axis_radius = 0.01) {}
  j1 = MultibodyComponents.Revolute(n = [1, 0, 0], w(initial = 5.235987755982989), radius = 0.1, statePriority = 5) {}
  j2 = MultibodyComponents.Prismatic(n = [1, 0, 0], s(initial = -0.2)) {}
  b1 = MultibodyComponents.BodyShape(r = [0, 0.5, 0.1]) {}
  b2 = MultibodyComponents.BodyShape(r = [0, 0.2, 0]) {}
  b3 = MultibodyComponents.BodyShape(r = [-1, 0.3, 0.1]) {}
  rev = MultibodyComponents.Revolute(n = [0, 1, 0]) {}
  rev1 = MultibodyComponents.Revolute() {}
  j3 = MultibodyComponents.Revolute(n = [1, 0, 0]) {}
  j4 = MultibodyComponents.Revolute(n = [0, 1, 0]) {}
  j5 = MultibodyComponents.Revolute(n = [0, 0, 1], iscut = true) {}
  b0 = MultibodyComponents.FixedTranslation(r = [1.2, 0, 0], radius = 0) {}
relations
  connect(j2.frame_b, b2.frame_a)
  connect(j1.frame_b, b1.frame_a)
  connect(rev.frame_a, b2.frame_b)
  connect(rev.frame_b, rev1.frame_a)
  connect(rev1.frame_b, b3.frame_a)
  connect(world.frame_b, j1.frame_a)
  connect(b1.frame_b, j3.frame_a)
  connect(j3.frame_b, j4.frame_a)
  connect(j4.frame_b, j5.frame_a)
  connect(j5.frame_b, b3.frame_b)
  connect(b0.frame_a, world.frame_b)
  connect(b0.frame_b, j2.frame_a)
metadata {}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses