# Implementation of the Control of a Quadrotor, as taught in Aerial Robotics in Coursera [closed]

I completed the course of Aerial Robotics in Coursera and I want to implement what I learned in a real quadrotor. The thing is that when I see the equations given like this: For the sake of the argument let's assume I have implemented the PD Controllers and every moment I find u1 (the sum of the forces applied to the quadrotor) and u2 (the sum of the moments applied to the quadrotor). I then ask myself: How can I find what force and moment should specifically each one of the motors produce? And here I am stuck as I can't find an answer.Could anyone help?

• are you planning on having a physical quadrotor which you are controlling? – holmeski Nov 24 '16 at 14:33
• yeap, I do have one and I'm controling it with Arduino for now – M.Karam Nov 24 '16 at 14:54
• i recommend getting a purpose built autopilot. it'll save a lot of headaches – holmeski Nov 24 '16 at 15:01
• Yeah but the thing is that the purpose of the drone is not to control it with PID – M.Karam Nov 24 '16 at 15:16
• But to experiment on nonlinear control – M.Karam Nov 24 '16 at 15:17

## 1 Answer

If i've understood your question correctly, you are trying to convert the desired set of moments and total force which you calculated from a hypothetical pd controller into a set of forces. This is the relation that needs to be solved

$$\begin{bmatrix} u_1\\ \mathbf{u}_2 \end{bmatrix} = \begin{bmatrix} 1&1&1&1\\ 0&L&0&-L\\ -L&0&L&0\\ \gamma&-\gamma&\gamma&-\gamma \end{bmatrix} \begin{bmatrix} F_1\\ F_2\\ F_3\\ F_4\\ \end{bmatrix}$$

where $u_1$ is the total force of all motors and $\mathbf{u}_2$ is the vector of moments acting on the system. This can simply be solved for by inverting this matrix. So $$\begin{bmatrix} 1&1&1&1\\ 0&L&0&-L\\ -L&0&L&0\\ \gamma&-\gamma&\gamma&-\gamma \end{bmatrix}^{-1} \begin{bmatrix} u_1\\ \mathbf{u}_2 \end{bmatrix} = \begin{bmatrix} F_1\\ F_2\\ F_3\\ F_4\\ \end{bmatrix}$$