# Real-Time Terrain-Following of an Autonomous Quadrotor by Multi-Sensor Fusion and Control
## 4 Simulation and Experiment Evaluations
### Carton Box Avoidance Experiment  
To simulate the drastic changes of relative height to the ground, we carried out a carton box avoidance experiment to validate the proposed control algorithm. The assembled quadrotor as the experimental platform used a core controller stm32f427 cortex M4 and output inertial data with an mpu9250 nine axis IMU. Lidar-lite V3, a high-precision laser-range-finder, was used in the ranging sensor. Its data update frequency can reach 400 Hz, which can meet the requirements of high dynamic ranging. The cascade PID control algorithm was transplanted to flight control. The laser-range-finder height was taken as the output of the outer loop and the change rate of the measured altitude with time was taken as the input of the inner loop. The control performance test was carried out in an open outdoor field in Southeast University, China. The wheelbase of our quadrotor was 400 mm and the parameters of its brushless motor are shown in Table 4.  
In order to simulate the height mutation of ground obstacles, a 0.48 m high carton was placed on flat ground as shown in Figure 10. Considering the great influence of high winds before take-off, the expected height of the UAV was set as 1.9 m, the horizontal flight speed was set as 0.5 m/s and the UAV was manipulated to fly over the carton repeatedly for 10 times. The controlled variables and experimental scenarios in the experiment are shown in Table 5 and Figure 10, respectively. When the quadrotor was holding its altitude,  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline m/kg & 1.2 \\ K & 1542 \\ \(T_{m}\) & 0.153 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Parameters of the brushless motor.  
Figure 9: Dynamic response curve of the single-stage/cascade PID controller.  
the proposed controller should have detected the edge of the box and manipulated it to fly over the box.  
The resulting height data of the multi-sensor based controller can be seen in Figure 11 with the target height of 10 m above flat terrain. The difference in the performance of the height control clearly illustrates a better stability and sensitivity of the multi-sensor control. Therefore, the multi-sensor based control can react quickly especially with a reliable position and the velocity control in the z-axis.  
Figure 11: Comparison of the multi-sensor height control of the quadrotor above flat terrain.  
Figure 10: Terrain-following experiment of the quadrotor above the ground with the cardboard box as the obstacle or the ground undulation.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Variables** & **Values/m** \\ \hline Height of the obstacle (the box) & 0.48 \\ Width of the obstacle (the box) & 1.2 \\ Travel speed of the quadrotor (m/s) & 0.5 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Variable setting of the experiment.  
For the height control of the quadrotor, we implemented with a PID and a cascade PID controller, respectively. The laser-range-finder measurements for the two controllers and the target height (1.9 m) are shown in Figure 12.  
From the comparison of the fixed height flight results in Figure 12a,b, it can be seen that the adjustment time of the cascade PID controller was much less than that of the PID controller in the case of sudden changes of the ground altitude. In addition, the stability of the cascade PID control was better than that of the PID. After considering the statistics of all of the height measurement data, the shortest time from detecting a height change to reaching the desired height was 1.13 s and the longest time was 1.66 s when using the PID controller; when using the cascade PID controller, the shortest time was 0.43 s and the longest time was 0.75 s. The adjustment time of the cascade PID controller improved over 50% than that of the PID controller.