Add text about module margin

This commit is contained in:
Thomas Dehaeze 2020-12-01 00:23:13 +01:00
parent 5c01eca88c
commit 1065724fb5
6 changed files with 611 additions and 296 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

File diff suppressed because it is too large Load Diff

215
index.org
View File

@ -39,7 +39,18 @@
#+PROPERTY: header-args:latex+ :post pdf2svg(file=*this*, ext="png")
:END:
* TODO Introduction :ignore:
* Introduction :ignore:
This document is structured as follows:
- As $\mathcal{H}_\infty$ Control is a /model based/ control technique, a short introduction to model based control is given in Section [[sec:model_based_control]]
- Classical /open/ loop shaping method is presented in Section [[sec:open_loop_shaping]].
It is also shown that $\mathcal{H}_\infty$ synthesis can be used for /open/ loop shaping.
- $\mathcal{H}_\infty$
Important concepts such as the $\mathcal{H}_\infty$ norm and the generalized plant are introduced.
- A
- Finally, an complete example of the
is performed in Section [[sec:h_infinity_mixed_sensitivity]].
* Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
<<matlab-dir>>
@ -53,7 +64,7 @@
addpath('matlab')
#+end_src
* Introduction to the Control Methodology - Model Based Control
* Introduction to Model Based Control
<<sec:model_based_control>>
** Model Based Control - Methodology
@ -101,7 +112,12 @@ It consists of three steps:
In this document, we will mainly focus on steps 2 and 3.
** Some Background: From Classical Control to Robust Control
Step 2 will be discussed in Section [[sec:modern_interpretation_specification]].
There are two main methods for the controller synthesis (step 3):
- /open/ loop shaping discussed in Section [[sec:open_loop_shaping]]
- /closed/ loop shaping discussed in Sections [[sec:modern_interpretation_specification]] and [[sec:h_infinity_mixed_sensitivity]]
** From Classical Control to Robust Control
<<sec:comp_classical_modern_robust_control>>
#+name: tab:comparison_control_methods
@ -117,9 +133,8 @@ In this document, we will mainly focus on steps 2 and 3.
| | Phase and Gain margins | | Weighting Functions |
| | | | Disk margin |
|-------------------------+------------------------------------+--------------------------------------+-------------------------------------------------------------------------|
| *Control Architectures* | Proportional, Integral, Derivative | Full State Feedback | General Control Configuration |
| | Leads, Lags | LQR, LQG | |
| | | Kalman Filters | |
| *Control Architectures* | Proportional, Integral, Derivative | Full State Feedback, LQR | General Control Configuration |
| | Leads, Lags | Kalman Filters, LQG | Generalized Plant |
|-------------------------+------------------------------------+--------------------------------------+-------------------------------------------------------------------------|
| *Advantages* | Study Stability | Automatic Synthesis | Automatic Synthesis |
| | Simple | MIMO | MIMO |
@ -508,7 +523,7 @@ Let's take our example system and try to apply the Open-Loop shaping strategy to
#+begin_exercice
Using =SISOTOOL=, design a controller that fulfill the specifications.
#+begin_src matlab :eval no
#+begin_src matlab :eval no :tangle no
sisotool(G)
#+end_src
#+end_exercice
@ -583,7 +598,7 @@ The Open Loop Shaping synthesis can be performed using the $\mathcal{H}_\infty$
Even though we will not go into details, we will provide one example.
Using Matlab, the $\mathcal{H}_\infty$ Loop Shaping Synthesis can be performed using the =loopsyn= command:
#+begin_src matlab :eval no
#+begin_src matlab :eval no :tangle no
K = loopsyn(G, Gd);
#+end_src
where:
@ -852,7 +867,7 @@ It can indeed represent feedback as well as feedforward control architectures.
| $u$ | Control signals |
#+end_important
** The General Synthesis Problem Formulation
** The $\mathcal{H}_\infty$ Synthesis applied on the Generalized plant
<<sec:h_infinity_general_synthesis>>
Once the generalized plant is obtained, the $\mathcal{H}_\infty$ synthesis problem can be stated as follows:
@ -897,7 +912,7 @@ Note that the closed-loop transfer function from $w$ to $z$ is:
\end{equation}
Using Matlab, the $\mathcal{H}_\infty$ Synthesis applied on a Generalized plant can be applied using the =hinfsyn= command ([[https://www.mathworks.com/help/robust/ref/hinfsyn.html][documentation]]):
#+begin_src matlab :eval no
#+begin_src matlab :eval no :tangoe no
K = hinfsyn(P, nmeas, ncont);
#+end_src
where:
@ -997,27 +1012,27 @@ Using Matlab, the generalized plant can be defined as follows:
** Introduction
As shown in Section [[sec:open_loop_shaping]], the loop gain $L(s) = G(s) K(s)$ is a useful and easy tool for the design of controllers by hand.
As shown in Section [[sec:open_loop_shaping]], the loop gain $L(s) = G(s) K(s)$ is a useful and easy tool for the manual design of controllers.
It is very easy to shape as it depends linearly on $K(s)$.
Moreover, it gives information on important quantities such as the stability margins and the control bandwidth.
$L(s)$ is very easy to shape as it depends linearly on $K(s)$.
Moreover, important quantities such as the stability margins and the control bandwidth can be estimated from the shape/phase of $L(s)$.
However, the loop gain $L(s)$ does *not* directly give the performances of the closed-loop system.
The closed loop system behavior is determined by the *closed-loop transfer functions*.
The closed loop system behavior is indeed determined by the *closed-loop* transfer functions.
If we consider the feedback system shown in Figure [[fig:gang_of_four_feedback]], we can link to the following specifications to closed-loop transfer functions
- *Reference tracking* (Overshoot, Static error, Settling time, ...)
- From $r$ to $\epsilon$
- *Disturbances rejection*
- From $d$ to $y$
- *Measurement noise filtering*
- From $n$ to $y$
- *Small command amplitude*
- From $n, r, d$ to $u$
- *Stability*
- All closed-loop transfer functions must be stable
- *Robustness* (stability margins)
- Module margin (see Section [[sec:module_margin]])
If we consider the feedback system shown in Figure [[fig:gang_of_four_feedback]], we can link to the following specifications to closed-loop transfer functions.
This is summarized in Table [[tab:spec_closed_loop_tf]].
#+name: tab:spec_closed_loop_tf
#+caption: Typical Specification and associated closed-loop transfer function
| Specification | Closed-Loop Transfer Function |
|--------------------------------+-----------------------------------------------|
| Reference Tracking | From $r$ to $\epsilon$ |
| Disturbance Rejection | From $d$ to $y$ |
| Measurement Noise Filtering | From $n$ to $y$ |
| Small Command Amplitude | From $n,r,d$ to $u$ |
| Stability | All closed-loop transfer function |
| Robustness (stability margins) | Module margin (see Section [[sec:module_margin]]) |
#+begin_src latex :file gang_of_four_feedback.pdf
\begin{tikzpicture}
@ -1202,12 +1217,152 @@ Similarly, to reduce the effect of measurement noise $n$ on the output $y$, we w
** Robustness: Module Margin
<<sec:module_margin>>
- [ ] Definition of Module margin
- [ ] Why it represents robustness
- [ ] Example
Let's start by an example demonstrating why the phase and gain margins might not be good indicators of robustness.
#+begin_exampl
Let's consider the following plant:
#+begin_src matlab
w0 = 2*pi*100;
xi = 0.1;
k = 1e7;
Gt = 1/k*(s/w0/4 + 1)/(s^2/w0^2 + 2*xi*s/w0 + 1);
#+end_src
Let's say we have designed a controller that gives the loop gain shown in Figure [[fig:phase_gain_margin_model_plant]] where the following characteristics can be determined:
- bandwidth of $\approx 10\, \text{Hz}$
- infinite gain margin (the phase of the loop-gain never reaches -180 degrees
- more than 90 degrees of phase margin
This might indicate very good robustness properties of the closed-loop system.
#+begin_src matlab
Kt = 1.2e6*(s + w0)/s;
#+end_src
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
ax1 = nexttile([2,1]);
hold on;
plot(freqs, abs(squeeze(freqresp(Gt*Kt, freqs, 'Hz'))), 'DisplayName', '$L(s)$');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Magnitude'); set(gca, 'XTickLabel',[]);
hold off;
legend('location', 'northeast');
ax2 = nexttile;
hold on;
plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(Gt*Kt, freqs, 'Hz')))));
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
yticks(-360:90:360); ylim([-200, 0]);
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
hold off;
linkaxes([ax1,ax2],'x');
xlim([freqs(1), freqs(end)]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/phase_gain_margin_model_plant.pdf', 'width', 'wide', 'height', 'normal');
#+end_src
#+name: fig:phase_gain_margin_model_plant
#+caption: Bode plot of the obtained Loop Gain $L(s)$
#+RESULTS:
[[file:figs/phase_gain_margin_model_plant.png]]
Now let's suppose the "real" plant =Gr= as a slightly lower damping factor:
#+begin_src matlab
xi = 0.03;
Gr = 1/k*(s/w0/4 + 1)/(s^2/w0^2 + 2*xi*s/w0 + 1);
#+end_src
The obtained loop gain is in Figure [[fig:phase_gain_margin_real_plant]].
It is shown that at a frequency little bit above 100Hz, the phase of the loop gain reaches -180 degrees while its magnitude is more than one which indicated unstability.
It is confirmed by checking the stability of the closed loop system:
#+begin_src matlab :results value replace
isstable(feedback(Gp,K))
#+end_src
#+RESULTS:
: 0
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
ax1 = nexttile([2,1]);
hold on;
plot(freqs, abs(squeeze(freqresp(Gt*Kt, freqs, 'Hz'))), 'DisplayName', '$L(s)$');
plot(freqs, abs(squeeze(freqresp(Gr*Kt, freqs, 'Hz'))), 'DisplayName', '$L_r(s)$');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Magnitude'); set(gca, 'XTickLabel',[]);
hold off;
legend('location', 'northeast');
ax2 = nexttile;
hold on;
plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(Gt*Kt, freqs, 'Hz')))));
plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(Gr*Kt, freqs, 'Hz')))));
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
yticks(-360:90:360); ylim([-200, 0]);
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
hold off;
linkaxes([ax1,ax2],'x');
xlim([freqs(1), freqs(end)]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/phase_gain_margin_real_plant.pdf', 'width', 'wide', 'height', 'normal');
#+end_src
#+name: fig:phase_gain_margin_real_plant
#+caption: Bode plots of $L(s)$ (loop gain corresponding the nominal plant) and $L_r(s)$ (loop gain corresponding to the real plant)
#+RESULTS:
[[file:figs/phase_gain_margin_real_plant.png]]
Therefore, even a small change of the plant parameter makes the system unstable even though both the gain margin and the phase margin for the nominal plant are excellent.
This is due to the fact that the gain and phase margin are indicators to the robustness of the system to a *pure* change or gain or a *pure* change of phase but not a combination of both.
#+end_exampl
#+begin_seealso
To learn more about module (or disk) margin, you can check out [[https://www.youtube.com/watch?v=XazdN6eZF80][this]] video.
#+end_seealso
- [ ] Example why the module margin might be a good alternative
- [ ] Stability => L does not does at the left of point -1
- [ ] => ...
#+begin_definition
The *module margin* $\Delta M$ is defined as the *minimum distance* between the point $-1$ and $L(j\omega) = G(j\omega) K(j\omega)$ in the complex plane.
#+end_definition
The module margin can be visually determined on the Nyquist plot ($L(j\omega)$ from $\omega = -\infty$ to $\infty$ in the complex plane).
- [ ] Example of Nyquist plot and module margin
- [ ] Express the module margin as a function of $\|S\|_\infty$
\[ M_S < 2 \Rightarrow \text{GM} > 2 \text{ and } \text{PM} > 29^o \]
#+begin_important
Large peak value of $S$ indicate robustness problems.
The wanted robustness of the closed-loop system can there be specified by setting a maximum value on $\|S\|_\infty$.
#+end_important
** How to *Shape* transfer function? Using of Weighting Functions!
<<sec:weighting_functions>>