PositionPosition Icon

Position

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:

NameDescriptionUnitsDefault value
f_critUser-defined critical frequency of the Bessel filter in HertzHz0

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

NameDescriptionUnits
sState variable for the actual position of the flangem
vState variable for the velocity of the flangem/s
aState variable for the acceleration of the flangem/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
&nbsp;&nbsp;<span class="hljs-comment">"Input connector for the reference position signal"</span>
&nbsp;&nbsp;<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}}}}
&nbsp;&nbsp;<span class="hljs-comment">"Output connector representing the mechanical translational flange"</span>
&nbsp;&nbsp;<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}}}}
&nbsp;&nbsp;<span class="hljs-comment">"State variable for the actual position of the flange"</span>
&nbsp;&nbsp;<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>
&nbsp;&nbsp;<span class="hljs-comment">"User-defined critical frequency of the Bessel filter in Hertz"</span>
&nbsp;&nbsp;<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
&nbsp;&nbsp;<span class="hljs-comment">"Pre-defined s-coefficient for the Bessel filter's characteristic polynomial"</span>
&nbsp;&nbsp;<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">af</span>::<span>Real</span> = 1.3617
&nbsp;&nbsp;<span class="hljs-comment">"Pre-defined s^2-coefficient for the Bessel filter's characteristic polynomial"</span>
&nbsp;&nbsp;<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">bf</span>::<span>Real</span> = 0.6180
&nbsp;&nbsp;<span class="hljs-comment">"Calculated critical angular frequency in rad/s (2*pi*f_crit)"</span>
&nbsp;&nbsp;<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
&nbsp;&nbsp;<span class="hljs-comment">"State variable for the velocity of the flange"</span>
&nbsp;&nbsp;<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>
&nbsp;&nbsp;<span class="hljs-comment">"State variable for the acceleration of the flange"</span>
&nbsp;&nbsp;<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>
&nbsp;&nbsp;<span class="hljs-keyword">initial</span> s = s_ref
&nbsp;&nbsp;v = der(s)
&nbsp;&nbsp;a = der(v)
&nbsp;&nbsp;a = ((s_ref - s) * w_crit - af * v) * (w_crit / bf)
&nbsp;&nbsp;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
&nbsp;&nbsp;<span class="hljs-comment">"Input connector for the reference position signal"</span>
&nbsp;&nbsp;<span class="hljs-symbol">s_ref</span> = <span>RealInput</span>() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
&nbsp;&nbsp;<span class="hljs-comment">"Output connector representing the mechanical translational flange"</span>
&nbsp;&nbsp;<span class="hljs-symbol">flange</span> = <span>Flange</span>() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
&nbsp;&nbsp;<span class="hljs-comment">"State variable for the actual position of the flange"</span>
&nbsp;&nbsp;<span class="hljs-keyword">variable</span> <span class="hljs-symbol">s</span>::<span>Length</span>
&nbsp;&nbsp;<span class="hljs-comment">"User-defined critical frequency of the Bessel filter in Hertz"</span>
&nbsp;&nbsp;<span class="hljs-keyword">parameter</span> <span class="hljs-symbol">f_crit</span>::<span>Frequency</span> = 0.0
&nbsp;&nbsp;<span class="hljs-comment">"Pre-defined s-coefficient for the Bessel filter's characteristic polynomial"</span>
&nbsp;&nbsp;<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">af</span>::<span>Real</span> = 1.3617
&nbsp;&nbsp;<span class="hljs-comment">"Pre-defined s^2-coefficient for the Bessel filter's characteristic polynomial"</span>
&nbsp;&nbsp;<span class="hljs-keyword">final</span> <span class="hljs-keyword">parameter</span> <span class="hljs-symbol">bf</span>::<span>Real</span> = 0.6180
&nbsp;&nbsp;<span class="hljs-comment">"Calculated critical angular frequency in rad/s (2*pi*f_crit)"</span>
&nbsp;&nbsp;<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
&nbsp;&nbsp;<span class="hljs-comment">"State variable for the velocity of the flange"</span>
&nbsp;&nbsp;<span class="hljs-keyword">variable</span> <span class="hljs-symbol">v</span>::<span>Velocity</span>
&nbsp;&nbsp;<span class="hljs-comment">"State variable for the acceleration of the flange"</span>
&nbsp;&nbsp;<span class="hljs-keyword">variable</span> <span class="hljs-symbol">a</span>::<span>Acceleration</span>
<span class="hljs-keyword">relations</span>
&nbsp;&nbsp;<span class="hljs-keyword">initial</span> s = s_ref
&nbsp;&nbsp;v = der(s)
&nbsp;&nbsp;a = der(v)
&nbsp;&nbsp;a = ((s_ref - s) * w_crit - af * v) * (w_crit / bf)
&nbsp;&nbsp;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.

  • Examples
  • Experiments
  • Analyses