Consider the wheeled robot shown below,
where,
The full dynamic model of the robot can be written as,
$$ \left[ \begin{array}{c} \dot{x} \\ \dot{y} \\ \dot{\psi} \\ \dot{u} \\ \dot{\omega} \end{array} \right] = \left[ \begin{array}{c} u cos(\psi) - a \omega \sin(\psi) \\ u sin(\psi) + a \omega \cos(\psi) \\ \omega \\ \frac{\lambda_3}{\lambda_1} \omega^2 - \frac{\lambda_4}{\lambda_1} u \\ -\frac{\lambda_5}{\lambda_2} u \omega - \frac{\lambda_6}{\lambda_2} \omega \end{array} \right] + \left[ \begin{array}{cc} 0 & 0 \\ 0 & 0 \\ 0 & 0 \\ \frac{1}{\lambda_1} & 0 \\ 0 & \frac{1}{\lambda_2} \end{array} \right] \left[ \begin{array}{c} u_{ref} \\ \omega_{ref} \end{array} \right]$$or
$$\left[\begin{array}{c} u \\ \omega \end{array} \right] = \left[ \begin{array}{cc} cos(\psi) & sin(\psi) \\ \frac{-1}{a} sin(\psi) & \frac{1}{a} cos(\psi) \end{array} \right] \left[\begin{array}{c} \mu_x \\ \mu_y \end{array} \right] $$where, \(q = [x~y~\psi] \) and \( q_d\) represents the desired trajectory.
We define a Lyapunov as,
$$ L = \frac{1}{2} \tilde{q}^T \tilde{q} $$Taking derivative gives,
$$ \dot{L} = \tilde{q}^T \dot{\tilde{q}} = \tilde{q}^T (\dot{q} - \dot{q}_d) $$ $$ \dot{L} = (x-x_d)\mu_x + (y-y_d) \mu_y + (\psi - \psi_d) \omega $$ $$ \dot{L} = (x-x_d)(\mu_x - \dot{x}_d) + (y-y_d) (\mu_y - \dot{y}_d) + (\psi - \psi_d)(\omega - \dot{\psi}_d) $$Therefore choosing,
$$ \mu_x = - K_x(x-x_d) + \dot{x_d} $$$$ \mu_y = - K_y(y-y_d) + \dot{y_d} $$$$ \omega = - K_\psi(\psi - \psi_d)+ \dot{\psi}_d $$Gives the Lyapunov function as,
$$ \dot{L} = - K_x(x-x_d)^2 - K_y (y-y_d)^2 -K_\psi (\psi - \psi_d)^2 $$Therefore,
$$ u = (- K_x(x-x_d) + \dot{x_d} ) cos(\psi) + (- K_y(y-y_d) + \dot{y_d}) sin(\psi) = u_d $$and
$$ \omega = -\frac{1}{a} \left( (- K_x(x-x_d) + \dot{x_d} ) sin(\psi) -(- K_y(y-y_d) + \dot{y_d}) cos(\psi)\right) = \omega_d $$From before, we have,
$$ \dot{L}_u = (u-u_d)(\dot{u}-\dot{u}_d) + (\omega-\omega_d)(\dot{\omega}-\dot{\omega}_d) - K_x(x-x_d)^2 - K_y (y-y_d)^2 -K_\psi (\psi - \psi_d)^2 $$$$ \dot{L}_u = (u-u_d)(\dot{u}-\dot{u}_d) + (\omega-\omega_d)(\dot{\omega}-\dot{\omega}_d) - K_x(x-x_d)^2 - K_y (y-y_d)^2 -K_\psi (\psi - \psi_d)^2 $$Choosing,
$$ u_{ref}= -K_u(u-u_d) + \dot{u}_d + u - \omega^2 $$and
$$ \omega_{ref}= -K_\omega (\omega-\omega_d) + \dot{\omega}_d + \omega - u \omega $$gives,
$$ \dot{L}_u = -K_u(u-u_d)^2 + -K_\omega(\omega-\omega_d)^2- K_x(x-x_d)^2 - K_y (y-y_d)^2 -K_\psi (\psi - \psi_d)^2 $$Therefore,
$$ u_d = (- K_x(x-x_d) + \dot{x_d} ) cos(\psi) + (- K_y(y-y_d) + \dot{y_d}) sin(\psi) $$and
$$ \omega_d = -\frac{1}{a} \left( (- K_x(x-x_d) + \dot{x_d} ) sin(\psi) -(- K_y(y-y_d) + \dot{y_d}) cos(\psi)\right) $$along with,
$$ u_{ref}= -K_u(u-u_d) + \dot{u}_d + u - \omega^2 $$and
$$ \omega_{ref}= -K_\omega (\omega-\omega_d) + \dot{\omega}_d + \omega - u \omega $$gives a stable control system that drives states to desired values.