4.10 Control using Integral Backstepping
4.10.1 Attitude Control
Attitude control is the heart of the control system, it keeps the 3D orientation of the helicopter to the desired value. Usually roll and pitch angles are forced to zero which permits hovering flight. Attitude control loop runs at 76 Hz which is the update rate of the IMU (Microstrain 3DM-GX1). The latter provides the rates of turn and orientations around (x, y, z) axes with an accuracy of ±2◦ in dynamic. The first step in IB control design is to consider the tracking-error e1= φd− φ and its dynamics:
de1
dt = ˙φd− ωx (4.45) The angular speed ωxis not our control input and has its own dynamics. So,
we set for it a desired behavior and we consider it as our virtual control: ωxd= c1e1+ ˙φd+ λ1χ1 (4.46)
with c1 and λ1 positive constants and χ1 =
Rt
0e1(τ )dτ the integral of roll
tracking error. So, the integral term is now introduced in (4.46).
Since ωxhas its own error e2, we compute its dynamics using (4.46) as follows:
de2
dt = c1( ˙φd− ωx) + ¨φd+ λ1e1− ¨φ (4.47) where e2, the angular velocity tracking error is defined by:
4.10. CONTROL USING INTEGRAL BACKSTEPPING 71
Using (4.46) and (4.48) we rewrite roll tracking error dynamics as: de1
dt = −c1e1− λχ1+ e2 (4.49) By replacing ¨φ in (4.47) by its corresponding expression from model (4.5), the control input U2appears in (4.50):
de2
dt = c1( ˙φd− ωx) + ¨φd+ λ1e1− ˙θ ˙ψa1− ˙θa2Ωr− b1U2 (4.50) The real control input has appeared in (4.50). So, using equations (4.45), (4.49) and (4.50) we combine the tracking errors of the position e1, of the angular
speed e2and of the integral position tracking error χ1to obtain:
de2
dt = c1(−c1e1− λ1χ1+ e2) + ¨φd+ λ1e1− τx/Ixx (4.51) where τxis the overall rolling torque. The desirable dynamics for the angular
speed tracking error is:
de2
dt = −c2e2− e1 (4.52) This is obtained if one chooses the control input U2as:
U2=
1 b1
[(1 − c21+ λ1)e1+ (c1+ c2)e2− c1λ1χ1+ ¨φd− ˙θ ˙ψa1− ˙θa2Ωr] (4.53)
where c2 is a positive constant which determines the convergence speed of
the angular speed loop. Similarly, pitch and yaw controls are: U3= b1 2[(1 − c 2 3+ λ2)e3+ (c3+ c4)e4− c3λ2χ2+ ¨θd− ˙φ ˙ψa3+ ˙φa4Ωr] U4= b1 3[(1 − c 2 5+ λ3)e5+ (c5+ c6)e6− c5λ3χ3] (4.54) with (c3, c4, c5, c6, λ2, λ3) > 0, and (χ2, χ3) the integral position tracking
error of pitch and yaw angles respectively.
Stability Analysis
Stability analysis is performed using Lyapunov theory. The following candi- date Lyapunov function is chosen:
V = λ1 2[χ
2
72 4. SYSTEM CONTROL
It includes the position tracking error e1, its integration χ1 and velocity
tracking error e2. Deriving (4.55) and using equations (4.49) and (4.52)
gives:
˙
V = −c1e21− c2e226 0 (4.56)
The definition of (4.55) and the fact that ˙V 6 0, ∀(e1, e2) guarantees the
boundedness of e1, χ1 and e2. The desired position reference φd is bounded
by assumption and e1= φd−φ is also bounded, so, position φ is also bounded.
This implies the boundedness of the virtual control ωx. Finally, the bound-
edness of the overall control torque is due to our choice of the control law in (4.53). Global Asymptotic Stability is also ensured from the positive defi- nition of V and the fact that ˙V (e1, e2) < 0 , ∀(e1, e2) 6= 0 and ˙V (0) = 0 and
by applying LaSalle theorem. In fact, the maximum invariance set of angular rotations subsystem under control (4.53) and (4.54) is restricted only to the equilibrium point.
Results
Attitude control performance is of crucial importance, it is directly linked to the performance of the actuators. OS4 is equipped with brushless sensorless motors powerful enough to avoid amplitude saturation. However, they suffer from low dynamics and thus from bandwidth saturation. This was taken into account in control design. Simulation results shown in Fig. 4.17 are performed with a model which includes actuators’ dynamics and amplitude saturation. The simulation takes into account the delay and the noise inherent to sensors. The task was to stabilize roll, pitch and yaw angles and maintain them at zero. Control parameters were in the simulation C1 = 10, C2= 2, C3 = 10,
C4 = 2, C5 = 2, C6 = 2. The experiment shown in Fig. 4.19 is a free flight
were attitude references are zero. One can see in Fig. 4.18 that roll and pitch plots show a bounded oscillation of 0.1 rad in amplitude. This oscillation is not perceptible in flight, nevertheless it is due to the slow dynamics of OS4’s actuators coupled with the differences between the four propulsion groups. Control parameters were in this experiment C1 = 10.5, C2 = 2, C3 = 10,
C4 = 2, C5 = 2, C6 = 2. These are really close to the parameters used in
simulation which highlights the quality of the model.
4.10.2
Altitude Control
The altitude controller keeps the distance of the helicopter to the ground at a desired value. It is based on a sonar (Devantech SRF10) which gives the range to the closest obstacle at 15 Hz. The accuracy depends on the
4.10. CONTROL USING INTEGRAL BACKSTEPPING 73 0 5 10 15 20 25 30 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Roll angle Roll [rad] Time [s] 0 5 10 15 20 25 30 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Pitch angle Pitch [rad] Time [s] 0 5 10 15 20 25 30 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Yaw angle Yaw [rad] Time [s]
Figure 4.17: Simulation: Integral backstepping attitude controller has to maintain roll, pitch and yaw angles to zero. Despite of the hard initial conditions and the white noise, the helicopter is quickly brought back to equilibrium.
74 4. SYSTEM CONTROL 0 5 10 15 20 25 30 -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 Roll angle Roll [rad] Time [s] 0 5 10 15 20 25 30 -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 Pitch angle Pitch [rad] Time [s] 0 5 10 15 20 25 30 -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 Yaw angle Yaw [rad] Time [s]
Figure 4.18: Experiment: Integral backstepping attitude controller has to maintain attitude angles to zero in flight. The helicopter is stabilized despite the numerous disturbances due to yaw drift, sensors noise and unmodeled effects.
4.10. CONTROL USING INTEGRAL BACKSTEPPING 75
distance, it is about 1 to 2 cm at 1 m. The necessary altitude rate of change is estimated based on the range. On the control law side, altitude tracking error is defined as:
e7= zd− z (4.57)
The speed tracking error is:
e8= c7e7+ ˙zd+ λ4χ4− ˙z (4.58)
The control law is then: U1=
m
cosφcosθ[g + (1 − c
2
7+ λ4)e7+ (c7+ c8)e8− c7λ4χ4] (4.59)
where (c7, c8, λ4) are positive constants. Take-off and Landing
The autonomous take-off and landing algorithm adapts the altitude reference zd to follow the dynamics of the quadrotor for taking-off or landing. One can
see in Fig. 4.20 that the desired altitude reference is gradually reduced by a fixed step k (k > 0) which depends on the vehicle dynamics and the desired landing speed. Moreover, the fact that the control loop is much faster than the vehicle dynamics, makes the landing very smooth. Ground effect was not implemented because the landing skids are long enough to keep the propellers out of ground effect even after touch-down.
Results
Altitude control works surprisingly well despite all the limitations of the sonar. Figure 4.21 shows an altitude reference profile (green) followed by the simulated controller (red) and the real controller (blue). The task was to climb to 0.5 m, hover and then land. Control parameters where C7 = 3.5,
C8 = 1.5 in simulation and C7 = 4, C8 = 2 in experiment. The slight
deviation between simulation and reality in take-off and landing phases is inherited from actuators’ dynamics where the model was slightly slower in the raising edge, and slightly faster in the falling one. Take-off is performed in 2 s (0-0.5 m) and landing in 2.8 s (0.5-0 m). Altitude control has a maximum of 3 cm deviation from the reference.
4.10.3
Position Control
Position control keeps the helicopter over the desired point. It is meant here the (x, y) horizontal position with regard to a starting point. Horizontal mo- tion is achieved by orienting the thrust vector towards the desired direction of
76 4. SYSTEM CONTROL z = z-kd Altitude control Attitude control Stop motors Landing mode ?
From main loop
yes yes zd U(0) no no Landed?
Figure 4.20: Autonomous landing flowchart. Altitude reference is gradually reduced taking into account the dynamics of the robot.
0 5 10 15 20 25 30 0 0.1 0.2 0.3 0.4 0.5 0.6
0.7 OS4 take-off, altitude control and landing
Altitude [m]
Time [s]
altitude reference (zd) altitude (z) simulated altitude (zs)
Figure 4.21: Autonomous take-off, altitude control and landing in simulation and in real flight.
4.10. CONTROL USING INTEGRAL BACKSTEPPING 77
motion. This is done by rotating the vehicle itself in the case of a quadrotor. In practice, one performs position control by rolling or pitching the helicopter in response to a deviation from the yd or xd references respectively. Thus,
the position controller outputs the attitude references φd and θd, which are
tracked by the attitude controller (see Fig. 4.16). The thrust vector orienta- tion in the earth fixed frame is given by R, the rotation matrix. Applying small angle approximation to R gives:
R = 1 ψ θ ψ 1 −φ −θ φ 1 (4.60)
From (4.5) and using (4.60) one can simplify horizontal motion dynamics to m¨x m¨y = −θU1 φU1 (4.61) The control law is then derived using IB technique. Position tracking errors for x and y are defined as:
e9= xd− x
e11= yd− y
(4.62) Accordingly speed tracking errors are:
e10= c9e9+ ˙xd+ λ5χ5− ˙x
e12= c11e11+ ˙yd+ λ6χ6− ˙y
(4.63) The control laws are then:
Ux= Um 1[(1 − c 2 9+ λ5)e9+ (c9+ c10)e10− c9λ5χ5] Uy= −Um1[(1 − c 2 11+ λ6)e11+ (c11+ c12)e12− c11λ6χ6] (4.64)
where (c9, c10, c11, c12, λ5, λ6) are positive constants. Results
The main result in position control was obtained in simulation. Fig. 4.16 shows how the different controllers are cascaded. In fact, only the attitude is driven by the position, altitude controller is simply feeding them with U1.
Attitude and position loops run at 76 Hz and 25 Hz respectively. This spectral separation is necessary to avoid a conflict between the two loops; it is often accompanied with gain reductions in the driving loop. Control parameters were C9= 2, C10= 0.5, C11= 2, C12= 0.5 in the simulation of Fig. 4.22.
78 4. SYSTEM CONTROL 0 5 10 15 20 25 30 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 x position x [m] Time [s] 0 5 10 15 20 25 30 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 y position y [m] Time [s] 0 5 10 15 20 25 30 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 x speed dx [m/s] Time [s] 0 5 10 15 20 25 30 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 y speed dy [m/s] Time [s]
Figure 4.22: Simulation: Integral backstepping position controller drives at- titude controller in order to maintain the helicopter over a given point.
4.10. CONTROL USING INTEGRAL BACKSTEPPING 79
Way-points following
The planner block in Fig. 2.5 defines the way-points and hence the trajectories OS4 has to follow. The position of the next way-point is sent to position controller which directs the vehicle towards the goal. A way-point is declared reached when the helicopter enters a sphere around this point. The radius of this sphere (0.1 m) is the maximum admitted error. Figure 4.23 shows a square trajectory defined by four way-points. The task was to climb to 1 m from the ground and then follow the four way-points of a square of 2 m side. In order to track the square trajectory, the planner generates the (xd, yd)
Figure 4.23: Four way-points for a square trajectory tracked by OS4. position references, and consequently the position controller generates the (φd, θd) attitude references. Figure 4.24 depicts these signals and shows that
the 2 m side square is tracked with about 10% overshoot (20 cm), while the trajectory is completed in 20 s.
4.10.4
Obstacle Avoidance
OS4 is equipped with a sonar-based obstacle avoidance system composed of four miniature ultrasound range finders in cross configuration. First of all, we introduced the obstacle avoidance controller into the Simulink model and inserted the environment and sensor libraries. Aiming to simplify the pro- cedure, we decided to keep the altitude constant during evasive maneuvers. This would reduce the path planning complexity to a 2D problem. We also restricted its direction of flight: OS4 can move only on the four directions where the US sensors were placed. To increase the flight safety, a 90 cm ra- dius security zone is constantly maintained between the helicopter and the
80 4. SYSTEM CONTROL 0 10 20 30 -0.2 -0.1 0 0.1 0.2 0.3 Pitch [rad] Time [s] 0 10 20 30 -0.2 -0.1 0 0.1 0.2 0.3 Roll [rad] Time [s] 0 10 20 30 -0.5 0 0.5 1 1.5 2 2.5 3 Y position [m] Time [s] 0 10 20 30 -0.5 0 0.5 1 1.5 2 2.5 3 X position [m] Time [s]
Figure 4.24: Simulation: The position and attitude signals generated to track the square trajectory.
4.10. CONTROL USING INTEGRAL BACKSTEPPING 81
environment (see Fig. 4.25). This zone assures a 50 cm distance between the helicopter rotors and any obstacle. If an obstacle is detected inside the security zone, a safety loop (that runs in parallel to the OAC) interferes in the helicopter flight control and generates an evasive maneuver. This ma- neuver is obtained by selecting a predefined pitch and/or roll angles that would avoid a collision between the helicopter and the obstacles. Several
Figure 4.25: The 4 flight directions (left) and the security zone (right). algorithms were simulated (see Appendix A) with various results in a 100 m2
environment with obstacles represented as columns of 20 cm in diameter and 3 meters in height. The developed approaches can be divided into two cat- egories: Relative position and speed-based approaches. The first OAC uses position controller to act on the relative position of the helicopter wrt. the closest obstacle (Xoa, Yoa). The second one uses speed controller to act on
the speed of the vehicle ( ˙X, ˙Y ) if an obstacle is detected. The latter approach was used to develop our main OAC algorithm. The idea was to act on ˙X and
˙
Y while keeping the heading and altitude constants. When an obstacle is detected its distance to the helicopter is classified based on a given threshold as "far", "close" or "too close". If the obstacle is "far", no avoidance action is needed and the OAC does not interfere with the helicopter normal flight. On the other hand, if the obstacle distance is "close" or "too close" the OAC informs the helicopter flight control, reduces its speed, and generates evasive maneuvers using predefined flight directions, this is shown in Fig. 4.26. The selection of the direction of the evasive flight depends on the stimulated sen- sor and the desired flight direction previously selected by the user. However, if the quadrotor is surrounded by obstacles that are "too close", it reduces the speed and keeps a hovering behavior. The lack of precise sensors for linear speed made the implementation of this approach difficult. A simple collision avoidance algorithm was then developed. The idea was to avoid collision with walls or persons present in the flight area. The inherent noise of the sonar especially in absence of obstacles was threatening OS4 stability. This
82 4. SYSTEM CONTROL
Figure 4.26: Simulation: OS4 avoiding static obstacles.
is mainly due to the interferences between the five sonar and the effect of the propellers on the ultrasound waves. Figure 4.27 shows a detection of an obstacle with and without the filter. The latter is based on the variation of successive samples and gives a reliable detection signal usable in flight.
0 5 10 15 20 25 30 35 40 45 0 50 100 150 200 250
Sonar noise filtering
Sensor range [cm]
Time [s]
raw data filtered data
Figure 4.27: Obstacle detection with and without the filter.
Results
A collision avoidance behavior was practically obtained after numerous tests and tuning. Once the obstacle is detected, a pitch reference is given to fly away the helicopter from the obstacle. Figure 4.28 shows the reaction of OS4 to an obstacle at 40 cm, one can see the distance to the obstacle increasing until the latter disappears, then OS4 recovers a normal flight.
4.11. CONCLUSION 83 12 14 16 18 20 22 -40 -20 0 20 40 60 80 Time [s]
Data: distances [cm], angles [degrees]
Collision avoidance Altitude [cm] OA engaged Pitch [1/100 rad] Sensor n° 1 [cm] Obstacle detection Obstacle disappearance
Figure 4.28: Experiment: Collision avoidance with OS4. The helicopter flies back until the obstacle disappears.
4.11
Conclusion
This chapter presented the simulation and the testing of five control tech- niques for the attitude control of a quadrotor. The first technique is based on Lyapunov theory, it proved to be very reactive, especially for the yaw angle control. However, the stabilization in the direct neighborhood of the equilibrium point was not rigid enough to permit hover flight. The second one is a PID controller, it proved to be well adapted to the quadrotor when flying near hover. It was possible using this technique to successfully perform the first autonomous flight. The PID controller was only able to control the quadrotor in near hover and absence of large disturbances. The third one is an LQ controller, it displayed average stabilization results. It showed to be less dynamic than the PID. The fourth control technique is the Back- stepping, its ability to control the orientation angles in presence of relatively high perturbations is very interesting. The sliding-mode technique is the fifth approach, it did not provide excellent results. The switching nature of the controller seems to be ill adapted to the dynamics of the quadrotor. The re- sults of all these control approaches conducted to a combination of PID and Backstepping into the so-called Integral Backstepping. This was proposed as a single tool to design attitude, altitude and position controllers. The experiment has shown that OS4 is currently able to take-off, hover, land and avoid collisions automatically. As far as we know, OS4 is the first quadrotor practically capable of a collision avoidance maneuver.
Chapter 5
General Conclusion
I have discovered that a screw-shaped device such as this, if it is well made from starched linen, will rise in the air if turned quickly.
Leonardo Da Vinci
This chapter is divided into a review of the main contributions of this thesis, followed by an outlook on future work, which takes a longer perspective on miniature aerial robots. It tries to identify possible future steps towards fully autonomous miniature flying robots.
5.1
Review
The explosion of the market for handheld devices a few years ago accelerated incredibly the development of technologies, not only useful for mobile phones or digital cameras but also determinant for micro aerial vehicles.
This project was born in this context, on the conviction that the develop- ment of miniature flying robots requires the simultaneous consideration of the system level optimization along with control design.
Understanding the vehicle’s dynamics has been a constant concern, it has been investigated through system modelling, simulation and analysis. It rep- resents the essential insight not only for an elaborated system design, but also for the selection of control approaches adapted to quadrotors.
86 5. GENERAL CONCLUSION
A two-step approach for the system design was adopted throughout this work. A first platform was designed to allow easy experimentation and control val- idation. Then, following a new design methodology, a second platform was developed to permit free flight experiments, based on the control algorithms previously matured.
The investigation on control approaches was conducted along progressively increased complexity. Each approach was studied through controller syn- thesis, simulation and experimentation on the first platform. The proposed control approach was extensively simulated and fully implemented on the second platform.
5.1.1
Modelling
The whole dynamic model was built on basic physics and aerodynamics equa- tions, and a faithful CAD model allowed easy extraction of the physical pa- rameters. In addition, rotor dynamics was identified in order to accurately grasp the dynamics of the brushless motor, its power electronics, the gearbox and the propeller all together at once. The implementation of an aerodynam- ics block allowed the consideration of variable aerodynamic coefficients that were validated in hover. The result is a set of equations describing the vehicle dynamics not only in hover, but also in motion. A simulator was developed based on this model and is presently used in other quadrotor projects. The final experiments were all performed with strictly the same parameters found by simulation.
5.1.2
Design
The methodology developed and followed in the design of the OS4 robot ap- preciably facilitated the components selection process and battery dimension- ing. Several requirements like target size and weight or target thrust/weigth ratio were considered. The challenges encountered in OS4 design included: the motor selection, electronics integration, structure design and design vari- ables optimization. The actuators’ saturation issue was alleviated by using brushless technology and the motor was selected based on considerations like the energy cost of the lifted mass or the quality of this lifting in terms of cur- rent losses, bandwidth available, etc. The electronics integration issue was addressed by developing all OS4’s electronic modules from scratch. Special attention was given to the motherboard, a six-layer printed circuit board with all the electronics for a flying robot. Structure design issue was addressed by using a combination of carbon fibers (arms), lightweight polyurethane
5.1. REVIEW 87
(molded parts) and aluminium (critical parts). Design variables optimization was carried out with the design method especially developed for miniature rotorcraft. As far as we know, OS4 is one of the most integrated quadrotors ever designed.
5.1.3
Control
An important part of this thesis was dedicated to finding a good control approach for quadrotors. Five techniques were explored from theoretical de- velopment to final experiments. The difficulties encountered in OS4 control included: Sensor quality, yaw drift, robustness against large disturbances and model uncertainties. Sensor noise is inherent to micro IMUs and is dramati- cally amplified on helicopters. This degrades sensor accuracy and accelerates drift. Yaw drift is one of the most annoying issues as the contribution of yaw control in the overall control is important. The best robustness against large disturbances was achieved using backstepping technique, while model uncer- tainties were cancelled thanks to integral action. Thus, integral backstepping has been proposed for full control of quadrotors. Thanks to this technique,