Position IconPosition
Forced movement of a flange according to a reference position
Forces a translational flange to track a reference position input via a second-order Bessel filter.
This component drives the translational position 's' of its 'flange' to follow an external reference signal s_ref. The movement is smoothed by a second-order linear filter, configured as a Bessel filter using the parameters f_crit (critical frequency), af (s-coefficient), and bf (s²-coefficient). The control input s_ref dictates the target position.
The core dynamic relationship, ensuring smooth tracking, is given by the differential equation:
\[\frac{bf}{w_{crit}^2} \frac{d^2s}{dt^2} + \frac{af}{w_{crit}} \frac{ds}{dt} + s = s_{ref}\]
where the critical angular frequency 'w_crit' is defined as:
\[w_{crit} = 2\pi f_{crit}\]
This formulation ensures a smooth transition of the flange position towards the reference, exhibiting the linear phase characteristics of a Bessel filter. The flange's velocity v and acceleration a are also calculated. Initially, the flange position s is set to the reference position s_ref.
Usage
TranslationalComponents.Position(f_crit=0.0, af=1.3617, bf=0.6180, w_crit=2 * π * f_crit)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
f_crit | User-defined critical frequency of the Bessel filter in Hertz | Hz | 0 |
Connectors
s_ref- This connector represents a real signal as an input to a component (RealInput)flange- This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)
Variables
| Name | Description | Units |
|---|---|---|
s | State variable for the actual position of the flange | m |
v | State variable for the velocity of the flange | m/s |
a | State variable for the acceleration of the flange | m/s2 |
Behavior
\[ \begin{align} v\left( t \right) &= \frac{\mathrm{d} s\left( t \right)}{\mathrm{d}t} \\ a\left( t \right) &= \frac{\mathrm{d} v\left( t \right)}{\mathrm{d}t} \\ a\left( t \right) &= \frac{\left( - \mathtt{af} v\left( t \right) + \mathtt{w\_crit} \left( - s\left( t \right) + \mathtt{s\_ref}\left( t \right) \right) \right) \mathtt{w\_crit}}{\mathtt{bf}} \\ \mathtt{flange.s}\left( t \right) &= s\left( t \right) \end{align} \]
Source
"""
Forced movement of a flange according to a reference position
Forces a translational flange to track a reference position input via a second-order Bessel filter.
This component drives the translational position 's' of its 'flange' to follow an external reference signal `s_ref`.
The movement is smoothed by a second-order linear filter, configured as a Bessel filter using the
parameters `f_crit` (critical frequency), `af` (s-coefficient), and `bf` (s²-coefficient).
The control input `s_ref` dictates the target position.
The core dynamic relationship, ensuring smooth tracking, is given by the differential equation:math \frac{bf}{w{crit}^2} \frac{d^2s}{dt^2} + \frac{af}{w{crit}} \frac{ds}{dt} + s = s_{ref}
where the critical angular frequency 'w_crit' is defined as:
math w{crit} = 2\pi f{crit}
This formulation ensures a smooth transition of the flange position towards the reference,
exhibiting the linear phase characteristics of a Bessel filter. The flange's velocity `v`
and acceleration `a` are also calculated. Initially, the flange position `s` is set to the
reference position `s_ref`.
"""</span>
<span class="hljs-keyword">component</span> Position
<span class="hljs-comment">"Input connector for the reference position signal"</span>
<span class="hljs-symbol">s_ref</span> = <span class="hljs-link"><a href="https://help.juliahub.com/dyad/dev/stdlib/Dyad/connectors/RealInput.html">RealInput</a></span>() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
<span class="hljs-comment">"Output connector representing the mechanical translational flange"</span>
<span class="hljs-symbol">flange</span> = <span class="hljs-link"><a href="https://help.juliahub.com/dyad/dev/stdlib/Dyad/connectors/Flange.html">Flange</a></span>() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
<span class="hljs-comment">"State variable for the actual position of the flange"</span>
<span class="hljs-keyword">variable</span> <span class="hljs-symbol">s</span>::<span class="hljs-link"><a href="https://help.juliahub.com/dyad/dev/stdlib/Dyad/types/Length.html">Length</a></span>
<span class="hljs-comment">"User-defined critical frequency of the Bessel filter in Hertz"</span>
<span class="hljs-keyword">parameter</span> <span class="hljs-symbol">f_crit</span>::<span class="hljs-link"><a href="https://help.juliahub.com/dyad/dev/stdlib/Dyad/types/Frequency.html">Frequency</a></span> = 0.0
<span class="hljs-comment">"Pre-defined s-coefficient for the Bessel filter's characteristic polynomial"</span>
<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">af</span>::<span>Real</span> = 1.3617
<span class="hljs-comment">"Pre-defined s^2-coefficient for the Bessel filter's characteristic polynomial"</span>
<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">bf</span>::<span>Real</span> = 0.6180
<span class="hljs-comment">"Calculated critical angular frequency in rad/s (2*pi*f_crit)"</span>
<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">w_crit</span>::<span>Real</span> = 2 * π * f_crit
<span class="hljs-comment">"State variable for the velocity of the flange"</span>
<span class="hljs-keyword">variable</span> <span class="hljs-symbol">v</span>::<span class="hljs-link"><a href="https://help.juliahub.com/dyad/dev/stdlib/Dyad/types/Velocity.html">Velocity</a></span>
<span class="hljs-comment">"State variable for the acceleration of the flange"</span>
<span class="hljs-keyword">variable</span> <span class="hljs-symbol">a</span>::<span class="hljs-link"><a href="https://help.juliahub.com/dyad/dev/stdlib/Dyad/types/Acceleration.html">Acceleration</a></span>
<span class="hljs-keyword">relations</span>
<span class="hljs-keyword">initial</span> s = s_ref
v = der(s)
a = der(v)
a = ((s_ref - s) * w_crit - af * v) * (w_crit / bf)
flange.s = s
<span class="hljs-keyword">metadata</span> {"Dyad": {"icons": {"default": "dyad://TranslationalComponents/Position.svg"}}}
<span class="hljs-keyword">end</span></code></pre>
Flattened Source
"""
Forced movement of a flange according to a reference position
Forces a translational flange to track a reference position input via a second-order Bessel filter.
This component drives the translational position 's' of its 'flange' to follow an external reference signal `s_ref`.
The movement is smoothed by a second-order linear filter, configured as a Bessel filter using the
parameters `f_crit` (critical frequency), `af` (s-coefficient), and `bf` (s²-coefficient).
The control input `s_ref` dictates the target position.
The core dynamic relationship, ensuring smooth tracking, is given by the differential equation:math \frac{bf}{w{crit}^2} \frac{d^2s}{dt^2} + \frac{af}{w{crit}} \frac{ds}{dt} + s = s_{ref}
where the critical angular frequency 'w_crit' is defined as:
math w{crit} = 2\pi f{crit}
This formulation ensures a smooth transition of the flange position towards the reference,
exhibiting the linear phase characteristics of a Bessel filter. The flange's velocity `v`
and acceleration `a` are also calculated. Initially, the flange position `s` is set to the
reference position `s_ref`.
"""</span>
<span class="hljs-keyword">component</span> Position
<span class="hljs-comment">"Input connector for the reference position signal"</span>
<span class="hljs-symbol">s_ref</span> = <span>RealInput</span>() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
<span class="hljs-comment">"Output connector representing the mechanical translational flange"</span>
<span class="hljs-symbol">flange</span> = <span>Flange</span>() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
<span class="hljs-comment">"State variable for the actual position of the flange"</span>
<span class="hljs-keyword">variable</span> <span class="hljs-symbol">s</span>::<span>Length</span>
<span class="hljs-comment">"User-defined critical frequency of the Bessel filter in Hertz"</span>
<span class="hljs-keyword">parameter</span> <span class="hljs-symbol">f_crit</span>::<span>Frequency</span> = 0.0
<span class="hljs-comment">"Pre-defined s-coefficient for the Bessel filter's characteristic polynomial"</span>
<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">af</span>::<span>Real</span> = 1.3617
<span class="hljs-comment">"Pre-defined s^2-coefficient for the Bessel filter's characteristic polynomial"</span>
<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">bf</span>::<span>Real</span> = 0.6180
<span class="hljs-comment">"Calculated critical angular frequency in rad/s (2*pi*f_crit)"</span>
<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">w_crit</span>::<span>Real</span> = 2 * π * f_crit
<span class="hljs-comment">"State variable for the velocity of the flange"</span>
<span class="hljs-keyword">variable</span> <span class="hljs-symbol">v</span>::<span>Velocity</span>
<span class="hljs-comment">"State variable for the acceleration of the flange"</span>
<span class="hljs-keyword">variable</span> <span class="hljs-symbol">a</span>::<span>Acceleration</span>
<span class="hljs-keyword">relations</span>
<span class="hljs-keyword">initial</span> s = s_ref
v = der(s)
a = der(v)
a = ((s_ref - s) * w_crit - af * v) * (w_crit / bf)
flange.s = s
<span class="hljs-keyword">metadata</span> {"Dyad": {"icons": {"default": "dyad://TranslationalComponents/Position.svg"}}}
<span class="hljs-keyword">end</span></code></pre>
Test Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses