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=MultibodyComponents.world_default_joint_color(), specular_coefficient=1.5, radius=MultibodyComponents.world_default_joint_width(), cylinder_length=MultibodyComponents.world_default_joint_length(), z_position=0)

Parameters:

NameDescriptionUnitsDefault value
statePriority10
rendertrue
colorMultibodyCo...int_color()
specular_coefficient1.5
radiusRadius of the revolute cylinder in animationsMultibodyCo...int_width()
cylinder_lengthLength of the revolute cylinder in animationsMultibodyCo...nt_length()
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 = MultibodyComponents.world_default_joint_color())
  flange_a = Spline() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 450, "x2": 550, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Visualization shape for the revolute cylinder"
  shape = MultibodyComponents.CylinderShape(render = render, color = color, r = [frame_a.x, frame_a.y, z_position], R = MultibodyComponents.RR(MultibodyComponents.axis_rotation(3, frame_a.phi)), r_shape = [0, 0, -cylinder_length / 2], length_direction = [0, 0, 1], width_direction = [1, 0, 0], length = cylinder_length, width = 2 * radius, height = 2 * radius)
  structural parameter statePriority::Integer = 10
  "Radius of the revolute cylinder in animations"
  parameter radius::Real = MultibodyComponents.world_default_joint_width()
  "Length of the revolute cylinder in animations"
  parameter cylinder_length::Real = MultibodyComponents.world_default_joint_length()
  "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 = statePriority)
  "angular velocity"
  variable w::AngularVelocity(statePriority = statePriority)
  "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 = 1.5
  flange_a = Spline() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 450, "x2": 550, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Visualization shape for the revolute cylinder"
  shape = MultibodyComponents.CylinderShape(render = render, color = color, r = [frame_a.x, frame_a.y, z_position], R = MultibodyComponents.RR(MultibodyComponents.axis_rotation(3, frame_a.phi)), r_shape = [0, 0, -cylinder_length / 2], length_direction = [0, 0, 1], width_direction = [1, 0, 0], length = cylinder_length, width = 2 * radius, height = 2 * radius)
  structural parameter statePriority::Integer = 10
  "Radius of the revolute cylinder in animations"
  parameter radius::Real = MultibodyComponents.world_default_joint_width()
  "Length of the revolute cylinder in animations"
  parameter cylinder_length::Real = MultibodyComponents.world_default_joint_length()
  "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 = statePriority)
  "angular velocity"
  variable w::AngularVelocity(statePriority = statePriority)
  "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
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.