digital-brain/content/zettels/feedforward_control.md

143 lines
6.8 KiB
Markdown

+++
title = "Feedforward Control"
author = ["Dehaeze Thomas"]
draft = false
+++
Tags
:
Depending on the physical system to be controlled, several feedforward controllers can be used:
- <sec:rigid_body_feedforward>
- <sec:fourth_order_feedforward>
- <sec:model_based_feedforward>
## Rigid Body Feedforward {#rigid-body-feedforward}
<span class="org-target" id="org-target--sec-rigid-body-feedforward"></span>
Second order trajectory planning: the acceleration and velocity can be bound to wanted values.
Such trajectory is shown in Figure [1](#figure--fig:feedforward-second-order-trajectory).
<a id="figure--fig:feedforward-second-order-trajectory"></a>
{{< figure src="/ox-hugo/feedforward_second_order_trajectory.png" caption="<span class=\"figure-number\">Figure 1: </span>Second order trajectory" >}}
Here, it is supposed that the driven system is a simple mass \\(m\\) with a damper \\(c\\).
In that case, the feedforward force should be:
\begin{equation}
F\_{ff} = m a + c v
\end{equation}
## Fourth Order Feedforward {#fourth-order-feedforward}
<span class="org-target" id="org-target--sec-fourth-order-feedforward"></span>
The main advantage of "fourth order feedforward" is that it takes into account the flexibility in the system (one resonance between the actuation point and the measurement point, see Figure [2](#figure--fig:feedforward-double-mass-system)).
This can lead to better results than second order trajectory planning as demonstrated [here](https://www.20sim.com/control-engineering/snap-feedforward/).
<a id="figure--fig:feedforward-double-mass-system"></a>
{{< figure src="/ox-hugo/feedforward_double_mass_system.png" caption="<span class=\"figure-number\">Figure 2: </span>Double mass system" >}}
The equations of motion are:
\begin{align}
m\_1 \ddot{x}\_1 &= -c\_1 \dot{x}\_1 - k(x\_1 - x\_2) - c (\dot{x}\_1 - \dot{x}\_2) + F \\\\
m\_2 \ddot{x}\_2 &= k(x\_1 - x\_2) + c (\dot{x}\_1 - \dot{x}\_2)
\end{align}
From the equation of motion, two transfer functions are computed:
\begin{align}
\frac{x\_2}{F}(s) &= \frac{c s + k}{(m\_1 s^2 + c\_1 s)(m\_2 s^2 + c s + k) + m\_2 s^2 (cs + k)} \\\\
\frac{x\_1}{F}(s) &= \frac{m\_2 s^2 + c s + k}{(m\_1 s^2 + c\_1 s)(m\_2 s^2 + c s + k) + m\_2 s^2 (cs + k)}
\end{align}
Depending on whether \\(x\_1\\) or \\(x\_2\\) is to be positioned, two feedforward controllers can be used.
If \\(x\_2\\) is to be positioned, the ideal feedforward force \\(F\_{f2}\\) is:
\begin{equation}
F\_{f2} = \frac{q\_1 s^4 + q\_2 s^3 + q\_3 s^2 + q\_4 s}{k\_{12} s + c} \cdot x\_2
\end{equation}
with:
\begin{align}
q\_1 &= m\_1 m\_2 \\\\
q\_2 &= (m\_1 + m\_2) k\_{12} + m\_1 k\_2 + m\_2 k\_1 \\\\
q\_3 &= (m\_1 + m\_2)c + k\_1 k\_2 + (k\_1 + k\_2) k\_{12} \\\\
q\_4 &= (k\_1 + k\_2) c
\end{align}
This means that if a fourth-order trajectory for \\(x\_2\\) is used, the feedforward architecture shown in Figure [3](#figure--fig:feedforward-fourth-order-feedforward-architecture) can be used:
\begin{equation}
F\_{f2} = \frac{1}{k\_12 s + c} (q\_1 d + q\_2 j + q\_3 q + q\_4 v)
\end{equation}
<a id="figure--fig:feedforward-fourth-order-feedforward-architecture"></a>
{{< figure src="/ox-hugo/feedforward_fourth_order_feedforward_architecture.png" caption="<span class=\"figure-number\">Figure 3: </span>Fourth order feedforward implementation" >}}
Similarly, if \\(x\_1\\) is to be positioned, the perfect feedforward force \\(F\_{f1}\\) is:
\begin{equation}
F\_{f1} = \frac{1}{m\_2 s^2 + c s + k} \cdot (q\_1 s + q\_2 j + q\_3 a + q\_4 v)
\end{equation}
with:
\begin{align}
q\_1 &= m\_1 m\_2 \\\\
q\_2 &= (m\_1 + m\_2) c + m\_2 c\_1 \\\\
q\_3 &= (m\_1 + m\_2) k + c\_1 c \\\\
q\_4 &= c\_1 k
\end{align}
and \\(s\\) the snap, \\(j\\) the jerk, \\(a\\) the acceleration and \\(v\\) the velocity.
The same architecture shown in Figure [3](#figure--fig:feedforward-fourth-order-feedforward-architecture) can be used.
In order to implement a fourth order trajectory, look at [this](https://www.mathworks.com/matlabcentral/fileexchange/16352-advanced-setpoints-for-motion-systems) nice implementation in Simulink of fourth-order trajectory planning (see also (<a href="#citeproc_bib_item_1">Lambrechts, Boerlage, and Steinbuch 2004</a>)).
## Model Based Feedforward Control for Second Order resonance plant {#model-based-feedforward-control-for-second-order-resonance-plant}
<span class="org-target" id="org-target--sec-model-based-feedforward"></span>
See (<a href="#citeproc_bib_item_2">Schmidt, Schitter, and Rankers 2020</a>) (Section 4.2.1).
Suppose we have a second order plant (could typically be a piezoelectric stage):
\\[ G(s) = \frac{C\_f \omega\_0^2}{s^2 + 2\xi \omega\_0 s + \omega\_0^2} \\]
<a id="figure--fig:feedforward-second-order-plant"></a>
{{< figure src="/ox-hugo/feedforward_second_order_plant.png" caption="<span class=\"figure-number\">Figure 4: </span>Bode plot of a second order system with fitted model" >}}
The idea is to design a feedforward controller that corresponds to the plant inverse:
\\[ C\_{ff}(s) = \frac{s^2 + 2\xi \omega\_0 s + \omega\_0^2}{C\_f \omega\_0^2} \\]
This controller has a pair of zeros, corresponding to an anti-resonance at the eigenfrequency of the first eigenmode of the system, with equal damping.
The controller needs to be modified in such a way that it becomes realisable.
In this case it is decided to create a resulting overall transfer function of the controller and the plant that acts like a well damped mass-spring system with the same natural frequency as the plant and an additional reduction of the excitation of higher frequency eigenmodes.
In order to realise this controller first two poles have to be added, placed at the same frequency as the resonance but with a higher damping ratio.
Typically a damping ratio between aperiodic and critical (\\(0.7 < \xi < 1\\)) is applied to avoid oscillations.
For \\(\xi = 1\\) this results in the following transfer function:
\\[ C\_{ff}(s) = \frac{s^2 + 2\xi \omega\_0 s + \omega\_0^2}{s^2 + 2 \cdot 1 \cdot \omega\_0 s + \omega\_0^2}\\]
<a id="figure--fig:feedforward-compensated-system"></a>
{{< figure src="/ox-hugo/feedforward_compensated_system.png" caption="<span class=\"figure-number\">Figure 5: </span>Bode plot of the feedforward controlled system" >}}
<style>.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}</style><div class="csl-bib-body">
<div class="csl-entry"><a id="citeproc_bib_item_1"></a>Lambrechts, P., M. Boerlage, and M. Steinbuch. 2004. “Trajectory Planning and Feedforward Design for High Performance Motion Systems.” In <i>Proceedings of the 2004 American Control Conference</i>, nil. doi:<a href="https://doi.org/10.23919/acc.2004.1384042">10.23919/acc.2004.1384042</a>.</div>
<div class="csl-entry"><a id="citeproc_bib_item_2"></a>Schmidt, R Munnig, Georg Schitter, and Adrian Rankers. 2020. <i>The Design of High Performance Mechatronics - Third Revised Edition</i>. Ios Press.</div>
</div>