From 149312376c1f10726c04f1d5318daf6e36921581 Mon Sep 17 00:00:00 2001 From: Tobias Meier Date: Thu, 30 May 2024 18:15:19 +0200 Subject: [PATCH 01/10] feedback linearization started --- src/main.tex | 2 +- .../{nonlinear.tex => nonlinear_systems.tex} | 85 +++++++++++++++++-- 2 files changed, 80 insertions(+), 7 deletions(-) rename src/sections/{nonlinear.tex => nonlinear_systems.tex} (75%) diff --git a/src/main.tex b/src/main.tex index b3d96c1..801f071 100644 --- a/src/main.tex +++ b/src/main.tex @@ -24,7 +24,7 @@ \input{sections/stab_and_perf_robustness.tex} \input{sections/modern_controller_synthesis.tex} \input{sections/h2_hinf_synthesis.tex} - \input{sections/nonlinear.tex} + \input{sections/nonlinear_systems.tex} \newpage \input{sections/Appendix.tex} diff --git a/src/sections/nonlinear.tex b/src/sections/nonlinear_systems.tex similarity index 75% rename from src/sections/nonlinear.tex rename to src/sections/nonlinear_systems.tex index 3f311c3..8b56885 100644 --- a/src/sections/nonlinear.tex +++ b/src/sections/nonlinear_systems.tex @@ -74,8 +74,8 @@ \subsubsection{Lyapunov Functions} \ptitle{Remarks} \begin{itemize} \item If there could be multiplie equilibrium points one needs to use LaSalle. - %TBD: must the "only equilibrium point" from above be (0,...0)? - %TBD: x eventually aproaches the largest pos. inv. set. in which Vdot=0. But are there also pos. inv. sets in which Vdot \neq 0? + %TBD: must the "only equilibrium point" from above be (0,...0)? + %TBD: x eventually aproaches the largest pos. inv. set. in which Vdot=0. But are there also pos. inv. sets in which Vdot \neq 0? \end{itemize} \paragraph{Global Stability} @@ -188,7 +188,7 @@ \subsubsection{Backstepping Control} where the inner system has an equilibrium point in $\mathbf{x}=0, \mathbf{z}=0$. \newpar{} -If $\mathbf{z} = \mathbf{u}_0(\mathbf{x})$ then +If $\mathbf{z} = \mathbf{u}_0(\mathbf{x})$ then \noindent\begin{equation*} \frac{d}{dt} V_0(\mathbf{x}) = -W(\mathbf{x}) < 0 \end{equation*} @@ -209,6 +209,79 @@ \subsubsection{Backstepping Control} \end{equation*} and thus proves the stability of the ``error'' system \noindent\begin{align*} - \dot{\mathbf{x}} &= f_0(\mathbf{x})+g_0(\mathbf{x})\mathbf{u}_0(\mathbf{x}) + g_0(\mathbf{x})\mathbf{e}\\ - \dot{\mathbf{e}} &= \dot{\mathbf{z}} - \underbrace{\frac{\partial \mathbf{u}_0(\mathbf{x})}{\partial \mathbf{x}}(\dot{\mathbf{x}})}_{\dot{\mathbf{u}}_0} = \mathbf{v} -\end{align*} \ No newline at end of file + \dot{\mathbf{x}} & = f_0(\mathbf{x})+g_0(\mathbf{x})\mathbf{u}_0(\mathbf{x}) + g_0(\mathbf{x})\mathbf{e} \\ + \dot{\mathbf{e}} & = \dot{\mathbf{z}} - \underbrace{\frac{\partial \mathbf{u}_0(\mathbf{x})}{\partial \mathbf{x}}(\dot{\mathbf{x}})}_{\dot{\mathbf{u}}_0} = \mathbf{v} +\end{align*} + +\subsection{Feedback Linearization} +Feedback linearization is an approach based on a change of variables, transforming the nonlinear system into a linear one (seen from the controller perspective). In other words the nonlinearity gets ``hidden'' in a substituted input signal. +In order to apply this technique the system needs to be \textbf{differentially flat} with a \textbf{flat output} (see Section~\ref{diff_flatness}). +\newpar{} +To find the input transformation that linearizes the system +\begin{align*} + \dot{x} & = f(x) + g(x) u \\ + y & = h(x) +\end{align*} +the output has to be differentiated enough times until the input $u$ appears in the equation. +\begin{align*} + \dot{y} & = \frac{\partial h}{\partial x}f(x) + \frac{\partial h}{\partial x}g(x) u\\ + & = L_f h(x) + L_g h(x) u +\end{align*} +where $L_f h$ and $L_g h$ are called the \textit{Lie derivatives} of $h$ with respect to $f$ and $g$, respectively. +% TODO: add output case +If $L_g h(x) = 0$, the output has to be differentiated again +\begin{equation*} + \ddot{y} = L_f^2 h(x) + L_g L_f h(x) u +\end{equation*} +where +\begin{align*} + L_f^2 h(x) & := L_f(L_f h(x)) \\ + L_g L_f h(x) & := L_g (L_f h(x)) +\end{align*} + + +% This corresponds to the \textbf{relative degree} of the nonlinear system. + + + +% TODO: Maybe add as en example +% In the case of the nonlinear pendulum with a torque input $u$ and an output $y=\theta$ +% \begin{align*} +% \dot{x}_1 & = x_2 \\ +% \dot{x}_2 & = -a \sin(x_1)-c x_2 + u\\ +% y &= x_1 +% \end{align*} +% A virtual control signal $v = -a \sin(x_1)-c x_2 + u$ can be substituted which results in the linear system +% \begin{align*} +% \dot{x}_1 & = x_2 \\ +% \dot{x}_2 & = v\\ +% y &= x_1 +% \end{align*} +% This can be controlled by a simple feedback controller with $v = -k_1x_1 -k_2x_2$. The physical control input $u$ is then recovered from +% \begin{equation*} +% u = v + a \sin(x_1) +c x_2 = -k_1x_1 -k_2x_2 + a \sin(x_1) +c x_2 +% \end{equation*} + + + +\newpar{} +\ptitle{Remarks:} +\begin{itemize} + \item The actuator basically cancels out the behavior of the original system to replace it with the designed linear one. + \item This has the disadvantage that potential good characteristics of the nonlinear system (like damping) get actively canceled out. + \item Feedback linearization provides an exact linear model of a nonlinear system. Not like the Jacobian-Linearization which linearizes the system around an equilibrium point. +\end{itemize} + +\subsubsection{Differental Flatness}\label{diff_flatness} +A dynamic system +\begin{gather*} + \dot{x} = f(x,u) \\ + y = h(x,u) +\end{gather*} +is differentially flat, with flat output $y$, if one can compute the state and input trajectories as a function of the flat outputs and a finite number of derivatives. +\begin{equation*} + (x,u) = M(y,\dot{y}, \ldots, y^{(m)}) +\end{equation*} + +% TODO: Example from page 6 + From 04bc7fd870a746890e46e96eb050abbafe1307aa Mon Sep 17 00:00:00 2001 From: Tobias Meier Date: Fri, 31 May 2024 13:41:12 +0200 Subject: [PATCH 02/10] feedback linearization finished --- src/images/nonlinear_systems_diff_flat_1.png | 3 + src/images/nonlinear_systems_diff_flat_2.png | 3 + src/sections/nonlinear_systems.tex | 165 ++++++++++++++----- 3 files changed, 134 insertions(+), 37 deletions(-) create mode 100644 src/images/nonlinear_systems_diff_flat_1.png create mode 100644 src/images/nonlinear_systems_diff_flat_2.png diff --git a/src/images/nonlinear_systems_diff_flat_1.png b/src/images/nonlinear_systems_diff_flat_1.png new file mode 100644 index 0000000..39edfc0 --- /dev/null +++ b/src/images/nonlinear_systems_diff_flat_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:724c05ec392bac485a14c48159c268cd157fb6a356352b378664cd06c7112b80 +size 210281 diff --git a/src/images/nonlinear_systems_diff_flat_2.png b/src/images/nonlinear_systems_diff_flat_2.png new file mode 100644 index 0000000..d4fbdcc --- /dev/null +++ b/src/images/nonlinear_systems_diff_flat_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:823e84fd31835b9f9bd3f6e8421c9d6392cfdb0626aed383b3b5e5987d6be691 +size 585979 diff --git a/src/sections/nonlinear_systems.tex b/src/sections/nonlinear_systems.tex index 8b56885..c583805 100644 --- a/src/sections/nonlinear_systems.tex +++ b/src/sections/nonlinear_systems.tex @@ -214,7 +214,8 @@ \subsubsection{Backstepping Control} \end{align*} \subsection{Feedback Linearization} -Feedback linearization is an approach based on a change of variables, transforming the nonlinear system into a linear one (seen from the controller perspective). In other words the nonlinearity gets ``hidden'' in a substituted input signal. +Feedback linearization is an approach based on a change of variables, transforming the nonlinear system into a linear one (seen from the controller perspective). In other words the nonlinearity gets ``hidden'' in a transformed input signal. + In order to apply this technique the system needs to be \textbf{differentially flat} with a \textbf{flat output} (see Section~\ref{diff_flatness}). \newpar{} To find the input transformation that linearizes the system @@ -222,47 +223,41 @@ \subsection{Feedback Linearization} \dot{x} & = f(x) + g(x) u \\ y & = h(x) \end{align*} -the output has to be differentiated enough times until the input $u$ appears in the equation. -\begin{align*} - \dot{y} & = \frac{\partial h}{\partial x}f(x) + \frac{\partial h}{\partial x}g(x) u\\ - & = L_f h(x) + L_g h(x) u -\end{align*} -where $L_f h$ and $L_g h$ are called the \textit{Lie derivatives} of $h$ with respect to $f$ and $g$, respectively. -% TODO: add output case -If $L_g h(x) = 0$, the output has to be differentiated again +the output $y$ has to be differentiated $\gamma$ times, where $\gamma$ (the relative degree) is the smallest number (if it exists) such that \begin{equation*} - \ddot{y} = L_f^2 h(x) + L_g L_f h(x) u + L_g L_f^{\gamma-1} h(x) \ne 0 \end{equation*} -where +with \begin{align*} - L_f^2 h(x) & := L_f(L_f h(x)) \\ + L_f h(x) & := \frac{\partial h}{\partial x}f(x) \\ + L_g h(x) & := \frac{\partial h}{\partial x}g(x) \\ + L_f^2 h(x) & := L_f(L_f h(x)) \\ L_g L_f h(x) & := L_g (L_f h(x)) \end{align*} +where $L_f h(x)$ and $L_g h(x)$ are called the \textit{Lie derivatives} of $h(x)$. +\newpar{} +The system then can be transformed into a linear system +\begin{equation*} + \frac{d^\gamma y}{dt^\gamma} = v +\end{equation*} +by choosing +\begin{equation*} + u = \frac{1}{L_g L_f^{\gamma-1} h(x)}(-L_f^\gamma h(x) + v) +\end{equation*} - -% This corresponds to the \textbf{relative degree} of the nonlinear system. - - - -% TODO: Maybe add as en example -% In the case of the nonlinear pendulum with a torque input $u$ and an output $y=\theta$ -% \begin{align*} -% \dot{x}_1 & = x_2 \\ -% \dot{x}_2 & = -a \sin(x_1)-c x_2 + u\\ -% y &= x_1 -% \end{align*} -% A virtual control signal $v = -a \sin(x_1)-c x_2 + u$ can be substituted which results in the linear system -% \begin{align*} -% \dot{x}_1 & = x_2 \\ -% \dot{x}_2 & = v\\ -% y &= x_1 -% \end{align*} -% This can be controlled by a simple feedback controller with $v = -k_1x_1 -k_2x_2$. The physical control input $u$ is then recovered from -% \begin{equation*} -% u = v + a \sin(x_1) +c x_2 = -k_1x_1 -k_2x_2 + a \sin(x_1) +c x_2 -% \end{equation*} - - +\newpar{} +Explicit examples for $\gamma = 1$ +\begin{align*} + \dot{y} & = L_f h(x) + L_g h(x) u \\ + \dot{y} & = v \\ + u & = \frac{1}{L_g h(x)}(-L_f h(x) + v) +\end{align*} +and for $\gamma = 2$ +\begin{align*} + \ddot{y} & = L_f^2 h(x) + L_g L_f h(x) u \\ + \ddot{y} & = v \\ + u & = \frac{1}{L_g L_f h(x)}(-L_f^2 h(x) + v) +\end{align*} \newpar{} \ptitle{Remarks:} @@ -272,6 +267,65 @@ \subsection{Feedback Linearization} \item Feedback linearization provides an exact linear model of a nonlinear system. Not like the Jacobian-Linearization which linearizes the system around an equilibrium point. \end{itemize} +\begin{examplesection}[Pendulum] + In the case of the nonlinear pendulum with a torque input $u$ and an output $y=\theta$ + \begin{align*} + \dot{x}_1 & = x_2 \\ + \dot{x}_2 & = -a \sin(x_1)-c x_2 + u \\ + y & = x_1 + \end{align*} + The Lie derivatives are + \begin{align*} + L_f h(x) & = \begin{bmatrix} + 1 & 0 + \end{bmatrix} + \begin{bmatrix} + x_2 \\ + -a \sin(x_1) -cx_2 + \end{bmatrix} = x_2 + \\ + L_g h(s) & = \begin{bmatrix} + 1 & 0 + \end{bmatrix} + \begin{bmatrix} + 0 \\ + 1 + \end{bmatrix} = 0 + \end{align*} + Since $L_g h(x) = 0$ we need to differentiate again + \begin{align*} + L_f^2 h(x) & = \begin{bmatrix} + 0 & 1 + \end{bmatrix} + \begin{bmatrix} + x_2 \\ + -a \sin(x_1) -cx_2 + \end{bmatrix} = -a \sin(x_1) -c x_2 + \\ + L_g L_f h(s) & = \begin{bmatrix} + 0 & 1 + \end{bmatrix} + \begin{bmatrix} + 0 \\ + 1 + \end{bmatrix} = 1 + \end{align*} + This results in + \begin{equation*} + u = \frac{1}{L_g L_f h(x)}(-L_f^2 h(x) + v) = a \sin(x_1) + c x_2 + v + \end{equation*} + and the linear system + \begin{align*} + \dot{x}_1 & = x_2 \\ + \dot{x}_2 & = v \\ + y & = x_1 + \end{align*} + with + \begin{equation*} + v = -a \sin(x_1)-c x_2 + u + \end{equation*} +\end{examplesection} + \subsubsection{Differental Flatness}\label{diff_flatness} A dynamic system \begin{gather*} @@ -283,5 +337,42 @@ \subsubsection{Differental Flatness}\label{diff_flatness} (x,u) = M(y,\dot{y}, \ldots, y^{(m)}) \end{equation*} -% TODO: Example from page 6 +\begin{examplesection}[Pendulum] + The nonlinear pendulum with a torque input $u$ and an output $y=\theta$ + \begin{align*} + \dot{x}_1 & = x_2 \\ + \dot{x}_2 & = -a \sin(x_1)-c x_2 + u \\ + y & = x_1 + \end{align*} + Is differentially flat with flat output $y$. As per definition $x$ and $u$ can be reconstructed from $y$, $\dot{y}$ and $\ddot{y}$. + \begin{align*} + x_1 & = y \\ + x_2 & = \dot{y} \\ + u & = \ddot{y} + c \dot{y} + a \sin(y) + \end{align*} +\end{examplesection} + +\paragraph{Differental flat systems} +\begin{center} + \includegraphics[width=\linewidth]{nonlinear_systems_diff_flat_1.png} + \includegraphics[width=\linewidth]{nonlinear_systems_diff_flat_2.png} +\end{center} + +\subsubsection{Feedback control of differentially-flat systems} +The geometric property of differential flatness allows to compute the input control signal and the internal state of a system given a desired, sufficient differentiable output trajectory. A problem arises if the actual initial state does not match the computed initial state. This deviation can be controlled by introducing a feedback loop into the virtual signal $v$. +\begin{equation*} + v = y_d^{(\gamma)} + K \begin{bmatrix} + y_d - y \\ + \dot{y}_d - \dot{y} \\ + \vdots \\ + y_d^{(\gamma-1)} - y^{(\gamma-1)} + \end{bmatrix} +\end{equation*} + +\newpar{} +\ptitle{Remarks:} +\begin{itemize} + \item Due to the coordinate transformation it becomes hard to check the control input e.g.\ for saturation bounds. +\end{itemize} +\subsubsection{Zero dynamics} \ No newline at end of file From d0bbf4f5e9c7eda7aa0d43ef6b908e4bdaba03ed Mon Sep 17 00:00:00 2001 From: Tobias Meier Date: Fri, 31 May 2024 18:26:48 +0200 Subject: [PATCH 03/10] zero dynamics added --- src/sections/nonlinear_systems.tex | 52 ++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/src/sections/nonlinear_systems.tex b/src/sections/nonlinear_systems.tex index c583805..ba156e1 100644 --- a/src/sections/nonlinear_systems.tex +++ b/src/sections/nonlinear_systems.tex @@ -244,6 +244,29 @@ \subsection{Feedback Linearization} \begin{equation*} u = \frac{1}{L_g L_f^{\gamma-1} h(x)}(-L_f^\gamma h(x) + v) \end{equation*} +A realization of this system is given by +\begin{align*} + \dot{x} & = \begin{bmatrix} + 0 & 1 & 0 & \cdots & 0 \\ + 0 & 0 & 1 & \cdots & 0 \\ + \vdots & \vdots & \vdots & \ddots & \vdots \\ + 0 & 0 & 0 & \cdots & 1 \\ + 0 & 0 & 0 & \cdots & 0 + \end{bmatrix} + x + + \begin{bmatrix} + 0 \\ + 0 \\ + \vdots \\ + 0 \\ + 1 + \end{bmatrix} + v \\ + y & = \begin{bmatrix} + 1 & 0 & \cdots & 0 + \end{bmatrix} + x +\end{align*} \newpar{} Explicit examples for $\gamma = 1$ @@ -359,7 +382,7 @@ \subsubsection{Differental Flatness}\label{diff_flatness} \end{center} \subsubsection{Feedback control of differentially-flat systems} -The geometric property of differential flatness allows to compute the input control signal and the internal state of a system given a desired, sufficient differentiable output trajectory. A problem arises if the actual initial state does not match the computed initial state. This deviation can be controlled by introducing a feedback loop into the virtual signal $v$. +The geometric property of differential flatness allows to compute the input control signal and the internal state of a system given a desired, sufficient differentiable output trajectory. A problem arises if the actual initial state does not match the computed initial state. This deviation can be controlled by introducing a feedback loop into the virtual signal $v$ depending on the desired output $y_d$ \begin{equation*} v = y_d^{(\gamma)} + K \begin{bmatrix} y_d - y \\ @@ -368,11 +391,36 @@ \subsubsection{Feedback control of differentially-flat systems} y_d^{(\gamma-1)} - y^{(\gamma-1)} \end{bmatrix} \end{equation*} +or the desired internal state $\mathbf{x}_d$ +\begin{equation*} + v = y_d^{(\gamma)} + K \begin{bmatrix} + x_d - x \\ + \dot{x}_d - \dot{x} \\ + \vdots \\ + x_d^{(\gamma-1)} - x^{(\gamma-1)} + \end{bmatrix} +\end{equation*} \newpar{} \ptitle{Remarks:} \begin{itemize} \item Due to the coordinate transformation it becomes hard to check the control input e.g.\ for saturation bounds. + \item The feedback is non-proper, i.e., it contains a number of differentiators that is equal to the relative degree + \item The closed-loop dynamics are (internally) stable iff the zero dynamics are stable, i.e., if the system is minimum phase. \end{itemize} -\subsubsection{Zero dynamics} \ No newline at end of file +\subsubsection{Zero dynamics} +% Maybe write this section in a simpler more understandable way +By only looking at the input-output relationship $y^{(\gamma)}=v$, one ignores the dynamics on a manifold of dimensions $n-\gamma$. + +It is possible to find a $u_0(x)$ such that $y=\dot{y}=\ddot{y}=\cdots=0$, and still have non-trivial dynamics in the state space +\begin{equation*} + \dot{x} = f(x) + g(x)u_0(x) +\end{equation*} +In other words, there can be a control input that only excites the internal behavior of the system but does not affect the output. + +This is called the \textbf{zero dynamics} of the system. +\newpar{} +Assume now that $f(x_0) = 0$, and $h(x_0) = 0$, i.e., that $x_0$ is an equilibrium point, with zero output. Then, the system is said to be asymptotically (exponentially) minimum-phase at $x_0$ if $x_0$ is an asymptotically (exponentially) stable equilibrium point for the zero dynamics. +\newpar{} +Note that if the system is not minimum-phase, the feedback linearization approach does not ensure internal stability of the closed-loop system, i.e., there are ``unobservable mode'' that are unstable. \ No newline at end of file From 298df8cf813783932144d0d7feb19adb49543241 Mon Sep 17 00:00:00 2001 From: DanielSchweizer1999 <126180829+DanielSchweizer1999@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:45:55 +0200 Subject: [PATCH 04/10] fixed some typos (e.g. gail->gain :p ) --- src/sections/modern_controller_synthesis.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sections/modern_controller_synthesis.tex b/src/sections/modern_controller_synthesis.tex index 10346db..4a05c7b 100644 --- a/src/sections/modern_controller_synthesis.tex +++ b/src/sections/modern_controller_synthesis.tex @@ -92,7 +92,7 @@ \subsection{Frequency Weights} \|\Delta(s)\|_{\mathcal{H}_\infty} < 1 \\ \|M(s)\|_{\mathcal{H}_\infty} < 1 \end{gather*} -where $M(s)$ is the TF from the output of $\delta$ ti its input. +where $M(s)$ is the TF from the output of $\Delta$ to its input. \subsubsection{First Order Weights} \ptitle{Lowpass} @@ -297,7 +297,7 @@ \subsection{Youla's Q Parameterization} \begin{equation*} C_0(s)=-{X_0(s)}^{-1}Y_0(s) \end{equation*} -is the TF when $Q(s)=0$ with controller gain $K_0$ and observer gail $L_0$ +is the TF when $Q(s)=0$ with controller gain $K_0$ and observer gain $L_0$ \noindent\begin{align*} X_0(s) & = -K_0{(sI-A-L_0C)}^{-1}B \\ Y_0(s) & = -K_0{(sI-A-L_0C)}^{-1}L_0 @@ -309,7 +309,7 @@ \subsection{Youla's Q Parameterization} \end{align*} where $L_0$ is an observer gain that would stabilize the error dynamics. \newpar{} -It can be show that the interconnection of the system is stable if the \textbf{Bezout identity} is fulfilled +It can be shown that the interconnection of the system is stable if the \textbf{Bezout identity} is fulfilled \begin{equation*} D(s)X(s)-N(s)Y(s)=1 \end{equation*} From bf1d36bd65803f643db0215a7c4578c7bc36a658 Mon Sep 17 00:00:00 2001 From: DanielSchweizer1999 <126180829+DanielSchweizer1999@users.noreply.github.com> Date: Wed, 5 Jun 2024 11:29:18 +0200 Subject: [PATCH 05/10] some remarks on FB linearization --- src/sections/nonlinear_systems.tex | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/sections/nonlinear_systems.tex b/src/sections/nonlinear_systems.tex index ba156e1..2b74f9f 100644 --- a/src/sections/nonlinear_systems.tex +++ b/src/sections/nonlinear_systems.tex @@ -218,7 +218,7 @@ \subsection{Feedback Linearization} In order to apply this technique the system needs to be \textbf{differentially flat} with a \textbf{flat output} (see Section~\ref{diff_flatness}). \newpar{} -To find the input transformation that linearizes the system +To find the input transformation that linearizes a system of the form \begin{align*} \dot{x} & = f(x) + g(x) u \\ y & = h(x) @@ -234,17 +234,17 @@ \subsection{Feedback Linearization} L_f^2 h(x) & := L_f(L_f h(x)) \\ L_g L_f h(x) & := L_g (L_f h(x)) \end{align*} -where $L_f h(x)$ and $L_g h(x)$ are called the \textit{Lie derivatives} of $h(x)$. +where $L_f h(x)$ and $L_g h(x)$ are called the \textit{Lie derivatives} of $h(x)$ in direction $f$ or $g$ respectively. \newpar{} -The system then can be transformed into a linear system +The system then can be transformed into a (virtually) linear system \begin{equation*} \frac{d^\gamma y}{dt^\gamma} = v \end{equation*} -by choosing +by choosing a physical input \begin{equation*} u = \frac{1}{L_g L_f^{\gamma-1} h(x)}(-L_f^\gamma h(x) + v) \end{equation*} -A realization of this system is given by +A (linear, ``virtual'') realization of this system is given by \begin{align*} \dot{x} & = \begin{bmatrix} 0 & 1 & 0 & \cdots & 0 \\ @@ -269,7 +269,7 @@ \subsection{Feedback Linearization} \end{align*} \newpar{} -Explicit examples for $\gamma = 1$ +Explicit examples for $\gamma = 1$ (then $L_f h(x)=h(x)$) \begin{align*} \dot{y} & = L_f h(x) + L_g h(x) u \\ \dot{y} & = v \\ @@ -287,6 +287,7 @@ \subsection{Feedback Linearization} \begin{itemize} \item The actuator basically cancels out the behavior of the original system to replace it with the designed linear one. \item This has the disadvantage that potential good characteristics of the nonlinear system (like damping) get actively canceled out. + \item One can imagine the FB linearization as controlling a virtual linear system with control input $v$ but under the hood applying a cleverly chosen physical control input $u$. \item Feedback linearization provides an exact linear model of a nonlinear system. Not like the Jacobian-Linearization which linearizes the system around an equilibrium point. \end{itemize} From a713ed73d6404c2889458300ecb713dcfc21a71e Mon Sep 17 00:00:00 2001 From: DanielSchweizer1999 <126180829+DanielSchweizer1999@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:22:33 +0200 Subject: [PATCH 06/10] added remarks to h2, hinf synthesis --- src/sections/h2_hinf_synthesis.tex | 135 ++++++++++++++++++++++------- 1 file changed, 103 insertions(+), 32 deletions(-) diff --git a/src/sections/h2_hinf_synthesis.tex b/src/sections/h2_hinf_synthesis.tex index 3486faa..742344e 100644 --- a/src/sections/h2_hinf_synthesis.tex +++ b/src/sections/h2_hinf_synthesis.tex @@ -1,9 +1,21 @@ \subsection{\texorpdfstring{$\mathcal{H}_2$}{H2} Synthesis} +The dynamics of the standard setup for modern control synthesis are given by +\begin{align*} + \quad \mathbf{x}(0) & =\mathbf{x}_{0} \\ + \dot{\mathbf{x}}(t) & =\quad \mathbf{A}\mathbf{x}(t)+\mathbf{B}_{w}\mathbf{w}(t)+\mathbf{B}_{u}\mathbf{u}(t) \\ + \mathbf{z}(t) & =\quad \mathbf{C}_{z}\mathbf{x}(t)+\mathbf{D}_{zw}\mathbf{w}(t)+\mathbf{D}_{zu}\mathbf{u}(t) \\ + \mathbf{y}(t) & =\quad \mathbf{C}_{y}\mathbf{x}(t)+\mathbf{D}_{yw}\mathbf{w}(t)+\mathbf{D}_{yu}\mathbf{u}(t) +\end{align*} +LQR, LQE, LQG are applied to special cases of the standard setup. \subsubsection{LQR} + +\newpar{} +\ptitle{Problem Statement} + In the LQR problem we assume \begin{itemize} \item Full state feedback: $\mathbf{C_y}=\mathbf{\mathbb{I}}$ - \item No disturbance input: $w=0$ + \item No disturbance input: $w=0$ ($\mathbf{B}_w=\mathbf{D}_{zw}=\mathbf{D}_{yw}=\mathbf{0}$) \item $\mathbf{C}_z^{\mathsf{T}}\mathbf{D}_{zu}=0$ \end{itemize} and try to find a control signal $u(t,x)$ that minimizes @@ -26,13 +38,20 @@ \subsubsection{LQR} \|\mathbf{z}\|_2^2=\int_0^{+\infty}(\mathbf{x}^{\mathsf{T}}\mathbf{Q}\mathbf{x}+\mathbf{u}^{\mathsf{T}}\mathbf{R}\mathbf{u})\;dt \end{equation*} -\ptitle{ARE} -\noindent\begin{gather*} - \mathbf{A}^{\mathsf{T}}\mathbf{X}_F + \mathbf{X}_F \mathbf{A} - \mathbf{X}_F \mathbf{B}_u{\left(\mathbf{D}_{zu}^{\mathsf{T}}\mathbf{B}_{zu}\right)}^{-1} \mathbf{B}_u^{\mathsf{T}} \mathbf{X}_F + \mathbf{C}_z^{\mathsf{T}}\mathbf{C}_z = \mathbf{0}\\ +\newpar{} +\ptitle{Solving for the Controller Matrix} + +One can show that minimizing $\|\mathbf{z}\|_2^2$ imposes the following ARE on $\mathbf{X}_F$: +\begin{equation*} + \mathbf{A}^{\mathsf{T}}\mathbf{X}_F + \mathbf{X}_F \mathbf{A} - \mathbf{X}_F \mathbf{B}_u{\left(\mathbf{D}_{zu}^{\mathsf{T}}\mathbf{B}_{zu}\right)}^{-1} \mathbf{B}_u^{\mathsf{T}} \mathbf{X}_F + \mathbf{C}_z^{\mathsf{T}}\mathbf{C}_z = \mathbf{0} +\end{equation*} +Solving this ARE yields the controller +\begin{equation*} \mathbf{F} = -{\left(\mathbf{D}_{zu}^{\mathsf{T}}\mathbf{D}_{zu}\right)}^{-1} \mathbf{B}_u^{\mathsf{T}}\mathbf{X}_F -\end{gather*} +\end{equation*} where $\mathbf{X}_F$ is symmetric and positive semidefinite. +\newpar{} \ptitle{Technical Considerations} \begin{enumerate} @@ -45,6 +64,7 @@ \subsubsection{LQR} Is for convenience. \end{enumerate} +\newpar{} \ptitle{Remarks} \begin{itemize} @@ -54,6 +74,10 @@ \subsubsection{LQR} \subsubsection{LQE} + +\newpar{} +\ptitle{Problem Statement} + In the LQE problem we assume \begin{itemize} \item That $\mathbf{u}$ takes the role uf the observer update @@ -82,11 +106,16 @@ \subsubsection{LQE} \end{equation*} \newpar{} -\ptitle{ARE} -\noindent\begin{gather*} - \mathbf{A}\mathbf{Y}_L + \mathbf{Y}_L \mathbf{A}^{\mathsf{T}} - \mathbf{Y}_L \mathbf{C}_y^{\mathsf{T}}{\left(\mathbf{D}_{yw}\mathbf{D}_{yw}^{\mathsf{T}}\right)}^{-1} \mathbf{C}_y \mathbf{Y}_L + \mathbf{B}_w\mathbf{B}_w^{\mathsf{T}} = \mathbf{0}\\ - \mathbf{F} = -\mathbf{Y}_L\mathbf{C}_y^{\mathsf{T}}{\left(\mathbf{D}_{yw}\mathbf{D}_{yw}^{\mathsf{T}}\right)}^{-1} -\end{gather*} +\ptitle{Solving for the Observer Matrix} + +One can show that the given problem statement on $\mathbf{u}$ imposes the following ARE on $\mathbf{Y}_L$: +\begin{equation*} + \mathbf{A}\mathbf{Y}_L + \mathbf{Y}_L \mathbf{A}^{\mathsf{T}} - \mathbf{Y}_L \mathbf{C}_y^{\mathsf{T}}{\left(\mathbf{D}_{yw}\mathbf{D}_{yw}^{\mathsf{T}}\right)}^{-1} \mathbf{C}_y \mathbf{Y}_L + \mathbf{B}_w\mathbf{B}_w^{\mathsf{T}} = \mathbf{0} +\end{equation*} +The optimal observer matrix is then given by +\begin{equation*} + \mathbf{L} = -\mathbf{Y}_L\mathbf{C}_y^{\mathsf{T}}{(\underbrace{\mathbf{D}_{yw}\mathbf{D}_{yw}^{\mathsf{T}}}_{=\mathbf{R}})}^{-1} +\end{equation*} where $\mathbf{Y}_L$ is symmetric and positive semidefinite. \newpar{} @@ -130,6 +159,11 @@ \subsubsection{LQG} \end{equation*} where $\mathbf{Y}$ is the stabilizing solution to the corresponding ARE. +\newpar{} +\ptitle{Technical Considerations} + +Remember that LGQ combines LQR and LQE. + \subsection{\texorpdfstring{$\mathcal{H}_\infty$}{H-infinity} Synthesis} \ptitle{Differentiation from $\mathcal{H}_2$ Synthesis} \begin{itemize} @@ -151,27 +185,27 @@ \subsection{\texorpdfstring{$\mathcal{H}_\infty$}{H-infinity} Synthesis} \end{itemize} \subsubsection{Optimal \texorpdfstring{$\mathcal{H}_\infty$}{H-infinity} Synthesis} -\begin{itemize} - \item In principle, we would like to find a controller K that minimizes the energy ($\mathcal{L}_2$) gain of the CL system i.e. - \begin{equation*} - \left\|\mathbf{T}_{zw}\right\|_{\mathcal{H}_\infty}=\sup_{w\neq0}\frac{\left\|\mathbf{z}\right\|_{\mathcal{L}_2}}{\left\|\mathbf{w}\right\|_{\mathcal{L}_2}} - \end{equation*} - \item However, the optimal controller(s) are such that - \begin{enumerate} - \item $\sigma_{\max}(\mathbf{T}_{zw}(j\omega))$ is a constant over all frequencies, the response does not roll off at high frequencies (\textit{Bode's integral law}). - \item The controller is not strictly proper. (The optimal controller is not unique) - \item Computing an optimal controller is numerically challenging. - \end{enumerate} -\end{itemize} +In principle, we would like to find a controller K that minimizes the energy ($\mathcal{L}_2$) gain of the CL system i.e. +\begin{equation*} + \left\|\mathbf{T}_{zw}\right\|_{\mathcal{H}_\infty}=\sup_{w\neq0}\frac{\left\|\mathbf{z}\right\|_{\mathcal{L}_2}}{\left\|\mathbf{w}\right\|_{\mathcal{L}_2}} +\end{equation*} +However, the optimal controller(s) are such that +\begin{enumerate} + \item $\sigma_{\max}(\mathbf{T}_{zw}(j\omega))$ is a constant over all frequencies, the response does not roll off at high frequencies (\textit{Bode's integral law}). + \item The controller is not strictly proper. (The optimal controller is not unique) + \item Computing an optimal controller is numerically challenging. +\end{enumerate} \subsubsection[Suboptimal H-infinity Synthesis]{Suboptimal $\mathcal{H}_\infty$ Synthesis} +\newpar{} +\ptitle{Problem Statement} In practice one pursues a sub-optimal design, i.e., given $\gamma>0$, find a controller $K$ such that \begin{equation*} \|\mathbf{T}_{zw}\|_{\mathcal{H}_\infty}<\gamma \end{equation*} if one exists. This can be formulated mathematically as a cost function: \begin{equation*} - \|\mathbf{z}\|_{\mathcal{L}_2}^2-\gamma^2\|\mathbf{w}\|_{\mathcal{L}_2}^2 + \|\mathbf{z}\|_{\mathcal{L}_2}^2-\gamma^2\|\mathbf{w}\|_{\mathcal{L}_2}^2 < 0 \end{equation*} where we search for the smallest $\gamma$ such that the controller can achieve negative cost. We \textbf{need} $\boldsymbol{\gamma}\mathbf{\le1}$ for a stabilizing controller as otherways for larger gamma one could easily achieve negative cost even though the energy of the disturbance gets not damped at all! The formula can be understood as \begin{itemize} @@ -180,6 +214,29 @@ \subsubsection{Optimal \texorpdfstring{$\mathcal{H}_\infty$}{H-infinity} Synthes \item The aforementioned formula becomes negative if the disturbance energy term is larger than the (hopefully damped) performance output $\mathbf{z}$. A small $\gamma$ gives an even better controller as it is more difficult to achieve negative cost then. \end{itemize} +\newpar{} +\ptitle{Conditions} + +For feasibility one must have +\begin{enumerate} + \item $(\mathbf{A}_{ext}, \mathbf{B}_2)$ must be stabilizable + \item $(\mathbf{C}_{ext, y},\mathbf{A}_{ext})$ must be detectable + \item $\begin{bmatrix}\mathbf{A}-j\omega \mathbf{I}&\mathbf{B}_w\end{bmatrix},\begin{bmatrix}\mathbf{A}^{\prime}-j\omega \mathbf{I}&\mathbf{C}_z^{\prime}\end{bmatrix}$ must have full row rank +\end{enumerate} +\newpar{} +A controller $\mathbf{K}$ fulfilling the cost inequality exists, only if +\begin{enumerate} + \item The following ARE has a solution for $\mathbf{X}_{\infty}$ + \begin{equation*} + \mathbf{A}^{\prime}\mathbf{X}_{\infty}+\mathbf{X}_{\infty}\mathbf{A}+\mathbf{C}_{z}^{\prime}\mathbf{C}_{z}=\mathbf{X}_{\infty}(\mathbf{B}_{u}\mathbf{B}_{u}^{\prime}-\gamma^{-2}\mathbf{B}_{w}\mathbf{B}_{w}^{\prime})\mathbf{X}_{\infty} + \end{equation*} + \item The following ARE has a solution for $\mathbf{Y}_{\infty}$ + \begin{equation*} + \mathbf{A}\mathbf{Y}_\infty + \mathbf{Y}_\infty \mathbf{A}^{\prime} + \mathbf{B}_w^{\prime} \mathbf{B}_w = \mathbf{Y}_\infty (\mathbf{C}_y \mathbf{C}_y^{\prime} - \gamma^{-2} \mathbf{C}_z \mathbf{C}_z^{\prime}) \mathbf{Y}_\infty + \end{equation*} + \item The matrix $\gamma^2 \mathbf{I} - \mathbf{Y}_{\infty} \mathbf{X}_{\infty}$ is positive definite +\end{enumerate} + \newpar{} \ptitle{Bisection Algorithm} @@ -190,6 +247,20 @@ \subsubsection{Optimal \texorpdfstring{$\mathcal{H}_\infty$}{H-infinity} Synthes \item Repeat from step 2 until $\gamma_+-\gamma_-<\epsilon$. \item Return $\mathbf{K}_+$. \end{enumerate} +\newpar{} +Remarks +\begin{itemize} + \item The conditions are only fulfilled if $\gamma\le 1$ + \item For $\gamma>1$ use relaxed weights + \item The final controller gains are + \begin{equation*} + \mathbf{F}_u=-\mathbf{B}_u^{\prime}\mathbf{X}_\infty,\quad \mathbf{F}_w=\frac1{\gamma^2}\mathbf{B}_w^{\prime}\mathbf{X}_\infty + \end{equation*} + \item The final observer gain is + \begin{equation*} + \mathbf{L}=-{(\mathbf{I}-\gamma^{-2}\mathbf{Y}_\infty \mathbf{X}_\infty)}^{-1}\mathbf{Y}_\infty \mathbf{C}_y^{\prime} + \end{equation*} +\end{itemize} \newpar{} \ptitle{Simplified Setup} @@ -206,13 +277,13 @@ \subsubsection{Applying Frequency Weights} \begin{itemize} \item In order for $\mathcal{H}_\infty$ synthesis to be possible, frequency weights must be \textbf{stable and proper}. \item Integrators (not asymptotically stable) can be approximated by very slow poles. - \item MATLAB: - \begin{itemize} - \item \texttt{Pinf=augw(G,W1,0,W3)}\\ - creates the augmented (weighted) system - \item \texttt{[Kinf, CL, GAM, INFO]=hinfsyn(Pinf,1,1)}\\ - applies optimal $\mathcal{H}_\infty$ synthesis - \item \texttt{[K09, CL, GAM, I]=hinfsyn(Pinf,1,1,0.9)}\\ - applies suboptimal $\mathcal{H}_\infty$ synthesis targeting $\gamma=0.9$. This can yield a more feasible controller (less control effort) - \end{itemize} + \item MATLAB: + \begin{itemize} + \item \texttt{Pinf=augw(G,W1,0,W3)}\\ + creates the augmented (weighted) system + \item \texttt{[Kinf, CL, GAM, INFO]=hinfsyn(Pinf,1,1)}\\ + applies optimal $\mathcal{H}_\infty$ synthesis + \item \texttt{[K09, CL, GAM, I]=hinfsyn(Pinf,1,1,0.9)}\\ + applies suboptimal $\mathcal{H}_\infty$ synthesis targeting $\gamma=0.9$. This can yield a more feasible controller (less control effort) + \end{itemize} \end{itemize} \ No newline at end of file From f0b05d5f3bdc7fd799ae0a0d03250f0d78b4a185 Mon Sep 17 00:00:00 2001 From: DanielSchweizer1999 <126180829+DanielSchweizer1999@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:00:21 +0200 Subject: [PATCH 07/10] remarks on nonlinear control --- src/sections/nonlinear_systems.tex | 71 +++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/src/sections/nonlinear_systems.tex b/src/sections/nonlinear_systems.tex index 2b74f9f..fc26dbd 100644 --- a/src/sections/nonlinear_systems.tex +++ b/src/sections/nonlinear_systems.tex @@ -54,18 +54,18 @@ \subsubsection{Lyapunov Functions} If this Lyapunov function satisfies \noindent\begin{align*} - V(\mathbf{x}) & \geq 0 & & \forall \mathbf{x}\in D \\ - V(\mathbf{x}) & = 0 \Leftrightarrow \mathbf{x}_e = \mathbf{x} \\ - \frac{d}{dt} V(\mathbf{x}(t)) & = \frac{\partial V(\mathbf{x})}{\partial t} \frac{\partial \mathbf{x}(t)}{\partial \mathbf{x}} = \frac{\partial V(\mathbf{x})}{\partial t} f(\mathbf{x}) \leq 0 & & \forall \mathbf{x}(t)\in D + V(\mathbf{x}) & \geq 0 & & \forall \mathbf{x}\in D \\ + V(\mathbf{x}) & = 0 \Leftrightarrow \mathbf{x}_e = \mathbf{x} & & \text{(if and only if)} \\ + \dot{V}(\mathbf{x}(t)) & = \frac{\partial V(\mathbf{x})}{\partial \mathbf{x}} \frac{\partial \mathbf{x}(t)}{\partial t} = \frac{\partial V(\mathbf{x})}{\partial \mathbf{x}} f(\mathbf{x}) \leq 0 & & \forall \mathbf{x}(t)\in D \end{align*} -the equillibrium point $\mathbf{x_e}$ is \textbf{stable in the sense of Lyapunov}. +the equillibrium point $\mathbf{x_e}$ is \textbf{stable in the sense of Lyapunov}. Remember that $V$ is defined on a set containing $\mathbf{x}_e$. \newpar{} Futhermore, $\mathbf{x}_e$ is \textbf{asymptotically stable} if \noindent\begin{equation*} - \dot{V}(\mathbf{x}(t)) = 0 \Leftarrow \mathbf{x}(t) = \mathbf{x}_e + \dot{V}(\mathbf{x}(t)) = 0 \Leftarrow \mathbf{x}(t) = \mathbf{x}_e \quad \text{(only if)} \end{equation*} -i.e.\ given $\dot{V}(\mathbf{x}(t)) = 0$ we know that the system is in the \textbf{only} equilibrium point. Finally, $\mathbf{x}_e$ is \textbf{exponentially stable} if +Finally, $\mathbf{x}_e$ is \textbf{exponentially stable} if \noindent\begin{equation*} \dot{V}(\mathbf{x}(t)) < -\alpha V(\mathbf{x}(t)), \qquad \alpha>0 \end{equation*} @@ -74,12 +74,18 @@ \subsubsection{Lyapunov Functions} \ptitle{Remarks} \begin{itemize} \item If there could be multiplie equilibrium points one needs to use LaSalle. + \item $V(\mathbf{x})=0$ must hold in any equilibrium point, even if there are more then one. %TBD: must the "only equilibrium point" from above be (0,...0)? %TBD: x eventually aproaches the largest pos. inv. set. in which Vdot=0. But are there also pos. inv. sets in which Vdot \neq 0? + \item If one has more than one state vector, then + \begin{equation*} + \dot{V}=\sum_{i} \frac{\partial V(\mathbf{x}_i)}{\partial \mathbf{x}_i} \frac{\partial \mathbf{x}_i(t)}{\partial t} + \end{equation*} + \item For asymptotical stability, given $\dot{V}(\mathbf{x}(t)) = 0$ we know that the system is in the \textbf{only} equilibrium point. \end{itemize} \paragraph{Global Stability} -To ensure global stability, i.e. $D=\mathbb{R}^n$, a Lyapunov function $V$ satisfying the aforementioned properties needs to be \textbf{radially unbounded}: +According to the Barbashin-Krasovski theorem, to ensure global stability (not necessarily asymptotical or exponential), i.e. $D=\mathbb{R}^n$, a Lyapunov function $V$ satisfying the aforementioned three properties \textbf{additionally} needs to be \textbf{radially unbounded}: \noindent\begin{equation*} \|\mathbf{x}\| \to +\infty \Rightarrow V(\mathbf{x}) \to +\infty \end{equation*} @@ -127,6 +133,8 @@ \subsection{Control Lyapunov Functions} \frac{d}{dt} V(\mathbf{x}, \tilde{\mathbf{u}}(\mathbf{x})) & = \frac{\partial V(\mathbf{x})}{\partial t} f(\mathbf{x}, \tilde{\mathbf{u}}(\mathbf{x})) \leq 0 & & \forall \mathbf{x}\neq 0 \end{align*} +In the following methods, one aims to find a control Lypunov function to prove stabilizing behavior. + \subsubsection{Gain Scheduling} In gain scheduling, the state space is partitioned into disjoint subspaces and for a number of design equilibria ($\mathbf{x}_i, \mathbf{u}_i$) nominal contorl laws $\mathbf{K}_i$ are designed using the aforementioned techniques. @@ -146,18 +154,22 @@ \subsubsection{Gain Scheduling} \end{equation*} \subsubsection{Multiple Lyapunov Functions} -Another option is to consider multiple Lyapunov functions $V_i$ with corresponding sets $X_i$ that satisfy +Another option is to consider multiple Lyapunov-like functions $V_i$ with corresponding sets $X_i$ that satisfy \begin{itemize} \item positive definite in $X_i$ \item $\dot{V_i}(\mathbf{x})\leq 0$ when $\mathbf{x}\in X_i$ \end{itemize} - -and to check if the system satisfies the \textbf{sequence non-increasing condition}: +Then, define $V_i[k]$ as infimum taken by $V_i$ in the given time interval and to check if the system satisfies the \textbf{sequence non-increasing condition}: \noindent\begin{equation*} V_i[k+1] < V_i[k] \qquad \forall k \in \mathbb{N} \end{equation*} -\subsubsection{Linear Parameter-Varying Systems} +\newpar{} +\ptitle{Rationale} + +Assuming the system can move from region to region, we look at all time intervals where system is in a certain region $X_i$. We want to have the Lyapunov function decreased everytime the system reenters a certain region again. Defining $V_i$ as infimum (largest lower bound), we have stable behaviour if the infimum decreases at every re-entry of region $X_i$. + +\subsubsection{Linear Parameter-Varying (LPV) Systems} A third option is to rewrite the nonlinear system in a ``linear'' fashion with slow varying parameter $\sigma(\mathbf{x})$ \noindent\begin{equation*} \dot{\mathbf{x}}_\delta = \mathbf{A} (\sigma(\mathbf{x}))\mathbf{x}_\delta + \mathbf{B}(\sigma(\mathbf{x}))\mathbf{u}_\delta\quad @@ -167,6 +179,9 @@ \subsubsection{Linear Parameter-Varying Systems} \end{cases} \end{equation*} +\newpar{} +\ptitle{Lyapunv Condition for LPV} + This system is \textbf{exponentially stable} if \noindent\begin{equation*} {\bar{\mathbf{A}}(\sigma)}^{\mathsf{T}} \mathbf{P} + \mathbf{P}\bar{\mathbf{A}}(\sigma) + \sum \rho_i \frac{\partial \mathbf{P}(\sigma)}{\partial \sigma_i} < 0,\qquad @@ -178,6 +193,15 @@ \subsubsection{Linear Parameter-Varying Systems} \end{equation*} In other words, the existence of a family of positive matrices $\mathbf{P}(\sigma)$ (common Lyapunov functions) prove the systems exponential stability. +\newpar{} +\ptitle{LPV Controllers} + +\begin{itemize} + \item One assumes $\sigma$ is measurable + \item Then, one will design a stabilizing controller for every $\sigma$ + \item LPV can be imagined as continuous gain scheduling: one has controllers depending on a (possibly infinite) number of $\sigma$s instead of a number of equilibrium points +\end{itemize} + \subsubsection{Backstepping Control} Backstepping is a form of \textit{cascaded control} where a control input $\mathbf{u}$ is chosen s.t.\ the output $\mathbf{z}$ of the outer loop stabilizes the inner loop: @@ -198,8 +222,12 @@ \subsubsection{Backstepping Control} \ptitle{Controlling the Error} In order to ensure stability, Lyapunov stability of the error $\mathbf{e} = \mathbf{z}-\mathbf{u}_0$ needs to be established. - -The Lypunov candidate +The error evolves as +\begin{align*} + \dot{\mathbf{x}} & =\mathbf{f}_{0}(\mathbf{x})+\mathbf{g}_{0}(\mathbf{x})\mathbf{u}_{0}(x)+\mathbf{g}_{0}(\mathbf{x})\mathbf{e}, \\ + \dot{\mathbf{e}} & =\mathbf{f}_{1}(\mathbf{x},\mathbf{z})+\mathbf{g}_{1}(\mathbf{x},\mathbf{z})\mathbf{u}-\frac{\partial \mathbf{u}_{0}(\mathbf{x})}{\partial \mathbf{x}}\left(\mathbf{f}_{0}(\mathbf{x})+\mathbf{g}_{0}(\mathbf{x})\mathbf{z}\right)=\mathbf{v} +\end{align*} +Then, the Lypunov candidate \noindent\begin{equation*} V_1(\mathbf{x}, \mathbf{e}) = V_0(\mathbf{x})+\frac{1}{2} \mathbf{e}^2 \end{equation*} @@ -207,12 +235,25 @@ \subsubsection{Backstepping Control} \noindent\begin{equation*} \frac{d}{dt}V_1(\mathbf{x}, \mathbf{e}) = -W(\mathbf{x}) - k_1 \mathbf{e}^2 <0 ,\qquad \forall(\mathbf{x},\mathbf{e}) \neq 0 \end{equation*} +if one cleverly picks +\begin{equation*} + \mathbf{v}=-\frac{\partial V_0(\mathbf{x})}{\partial \mathbf{x}}\mathbf{g}_0(\mathbf{x})-k_1\mathbf{e},\quad k_1>0 +\end{equation*} and thus proves the stability of the ``error'' system \noindent\begin{align*} \dot{\mathbf{x}} & = f_0(\mathbf{x})+g_0(\mathbf{x})\mathbf{u}_0(\mathbf{x}) + g_0(\mathbf{x})\mathbf{e} \\ \dot{\mathbf{e}} & = \dot{\mathbf{z}} - \underbrace{\frac{\partial \mathbf{u}_0(\mathbf{x})}{\partial \mathbf{x}}(\dot{\mathbf{x}})}_{\dot{\mathbf{u}}_0} = \mathbf{v} \end{align*} +\newpar{} +\ptitle{Remarks} + +\begin{itemize} + \item The control input $\mathbf{u}$ affects $\mathbf{z}$, which in turn affects $\mathbf{x}$ + \item One assumes that the inner system is easily controllable by $\mathbf{u}_0$ (e.g.\ because it is linear) + \item The idea can be extended to multiple nested sytems +\end{itemize} + \subsection{Feedback Linearization} Feedback linearization is an approach based on a change of variables, transforming the nonlinear system into a linear one (seen from the controller perspective). In other words the nonlinearity gets ``hidden'' in a transformed input signal. @@ -410,11 +451,11 @@ \subsubsection{Feedback control of differentially-flat systems} \item The closed-loop dynamics are (internally) stable iff the zero dynamics are stable, i.e., if the system is minimum phase. \end{itemize} -\subsubsection{Zero dynamics} +\subsubsection{Zero dynamics} % Maybe write this section in a simpler more understandable way By only looking at the input-output relationship $y^{(\gamma)}=v$, one ignores the dynamics on a manifold of dimensions $n-\gamma$. -It is possible to find a $u_0(x)$ such that $y=\dot{y}=\ddot{y}=\cdots=0$, and still have non-trivial dynamics in the state space +It is possible to find a $u_0(x)$ such that $y=\dot{y}=\ddot{y}=\cdots=0$, and still have non-trivial dynamics in the state space \begin{equation*} \dot{x} = f(x) + g(x)u_0(x) \end{equation*} From bcdc4ea9e31691885c503ae2a12636b139bec3c2 Mon Sep 17 00:00:00 2001 From: DanielSchweizer1999 <126180829+DanielSchweizer1999@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:13:00 +0200 Subject: [PATCH 08/10] more remarks on nonlinear control --- src/sections/nonlinear_systems.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sections/nonlinear_systems.tex b/src/sections/nonlinear_systems.tex index fc26dbd..c60ef43 100644 --- a/src/sections/nonlinear_systems.tex +++ b/src/sections/nonlinear_systems.tex @@ -326,6 +326,7 @@ \subsection{Feedback Linearization} \newpar{} \ptitle{Remarks:} \begin{itemize} + \item Only works for \textbf{controllable} systems \item The actuator basically cancels out the behavior of the original system to replace it with the designed linear one. \item This has the disadvantage that potential good characteristics of the nonlinear system (like damping) get actively canceled out. \item One can imagine the FB linearization as controlling a virtual linear system with control input $v$ but under the hood applying a cleverly chosen physical control input $u$. From 970635e62985947c01235a3914609741d59b41a7 Mon Sep 17 00:00:00 2001 From: TobiasMeier Date: Wed, 5 Jun 2024 19:45:34 +0200 Subject: [PATCH 09/10] general description of MPC added --- src/main.tex | 1 + src/sections/mpc.tex | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/sections/mpc.tex diff --git a/src/main.tex b/src/main.tex index 801f071..068c8c0 100644 --- a/src/main.tex +++ b/src/main.tex @@ -25,6 +25,7 @@ \input{sections/modern_controller_synthesis.tex} \input{sections/h2_hinf_synthesis.tex} \input{sections/nonlinear_systems.tex} + \input{sections/mpc.tex} \newpage \input{sections/Appendix.tex} diff --git a/src/sections/mpc.tex b/src/sections/mpc.tex new file mode 100644 index 0000000..bebe47d --- /dev/null +++ b/src/sections/mpc.tex @@ -0,0 +1,40 @@ +\section{Model Predictive Control (MPC)} + +For a discrete-time nonlinear control system of the form +\begin{align*} + \mathbf{x}[k+1] & = f(\mathbf{x}[k], \mathbf{u}[k]) \\ + \mathbf{y}[k] & = h(\mathbf{x}[k],\mathbf{u}[k]) +\end{align*} +a general description of the cost function and the constraints with the horizon length $H$ can be formulated as following +\begin{align*} + \min_{u[0], \ldots, u[H-1]} J_{H}(\mathbf{x,u}) & := \sum_{k=0}^{H-1}g(\mathbf{x}[k],\mathbf{u}[k]) \\ + \mathbf{x}[k+1] & = f(\mathbf{x}[k]. \mathbf{u}[k]) \\ + \mathbf{x}[0] & = \mathbf{x}_0 \\ + \mathbf{x}[k] & \in X \\ + \mathbf{u}[k] & \in U \\ + k & = 0,\ldots,H-1 +\end{align*} +By solving these equations one can obtain the best control input $u$ for the next step. This is then done over and over again. + +\newpar{} + +The remaining costs from $k=H, \ldots, \infty$ are called the tail. If the prediction is too short-sighted (hence the tail is to large) the system can get instable. To fix this, one can +\begin{itemize} + \item shorten the tail (enlarge the horizon). This introduces more computational effort each step. + \item make the tail zero (or sufficiently small). If the state is forced to an equilibrium at the end of the horizon it wil remain there and the tail will have no further effect. + \item replace the tail with an estimate. +\end{itemize} + +The formulation becomes +\begin{align*} + \min_{u[0], \ldots, u[H-1]} J_{H}(\mathbf{x,u}) & := \sum_{k=0}^{H-1}g(\mathbf{x}[k],\mathbf{u}[k]) \textcolor{blue}{+V(\textbf{x}[H])} \\ + \mathbf{x}[k+1] & = f(\mathbf{x}[k]. \mathbf{u}[k]) \\ + \mathbf{x}[0] & = \mathbf{x}_0 \\ + \mathbf{x}[k] & \in X \\ + \mathbf{u}[k] & \in U \\ + \textcolor{blue}{\mathbf{x}[H]} & \textcolor{blue}{\;\in X_H} \\ + k & = 0,\ldots,H-1 +\end{align*} + +\subsection{Terminal Constraints} + From c7eaee4ece21cc6fe3b21c4bf1ceaef0e316c8fc Mon Sep 17 00:00:00 2001 From: Tobias Meier Date: Thu, 6 Jun 2024 13:23:03 +0200 Subject: [PATCH 10/10] terminal costs and interior point method added --- src/sections/mpc.tex | 83 ++++++++++++++++++++++++++++-- src/sections/nonlinear_systems.tex | 2 +- 2 files changed, 80 insertions(+), 5 deletions(-) diff --git a/src/sections/mpc.tex b/src/sections/mpc.tex index bebe47d..710f456 100644 --- a/src/sections/mpc.tex +++ b/src/sections/mpc.tex @@ -18,11 +18,11 @@ \section{Model Predictive Control (MPC)} \newpar{} -The remaining costs from $k=H, \ldots, \infty$ are called the tail. If the prediction is too short-sighted (hence the tail is to large) the system can get instable. To fix this, one can +The remaining costs from $k=H, \ldots, \infty$ are called the tail. If the prediction is too short-sighted (hence the tail is to large) the system can get unstable. To fix this, one can \begin{itemize} \item shorten the tail (enlarge the horizon). This introduces more computational effort each step. - \item make the tail zero (or sufficiently small). If the state is forced to an equilibrium at the end of the horizon it wil remain there and the tail will have no further effect. - \item replace the tail with an estimate. + \item make the tail zero (or sufficiently small). See Section~\ref{mpc_terminal_constraint}. + \item replace the tail with an estimate. See Section~\ref{mpc_terminal_cost}. \end{itemize} The formulation becomes @@ -36,5 +36,80 @@ \section{Model Predictive Control (MPC)} k & = 0,\ldots,H-1 \end{align*} -\subsection{Terminal Constraints} +\subsection{Terminal Constraints}\label{mpc_terminal_constraint} + +If the state is forced to an equilibrium at the end of the horizon it wil remain there and the tail will have no further effect. On the down side this may put excessive pressure on the actuators/control effort. + +\subsection{Terminal Cost}\label{mpc_terminal_cost} + +The best terminal cost estimate would be $V = J^*_\infty$ the cost from the end of the horizon up to infinity. + +Because this is not determinable we are looking for a \textbf{global Control Lyapunov Function (CLF)} such that +\begin{equation*} + V(\mathbf{x}) \geq \mathbf{c}_v {\lVert \mathbf{x} \rVert}^2 +\end{equation*} +and +\begin{equation*} + \min_{u}(V(f(\mathbf{x,u})) + \mathbf{x}^T \mathbf{Qx + u}^T \mathbf{R u}) \leq 0 \quad \forall \; \mathbf{x} +\end{equation*} +which is an upper bound for the optimal cost +\begin{equation*} + V(\mathbf{x}) \geq J^*_\infty (\mathbf{x}) +\end{equation*} +If we ensure that the terminal cost of the next step $V(f(\mathbf{x,u}))$ is less or equal to the current terminal cost $V(\mathbf{x})$ we get a stabilizing control law. + +However, the MPC control law will have better performance -- if not optimal, i.e. % TODO: Maybe explain this in more detail +\begin{equation*} + J^*_\infty(\mathbf{x}) \leq J^*_H(\mathbf{x}) \leq J^*_{CLF}(\mathbf{x}) +\end{equation*} + +An example of a CLF candidate may be given by the solution $\mathbf{P}$ of the Algebraic Ricatti Equation of the LQR problem, i.e., given $V(x) = \mathbf{x}^T \mathbf{Px}$. + +\subsection{Solving the Finite Horizon Optimization} + +For an unconstrained, differentiable and convex optimization problem one can +\begin{itemize} + \item set the gradient to zero to find the stationary points. + \item use a gradient descent method. +\end{itemize} + +In most cases one deals with limiting constraints. To incorporate these into the cost function a so called \textbf{barrier function} is added. +\begin{equation*} + V(\mathbf{x,u}) - \log(-c(\mathbf{x,u})) +\end{equation*} +Note that the function $c$ is defined in a way such that +\begin{equation*} + c(\mathbf{x,u}) \leq 0 +\end{equation*} +Hence the barrier function is not defined for $(x,u)$ not satisfying the constraints, and it becomes very large when approaching the boundaries of the constraint set. + +To solve this kind of optimization problem the \textbf{barrier interior-point method} can be used. + +\subsubsection{Barrier Interior-Point Metod} +Interior point methods solve \textbf{convex problems} of the form +\begin{align*} + \min \quad & f_0(x) \\ + \text{s.t.:} \quad & f_i(x) \leq 0 , \quad 0 = 1, \ldots, m \\ + & Ax = b +\end{align*} +where the scalar functions $f_0,f_1,\ldots,f_m$ are convex and twice differentiable. +\newpar{} +The problem is converted into a minimization with affine equality constraints by adding \textbf{barrier functions} in the following way +\begin{align*} + \min \quad & f_0(x) - \frac{1}{t}\sum_{i=1}^{m}\log(-f_i(x)) \\ + \text{s.t.:}\quad & Ax=b +\end{align*} + +As $t \to +\infty$, the objective function gets closer to $f_0$, but diverges very steeply at the boundary of the feasible set. +\newpar{} +The problem is then solved iteratively using gradient descent or Newton method for $t=\mu^k t_0$ with $t_0>0, \mu > 1$ where $k$ is the iteration variable. The solution of the pervious step is used as a starting point for the next step. + +% TODO: Add graphical example like the one drawn on the blackboard. + +\newpar{} +\ptitle{Remarks:} +\begin{itemize} + \item The sequence of intermediate optimal solutions forms what is known as the \textbf{cental path}, which is always contained in the interior of the feasible set. + \item This method terminates with $\mathcal{O}(\sqrt{m})$ time. +\end{itemize} diff --git a/src/sections/nonlinear_systems.tex b/src/sections/nonlinear_systems.tex index c60ef43..118a871 100644 --- a/src/sections/nonlinear_systems.tex +++ b/src/sections/nonlinear_systems.tex @@ -453,7 +453,7 @@ \subsubsection{Feedback control of differentially-flat systems} \end{itemize} \subsubsection{Zero dynamics} -% Maybe write this section in a simpler more understandable way +% TODO: Maybe write this section in a simpler more understandable way By only looking at the input-output relationship $y^{(\gamma)}=v$, one ignores the dynamics on a manifold of dimensions $n-\gamma$. It is possible to find a $u_0(x)$ such that $y=\dot{y}=\ddot{y}=\cdots=0$, and still have non-trivial dynamics in the state space