Skip to content
VelocitySensor.md

VelocitySensor

Measures the ideal absolute angular velocity of a rotational mechanical flange.

This sensor provides an ideal measurement of the absolute angular velocity of a connected rotational flange. It computes the angular velocity by taking the time derivative of the absolute angular position, spline.ϕ, of the flange. The angular position spline.ϕ is accessed via a spline connector. The defining equation for the output angular velocity w is:

w=d(phispline)dt

This component extends from PartialAbsoluteSensor

Usage

VelocitySensor()

Connectors

  • spline - (Spline)

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

Behavior

0=spline.tau(t)w(t)=dspline.phi(t)dt

Source

dyad
# Measures the ideal absolute angular velocity of a rotational mechanical flange.
#
# This sensor provides an ideal measurement of the absolute angular velocity of a
# connected rotational flange. It computes the angular velocity by taking the time
# derivative of the absolute angular position, \$\text{spline}.\\phi\$, of the
# flange. The angular position \$\text{spline}.\\phi\$ is accessed via a
# `spline` connector. The defining equation for the output angular
# velocity \$w\$ is:
# ```math
# w = \frac{d(\\phi_{spline})}{dt}
# ```
component VelocitySensor
  extends PartialAbsoluteSensor
  # Absolute angular velocity of flange as output signal
  w = RealOutput() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
relations
  w = der(spline.phi)
metadata {
  "Dyad": {"icons": {"default": "dyad://RotationalComponents/SingleSplineSensor.svg"}}
}
end
Flattened Source
dyad
# Measures the ideal absolute angular velocity of a rotational mechanical flange.
#
# This sensor provides an ideal measurement of the absolute angular velocity of a
# connected rotational flange. It computes the angular velocity by taking the time
# derivative of the absolute angular position, \$\text{spline}.\\phi\$, of the
# flange. The angular position \$\text{spline}.\\phi\$ is accessed via a
# `spline` connector. The defining equation for the output angular
# velocity \$w\$ is:
# ```math
# w = \frac{d(\\phi_{spline})}{dt}
# ```
component VelocitySensor
  # Spline of the shaft from which sensor information shall be measured
  spline = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Absolute angular velocity of flange as output signal
  w = RealOutput() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
relations
  0 = spline.tau
  w = der(spline.phi)
metadata {
  "Dyad": {"icons": {"default": "dyad://RotationalComponents/SingleSplineSensor.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