digital-brain/content/zettels/feedforward_control.md

11 KiB

+++ title = "Feedforward Control" author = ["Dehaeze Thomas"] draft = false +++

Tags :

Depending on the physical system to be controlled, several feedforward controllers can be used:

Rigid Body Feedforward

Second order trajectory planning: the acceleration and velocity can be bound to wanted values.

Such trajectory is shown in 1.

{{< figure src="/ox-hugo/feedforward_second_order_trajectory.png" caption="<span class="figure-number">Figure 1: 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

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 2). This can lead to better results than second order trajectory planning as demonstrated here.

{{< figure src="/ox-hugo/feedforward_double_mass_system.png" caption="<span class="figure-number">Figure 2: 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 3 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}

{{< figure src="/ox-hugo/feedforward_fourth_order_feedforward_architecture.png" caption="<span class="figure-number">Figure 3: 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 3 can be used.

In order to implement a fourth order trajectory, look at this nice implementation in Simulink of fourth-order trajectory planning (see also (Lambrechts, Boerlage, and Steinbuch 2004)).

Model Based Feedforward Control for Second Order resonance plant

See (Schmidt, Schitter, and Rankers 2020) (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} \]

{{< figure src="/ox-hugo/feedforward_second_order_plant.png" caption="<span class="figure-number">Figure 4: 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}\]

{{< figure src="/ox-hugo/feedforward_compensated_system.png" caption="<span class="figure-number">Figure 5: Bode plot of the feedforward controlled system" >}}

Advanced Feedforward (from MIMO training)

A typical control configuration for motion systems consists of:

  • A setpoint generator (SPG)
  • A feedback controller (\(K_{fb}\))
  • A feedforward controller (\(K_{ff}\))

{{< figure src="/ox-hugo/feedforward_schematic.png" >}}

The closed-loop error (no disturbances) is: \[ e(s) = (1 + G(s)K_{fb})^{-1} (1 - G(s)K_{ff}(s)) r(s) \] It therefore depends on:

  1. the setpoint \(r\)
  2. the feedforward controller
  3. the feedback controller

Setpoint generation:

  • It can be 2nd order, 3rd order or 4th order
  • For 4th order, derivative of jerk is generated over time, and then integrated 4 times to give: jerk, acceleration, velocity and position.

2nd order setpoint generation: If we compute the fourier transform of the generated acceleration, we get the following signal (-20db/dec).

{{< figure src="/ox-hugo/feedforward_2nd_order_fourier.png" >}}

Notches are at \(f_1\), \(2f_1\), \(3f_1\), ... with \(f_1 = \frac{a_{\text{max}}}{v_{\text{max}}}\). It is therefore possible to choose the velocity and acceleration such that \(f_1\) (or one of its integral multiple) matches the resonance frequency of the system. Therefore, the acceleration time constant can be chosen at the inverse of the plant resonance.

3rd order setpoint generation: There is a drawback of having an extra time of \(\frac{a_{max}}{J_{max}}\) seconds. However, we get an additional -20db/dec at high frequency, and additional notches at \(f_2 = \frac{j_{max}}{a_{max}}\). This new notch has larger "damping" and can be used to be more robust against resonances of the plant.

Feedforward control: Plant inversion: if \(K_{ff} = G^{-1}(s) \Longrightarrow e(s) = 0\) Challenges:

  • Model required
  • High order
  • Delay/non-minimum phase?

Rigid body dynamics: \(G(s) = \frac{1}{ms^2}\) In that case, \(G^{-1}(s) = ms^2\), and with 2nd order setpoint, a feedforward controller \(K_{ff}(s) = m\) gives good performances.

{{< figure src="/ox-hugo/feedforward_schematic_rigid_body.png" >}}

Discrete time implementation. The DAC can usually be modelled by a "Zero Order Hold" (ZOH) and the ADC with a "sampler". This adds 1.5 samples of delay: \(0.5z^{-1} + 0.5z^{-2}\).

It seems the ZOH can be modelled by an "half-sample delay". There is an additional one sample delay.

{{< figure src="/ox-hugo/feedforward_schematic_zoh_sampler.png" >}}

Therefore, it is very important to match the delay of the plant:

In high-performance control system, it can be useful to consider propagation delay when designing the feedforward and feedback controllers. Feedforward control directly uses the reference trajectory and does not depend on any measurement data. However, the feedback controller uses (delayed) measured position data. Due to propagation delay in the control system (caused by the controller, actuator or sensor), it can take multiple cycles for the effect of feedforward control to be observed in the measured position. In the meantime, the feedback control is already seeing a tracking error and is compensating for it. Essentially, the result of the feedforward action arrives too late, resulting in possible overcompensation by the feedback control. When the propagation delay in the control system is known, it can be compensated for by applying this same delay to the demand position in the tracking error calculation.

{{< figure src="/ox-hugo/feedforward_schematic_delay.png" >}}

Feedforward for flexible dynamics: 4th order dynamics:

{{< figure src="/ox-hugo/feedforward_4th_order.png" >}}

Dynamics from \(F\) to \(x_2\) is: \[ G(s) = \frac{x_2}{F} = \frac{cs + k}{m_1m_2 s^2(s^2 + 2\xi\omega_0 s + \omega_0^2)} \] We take the inverse for the feedforward controller: \[ K_{ff}(s) = G^{-1}(s) = \frac{m_1m_2 s^2(s^2 + 2\xi\omega_0 s + \omega_0^2)}{cs + k} \] If we neglect damped: \(\xi = 0\), and we get: \[ K_{ff}(s) = \underbrace{\frac{m_1m_2}{k} s^4}_{\text{snap FF}} + \underbrace{(m_1 + m_2) s^2}_{\text{acc FF}} \] This can be solved by using snap feedforward

{{< figure src="/ox-hugo/feedforward_schematic_snap.png" >}}

Bibliography

Lambrechts, P., M. Boerlage, and M. Steinbuch. 2004. “Trajectory Planning and Feedforward Design for High Performance Motion Systems.” In Proceedings of the 2004 American Control Conference. doi:10.23919/acc.2004.1384042.
Schmidt, R Munnig, Georg Schitter, and Adrian Rankers. 2020. The Design of High Performance Mechatronics - Third Revised Edition. Ios Press.