Skip to content
TorqueSensor.md

TorqueSensor

Ideal sensor measuring the torque transmitted between two rotational splines.

This ideal sensor measures the torque exchanged between two coaxial rotational splines, spline_a and spline_b It enforces that the splines are rigidly connected, meaning there is no relative angular displacement between them. The relationship is described by the equation:

\text{spline\\_a}.\\phi = \text{spline\\_b}.\\phi

The sensor provides an output signal, tau, which represents the torque transmitted through the splines. This output is set equal to the torque acting on spline_a (denoted τa):

\tau = \text{spline\\_a}.\tau

where τa is the torque variable of the spline_a connector. This is an ideal component as it introduces no mechanical losses, inertia, or backlash.

This component extends from PartialRelativeSensor

Usage

TorqueSensor()

Connectors

  • spline_a - (Spline)

  • spline_b - (Spline)

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

Behavior

0=spline_b.tau(t)+spline_a.tau(t)spline_a.phi(t)=spline_b.phi(t)spline_a.tau(t)=tau(t)

Source

dyad
# Ideal sensor measuring the torque transmitted between two rotational splines.
#
# This ideal sensor measures the torque exchanged between two coaxial rotational splines,
# `spline_a` and `spline_b` It enforces that the splines are rigidly connected,
# meaning there is no relative angular displacement between them. The relationship
# is described by the equation:
# ```math
# \text{spline\\_a}.\\phi = \text{spline\\_b}.\\phi
# ```
# The sensor provides an output signal, `tau`, which represents the torque transmitted
# through the splines.
# This output is set equal to the torque acting on `spline_a` (denoted \$\tau_a\$):
# ```math
# \tau = \text{spline\\_a}.\tau
# ```
# where \$\tau_a\$ is the torque variable of the `spline_a` connector. This is an
# ideal component as it introduces no mechanical losses, inertia, or backlash.
component TorqueSensor
  extends PartialRelativeSensor
  # Output signal representing the measured torque transmitted between the splines.
  tau = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 100, "y1": 950, "x2": 200, "y2": 1050, "rot": 90}}
    }
  }]
relations
  spline_a.phi = spline_b.phi
  spline_a.tau = tau
metadata {
  "Dyad": {"icons": {"default": "dyad://RotationalComponents/Sensor-Power-Torque.svg"}}
}
end
Flattened Source
dyad
# Ideal sensor measuring the torque transmitted between two rotational splines.
#
# This ideal sensor measures the torque exchanged between two coaxial rotational splines,
# `spline_a` and `spline_b` It enforces that the splines are rigidly connected,
# meaning there is no relative angular displacement between them. The relationship
# is described by the equation:
# ```math
# \text{spline\\_a}.\\phi = \text{spline\\_b}.\\phi
# ```
# The sensor provides an output signal, `tau`, which represents the torque transmitted
# through the splines.
# This output is set equal to the torque acting on `spline_a` (denoted \$\tau_a\$):
# ```math
# \tau = \text{spline\\_a}.\tau
# ```
# where \$\tau_a\$ is the torque variable of the `spline_a` connector. This is an
# ideal component as it introduces no mechanical losses, inertia, or backlash.
component TorqueSensor
  # Left spline connector for the sensor.
  spline_a = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Right spline connector for the sensor.
  spline_b = Spline() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
  # Output signal representing the measured torque transmitted between the splines.
  tau = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 100, "y1": 950, "x2": 200, "y2": 1050, "rot": 90}}
    }
  }]
relations
  0 = spline_a.tau+spline_b.tau
  spline_a.phi = spline_b.phi
  spline_a.tau = tau
metadata {
  "Dyad": {"icons": {"default": "dyad://RotationalComponents/Sensor-Power-Torque.svg"}}
}
end


Test Cases

This is setup code, that must be run before each test case.

julia
using RotationalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames

snapshotsdir = joinpath(dirname(dirname(pathof(RotationalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/RotationalComponents/0VPxm/test/snapshots"
  • Examples

  • Experiments

  • Analyses