# Stability analysis for tracking controller - error dynamics?

say I have an inverted pendulum system like

$$\begin{split} \dot{x}_1 &= x_2 \\ \dot{x}_2 &= \sin(x_1) - 0.5x_2 + u \,. \end{split}$$

I now want to design a controller that tracks a user defined reference for the system output $y = x_1$ such that the error $e := y_{set} - y$ gets zero.

Remark: I know that it doesn't really make sense to try to track any other reference for $y$ other than one of the equilibria, but I am more interested in the method itself rather than the result (the pendulum is just a minimal example, in reality I would track the position of the cart carrying the pendulum).

First I transform the system into error coordinates:

$$e = y_{set} - x_1 \rightarrow x_1 = y_{set} - e$$

and therefore, assuming constant references values $y_{set}$ we get the new system equations

$$\begin{split} \dot{e} &= -x_2 \\ \dot{x}_2 &= \sin(y_{set} - e) - 0.5x_2 + u \,. \end{split}$$

Correct so far?

Question: Now here is my problem: If I want to perform a stability analysis using the standard Lyapunov function approach, how do I have to deal with the $y_{set}$ in the system equation above?

Because for $y_{set} \neq 0$, the term $\dot{x}_2 \neq 0$ even if $e = x_2 = u = 0$.

Since the reference can in principle be an arbitrary constant, how can I deal with it efficiently?

• Hi, actually its already mentioned in the post, but thanks for the feedback :) Oct 7 '17 at 8:49
• Ah, now I see it :D. Oct 7 '17 at 8:49

Let $y_{set}$ be some function of $t$; we suppose we know $y_{set}(t)$, $\dot y_{set}(t)$, $\ddot y_{set}(t)$. The tracking error is a vector $e=(e_1,e_2)$, $e_1= y_{set}-x_1$, $e_2=\dot y_{set}-\dot x_1= \dot y_{set}-x_2$. The error dynamics is $$\dot e_1=\dot y_{set}-\dot x_1=e_2,$$ $$\dot e_2=\frac{d}{dt}(\dot y_{set}-\dot x_1)=\ddot y_{set}-\sin x_1+0.5x_2-u= \ddot y_{set}-\sin(y_{set}-e_1)+0.5(\dot y_{set}-e_2)-u.$$ Now we can use the feedback linearization method to introduce the tracking controller:
$$u=\ddot y_{set}-\sin(y_{set}-e_1)+0.5(\dot y_{set}-e_2)+k_0 e_1+k_1 e_2,\quad k_0,k_1>0$$ or $$u=\ddot y_{set}-\sin(x_1)+0.5(x_2)+k_0 (y_{set}-x_1)+k_1 (\dot y_{set}-x_2),\quad k_0,k_1>0.$$ Now we can search for a Lyapunov function of the closed system; it can be found as a quadratic form $V(e)=e^T Pe$.
• Thanks for the answer, but what can I do if I cannot cancel out the $y_{set}$ like in this example? I.e. when the $y_{set}$ remains in the state equations, what would be the way to go? Oct 2 '17 at 16:20
• @SampleTime If you mean obtaining the nonlinear tracking control, it depends on your concrete system. You can, for instance, try to find the coordinate transformation that eliminates the nonlinear dynamics, or you can try to find a control Lyapunov function (en.wikipedia.org/wiki/Control-Lyapunov_function), or maybe your system requires some special approach. There is no cure for all. If you mean the stability analysis, you can search for some Lyapunov function $V(e)$ or $V(e,t)$ in the usual way (using the non-autonomous versions of the Lyapunov theorems).