I am trying to understand a detail from an example, from the control textbook Slotine and Li (1991) "Applied Nonlinear Control", Prentice-Hall, Example 6.4, pag. 220 (hopefully there is not any typing error in the book). A linear system is given:
$$\eqalign{ \left[ {\matrix{ {{{\dot x}_1}} \cr {{{\dot x}_2}} \cr } } \right] =& \left[ {\matrix{ {{x_2} + u} \cr u \cr } } \right] \cr\\ y =& {x_1} \cr} $$
where the output $y$ is desired to track $y_d$. Differentiating the output, an explicit relation between $y$ -output- and $u$ -control input- is obtained:
$$\dot y = {x_2} + u$$
Until here it is clear. Now, the authors choose a control law:
$$u = - {x_2} + {{\dot y}_d} - (y - {y_d})$$
and say that this yield the tracking error equation:
$$\dot e + e = 0$$
with the $e$ being the tracking error, defined as $ e=y-y_{d} $ and the internal dynamics: $${{\dot x}_2} + x_2=\dot {y_d} - e$$ ... and the problem continues.
My question is: how does one define the control law $u = - {x_2} + {{\dot y}_d} - (y - {y_d})$ ?? And how does this relate to the two following equations ($\dot e + e = 0$ and ${{\dot x}_2} + x_2 = \dot{y_d} - e$)?
Any simple clarifying answer is much appreciated.
Thanks
Actually, @MrYouMath gave already a detailed and correct expalanation. Here some more words on the tracking error dynamics:
The dynamic of the tracking error $e = y-y_d$ is what you specify, i.e., the desired dynamics of the plant output $y$ along the desired trajectory $y_d$. This specified error dynamics should be asymptotically stable, since it might desired that $e \to 0$, as $t\to \infty$ or $y\to y_d$, as $t\to \infty$.
Here it is chosen as the error differential equation: \begin{align} 0 &= \dot e + e \\ & = \dot y-\dot y_d + y-y_d \end{align} which is asymptotically stable since it is Hurwitz (the corresponding characterisitic polynomial has an eigenvalue equals $-1$). Consequently, initial errors $e(t_0)$ tend to zero as time increases.
Now to obtain $0 = \dot e + e $ you simply choose $u$ in the equation \begin{align} \dot y = x_2 + u. \end{align} In the example, $x_2$ is compensated exactly, so you need just to add the remaining terms $(\dot y_d,y,y_d)$ to obtain the desired error dynamics, i.e.,
\begin{align} u = -x_2 + \dot y_d -(y- y_d) \end{align}
It follows
\begin{align} \dot y = x_2 - x_2 + \dot y_d -( y- y_d) \Rightarrow e +\dot e = 0 \end{align}
In the design, the dynamics in $x_2$ is not considered, it remains the internal dynamics
\begin{align} \dot x_2 &= u = -x_2 + \dot y_d -(y- y_d)\\ & \Rightarrow \dot x_2 +x_2 = \dot y_d - e \end{align}
final remark: Note that this dynamics must be stable for $e\equiv0$. This yields the zero dynamics $\dot x_2 = -x_2$ which is indeed asympt. stable.