---
url: /dyad/stable/stdlib/MultibodyComponents/components/PlanarMechanics.CutTorque.md
description: >-
  Dyad PlanarMechanics.CutTorque docs.  Measures the cut torque between two
  rigidly connected frames.
---

# `PlanarMechanics.CutTorque` {#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`](../types/PartialTwoFrameSensor.md) This component extends from [`MultibodyComponents.Renderable`](../types/Renderable.md)

## Usage {#Usage}

`MultibodyComponents.PlanarMechanics.CutTorque(render=true, color=MultibodyComponents.world_default_sensor_color(), specular_coefficient=1.5, positive_sign=true, scale=0.1, arrow_diameter=MultibodyComponents.world_default_arrow_diameter(), z_position=0)`

## Parameters: {#Parameters:}

|                   Name |                                                           Description | Units |             Default value |
| ----------------------:| ---------------------------------------------------------------------:| -----:| -------------------------:|
|               `render` |                                                                       |     – |                      true |
|                `color` |                                                                       |     – | MultibodyCo...sor_color() |
| `specular_coefficient` |                                                                       |     – |                       1.5 |
|        `positive_sign` |  Sign convention: true = torque on frame_a, false = torque on frame_b |     – |                      true |
|                `scale` | Scale factor for torque arrow visualization (length = torque \* scale) |     – |                       0.1 |
|       `arrow_diameter` |                                    Diameter of the torque arrow shaft |     – | MultibodyCo...\_diameter() |
|           `z_position` |                                 z-position of the arrow in animations |     – |                         0 |

## Connectors {#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`](/stdlib/Dyad/connectors/Frame2D#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`](/stdlib/Dyad/connectors/Frame2D#Frame2D))

* `torque_out` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Variables {#Variables}

|         Name |                               Description | Units |
| ------------:| -----------------------------------------:| -----:|
| `tau_signed` | Torque value with sign convention applied |   N.m |

## Behavior {#Behavior}

## Source {#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 = MultibodyComponents.world_default_sensor_color())
  "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, r = [frame_b.x, frame_b.y, z_position], length_direction = [0, 0, 1], width_direction = [1, 0, 0], length = tau_signed * scale, width = arrow_diameter, height = 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 = MultibodyComponents.world_default_arrow_diameter()
  "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
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/TwoFrameSensor.svg"},
    "labels": [{"label": "cut torque", "x": 500, "y": 680, "rot": 0}]
  }
}
end
```

```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 = 1.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, r = [frame_b.x, frame_b.y, z_position], length_direction = [0, 0, 1], width_direction = [1, 0, 0], length = tau_signed * scale, width = arrow_diameter, height = 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 = MultibodyComponents.world_default_arrow_diameter()
  "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
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/TwoFrameSensor.svg"},
    "labels": [{"label": "cut torque", "x": 500, "y": 680, "rot": 0}]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`CutTorqueTest`](PlanarMechanics.CutTorque.md)
