# Quadrotor Formation Strategies Based on Distributed Consensus and Model Predictive Controls
## 7 Simulation Results
### Quadrotor Parameter, Control Gain, and Weighting Matrices  
This section summarizes the parameters of the quadrotor (Table 4), weighting matrices, and consensus control gains that are used in the simulation.  
Figure 11: Configuration of follower’s horizontal motion control.  
Figure 10: Configuration of leader’s horizontal motion control.  
In the simulation, we assume that all the states in both horizontal and vertical motions are obtainable. That is, output matrix \(C\) in the state-space model for both motions for leader and followers is an identity matrix. The weighting matrices for the LQT and QP problem for the leader are given as follows:  
* Weighting matrices \(P\), \(Q\), and \(R\) of the unconstrained QP problem coded in simulink function _Leader MPC Algorithm_ in Figure 10 for the leader's horizontal motion control are given as follows: \[Q = l_{8},\] \[R = 0.5I_{2},\] \[P = \left[\begin{array}{cccccccc}29.8176&0&37.9636&0&25.3123&0&7.1 204&0\\ 0&29.8176&0&37.9636&0&25.3123&0&7.1204\\ 37.9636&0&86.4879&0&67.0493&0&20.8541&0\\ 0&37.9636&0&86.4879&0&67.0493&0&20.8541\\ 25.3123&0&67.0493&0&75.6689&0&26.9672&0\\ 0&25.3123&0&67.0493&0&75.6689&0&26.9672\\ 7.1204&0&20.8541&0&26.9672&0&18.4432&0\\ 0&7.1204&0&20.8541&0&26.9672&0&18.4432\\ \end{array}\right]\] (45)
* Weighting matrices \(P\), \(Q\), and \(R\) for the LQT coded in the simulink function \(LQT\) in Figure 9 for the leader's altitude control are given as follows: \[P=Q=\left[\begin{array}{cc}3&0\\ 0&10\\ \end{array}\right],\quad R=0.5.\] (46)  
As for the follower, the control gains for the consensus control in the horizontal motion and the weighting matrices for the LQT in vertical motion and the unconstrained QP problem in horizontal motion are given as follows:  
* Consensus control gain \(\beta_{ks}\) (\(ks=1,2,3,4\)) in the horizontal motion considering the states in (41) and the consensus control (15) coded in the _Consensus Algorithm_ in Figure 11 are given as follows: \[(\beta_{1},\ \beta_{2},\ \beta_{3},\ \beta_{4})=(13,\ 30,\ 60,\ 5)\,.\] (47)
* Weighting matrices \(P\), \(Q\), and \(R\) of the unconstrained QP problem coded in simulink function _MPC Algorithm_ in Figure 11 for the follower's horizontal motion control are given as follows:  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Symbol** & **Value** & **Unit** \\ \hline Mass of the Quadrotor & m & 1.5 & \(kg\) \\ Acceleration of Gravity & g & 9.807 & \(m/s^{2}\) \\ Quadrotor Arm Length & L & 0.225 & \(m\) \\  & \(l_{xx}\) & 0.022 & \(kg\cdot m^{2}\) \\ Moment of Inertia & \(l_{yy}\) & 0.022 & \(kg\cdot m^{2}\) \\  & \(l_{zz}\) & 0.0018 & \(kg\cdot m^{2}\) \\ \hline \hline \end{tabular} Note: the above parameters were acquired from the quadrotor in the lab.  
\end{table}
Table 4: Parameters of the quadrotor.  
\[Q = I_{8},\] \[R = 0.3I_{2},\] \[P = \left[\begin{array}{cccccccc}28.8987&0&35.3119&0&22.1493&0&5.5294&0 \\ 0&28.8987&0&35.3119&0&22.1493&0&5.5294\\ 35.3119&0&78.6321&0&57.3341&0&15.6844&0\\ 0&35.3119&0&78.6321&0&57.3341&0&15.6844\\ 22.1493&0&57.3114&0&62.9640&0&19.4694&0\\ 0&22.1493&0&57.3114&0&62.9640&0&19.4694\\ 5.5294&0&15.6844&0&19.4694&0&12.6822&0\\ 0&5.5294&0&15.6844&0&19.4694&0&12.6822\\ \end{array}\right] \tag{48}\]
* Weighting matrices \(P\), \(Q\), and \(R\) for the LQT coded in simulink function \(LQT\) in Figure 9 for the follower's altitude control are given as follows: \[Q=P=\left[\begin{array}{cc}3&0\\ 0&10\\ \end{array}\right],\quad R=0.5.\] (49)  
The selection of weighting matrix \(P\) for the unconstrained QP problem utilizes the methodology provided by Reference [18]. The method ensures the MPC objective function has the same quadratic cost as the infinite horizon quadratic cost used by LQR.