# How to transform a systems states to error dynamics

suppose I have a system like

$$\begin{split} \dot{x}_1 &= -5x_1 + x_2 + u\\ \dot{x}_2 &= -x_2 \end{split}$$

then its pretty easy to derive a static state feedback controller since the system is linear. I would like to use this as a simple example for tracking control to understand how to apply the same techniques for nonlinear systems.

However, I have some understanding problems with what to do if I want to do tracking control. I would then define the error dynamics as (suppose I want to track $y = x_1$):

$$e = y_{\text{ref}} - y \rightarrow \dot{e} = \dot{y}_{\text{ref}} - \dot{x}_1$$

So, two questions:

1.) In litrature, the term $\dot{y}_{\text{ref}}$ is often omited (or better: set to zero). I guess this comes from an assumption that the reference does not change "fast", is this true?

2.) In the error dynamics, when inserting the equation for $\dot{x}_1$, I get:

$$\dot{e} = \dot{y}_{\text{ref}} + 5x_1 - x_2 - u$$

How to proceed from there? Do I have to replace $x_1$ in terms of $e$? And what happens with $x_2$? Since $x_2$ doesn't appear in the error equation, how is this state included into the tracking control problem?

1) Derivative of a constant$=0$. When we say $\dot{y}_{\text{ref}}=0$, it means that the reference is constant, and that implies reference is not varying with respect to time. Example ${y}_{\text{ref}}(t)=2$, $t\ge0$.
2) You need to track $x_1$ right? such as say $y=x_1=y_{\rm ref}=2$. For that, we have, as you derived, $\dot{e}=\dot{y}_{\text{ref}}+5x_1-x_2-u(t)$. For tracking a constant output, the term $\dot{e}=5x_1-x_2-u(t)$ needs to be decreasing. That is as $t\to\infty$, ${e}\to 0$. Finding a $u(t)$ that ensures that the error will go to zero is what you need to do. One method is to find \begin{align}u=&-[k_1~k_2]\left[ \begin{array}{c} (x_1-y_{\rm ref}) \\ x_2 \\ \end{array} \right]\nonumber\\=&k_1e-k_2x_2. \end{align}
Find $K=[k_1~k_2]$ for stabilizing(regulating) the system, may be by pole placement.
• Thanks, that helps me a lot already. However, I still have some difficulties in grasping the following: Actually, I want to apply step-like inputs to the system (constant for some time, but then change the constant setpoint). So when the change happens, the derivative of $y_{\text{ref}}$ would be not equal to zero (actually it wouldn't even be defined due to the discontinouity)... why isn't this a problem with the above approach? Mar 29 '17 at 21:15
• I am not sure about what happens exactly at the point of discontinuity. I never checked switching $y_{\rm ref}$. However, one thing to be noted is that the usually with the setpoint tracking, the control law $u=Kx(t)$ with state feedback can be derived irrespective of the value of the set point $y_{\rm ref}$ to be tracked or the initial condition. In that case, changing the set point does not demand changing the feedback gain matrix. Mar 30 '17 at 8:37
• Thanks for your answer... I thought I got it, but I am still getting stuck: Say I choose a controller like $u = 5y_{\text{ref}} - 3e$ then everything works fine and the output is tracked. However, for that I need to match the reference exactly (if the value 5 is a physical parameter and I am a bit off, I will get a steady state offset error)... However, when trying the proposed form by you I get $\dot{e} = 5x_1 - x_2 - u$ like described...but what is the A-Matrix of that? Since there is still $x_1$ appearing in that equation, don't I have to replace $x_1$ first in terms of $e$? How use PP now? Mar 30 '17 at 20:23