# Design and Experimental Comparison of PID, LQR and MPC Stabilizing Controllers for Parrot Mambo Mini-Drone

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

^{®}/Simulink™ environment was considered as the simulation platform. The successful simulation results finally led to the implementation of the controllers in real-time in the Parrot Mambo mini-drone. Here, MPC surpasses PID and LQR in ensuring the system’s stability and robustness in simulation and real-time experiment results. Thus, this work makes a contribution by introducing the impact of MPC on this quadrotor platform, such as system stability and robustness, and showing its efficacy over PID and LQR. All three controllers demonstrate similar tracking performance in simulations and experiments. In steady state, the maximal pitch deviation for the PID controller is 0.075 rad, for the LQR, it is 0.025 rad, and for the MPC, it is 0.04 rad. The maximum pitch deviation for the PID-based controller is 0.3 rad after the take-off impulse, 0.06 rad for the LQR, and 0.17 rad for the MPC.

## 1. Introduction

## 2. Parrot Mini-Drone

#### 2.1. Kinematics

#### 2.2. Dynamics

## 3. Control Strategies

#### 3.1. PID-Based Control

#### 3.2. Linear Quadratic Regulator

#### 3.3. Model-Predictive Controller

- Construct a discrete-time state-space model.
- Over a predefined prediction horizon, it predicts future plant states and outputs for a given control signal sequence over a predefined control horizon.
- Quadratic optimization procedure selects a control sequence, which minimizes the closed-loop cost function.
- Only the first sample from the optimal control signal is applied to the plant.
- The method is then repeated from step 2 sequentially.

#### 3.3.1. Plant Model

#### 3.3.2. Control Design

#### 3.3.3. Constrain Handling

## 4. Simulation Results

## 5. Experimental Results

## 6. Conclusions

- -
- The employment of a PID-based controller on a quadrotor platform is straightforward, given the accumulated research on the topic. The PID approach is advantageous because it allows manual parameter tuning but does not provide a unified, systematic way to optimize the system performance. We do not claim that simulated and experimental PID performance will be as poor with all the possible parameter tunings. However, for our time spent tuning the PID controller, we could not find tunings that led to a better result. The tuning of multivariate PID controllers is mostly a heuristic task trying to balance the requirements of several feedback loops with the aim of keeping internal stability.
- -
- The application of LQR for mini-drone stabilization is also extensively investigated on various platforms. It generally shows better performance in tracking and stability than PID-based controllers, which was confirmed by our simulations and experiments. The tuning of LQR requires less effort than tuning of PID because the existence of a solution to the algebraic Riccati equation guarantees the closed-loop stability. Interestingly, in experimental work, both MPC and LQR show similar tracking errors along the altitude.
- -
- This work brings novelty to the Parrot Mambo platform by offering MPC and introducing its characteristics and suitability. This work substantiates that MPC can be considered to ensure the stability and robustness of the system; however, simulation work shows poor performance in tracking than LQR. The explanation can be found that LQR provides an infinite time horizon quadratic cost minimization, while the MPC is always limited to a finite time horizon. Moreover, the iterative nature of MPC solution calculation may not always converge to a solution that minimizes the cost function. Practical tuning of the MPC weights to run on a Parrot Mambo drone proved a very hard task, requiring a lot of experiments.
- -
- The practical implementation of the proposed controllers was facilitated by the automatic code generation capabilities offered by the Simulink Coder. That mostly eliminated the need to perform lower-level system programming. The microcontroller installed in the Parrot Mambo drone is powerful enough to support each of the designed controllers. However, we have reached some limitations with the implementation of MPC. Due to its intensive computation requirements, we had to limit the prediction horizon to 10 samples and increase its sample time to 100 ms in order to perform a successful experiment. The LQR is far more efficient in implementation than MPC. The greatest benefit of MPC is that it allows explicit account for the control signal amplitude and rate constraints.
- -
- A relatively large mismatch between the simulation and experimental results is evident in the present research. We have explored a vast number of controller parameter values, which led us to the conclusion that there is inherent uncertainty in the linearized model, which can explain the differences between the simulation and experimental results. That can be compensated by performing a special identification experiment with random signals to extract statistical estimates about model parameters or estimate a state-space model directly using subspace identification methods.

## Supplementary Materials

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Olejnik, A.; Kiszkowiak, Ł.; Rogólski, R.; Chmaj, G.; Radomski, M.; Majcher, M.; Omen, Ł. The Use of Unmanned Aerial Vehicles in Remote Sensing Systems. Sensors
**2020**, 20, 2003. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Mehmood, Y.; Aslam, J.; Ullah, N.; Chowdhury, S.; Techato, K.; Alzaed, A. Adaptive Robust Trajectory Tracking Control of Multiple Quad-Rotor UAVs with Parametric Uncertainties and Disturbances. Sensors
**2021**, 21, 2401. [Google Scholar] [CrossRef] [PubMed] - Ganesan, R.; Raajini, X.M.; Nayyar, A.; Sanjeevikumar, P.; Hossain, E.; Ertas, A.H. BOLD: Bio-Inspired Optimized Leader Election for Multiple Drones. Sensors
**2020**, 20, 3134. [Google Scholar] [CrossRef] [PubMed] - Sun, C.; Liu, M.; Liu, C.; Feng, X.; Wu, H. An Industrial Quadrotor UAV Control Method Based on Fuzzy Adaptive Linear Active Disturbance Rejection Control. Electronics
**2021**, 10, 376. [Google Scholar] [CrossRef] - Zulu, A.; John, S. A Review of Control Algorithms for Autonomous Quadrotors. arXiv
**2016**, arXiv:1602.02622. [Google Scholar] [CrossRef] [Green Version] - Junior, J.C.V.; Paula, J.C.; De Paula, J.C.; Leandro, G.V.; Bonfim, M.C. Stability Control of a Quad-rotor Using a PID Controller. Braz. J. Instrum. Control
**2013**, 1, 15–20. [Google Scholar] [CrossRef] [Green Version] - ElKholy, H. Dynamic Modeling and Control of a Quadrotor Using Linear and Nonlinear Approaches. Master’s Thesis, The American University in Cairo, New Cairo, Egypt, 2014. [Google Scholar]
- Kendoul, F. Survey of advances in guidance, navigation, and control of unmanned rotorcraft systems. J. Field Robot.
**2012**, 29, 315–378. [Google Scholar] [CrossRef] - Baek, J.; Jung, J. A Model-Free Control Scheme for Attitude Stabilization of Quadrotor Systems. Electronics
**2020**, 9, 1586. [Google Scholar] [CrossRef] - Patel, B.; Patle, B. Analysis of Firefly–Fuzzy Hybrid Algorithm for Navigation of Quad-Rotor Unmanned Aerial Vehicle. Inventions
**2020**, 5, 48. [Google Scholar] [CrossRef] - Everett, M.F. LQR with Integral Feedback on a Parrot mini-drone. Massachusetts Institute of Technology, Tech. Rep. 2015. Available online: http://mfe.scripts.mit.edu/portfolio/img/portfolio/16.31/16.31longreport.pdf (accessed on 7 April 2022).
- Glazkov, T.V.; Golubev, A.E. Using Simulink Support Package for Parrot mini-drones in nonlinear control education. In AIP Conference Proceedings; AIP Publishing LLC: Melville, NY, USA, 2019; Volume 2195, p. 020007. [Google Scholar]
- Castañeda, H.; Gordillo, J. Embedded Flight Control Based on Adaptive Sliding Mode Strategy for a Quadrotor Micro Air Vehicle. Electronics
**2019**, 8, 793. [Google Scholar] [CrossRef] [Green Version] - Islam, M.; Okasha, M.; Idres, M.M. Trajectory tracking in quadrotor platform by using PD controller and LQR control approach. In IOP Conference Series: Materials Science and Engineering; IOP Publishing: Bristol, UK, 2017; Volume 260, p. 012026. [Google Scholar] [CrossRef]
- Sabatino, F. Quadrotor Control: Modeling, Nonlinearcontrol Design, and Simulation. Master’s Thesis, Electrical Engineering, KTH Royal Institute of Technology, Stockholm, Sweden, 2015. [Google Scholar]
- Islam, M.; Okasha, M.; Idres, M.M. Dynamics and control of quadcopter using linear model predictive control approach. In IOP Conference Series: Materials Science and Engineering; IOP Publishing: Bristol, UK, 2017; Volume 270, p. 012007. [Google Scholar] [CrossRef]
- Rodríguez-Abreo, O.; Garcia-Guendulain, J.M.; Hernández-Alvarado, R.; Flores Rangel, A.; Fuentes-Silva, C. Genetic Algorithm-Based Tuning of Backstepping Controller for a Quadrotor-Type Unmanned Aerial Vehicle. Electronics
**2020**, 9, 1735. [Google Scholar] [CrossRef] - Lyu, H. Multivariable Control of a Rolling Spider Drone; University of Rhode Island: Kingston, RI, USA, 2017. [Google Scholar]
- Islam, M.; Okasha, M.; Sulaeman, E. A Model Predictive Control (MPC) Approach on Unit Quaternion Orientation Based Quadrotor for Trajectory Tracking. Int. J. Control Autom. Syst.
**2019**, 17, 2819–2832. [Google Scholar] [CrossRef] - Murillo, M.H.; Limache, A.C.; Fredini, P.S.R.; Giovanini, L.L. Generalized nonlinear optimal predictive control using iterative state-space trajectories: Applications to autonomous flight of UAVs. Int. J. Control Autom. Syst.
**2015**, 13, 361–370. [Google Scholar] [CrossRef] - Saif, A.W.A.; Aliyu, A.; Dhaifallah, M.A.; Elshafei, M. Decentralized backstepping control of a quadrotor with tilted-rotor under wind gusts. Int. J. Control Autom. Syst.
**2018**, 16, 2458–2472. [Google Scholar] [CrossRef] - Islam, M.; Okasha, M. A Comparative Study of PD, LQR and MPC on Quadrotor Using Quaternion Approach. In Proceedings of the 2019 7th International Conference on Mechatronics Engineering (ICOM), Putrajaya, Malaysia, 30–31 October 2019; pp. 1–6. [Google Scholar]
- Mathworks. QP Solver. 2018. Available online: https://www.mathworks.com/help/mpc/ug/qp-solver.html (accessed on 7 April 2022).
- Yuan, Q.; Zhan, J.; Li, X. Outdoor flocking of quadcopter drones with decentralized model predictive control. ISA Trans.
**2017**, 71, 84–92. [Google Scholar] [CrossRef] [PubMed]

**Figure 1.**Configuration of the quadrotor. E(X,Y,Z)—Earth frame; B(x,y,z)—body fixed frame; Ω

_{i}—rotor angular velocity; F

_{i}—rotor lift force.

**Table 1.**Parrot mini-drone inertial parameters [18].

Parameter | Value | Unit |
---|---|---|

Mass, m | 0.068 | kg |

Length of an arm, l | 0.062 | m |

Gravity, g | 9.81 | $\mathrm{m}/{\mathrm{s}}^{2}$ |

$\mathrm{Moment}\mathrm{of}\mathrm{inertia}\mathrm{along}x\mathrm{axis},{I}_{x}$ | $6.86\times {10}^{-5}$ | $\mathrm{kg}{\mathrm{m}}^{2}$ |

$\mathrm{Moment}\mathrm{of}\mathrm{inertia}\mathrm{along}y\mathrm{axis},{I}_{y}$ | $9.2\times {10}^{-5}$ | $\mathrm{kg}{\mathrm{m}}^{2}$ |

$\mathrm{Moment}\mathrm{of}\mathrm{inertia}\mathrm{along}z\mathrm{axis},{I}_{z}$ | $1.366\times {10}^{-4}$ | $\mathrm{kg}{\mathrm{m}}^{2}$ |

$\mathrm{Thrust}\mathrm{coefficient},{k}_{F}$ | 0.01 | $\mathrm{N}/\left({\mathrm{rad}}^{2}/{\mathrm{s}}^{2}\right)$ |

$\mathrm{Thrust}\mathrm{coefficient},{k}_{M}$ | $7.8263\times {10}^{-4}$ | $\mathrm{Nm}/\left({\mathrm{rad}}^{2}/{\mathrm{s}}^{2}\right)$ |

Cost Name | Weight (%) | Interval |
---|---|---|

${W}_{pos,X}$ | 0.08 | [0, 1] |

${W}_{pos,Y}$ | 0.08 | [0, 1] |

${W}_{pos,Z}$ | 100.5 | [0, 1] |

${W}_{\phi ,\theta ,\psi}$ | 0.175 | [0, 0.35] |

${W}_{u,v,w}$ | 0.0583 | [0, 1] |

${W}_{p,q,r}$ | 0.8 | [0, 1] |

Dim | PID | LQR | MPC |
---|---|---|---|

X error | 29.005 | 111.7 | 103.61 |

Y error | 51.654 | 150.14 | 103.61 |

Z error | 21.895 | 8.9773 | 6.047 |

$\mathsf{\varphi}$ error | 13.146 | 2.2553 | 4.1943 |

$\mathsf{\theta}$ error | 3.7284 | 1.6177 | 2.9035 |

$\mathsf{\psi}$ error | 0.5375 | 0.0372 | 12.24 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Okasha, M.; Kralev, J.; Islam, M.
Design and Experimental Comparison of PID, LQR and MPC Stabilizing Controllers for Parrot Mambo Mini-Drone. *Aerospace* **2022**, *9*, 298.
https://doi.org/10.3390/aerospace9060298

**AMA Style**

Okasha M, Kralev J, Islam M.
Design and Experimental Comparison of PID, LQR and MPC Stabilizing Controllers for Parrot Mambo Mini-Drone. *Aerospace*. 2022; 9(6):298.
https://doi.org/10.3390/aerospace9060298

**Chicago/Turabian Style**

Okasha, Mohamed, Jordan Kralev, and Maidul Islam.
2022. "Design and Experimental Comparison of PID, LQR and MPC Stabilizing Controllers for Parrot Mambo Mini-Drone" *Aerospace* 9, no. 6: 298.
https://doi.org/10.3390/aerospace9060298