digital-brain/content/zettels/extremum_seeking_control.md

9.3 KiB
Raw Blame History

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

Tags
[Nonlinear Control]({{< relref "nonlinear_control.md" >}})

The idea behind "Extremum Seeking Control" is to use a controlled signal \(u\) to explore the relation \(y(u)\), estimate its gradient and find its minimum or maximum. This relation should be convex or concave for the architecture to work properly.

See (Tan et al. 2010) for a good overview.

Control Architecture

There are many extremum seeking control architectures. One of the simplest one is shown in Figure 1.

\begin{tikzpicture}[
  triangle/.style = {regular polygon, regular polygon sides=3},
  right/.style = {shape border rotate=-90},
  left/.style = {shape border rotate=90},
  top/.style = {shape border rotate=0}
  bottom/.style = {shape border rotate=180}
  ]
  % Extremum Seeking
  \node[draw, minimum width=10cm,minimum height=4.2cm, dashed, label=Extremum Seeking Control] (extremum) at (0, 0) {};
  \begin{scope}[shift={(-2.3, 0.7)}]
    \node[draw, label=Adapt] (Adapt) at (0, 0) {$\displaystyle\frac{1}{A_p}\frac{K_I}{s}$};
    \node[draw, label=LPF] (LPF) at (2, 0) {$\displaystyle\frac{1}{s/\omega_{L} + 1}$};
    \node[addb={\times}{}{}{}{}] (multiply) at (4, 0) {};
    \node[draw, label=HPF] (HPF) at (6, 0) {$\displaystyle\frac{s/\omega_{H}}{s/\omega_{H} + 1}$};
    \node[addb={+}{}{}{}{}] (add) at (-2, 0) {};
    \node[draw, triangle, left, inner sep=0pt] (gain_a) at (1, -2) {$A_p$};

    \node[] (sinus) at (4, -2) {$\sin(\omega_p t)$};

    \draw[<-] (add) -- node[above]{$\overline{u}$} (Adapt);
    \draw[<-] (Adapt) -- node[above left]{} (LPF);
    \draw[<-] (LPF) -- node[above left]{} (multiply);
    \draw[<-] (multiply) -- node[above left]{} (HPF);
    \draw[<-] (multiply) -- node[above right]{} (sinus);
    \draw[<-] (gain_a) -- node[above left]{} (sinus);
    \draw[<-] (add) -- node[above right]{$du$} (-2, -2) -- (gain_a);
  \end{scope}

  % Système
  \node[draw, fill=black!20!white, minimum width=10cm,minimum height=3cm, label=System] (system) at (0, 4.5) {};
  \begin{scope}[shift={(-2.5, 0.6)}]
    % AC function of C_phi
    \draw[domain=-1.5:1.5, shift={(2.5, 3)}] plot (2*\x, 0.8*\x*\x);
    % Axes of plot
    \draw[->] (-1, 2.8) -- (6, 2.8) node[above right]{$u$};
    \draw[->] (-0.9, 2.7) -- (-0.9, 5) node[below left]{$y$};
  \end{scope}

  % Connections
  \draw[<-] (system.west) node[above left](command){$u$} -- ++(-0.7, 0) |- (add);
  \draw[->] (system.east) node[above right](measure){$y$} -- ++(0.7, 0) |- (HPF);
\end{tikzpicture}

{{< figure src="/ox-hugo/extremum_seeking_control_architecture.png" caption="<span class="figure-number">Figure 1: Extremum seeking control algorithm" >}}

Its working principle is schematically shown in Figures 2 and 3.

\begin{tikzpicture}
  % AC function of phi0
  \draw[domain=-2:2] plot (\x, \x*\x);
  % Axes of plot
  \draw[->, >=latex] (-2.5 ,-0.5) -- (2.5, -0.5) node[below]{$u$};
  \draw[->, >=latex] (-2.4 ,-0.6) -- (-2.4, 4.5) node[left]{$y$};

  % Perturbation Signal
  \draw[domain=-pi/2:pi/2, shift={(1, -1.5)}, rotate=90, samples=200] plot (\x,{0.5*sin(4*deg(\x))});
  % Legend of perturbation Signal
  \node[align=center] (pert_signal) at (-2, -1.8) {$\overline{u}$\\[-0.4em]+\\[-0.4em]$A_p\sin(\omega_p t)$};
  \draw[<-, >=latex, dashed] ($(pert_signal.east)+(1.0, 0)$) -- ++(-1.5, 0);

  % Dashed lines to show limits of the signals
  \draw[dashed] (1.0, -3.2) -- ($(1.0, 1.0*1.0)$) -- ($(4.0, 1.0*1.0)$);
  \draw[dashed] (0.5, -3.2) -- ($(0.5, 0.5*0.5)$) -- ($(8.0, 0.5*0.5)$);
  \draw[dashed] (1.5, -3.2) -- ($(1.5, 1.5*1.5)$) -- ($(8.0, 1.5*1.5)$);

  \begin{scope}[shift={(-0.5, 0)}]
    % Image of the perturbation signal on AC
    \draw[domain=-pi/2:pi/2, shift={(6, 0)}, samples=200] plot (\x,{(1+0.5*sin(4*deg(\x)))^2});
    \draw[->, >=latex] (4, 1) -- (8, 1) node[below]{$t$};
    \draw[->, >=latex] (4.1, 0.9) -- (4.1, 1.5*1.5+0.4) node[left]{$y$};

    % Sinus omega_p
    \draw[domain=-pi/2:pi/2, shift={(6, 4)}, samples=200] plot (\x,{0.5*sin(4*deg(\x))});
    \draw[->, >=latex] (4, 4) -- (8, 4) node[below]{$t$};
    \draw[->, >=latex] (4.1, 3.75) -- (4.1, 4.5) node[left]{$\sin(\omega_p t)$};

    % Product of the sinus and the AC Command
    \draw[domain=-pi/2:pi/2, shift={(6, -2.5)}, samples=200] plot (\x,{0.5*sin(4*deg(\x))*(1+0.5*sin(4*deg(\x)))^2});
    \draw[->, >=latex] (4,-2.5) -- (8, -2.5) node[below]{$t$};
    \filldraw[fill=gray!20] (4,-2.5) -- plot [domain=-pi/2:pi/2, shift={(6, -2.5)}, samples=200] (\x,{0.5*sin(4*deg(\x))*(1+0.5*sin(4*deg(\x)))^2}) -- cycle;
    \draw[->, >=latex] (4.1,-2.6) -- (4.1, -1.0) node[left]{$ $};

    % Multiply and equal signs
    \node[addb={\times}{}{}{}{}] at (6, 3) {};
    \node[addb={=}{}{}{}{}] at (6, -0.6) {};
  \end{scope}
\end{tikzpicture}

{{< figure src="/ox-hugo/extremum_seeking_control_non_minimum.png" caption="<span class="figure-number">Figure 2: \(\bar{u}\) is not at the minimum of the \(y(u)\) relation. In that case the integral of the product between the sinusoidal excitation and the measured \(y\) is the image of the local gradient of the \(y(u)\) relationship." >}}

\begin{tikzpicture}
  % AC function of phi0
  \draw[domain=-2:2] plot (\x, \x*\x);
  % Axes of plot
  \draw[->, >=latex] (-2.5 ,-0.5) -- (2.5, -0.5) node[below]{$u$};
  \draw[->, >=latex] (-2.4 ,-0.6) -- (-2.4, 4.5) node[left]{$y$};

  % Perturbation Signal
  \draw[domain=-pi/2:pi/2, shift={(0, -1.5)}, rotate=90, samples=200] plot (\x,{0.5*sin(4*deg(\x))});
  % Legend of perturbation Signal
  \node[] (pert_signal) at (-2, -1.0) {};

  % Dashed lines to show limits of the signals
  \draw[dashed] (0.0, -3.2) -- ($(0, 0)$) -- ($(4.0, 0)$);
  \draw[dashed] (-0.5, -3.2) -- ($(-0.5, 0.5*0.5)$) -- ($(8.0, 0.5*0.5)$);
  \draw[dashed] (0.5, -3.2) -- ($(0.5, 0.5*0.5)$);

  \begin{scope}[shift={(-0.5, 0)}]
    % Image of the perturbation signal on AC
    \draw[domain=-pi/2:pi/2, shift={(6, 0)}, samples=200] plot (\x,{(0.5*sin(4*deg(\x)))^2});
    \draw[->, >=latex] (4, 0) -- (8,  0) node[below]{$t$};
    \draw[->, >=latex] (4.1, -0.1) -- (4.1, 1.0) node[left]{$y$};

    % Sinus omega_p
    \draw[domain=-pi/2:pi/2, shift={(6, 2.5)}, samples=200] plot (\x,{0.5*sin(4*deg(\x))});
    \draw[->, >=latex] (4, 2.5) -- (8, 2.5) node[below]{$t$};
    \draw[->, >=latex] (4.1, 2.25) -- (4.1, 3.0) node[above]{$\sin(\omega_p t)$};

    % Product of the sinus and the AC Command
    \draw[domain=-pi/2:pi/2, shift={(6, -2.5)}, samples=200] plot (\x,{0.7*(sin(4*deg(\x)))^3});
    \draw[->, >=latex] (4,-2.5) -- (8, -2.5) node[below]{$t$};
    \filldraw[fill=gray!20] (4,-2.5) -- plot [domain=-pi/2:pi/2, shift={(6, -2.5)}, samples=200] (\x,{0.7*(sin(4*deg(\x))^3}) -- cycle;
    \draw[->, >=latex] (4.1,-2.6) -- (4.1, -1.0) node[left]{$ $};

    % Multiply and equal signs
    \node[addb={\times}{}{}{}{}] at (6, 1.2) {};
    \node[addb={=}{}{}{}{}] at (6, -1.0) {};
  \end{scope}
\end{tikzpicture}

{{< figure src="/ox-hugo/extremum_seeking_control_minimum.png" caption="<span class="figure-number">Figure 3: \(\bar{u}\) is at the minimum of the \(y(u)\) relation. In that case the integral of the product between the sinusoidal excitation and the measured \(y\) is null." >}}

Tuning of the Extremum Seeking Control

The \(y(u)\) relationship should be static compared to \(\omega_p\) the frequency of the sinusoidal excitation.

When this architecture is to be applied the following two signals have to be properly chosen:

  • what is the controlled signal \(u\)
  • what is the measured signal to be minimized \(y\)

Then, the following parameters should be tuned:

  • \(\omega_p\): the frequency of the perturbation, that should be small compared to the system dynamics
  • \(A_p\): amplitude of the sinusoidal perturbation, that should be small compared to the allowed deviation from the minimum
  • \(\omega_H\) and \(\omega_L\): cut-off frequency of the high pass and low pass filters. As \(\omega_p\) should be in the pass band of both filters, \(\omega_H\) and \(\omega_L\) should be chosen such that: \[ \omega_H \ll \omega_p \quad \text{and} \quad \omega_L \gg \omega_p \]
  • \(K_I\): gain for the integrator that should be tuned such that the control loop is stable and converges to the minimum as fast as wanted.

There are three time scales present in this control algorithm:

  • Fast time scale that corresponds to the system variations (\(y(u)\) relationship)
  • Medium time scale that corresponds to the perturbations on \(u\) (frequency \(\omega_p\))
  • Slow time scale that corresponds to the variations of \(\bar{u}\)

Bibliography

Tan, Y, WH Moase, C Manzie, D Nešić, and IMY Mareels. 2010. “Extremum Seeking from 1922 to 2010.” In Control Conference (CCC), 2010 29th Chinese, 1426. IEEE.