Skip to content
LIBRARY
PlanarMechanics.Revolute.md

PlanarMechanics.Revolute

Revolute joint: allows rotation about the z-axis while rigidly connecting positions.

This component extends from PartialTwoFrames This component extends from MultibodyComponents.Renderable

Usage

MultibodyComponents.PlanarMechanics.Revolute(render=true, color=[1.0, 0.0, 0.0, 1.0], specular_coefficient=0.7, radius=0.1, cylinder_length=0.1, z_position=0)

Parameters:

NameDescriptionUnitsDefault value
rendertrue
color[1, 0, 0, 1]
specular_coefficient0.7
radiusRadius of the revolute cylinder in animations0.1
cylinder_lengthLength of the revolute cylinder in animations0.1
z_positionz-position of the revolute cylinder center in animations0

Connectors

  • frame_a - Coordinate system (2-dim.) fixed to the component with one cut-force and cut-torque.

All variables are resolved in the planar world frame. (Frame2D)

  • frame_b - Coordinate system (2-dim.) fixed to the component with one cut-force and cut-torque.

All variables are resolved in the planar world frame. (Frame2D)

  • flange_a - This connector represents a rotational spline with angle and torque as the potential and flow variables, respectively. (Spline)

Variables

NameDescriptionUnits
phiRelative rotation angle from frame_a to frame_brad
wangular velocityrad/s
alphaangular accelerationrad/s2
tautorqueN.m

Behavior

Dict{MIME{Symbol("text/plain")}, String} with 1 entry: MIME type text/plain => "Error displaying result"

Source

dyad
"Revolute joint: allows rotation about the z-axis while rigidly connecting positions."
component Revolute
  extends PartialTwoFrames
  extends MultibodyComponents.Renderable(color = [1.0, 0.0, 0.0, 1.0])
  flange_a = Spline() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 650, "x2": 550, "y2": 750, "rot": 0}
      },
      "tags": []
    }
  }
  "Visualization shape for the revolute cylinder"
  shape = MultibodyComponents.CylinderShape(render = render, color = color)
  "Radius of the revolute cylinder in animations"
  parameter radius::Real = 0.1
  "Length of the revolute cylinder in animations"
  parameter cylinder_length::Real = 0.1
  "z-position of the revolute cylinder center in animations"
  parameter z_position::Real = 0
  "Relative rotation angle from frame_a to frame_b"
  variable phi::Angle(statePriority = 10)
  "angular velocity"
  variable w::AngularVelocity(statePriority = 10)
  "angular acceleration"
  variable alpha::AngularAcceleration
  "torque"
  variable tau::Torque
relations
  w = der(phi)
  alpha = der(w)
  # rigidly connect positions
  frame_a.x = frame_b.x
  frame_a.y = frame_b.y
  # rotation constraint
  frame_a.phi + phi = frame_b.phi
  # balance forces
  frame_a.fx + frame_b.fx = 0
  frame_a.fy + frame_b.fy = 0
  # balance torques
  frame_a.tau + frame_b.tau = 0
  frame_a.tau = tau
  flange_a.phi = phi
  flange_a.tau = tau
  # set shape position and orientation (2D lifted to 3D)
  shape.r = [frame_a.x, frame_a.y, z_position]
  shape.R = MultibodyComponents.RR(MultibodyComponents.axis_rotation(3, frame_a.phi))
  shape.r_shape = [0, 0, -cylinder_length / 2]
  shape.length_direction = [0, 0, 1]
  shape.width_direction = [1, 0, 0]
  shape.length = cylinder_length
  shape.width = 2 * radius
  shape.height = 2 * radius
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/Revolute.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
Flattened Source
dyad
"Revolute joint: allows rotation about the z-axis while rigidly connecting positions."
component Revolute
  frame_a = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 50, "y1": 450, "x2": 150, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_b = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 850, "y1": 450, "x2": 950, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  parameter render::Boolean = true
  parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
  parameter specular_coefficient::Real = 0.7
  flange_a = Spline() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 650, "x2": 550, "y2": 750, "rot": 0}
      },
      "tags": []
    }
  }
  "Visualization shape for the revolute cylinder"
  shape = MultibodyComponents.CylinderShape(render = render, color = color)
  "Radius of the revolute cylinder in animations"
  parameter radius::Real = 0.1
  "Length of the revolute cylinder in animations"
  parameter cylinder_length::Real = 0.1
  "z-position of the revolute cylinder center in animations"
  parameter z_position::Real = 0
  "Relative rotation angle from frame_a to frame_b"
  variable phi::Angle(statePriority = 10)
  "angular velocity"
  variable w::AngularVelocity(statePriority = 10)
  "angular acceleration"
  variable alpha::AngularAcceleration
  "torque"
  variable tau::Torque
relations
  w = der(phi)
  alpha = der(w)
  # rigidly connect positions
  frame_a.x = frame_b.x
  frame_a.y = frame_b.y
  # rotation constraint
  frame_a.phi + phi = frame_b.phi
  # balance forces
  frame_a.fx + frame_b.fx = 0
  frame_a.fy + frame_b.fy = 0
  # balance torques
  frame_a.tau + frame_b.tau = 0
  frame_a.tau = tau
  flange_a.phi = phi
  flange_a.tau = tau
  # set shape position and orientation (2D lifted to 3D)
  shape.r = [frame_a.x, frame_a.y, z_position]
  shape.R = MultibodyComponents.RR(MultibodyComponents.axis_rotation(3, frame_a.phi))
  shape.r_shape = [0, 0, -cylinder_length / 2]
  shape.length_direction = [0, 0, 1]
  shape.width_direction = [1, 0, 0]
  shape.length = cylinder_length
  shape.width = 2 * radius
  shape.height = 2 * radius
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/Revolute.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end


Test Cases

No test cases defined.