**5. Simulation results**

138 Frontiers of Model Predictive Control

A part of this work is to implement the above Simulink model to the target PC-104. Fig.2 presents the overall experimental prototype setup. The IMU sensor was mounted on the

(a): xpctarget prototype configuration

(b): Helicopter platform

**4. Experimental setup** 

Fig. 2. Experimental setup

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 angle after 5 seconds of simulation.

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 illustrated in Figures 4, 5 and 6.

Fig. 3. Step responses

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

MPC X Y Plot Refrence

Fig. 6. Square wave yaw angle tracking with the MPC controller.

MPC is designed based on linearized model of the platform.

This section presents the implementation of developed hardware in the loop system. Two experiments were conducted in this work. The first is conducted where the flight test data were used as reference model and disabling the role of the IMU. Figures 4, 5 and 6 present the generated inputs by the real time MPC to the system to follow the reference model compared with the given inputs system during the flight test. From Fig 1, the collected PWM signals are collected as duty cycle; therefore it has to be transferred to the corresponding angles for each actuator. Instead of activating the IMU software, the feedback to the MPC is the reference model itself. It is noticeable that the generated inputs by the MPC do not follow closely the actual inputs used for modelling task. This is because the

0 5 10 15 20 25 30 35 40

Time (sec)

As preliminary step to investigate a real autonomous flight, a second experiment is carried out where the IMU software is enabled (fig1) to test its functioning and also to assess how the MPC is sensitive with disturbances. To achieve these criterions, the reference model is settled to zero and the nose of the helicopter is shaken slightly with small variation, the position of actuators change in order to bring back the system into the still condition i.e. the

**5.1 Experiment results** 




0

Yaw Ang (Deg)

5

10

15

MPC gives the action to the system.

Fig. 4. Square wave roll angle tracking with the MPC controller.

Fig. 5. Square wave pitch angle tracking with the MPC controller

Fig. 6. Square wave yaw angle tracking with the MPC controller.
