Skip to content
LIBRARY
PlanarMechanics.CutTorque.md

PlanarMechanics.CutTorque

Measures the cut torque between two rigidly connected frames.

This sensor is inserted between two frames in a kinematic chain. It constrains frame_a and frame_b to have identical position and orientation, and measures the reaction torque needed to maintain this constraint.

In 2D planar mechanics, torque is a scalar (rotation about the z-axis) and is invariant under planar frame rotations, so no resolve_in_frame is needed.

This is a sensor component: it does not alter the dynamics of the system.

This component extends from PartialTwoFrameSensor This component extends from MultibodyComponents.Renderable

Usage

MultibodyComponents.PlanarMechanics.CutTorque(render=true, color=[0, 1, 0, 0.5], specular_coefficient=0.7, positive_sign=true, scale=0.1, arrow_diameter=0.03, z_position=0)

Parameters:

NameDescriptionUnitsDefault value
rendertrue
color[0, 1, 0, 0.5]
specular_coefficient0.7
positive_signSign convention: true = torque on frame_a, false = torque on frame_btrue
scaleScale factor for torque arrow visualization (length = torque * scale)0.1
arrow_diameterDiameter of the torque arrow shaft0.03
z_positionz-position of the arrow 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)

  • torque_out - This connector represents a real signal as an output from a component (RealOutput)

Variables

NameDescriptionUnits
tau_signedTorque value with sign convention appliedN.m

Behavior

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

Source

dyad
"""
Measures the cut torque between two rigidly connected frames.

This sensor is inserted between two frames in a kinematic chain. It constrains
frame_a and frame_b to have identical position and orientation, and measures the
reaction torque needed to maintain this constraint.

In 2D planar mechanics, torque is a scalar (rotation about the z-axis) and is
invariant under planar frame rotations, so no resolve_in_frame is needed.

This is a sensor component: it does not alter the dynamics of the system.
"""
component CutTorque
  extends PartialTwoFrameSensor
  extends MultibodyComponents.Renderable(color = [0, 1, 0, 0.5])
  "Measured cut torque"
  torque_out = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 960, "x2": 550, "y2": 1060, "rot": 90}
      },
      "tags": []
    }
  }
  "Torque arrow visualization"
  torque_arrow = MultibodyComponents.ArrowShape(render = render, color = color, head_at_origin = true, diameter = arrow_diameter)
  "Sign convention: true = torque on frame_a, false = torque on frame_b"
  parameter positive_sign::Boolean = true
  "Scale factor for torque arrow visualization (length = torque * scale)"
  parameter scale::Real = 0.1
  "Diameter of the torque arrow shaft"
  parameter arrow_diameter::Real = 0.03
  "z-position of the arrow in animations"
  parameter z_position::Real = 0
  "Torque value with sign convention applied"
  variable tau_signed::Torque
relations
  # Rigid connection: identical position and orientation
  frame_a.x = frame_b.x
  frame_a.y = frame_b.y
  frame_a.phi = frame_b.phi
  # Force balance
  frame_a.fx + frame_b.fx = 0
  frame_a.fy + frame_b.fy = 0
  # Torque balance
  frame_a.tau + frame_b.tau = 0
  # Output torque (sign convention)
  tau_signed = ifelse(positive_sign, frame_a.tau, -frame_a.tau)
  torque_out = tau_signed
  # Torque arrow: displayed along z-axis at frame_b position
  torque_arrow.r = [frame_b.x, frame_b.y, z_position]
  torque_arrow.R = MultibodyComponents.RR(MultibodyComponents.nullrotation())
  torque_arrow.r_shape = [0, 0, 0]
  torque_arrow.length_direction = [0, 0, 1]
  torque_arrow.width_direction = [1, 0, 0]
  torque_arrow.length = tau_signed * scale
  torque_arrow.width = arrow_diameter
  torque_arrow.height = arrow_diameter
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/TwoFrameSensor.svg"},
    "labels": [{"label": "cut torque", "x": 500, "y": 680, "rot": 0}]
  }
}
end
Flattened Source
dyad
"""
Measures the cut torque between two rigidly connected frames.

This sensor is inserted between two frames in a kinematic chain. It constrains
frame_a and frame_b to have identical position and orientation, and measures the
reaction torque needed to maintain this constraint.

In 2D planar mechanics, torque is a scalar (rotation about the z-axis) and is
invariant under planar frame rotations, so no resolve_in_frame is needed.

This is a sensor component: it does not alter the dynamics of the system.
"""
component CutTorque
  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
  "Measured cut torque"
  torque_out = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 960, "x2": 550, "y2": 1060, "rot": 90}
      },
      "tags": []
    }
  }
  "Torque arrow visualization"
  torque_arrow = MultibodyComponents.ArrowShape(render = render, color = color, head_at_origin = true, diameter = arrow_diameter)
  "Sign convention: true = torque on frame_a, false = torque on frame_b"
  parameter positive_sign::Boolean = true
  "Scale factor for torque arrow visualization (length = torque * scale)"
  parameter scale::Real = 0.1
  "Diameter of the torque arrow shaft"
  parameter arrow_diameter::Real = 0.03
  "z-position of the arrow in animations"
  parameter z_position::Real = 0
  "Torque value with sign convention applied"
  variable tau_signed::Torque
relations
  # Rigid connection: identical position and orientation
  frame_a.x = frame_b.x
  frame_a.y = frame_b.y
  frame_a.phi = frame_b.phi
  # Force balance
  frame_a.fx + frame_b.fx = 0
  frame_a.fy + frame_b.fy = 0
  # Torque balance
  frame_a.tau + frame_b.tau = 0
  # Output torque (sign convention)
  tau_signed = ifelse(positive_sign, frame_a.tau, -frame_a.tau)
  torque_out = tau_signed
  # Torque arrow: displayed along z-axis at frame_b position
  torque_arrow.r = [frame_b.x, frame_b.y, z_position]
  torque_arrow.R = MultibodyComponents.RR(MultibodyComponents.nullrotation())
  torque_arrow.r_shape = [0, 0, 0]
  torque_arrow.length_direction = [0, 0, 1]
  torque_arrow.width_direction = [1, 0, 0]
  torque_arrow.length = tau_signed * scale
  torque_arrow.width = arrow_diameter
  torque_arrow.height = arrow_diameter
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/TwoFrameSensor.svg"},
    "labels": [{"label": "cut torque", "x": 500, "y": 680, "rot": 0}]
  }
}
end


Test Cases

No test cases defined.