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, PartialElementaryOneSplineAndSupport
(e.g., as w
, is defined as the time derivative of this relative angle
math The core behavior is to equate this kinematic angular velocity w
with the reference input
math This ensures that the spline rotates relative to the support precisely at the angular velocity specified by
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
Name | Description | Units |
---|---|---|
phi_support | Absolute angle of the support spline | rad |
phi | Angle of rotation calculated by differentiating w . | rad |
w | Angular velocity set by w_ref | rad/s |
Behavior
Source
# 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
# 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.
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"
Related
Examples
Experiments
Analyses