Skip to content
MultiSensor.md

MultiSensor

Ideal sensor to measure the absolute angular velocity, torque, and power between two splines.

This component serves as an ideal sensor for rotational mechanical systems. It provides output signals for the absolute angular velocity of its primary connection point (spline_a), the torque flowing through this connection, and the instantaneous mechanical power. As an ideal sensor, it introduces no parasitic effects like inertia or damping and its measurements are exact. The key relationships are: The absolute angular velocity w of spline_a:

w=dphiadt

The measured torque τ is the torque at spline_a:

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

The mechanical power P:

P=τcdotw

The component ensures that its two connection splines, spline_a and spline_b, have the same absolute angle (spline_a.phi = spline_b.phi), indicating a rigid passthrough.

This component extends from PartialRelativeSensor

Usage

MultiSensor()

Connectors

  • spline_a - (Spline)

  • spline_b - (Spline)

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

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

  • w - 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)w(t)=dspline_a.phi(t)dttau(t)=spline_a.tau(t)power(t)=w(t)tau(t)

Source

dyad
# Ideal sensor to measure the absolute angular velocity, torque, and power between two splines.
#
# This component serves as an ideal sensor for rotational mechanical systems.
# It provides output signals for the absolute angular velocity of its primary connection
# point (`spline_a`), the torque flowing through this connection, and the instantaneous
# mechanical power. As an ideal sensor, it introduces no parasitic effects like inertia
# or damping and its measurements are exact. The key relationships are:
# The absolute angular velocity `w` of `spline_a`:
# ```math
# w = \frac{d\\phi_a}{dt}
# ```
# The measured torque \$\tau\$ is the torque at `spline_a`:
# ```math
# \tau = \text{spline\\_a}.\\tau
# ```
# The mechanical power \$P\$:
# ```math
# P = \tau \\cdot w
# ```
# The component ensures that its two connection splines, `spline_a` and `spline_b`,
# have the same absolute angle (`spline_a.phi = spline_b.phi`), indicating a rigid passthrough.
component MultiSensor
  extends PartialRelativeSensor
  # Power in spline `spline_a` as output signal
  power = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 175, "y1": 950, "x2": 275, "y2": 1050, "rot": 90}}
    }
  }]
  # Torque in spline `spline_a` as output signal
  tau = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }]
  # Absolute angular velocity of spline `spline_a` as output signal
  w = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 725, "y1": 950, "x2": 825, "y2": 1050, "rot": 90}}
    }
  }]
relations
  spline_a.phi = spline_b.phi
  w = der(spline_a.phi)
  tau = spline_a.tau
  power = tau*w
end
Flattened Source
dyad
# Ideal sensor to measure the absolute angular velocity, torque, and power between two splines.
#
# This component serves as an ideal sensor for rotational mechanical systems.
# It provides output signals for the absolute angular velocity of its primary connection
# point (`spline_a`), the torque flowing through this connection, and the instantaneous
# mechanical power. As an ideal sensor, it introduces no parasitic effects like inertia
# or damping and its measurements are exact. The key relationships are:
# The absolute angular velocity `w` of `spline_a`:
# ```math
# w = \frac{d\\phi_a}{dt}
# ```
# The measured torque \$\tau\$ is the torque at `spline_a`:
# ```math
# \tau = \text{spline\\_a}.\\tau
# ```
# The mechanical power \$P\$:
# ```math
# P = \tau \\cdot w
# ```
# The component ensures that its two connection splines, `spline_a` and `spline_b`,
# have the same absolute angle (`spline_a.phi = spline_b.phi`), indicating a rigid passthrough.
component MultiSensor
  # 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}}}}]
  # Power in spline `spline_a` as output signal
  power = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 175, "y1": 950, "x2": 275, "y2": 1050, "rot": 90}}
    }
  }]
  # Torque in spline `spline_a` as output signal
  tau = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }]
  # Absolute angular velocity of spline `spline_a` as output signal
  w = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 725, "y1": 950, "x2": 825, "y2": 1050, "rot": 90}}
    }
  }]
relations
  0 = spline_a.tau+spline_b.tau
  spline_a.phi = spline_b.phi
  w = der(spline_a.phi)
  tau = spline_a.tau
  power = tau*w
metadata {}
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