I'm currently trying to (re)learn automatic control 2 years after having finished college, and I'm having a hard time. I'm trying to control a simplistic lunar lander in a 2d space.
The only way to control it is to change its angle and/or thrust power, so I have the following state-space representation:
$$ x=\begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} $$
$$ \begin{gather} \dot{x} = \begin{bmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} x\;+ \begin{bmatrix} 0 & 0 \\ 0 & 0 \\ 1 & 0 \\ 0 & 1 \end{bmatrix} u \end{gather} $$
Where:
- x$_1$ is the horizontal position
- x$_2$ is the vertical position
- x$_3$ is the horizontal velocity
- x$_4$ is the vertical velocity
And u is the command, accelerations on respectively the horizontal and vertical coordinates. My problem is the acceleration is unidirectional, and its horizontal and vertical components are correlated:
$$ \begin{gather} u = \begin{bmatrix} a\times\cos{\theta} \\ a\times\sin{\theta} - g \end{bmatrix} \end{gather} $$
$a$ is the acceleration provided by the thruster and $\theta$ is the angle of the lander. $g$ is the gravity constant.
Since the system is linear, I could calculate the feedback control with the gain K, but I realize this K would consider the two input commands are independent.
I've been stuck on this for a few days, I've tried including $\theta$ and $a$ in $x$ so $u$ could simply be an angular velocity and an acceleration derivative, which would be independent, but then the system becomes nonlinear and I have no idea how to solve it.
Maybe my approach is wrong, but I'm honestly lost here, could anyone explain to me what I did wrong or how I could take this input restriction into account in the feedback loop?
ADDENDUM 1: I'm considering for the sake of simplicity that I can freely and instantly change $\theta$ and $a$.
Since $a$ and $\theta$ are essentially polar coordinates. So if you have a state feedback control law $u=-K\,x$ then you can solve for $a$ and $\theta$ given each value for $u$. Namely
\begin{align} a &= \sqrt{u_1^2 + (u_2 + g)^2} \\ \theta &= \text{atan2}(u_2 + g, u_1) \end{align}