# State space model

I want to design a LQR controller for my two wheeled mobile robot. While designing the controller, I need to find gain, K for the LQR which this required the state space model of wheeled mobile robot. My question is how to find the matrix A, B, C and D for this nonlinear system by using the equations below.

The outputs are x, y and theta while inputs are v and w.

• A bit pushed for time right now, so can't really write a decent answer. Does this paper help? – sempaiscuba Mar 13 '18 at 4:59
• Thanks sempaiscuba! But my wheeled robot is not a bicycle. – CK1994 Mar 13 '18 at 5:09
• You can't. This system is nonlinear. You have to options. The first one is to linearize the system. The second is to design nonlinear controller. Also, it seems $v,w$ are the inputs and $x,y,\theta$ are the outputs. – CroCo Mar 13 '18 at 14:25
• Yes sorry my bad. The input is v and w while output is x,y and theta. Croco I know there is a way to linearise the equation but how to linearise it? – CK1994 Mar 13 '18 at 15:19

As an approximation, you could linearize the system. If the nonlinearities are small it's common to linearize about a nominal point such as $\theta=0$, but in your case this might not work well since it would eliminate any lateral dynamics. \begin{align} \dot{x} = v \\ \dot{y} = 0 \\ \dot{\theta} = \omega \end{align}
Another option would be to linearize every timestep. This could get expensive though as your feedback gain matrix, $K$, also needs to be recalculated each time.
Finally, a middle ground could be to linearize about several predefined points, e.g. $\theta=[-20,-15,-10,0,10,15,20]$. At each timestep you would separately compute the control action using the $K_j$ computed for each of these linearization points and then interpolate between those values based on the current $\theta$.