AccelerationSensor
Measures the absolute angular acceleration of a rotational spline.
This sensor determines the absolute angular acceleration of its spline
connector, leveraging properties inherited from PartialAbsoluteSensor
, such as the spline's angle (spline.phi
). The absolute angular velocity (w
) is first calculated as the time derivative of this angle:
Then, the absolute angular acceleration (a
) is computed as the time derivative of the angular velocity:
This resulting acceleration is provided as the output a
.
This component extends from PartialAbsoluteSensor
Usage
AccelerationSensor()
Connectors
spline
- (Spline
)a
- This connector represents a real signal as an output from a component (RealOutput
)
Variables
Name | Description | Units |
---|---|---|
w | Absolute angular velocity of flange | rad/s |
Behavior
Source
# Measures the absolute angular acceleration of a rotational spline.
#
# This sensor determines the absolute angular acceleration of its `spline` connector, leveraging properties inherited from `PartialAbsoluteSensor`, such as the spline's angle (`spline.phi`).
# The absolute angular velocity (`w`) is first calculated as the time derivative of this angle:
# ```math
# w = \frac{d\text{spline}.\\phi}{dt}
# ```
# Then, the absolute angular acceleration (`a`) is computed as the time derivative of the angular velocity:
# ```math
# a = \frac{dw}{dt} = \frac{d^2\text{spline}.\\phi}{dt^2}
# ```
# This resulting acceleration is provided as the output `a`.
component AccelerationSensor
extends PartialAbsoluteSensor
# Absolute angular acceleration of flange as output signal
a = RealOutput() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
# Absolute angular velocity of flange
variable w::AngularVelocity
relations
w = der(spline.phi)
a = der(w)
metadata {
"Dyad": {"icons": {"default": "dyad://RotationalComponents/SingleSplineSensor.svg"}}
}
end
Flattened Source
# Measures the absolute angular acceleration of a rotational spline.
#
# This sensor determines the absolute angular acceleration of its `spline` connector, leveraging properties inherited from `PartialAbsoluteSensor`, such as the spline's angle (`spline.phi`).
# The absolute angular velocity (`w`) is first calculated as the time derivative of this angle:
# ```math
# w = \frac{d\text{spline}.\\phi}{dt}
# ```
# Then, the absolute angular acceleration (`a`) is computed as the time derivative of the angular velocity:
# ```math
# a = \frac{dw}{dt} = \frac{d^2\text{spline}.\\phi}{dt^2}
# ```
# This resulting acceleration is provided as the output `a`.
component AccelerationSensor
# 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 acceleration of flange as output signal
a = RealOutput() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
# Absolute angular velocity of flange
variable w::AngularVelocity
relations
0 = spline.tau
w = der(spline.phi)
a = der(w)
metadata {
"Dyad": {"icons": {"default": "dyad://RotationalComponents/SingleSplineSensor.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