Skip to content
SpeedSource.md

SpeedSource

Forced movement of a spline according to a reference angular velocity signal.

Models an ideal source of rotational motion that imposes a prescribed relative angular velocity between a "spline" and its "support" based on the input signal w_ref. The relative rotation angle, ϕ, is dynamically calculated based on the angles of the spline and support, typically from an extended component like PartialElementaryOneSplineAndSupport (e.g., as ϕ=spline.ϕϕsupport). The relative angular velocity, w, is defined as the time derivative of this relative angle ϕ:

w=dphidt

math The core behavior is to equate this kinematic angular velocity w with the reference input wref:

w=wref

math This ensures that the spline rotates relative to the support precisely at the angular velocity specified by wref.

This component extends from PartialElementaryOneSplineAndSupport

Usage

SpeedSource()

Connectors

  • spline - (Spline)

  • support - (Spline)

  • w_ref - This connector represents a real signal as an input to a component (RealInput)

Variables

NameDescriptionUnits
phi_supportAbsolute angle of the support splinerad
phiAngle of rotation calculated by differentiating w.rad
wAngular velocity set by w_refrad/s

Behavior

support.phi(t)=phi_support(t)support.tau(t)=spline.tau(t)phi(t)=spline.phi(t)phi_support(t)w(t)=dphi(t)dtw(t)=w_ref(t)

Source

dyad
# Forced movement of a spline according to a reference angular velocity signal.
#
# Models an ideal source of rotational motion that imposes a prescribed relative angular velocity
# between a "spline" and its "support" based on the input signal `w_ref`.
# The relative rotation angle, \$\\phi\$, is dynamically calculated based on the angles of the spline and support,
# typically from an extended component like `PartialElementaryOneSplineAndSupport` (e.g., as \$\\phi = \text{spline}.\\phi - \\phi_\text{support}\$).
# The relative angular velocity, `w`, is defined as the time derivative of this relative angle \$\\phi\$:
# ```math
# w = \frac{d\\phi}{dt}
# ```math
# The core behavior is to equate this kinematic angular velocity `w` with the reference input \$w_{ref}\$:
# ```math
# w = w_{ref}
# ```math
# This ensures that the spline rotates relative to the support precisely at the angular velocity specified by \$w_{ref}\$.
component SpeedSource
  extends PartialElementaryOneSplineAndSupport
  # Input signal specifying the desired reference angular velocity of the spline relative to the support.
  w_ref = RealInput() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Angle of rotation calculated by differentiating `w`.
  variable phi::Angle
  # Angular velocity set by `w_ref`
  variable w::AngularVelocity
relations
  phi = spline.phi-phi_support
  w = der(phi)
  w = w_ref
metadata {
  "Dyad": {"icons": {"default": "dyad://RotationalComponents/Pos-Speed-Acc-Move.svg"}}
}
end
Flattened Source
dyad
# Forced movement of a spline according to a reference angular velocity signal.
#
# Models an ideal source of rotational motion that imposes a prescribed relative angular velocity
# between a "spline" and its "support" based on the input signal `w_ref`.
# The relative rotation angle, \$\\phi\$, is dynamically calculated based on the angles of the spline and support,
# typically from an extended component like `PartialElementaryOneSplineAndSupport` (e.g., as \$\\phi = \text{spline}.\\phi - \\phi_\text{support}\$).
# The relative angular velocity, `w`, is defined as the time derivative of this relative angle \$\\phi\$:
# ```math
# w = \frac{d\\phi}{dt}
# ```math
# The core behavior is to equate this kinematic angular velocity `w` with the reference input \$w_{ref}\$:
# ```math
# w = w_{ref}
# ```math
# This ensures that the spline rotates relative to the support precisely at the angular velocity specified by \$w_{ref}\$.
component SpeedSource
  # Primary rotational shaft spline connector
  spline = Spline() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
  # Support spline connector
  support = Spline() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "support", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
    }
  }]
  # Absolute angle of the support spline
  variable phi_support::Angle
  # Input signal specifying the desired reference angular velocity of the spline relative to the support.
  w_ref = RealInput() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Angle of rotation calculated by differentiating `w`.
  variable phi::Angle
  # Angular velocity set by `w_ref`
  variable w::AngularVelocity
relations
  support.phi = phi_support
  support.tau = -spline.tau
  phi = spline.phi-phi_support
  w = der(phi)
  w = w_ref
metadata {
  "Dyad": {"icons": {"default": "dyad://RotationalComponents/Pos-Speed-Acc-Move.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