**1. Introduction**

130 Frontiers of Model Predictive Control

Richalet, J. (1993). Industrial applications of model based predictive control. *Automatica*, 29

Siller-Alcalá, I.I. (2001). Generalized predictive control for nonlinear systems with unstable

Van Raumer, T. (1994). Nonlinear adaptive control of induction machine. PhD thesis (in

zero dynamics. *Journal of the Mexican Society of Instrumentation and Development*, 5

(5), pp. 1251-1274.

(3), pp. 146-151.

French), LAG, Grenoble, France.

In recent years, unmanned aerial vehicles (UAVs) have been shown a rapid development equipped with intelligent flight control devices. Many advantages could be offered by UAVs, due to their widely applications (Garcia and Valavanis, 2009).

Flight control is the principle unit for UAVs to perform a full autonomous mission without or with less interference of a human pilot. Numerous types of control have been developed for small-scale helicopters including classical, intelligent and vision controls.

The most conventional and common control methods that have been used by many researchers are the SISO controls, i.e., PI or PID control because their requirements are not highly dependent on the accuracy of the plant model. Two control approaches are proposed by Kim and Shim (2003), a multi-loop PID controller and a nonlinear model predictive control for the purpose of trajectory tracking. This strategy shows satisfactory results when applied to the Yamaha R-50. However, if large perturbations need to be compensated, or significant tracking abilities are required, this strategy may not be adequate.

Wenbing, et al (2007) presented a multiple-input-multiple-output (MIMO) neural network controller which has a structure of two inputs and two outputs to control a small-scale helicopter. The neural network controller is used with a simple adaptive PID configuration. The PID gains *ki, kp* and *kd* are tuned online via the training of the proposed neural networks during the flight.

Srikanth, James and Gaurav (2003) combined vision with low-level control to perform the landing operation of the helicopter. The vision control navigates the commands to a lowlevel controller to achieve a robust landing. In their experiments, state initializations were set in the hover condition arbitrarily. The idea was to find the helipad, then align with it, and land on it. The low-level (roll, pitch lateral and heading) controls were implemented with a proportional controller. The altitude behaviour was implemented with a PI controller. To make altitude control easier, the PI controller was split into three: sub-hover control, velocity and sonar control.

$$\mathfrak{H}\_{\mathbf{m}}(\mathbf{k}) = N\left[ \, \mathfrak{y}\_{\mathbf{m}}(\mathbf{k} - 1), \dots, \, \mathfrak{y}\_{\mathbf{m}}(\mathbf{k} - n\_{\mathbf{a}}), \, \mathfrak{u}\_{\mathbf{r}}(\mathbf{k} - n\_{\mathbf{k}}), \dots, \, \mathfrak{u}\_{\mathbf{r}}(\mathbf{k} - n\_{\mathbf{k}} - n\_{\mathbf{b}} + 1) \right] + e\_{\mathbf{m}}(\mathbf{k}) \tag{1}$$

$$\begin{cases} \chi\_m(k+1) = A\_m \chi\_m(k) + B\_m u\_r(k) \\ \chi\_m(k) = C\_m \chi\_m(k) + D\_m u\_r(k) \end{cases} \tag{2}$$


$$B\_m = \begin{bmatrix} -0.04578 & -0.07926 & -0.02391 & 0.1732 \\ 0.001391 & 0.00249 & 0.0007266 & -0.005263 \\ 0.266 & 0.06643 & 0.02064 & -0.1495 \\ -0.9375 & 0.0626 & 0.0899 & -0.1366 \\ -0.05145 & -0.1165 & -0.03514 & 0.2998 \\ -0.03485 & -0.02161 & -0.00652 & 0.07997 \\ 0.1059 & 0.1834 & 0.05529 & 0.9798 \\ -0.01412 & -0.02441 & 0.9926 & 0.05346 \\ 0.04682 & -0.9189 & 0.02449 & -0.1771 \end{bmatrix}$$

$$\mathcal{L}\_m = \begin{bmatrix} -2.473 & -7.36 & 3.98 & 0.2138 & -7.225 & -8.439 & 1.357 & 0.9117 & 4.069 \\ 1.657 & 0.04449 & -1.599 & -0.04054 & 0.1303 & 0.5443 & -1.073 & -3 & 0.8277 \\ -0.1596 & -6.469 & 1.333 & 3.037 & 5.237 & 0.1375 & -4.339 & 0.3119 & -1.192 \end{bmatrix}$$

$$D\_m = \begin{bmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix}$$

$$
\kappa\_m(k+1) - \kappa\_m(k) = A\_m\{\mathbf{x}\_m(k) - \mathbf{x}\_m(k-1)\} + B\_m(\mathbf{u}\_r(k) - \mathbf{u}\_r(k-1))\tag{3}
$$

$$\begin{cases} \Delta \boldsymbol{x}\_m(k+1) = \boldsymbol{x}\_m(k+1) - \boldsymbol{x}\_m(k) \\ \Delta \boldsymbol{x}\_m(k) = \boldsymbol{x}\_m(k) - \boldsymbol{x}\_m(k-1) \\ \Delta \boldsymbol{u}(k) = \boldsymbol{u}\_r(k) - \boldsymbol{u}\_r(k-1) \end{cases} \tag{4}$$

$$
\Delta \mathfrak{x}\_m(k+1) = A\_m \Delta \mathfrak{x}\_m(k) + B\_m \Delta \mathfrak{u}\_r(k) \tag{5}
$$

$$\begin{array}{l} \Delta \mathbf{y}\_m(k+1) = \mathcal{C}\_m \Delta \boldsymbol{\chi}\_m(k+1) + D\_m \Delta \boldsymbol{\mu}\_r(k+1) \\ = \mathcal{C}\_m A\_m \Delta \boldsymbol{\chi}\_m(k) + \mathcal{C}\_m B\_m \Delta \boldsymbol{\mu}\_r(k) + D\_m \Delta \boldsymbol{\mu}\_r(k+1) \end{array} \tag{6}$$

$$
\Delta \mathbf{y}\_m(k+1) = \mathbf{y}\_m(k+1) - \mathbf{y}\_m(k) \tag{7}
$$

$$\mathbf{x}(k) = [\Delta \mathbf{x}\_m(k)^T \; \mathbf{y}\_m(k)^T]^T \; \text{ }, \tag{8}$$

$$
\begin{bmatrix}
\Delta \mathbf{x}\_m (k+1) \\
\mathbf{y}\_m (k+1)
\end{bmatrix} = \begin{bmatrix}
A\_m & o\_m \\
C\_m A\_m & I\_{m \times m}
\end{bmatrix} \begin{bmatrix}
\Delta \mathbf{x}\_m (k) \\
\mathbf{y}\_m (k)
\end{bmatrix} + \begin{bmatrix}
B\_m \\
C\_m B\_m
\end{bmatrix} \Delta u\_r(k) + \begin{bmatrix}
o\_m \\D\_m
\end{bmatrix} \Delta u\_r(k+1) \tag{9}
$$

$$
\Delta u\_r(k), \Delta u\_r(k+1), \dots, \Delta u\_r(k+N\_\mathcal{C}-1) \; , \tag{10}
$$

$$\left(\mathbf{x}(k+1\mid k), \mathbf{x}(k+2\mid k), \dots, \mathbf{x}(k+p\mid k), \dots, \mathbf{x}(k+Np\mid k)\right),\tag{11}$$

$$\mathbf{x}(k+Np \mid k=A^{Np}\mathbf{x}(k) + A^{Np-1}B\mathbf{x}(k) + A^{Np-2}B\mathbf{x}(k+1) + \dots + A^{Np-N\_c}B\mathbf{x}(k+N\_c-1) \tag{12}$$

$$\begin{split} y\_m(k + Np \mid k) &= CA^{Np} \boldsymbol{\chi}(k) + CA^{Np-1} \boldsymbol{\chi}(k) + CA^{Np-2} B \Delta u\_q(k+1) + \cdots \\ &+ CA^{Np-N\_c} B \Delta u\_q(k + N\_c - 1) \end{split} \tag{13}$$

$$\mathbf{y}\_m = [\mathbf{y}\_m(k+1\mid k)\,\mathbf{y}\_m(k+2\mid k)\,\mathbf{y}\_m(k+3\mid k), \dots, \mathbf{y}\_m(k+N\mathbf{p}\mid k)]^T \tag{14}$$

$$
\Delta U = \begin{bmatrix} \Delta u\_q(k) \ \Delta u\_q(k+1) \ \Delta u\_q(k+2) \dots \Delta u\_q(k+N\_c-1) \end{bmatrix}^T \tag{15}
$$

$$Y = F\mathfrak{x}(k) + Q\Delta U \tag{16}$$

$$J = (R\text{s} - Y)^T (R\text{s} - Y) + \Delta U^T \mathbb{R} \Delta \text{U} \tag{17}$$

$$(\mathbf{R}\mathbf{s} - \mathbf{Y})^T(\mathbf{R}\mathbf{s} - \mathbf{Y})$$

$$F = \begin{bmatrix} CA^2 \\ CA^3 \\ \vdots \\ CA^{N\_p} \end{bmatrix} Q = \begin{bmatrix} CAB & CA & \dots & 0 \\ CA^2B & CAB & \dots & 0 \\ \vdots & & & 0 \\ CA^{N\_p - 1}B & CA^{N\_p - 2}B & \dots & CA^{N\_p - N\_c}B \end{bmatrix} \tag{18}$$

$$\frac{\partial J}{\partial \Delta U} = -2Q^T (R\mathbf{s} - F\mathbf{x}(k)) + 2(Q^T Q + \mathcal{R})\Delta U \tag{19}$$

$$
\Delta U = (Q^T Q + \bar{R})^{-1} \ast Q^T (R\text{s} - F\text{x}(k)) \tag{20}
$$

$$Q^T Q = \begin{bmatrix} 1.1735 & 0 & 0 \\ 0 & 1.1735 & 0 \\ 0 & 0 & 1.1735 \end{bmatrix} \tag{21}$$

$$
\mathcal{R} = \begin{bmatrix}
0.08521 & 0 & 0 & 0 \\
0 & 0.08521 & 0 & 0 \\
0 & 0 & 0.08521 & 0 \\
0 & 0 & 0 & 0.08521
\end{bmatrix} \tag{22}
$$

Development of Real-Time Hardware in the Loop Based MPC for Small-Scale Helicopter 139

nose of the helicopter and connected to the target PC-104 through a serial port. The corresponding pins of the I/O counter/timer board were connected to the servo actuators via a servo interface circuit. This circuit is an RC filter used to protect the I/O board form noises produced by the Helicopter components such as the actuators. The PC-104's

To test the designed MPC, a simulation of the helicopter performance under different setpoints is studied. The step response of the helicopter with the introduction of the disturbance in the roll angle is presented in Fig.3. The amplitudes of the roll, pitch and yaw angles are 12, 10 and 13 degrees, respectively. At 5 seconds, a disturbance with amplitude of 5 degrees is introduced. It can be seen that the controller damps down the amplitude of the angle to 13.3 out of 17 degrees in approximately 5 seconds. The effect of the disturbance on the other states is less and it would appear that there is a small steady state error in the yaw

The designed MPC has also been tested to track a square wave with a variety of amplitudes for Euler angles. The performance of the controller is good for all the utilized amplitudes, as

Plant Outputs

0 5 10 15 20 25 30

Time (sec)

processor runs the developed system in real time operating system.

**5. Simulation results** 

angle after 5 seconds of simulation.

illustrated in Figures 4, 5 and 6.


20

0

10

Roll (Deg)

Pitch (Deg)

20

Fig. 3. Step responses


0

10

yaw (Deg)

20


0

10
