Cyclone Shelter Construction, Maintenance and Management Policy ...
Development of a Model based Fuzzy-PID Controller for the AeroQuad Cyclone Quad-copter
Transcript of Development of a Model based Fuzzy-PID Controller for the AeroQuad Cyclone Quad-copter
American Institute of Aeronautics and Astronautics
1
Development of a Model based Fuzzy-PID Controller for the
AeroQuad Cyclone Quad-copter
Wei Wei1 and Kelly Cohen2
University of Cincinnati, Cincinnati, Ohio 45221
Over the years multi-rotor aircraft have been chosen as a viable configuration for small-
scaled VTOL UAVs in the form of quad-copters, hexa-copters and octo-copters. Multi-rotor
airframes require a simpler feedback control system and fewer mechanical parts. These
characteristics make these UAV platforms, especially quad-copters, a rugged and competitive
candidate for many applications in both military and civil areas. In this effort a fuzzy-PID
controller was developed to control a quad-copter model extracted from flight testing data
using system identification method. Characteristics of the new system with fuzzy-PID
controller were analyzed and compared to that with classic PID controller. Results show that
the fuzzy-PID controller has better stability and robustness performance when compared to
the classic PID controller.
Nomenclature
๐ = roll angular velocity
๐ = pitch angular velocity
๐ = yaw angular velocity
๐ฟ๐๐๐ = lateral axis input
๐ฟ๐๐๐ = longitudinal axis input
๐ฟ๐๐๐ก = lateral pilot input
๐ฟ๐๐ข๐ = directional axis input
๐ฟ๐กโ๐ = vertical axis input
๐ = pitch angle
๐ = roll angle
๐ = yaw angle
I. Introduction
HE research interest in unmanned aerial vehicles (UAVs) has dramatically increased in recent years. The
applications of UAVs used to be limited to military uses. In the past decade, there is a growing market for civilian
UAVs in a wide spectrum of areas such as surveillance, agriculture, disaster management, film making, sports
coverage and training, mapping, weather determination, and many others.1
For small-scale UAV applications, multi-rotor systems, especially quad-copters have been the most popular
configuration. Compared to single main rotor helicopters, quad-copters require a simpler feedback control system and
fewer mechanical parts. These characteristics make quad-copter a competitive candidate for many applications in both
military and civil areas.
All controller development of dynamic systems will be based on mathematic model of the system in a simulation
environment. One traditional method is to analyze the aerodynamic, inertial, and structural characteristics of an aircraft
or rotorcraft to predict a dynamic model. This preliminary model is then simulated and compared with flight testing
data. It is always necessary to fine-tune the model based on the comparison results. For small-scale rotorcraft
configurations, this method is not very effective due to their complex coupled aerodynamic forces and high
vulnerability to turbulences. In this paper, the dynamic model of the quad-copter was extracted from flight testing data
1 Graduate Student, Department of Aerospace Engineering and Engineering Mechanics, Student Member AIAA. 2 Professor, Department of Aerospace Engineering and Engineering Mechanics, Associate Fellow AIAA.
T Dow
nloa
ded
by K
elly
Coh
en o
n Ja
nuar
y 9,
201
5 | h
ttp://
arc.
aiaa
.org
| D
OI:
10.
2514
/6.2
015-
2029
AIAA Infotech @ Aerospace
5-9 January 2015, Kissimmee, Florida
AIAA 2015-2029
Copyright ยฉ 2015 by Wei Wei, Kelly Cohen. Published by the American Institute of Aeronautics and Astronautics, Inc., with permission.
AIAA SciTech
American Institute of Aeronautics and Astronautics
2
using system identification method. The model was verified with flight data not used in the system identification
process.
A variety of control techniques have been applied to quad-copter configuration. The most popular controller used
for quad-copter is the classic PID controller.2,3 Other methods including integral sliding mode and reinforcement
learning,4 backstepping controllers,5 and neural network6 were also explored.
In this paper, a fuzzy-PID controller was developed based on the quad-copter dynamic model obtained using
system identification, for stabilization of the lateral and longitudinal axes. A fuzzy-PID controller is a hybrid of fuzzy
logic and classic PID controller. Fuzzy logic control is an intelligent control that emulates humanlike approximate
reasoning and decision making by utilizing fuzzy sets and rule reference. In a fuzzy-PID controller, the gains are tuned
by a fuzzy controller. Characteristics of the legacy classic PID and fuzzy-PID controller are also analyzed and
compared.
II. Quad-copter Dynamic Modeling
A. Hardware
An AeroQuad Cyclone quad-copter was selected as the platform for the quad-copter dynamics modeling. (Fig. 1)
It features an aluminum frame with four APC 12ร3.8 propellers powered by 950KV motors. The onboard sensors
include an ITG-3200 gyro, ADXL345 accelerometer, HMC5883L magnetometer, BMP085 barometer, and
MaxSonars EZ0 ultrasonic sensor. The main controller is an ATmega 2560 Arduinoโข-based computing platform. A
pair of Digiยฎ XBee-PRO 900MHz modules was utilized for telemetry. The flight data was transmitted at 40 Hz and
was collected through MATLAB on a ground station computer.
Because a quad-copter configuration is inherently unstable in the lateral and longitudinal axes, a classic PID
controller was applied so that it could be easily piloted during flight-testing. PID gains were tuned such that good
handling qualities of the quad-copter was achieved.
The quad-copter control structure is depicted in Fig. 2. For the bare-airframe modeling, axis commands (๐ฟ๐๐๐, ๐ฟ๐๐๐,
๐ฟ๐๐ข๐, and ๐ฟ๐กโ๐) and vehicle response, including Euler angles (๐, ๐, ๐), angular rates (p, q, r), and linear accelerations
(๐๐ฅ, ๐๐ฆ, ๐๐ง), are recorded.
Figure 1. AeroQuad Cyclone quad-copter in flight.
Figure 2. Quad-copter control structure.
Dow
nloa
ded
by K
elly
Coh
en o
n Ja
nuar
y 9,
201
5 | h
ttp://
arc.
aiaa
.org
| D
OI:
10.
2514
/6.2
015-
2029
American Institute of Aeronautics and Astronautics
3
B. System Identification
The software package Comprehensive Identification from FrEquency Response (CIFERยฎ) was utilized to acquire
dynamic model of the quad-copter airframe. CIFERยฎ has been successfully implemented and applied in the system
identification of commercial and military aircraft and rotorcraft configurations, including the XV-15, Bell-214ST,
BO-105, AH-64, UH-60, V-22, AV-8 Harrier, and OH-58D.7
System identification in CIFERยฎ is conducted in frequency-domain. Therefore, a series of frequency sweep inputs
are used to excite the quad-copter system, and all flight data was collected. For the flight testing, the pilot starts with
about five seconds in trimmed hover condition, the axis of interest is then excited in a periodic motion starting at a
low frequency. The frequency of the disturbance gently increases until it reaches a pre-defined maximum, driven by
the instrumentation or vehicle limits. After the sweep ends, the quad-copter returns to hover conditions for another
five seconds before data collection is finished. Figure 3 shows concatenated time history of two lateral axis frequency
sweep inputs.
In previous work, the closed-loop model was identified to set up a baseline for controller design.8 The same
approach was used to obtain the quad-copter bare-airframe model. However, instead of transfer function model, a
state-space model structure was used so that coupled dynamics between different states can be identified.
Figure 4 displays the bare-airframe lateral frequency response from both flight data (solid line) and extracted model
(dash line.). It can be seen that the extracted model accurately predicts the response of the quad-copter lateral
dynamics, outlined by the solid line. This indicates that the dynamics is accurately modeled with high confidence.
Notice the very high coherence indicating excellent signal-to-noise and a very linear system.7 The magnitude peak at
Figure 4. Bare-airframe lateral frequency response.
Figure 3. Lateral axis frequency sweep time history.
Dow
nloa
ded
by K
elly
Coh
en o
n Ja
nuar
y 9,
201
5 | h
ttp://
arc.
aiaa
.org
| D
OI:
10.
2514
/6.2
015-
2029
American Institute of Aeronautics and Astronautics
4
about 3 rad/s corresponds to the bare-airframe short-period response also referred to as the โhovering cubic,โ which
is unstable as seen by the increasing phase curve near this mode.9
The extracted models were verified in the time-domain with flight data collected during flight testing. Data used
for verification was not used in the system identification process get dynamic model. The measured inputs and initial
conditions were feed into the models, which then predicted the outputs on each axis of interest. The simulation outputs
were then compared with the outputs gathered during flight testing.
Results of lateral axis verification is shown in Fig. 5. The top plot is the input, followed by linear acceleration ๐๐ฆ,
angular rate p, Euler angle ๐, and lienar velocity ๐ฃ. The flight data is shown in solid line, and model output is in
dashed line. It can be seen the flight data and model output agrees very well. These results show that an accurate
dynamic model of a bare-airframe quad-copter system was successfully extracted using system identification, thereby
decreasing modeling time and complexity when compared to traditional modeling techniques based on first principles.
C. Identified Model
The identified state-space model is presented in Eq. (1).9 Due to the unique symmetrical configuration of the quad-
copter, the identified lateral and longitudinal axes model parameters are very similar. Moreover, the attitude stabilize
controller actually have the same structure and gains for both axes. Therefore, the controller development focuses on
the lateral axis and the same controller will be used in the longitudinal axis. It is also interesting that unlike a
conventional flapping rotor helicopter, it has no rotor damping (๐ฟ๐ and ๐๐). This is because the small rotor area
compared to single main rotor helicopters.
Figure 5. Time-domain verification of lateral axis model.
Dow
nloa
ded
by K
elly
Coh
en o
n Ja
nuar
y 9,
201
5 | h
ttp://
arc.
aiaa
.org
| D
OI:
10.
2514
/6.2
015-
2029
American Institute of Aeronautics and Astronautics
5
[ ๏ฟฝฬ๏ฟฝ๏ฟฝฬ๏ฟฝ๏ฟฝฬ๏ฟฝ๏ฟฝฬ๏ฟฝ๏ฟฝฬ๏ฟฝ๏ฟฝฬ๏ฟฝ๏ฟฝฬ๏ฟฝ
๏ฟฝฬ๏ฟฝ๏ฟฝฬ๏ฟฝ]
=
[ โ0.0429 0 0 0 0 0 0 โ๐ 0
0 โ0.0429 0 0 0 0 ๐ 0 00 0 0 0 0 0 0 0 00 โ0.4376 0 0 0 0 0 0 0
0.5241 0 0 0 0 0 0 0 00 0 0 0 0 โ0.5231 0 0 00 0 0 1 0 0 0 0 00 0 0 0 1 0 0 0 00 0 0 0 0 1 0 0 0]
[ ๐ข๐ฃ๐ค๐๐๐๐๐๐]
+
[
0 0 0.2269 00 โ0.2016 0 0
โ0.7414 0 0 00 0.7066 0 00 0 0.6662 00 0 0 0.13060 0 0 00 0 0 00 0 0 0 ]
[
๐ฟ๐กโ๐
๐ฟ๐๐๐
๐ฟ๐๐๐
๐ฟ๐๐ข๐
]
(1)
III. Fuzzy-PID Controller Design
The flight testing of the quad-copter was based on a hand-tuned classic PID controller. Before the fuzzy-PID
controller development, the quad-copter with classic PID controller was firstly analyzed so that a baseline was set up
for comparison. As stated before, the lateral and longitudinal axes have similar dynamics and same controller layout.
So the attitude stabilize controller design focuses on the lateral axis.
The quad-copter classic PID controller layout is shown in Fig. 6. It features a dual-PID controller structure. The
attitude PID controller takes in the error of expected roll angle ๐ฟ๐๐๐ก and actual roll angle ๐. The proportional and
integral channel of rate PID takes in the error of the attitude PIDโs output and the actual roll rate ๐, while the derivative
channel takes roll rate ๐ directly. This is to avoid sudden controller output spike due to pilot inputs.
Analysis of the handling quality with legacy classic PID controller shows that it has very high bandwidth (10.97
rad/s), which ensures response speed. But the price is very low stability margins (1.93 dB of gain margin, 11.93
degrees of phase margin), and low damping ratio (0.18). These are signs of the system very close to an unstable
condition and measures need to be taken to better meet these criteria.
A fuzzy-PID controller was built for the quad-copter lateral axis model. Fuzzy reference systems were developed
to tune individual gains in the dual-PID controller. Because the att_D has the same effect as rt_P, and rt_I as att_P, so
both ๐พ๐๐ก๐ก_๐ท and ๐พ๐๐ก_๐ผ are set to 0. The derivative channel of rate PID rt_D is only takes roll rate ๐ as input, and lateral
input ๐ฟ๐๐๐ก has no effect on this channel at all. So this gain ๐พ๐๐ก_๐ท was not included in the fuzzy tuning system and was
left constant. Figure 7 shows the fuzzy-PID controller layout.
The integral gain of the attitude controller ๐พ๐๐ก๐ก_๐ผ was tied to proportional gain ๐พ๐๐ก๐ก_๐ such that the ratio of ๐พ๐๐ก๐ก_๐ผ
to ๐พ๐๐ก๐ก_๐is equal to 1/10 of the crossover frequency (about 10 rad/s). This ensures that integral effect does not degrade
phase margin, and also that integral effect is not too small to quickly recover steady state error. 10 So in this case, ๐พ๐๐ก๐ก_๐ผ
and ๐พ๐๐ก๐ก_๐ use the same fuzzy controller for gain tuning.
Figure 6. Classic PID controller layout.
Dow
nloa
ded
by K
elly
Coh
en o
n Ja
nuar
y 9,
201
5 | h
ttp://
arc.
aiaa
.org
| D
OI:
10.
2514
/6.2
015-
2029
American Institute of Aeronautics and Astronautics
6
As initial step of the fuzzy logic controller building process, the membership functions for each input and output
were first established. A series of flight data with different maneuver magnitudes was examined, so that appropriate
ranges can be applied for each individual membership function. Experience show that simpler membership functions
(fewer fuzzy sets) really enhance response speed. So only three input fuzzy sets were used for inputs (Negative,
Positive, and Stable), and two were used for outputs (Small, Large). Membership functions for the attitude and rate
fuzzy-PID controller are depicted in Fig. 8. It can be seen that because the attitude gain has the most influence on the
overall response, the stable fuzzy set was built around a small region, and has large broad regions outside of stable.
This ensures a smooth reaction when the error is small, and also allows quick convergence from extreme angles to
stable state when the error is large.
As discussed earlier, by examining the legacy classic PID controller flight characteristics, it was decided the
stability margins of the current setup was too low, so both attitude and rate gains need to be limited. This was
considered when building the output membership functions as can be seen below in Fig. 8.
Generally, it will be a two input three output fuzzy reference system for a fuzzy-PID controller: error, error
derivative, and P, I, D gains. However, due to the dual-PID controller structure used in this case, three single input
single output fuzzy inference systems are used. This greatly relieves the computing requirement to the hardware, and
allows for less computing time.
The commonly use Mamdani fuzzy inference method was chosen for the fuzzy-PID system, and the rule bases for
each controller were very straight forward as shown in Table 1.
Figure 7. Fuzzy-PID controller layout.
a) attitude
b) rate
Figure 8. Membership function of fuzzy controller.
Dow
nloa
ded
by K
elly
Coh
en o
n Ja
nuar
y 9,
201
5 | h
ttp://
arc.
aiaa
.org
| D
OI:
10.
2514
/6.2
015-
2029
American Institute of Aeronautics and Astronautics
7
IV. Results
The quad-copter system with fuzzy-PID controller was tested in SIMULINKยฎ and flight characteristics are
analyzed and compared to legacy classic PID controller. The results are summarized in Table 2. It can be seen that
stability margins and damping ratio have been substantially improved, and these numbers falls into the โsafe zoneโ of
a robust system. Bandwidth has decreased, but 6.69 rad/s still guarantees sufficient responsiveness to the pilot.
To get a more intuitive understanding of the difference, step responses of the system with legacy classic PID and
fuzzy-PID are shown respectively below in Fig. 9. It is clearly seen that the fuzzy-PID controller gets rid of the
oscillation associated with the legacy classic PID design.
Figure 9. Step response with different controllers.
Table 1. Rule bases.
Error Stable P N
attitude S L L
rate S L L
Table 2. Flight characteristics comparison.
Design Parameter Classic PID Fuzzy-PID Change
Gain Margin (dB) 1.93 4.78 147.67%
Phase Margin (deg) 11.93 47.14 295.14%
Bandwidth (rad/s) 10.97 6.69 -39.02%
Damping Ratio 0.18 0.27 50.00%
Time @ 0.1 Steady State (s) 0.2 0.21 5.00%
Time @ 0.9 Steady State (s) 0.36 0.41 13.89%
Rise Time (s) 0.16 0.19 18.75%
Natural Freq (rad/s) 11.227 8.65 -22.95%
Overshoot (%) 20.894 41.5 98.62%
Dow
nloa
ded
by K
elly
Coh
en o
n Ja
nuar
y 9,
201
5 | h
ttp://
arc.
aiaa
.org
| D
OI:
10.
2514
/6.2
015-
2029
American Institute of Aeronautics and Astronautics
8
V. Conclusions
A state-space model of a quad-copter system was developed using system identification techniques, and a fuzzy-
PID controller was developed based on this model to stabilize the lateral and longitudinal axes. Flight characteristics
of the system with legacy classic PID and fuzzy-PID controllers are provided. Results show that fuzzy-PID was able
to give more stability margins and damping with the price of slightly reduced bandwidth. It is worth mentioning that
fuzzy logic is not a โmagic boxโ that gives ideal results autonomously, membership functions and fuzzy rules set up
needs priori knowledge of the system, as well as design requirements.
In future work, the fuzzy-PID controller will be compared with finely tuned classic-PID through comprehensive
flight testing, and handling quality of each controller will be analyzed. Furthermore, future work may include a more
sophisticated autonomous system for rule development and tuning of the membership functions using a genetic fuzzy
approach which had several successful applications in our lab.
Acknowledgments
The authors would like to thank Dr. Mark Tischler from AFDD, Ames Research Center for his valuable time and
advice on the system identification of the quad-copter system.
References
1โUnmanned Aerial Vehicle (UAV) Market (2013 - 2018),โ PR Newswire, 19 Jun, 2013. 2Pounds, P., Mahony, R., and Corke, P., โModelling and Control of a Large Quadrotor Robot,โ Control Engineering
Practice, Vol. 18, No. 7, 2010, pp. 691-699. 3Goel, R., Shah, S. M., Gupta, N. K., and Ananthkrishnan, N., โModeling, Simulation and Flight Testing of an Autonomous
Quadrotor,โ IISc Centenary International Conference and Exhibition on Aerospace Engineering, Bangalore, India, 2009. 4Waslander, S. L., Hoffmann, G. M., Jang, J. S., and Tomlin, C. J., โMulti-agent Quadrotor Testbed Control Design: Integral
Sliding Mode vs. Reinforcement Learning,โ IEEE/RSJ International Conference on Intelligent Robots and Systems, Edmonton,
Alberta, Canada, 2005. 5Madani, T., and Benallegue, A., โBackstepping control for a quadrotor helicopter,โ IEEE/RSJ International Conference
on Intelligent Robots and Systems, Beijing, China, 2006. 6Nicol, C., Macnab, C. J. B., and Ramirez-Serrano, A., โRobust Neural Network Control of a Quadrotor Helicopter,โ
Canadian Conference on Electrical and Computer Engineering, Niagara Falls, Ontario, Canada, 2008. 7Tischler, M. B., and Remple, R. K., Aircraft and Rotorcraft System Identification: Engineering Methods with Flight-Test
Examples, 2nd ed., AIAA Education Series, AIAA, Reston, VA, 2012. 8Wei, W., Tischler, M. B., Schwartz, N., and Cohen, K., โFrequency-Domain System Identification and Simulation of a
Quadrotor Controller,โ Proceedings of the AIAA Modeling and Simulation Technologies Conference, National Harbor, MD,
2014, pp. 1834โ1839. 9Wei, W., Tischler, M. B., Schwartz, N., and Cohen, K., โSystem Identification and Controller Optimization of a Quadrotor
UAV,โ Proceedings of the American Helicopter Society 71th Annual Forum, Virginia Beach, VA, May 5-7, 2015. 10Anon, โCONDUITยฎ Training Course,โ University Affiliated Research Center, Moffett Field, CA, 2009.
Dow
nloa
ded
by K
elly
Coh
en o
n Ja
nuar
y 9,
201
5 | h
ttp://
arc.
aiaa
.org
| D
OI:
10.
2514
/6.2
015-
2029