0% found this document useful (0 votes)
62 views

Autonomous Flight Control For An RC Helicopter

Uploaded by

Waleed Tayyab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Autonomous Flight Control For An RC Helicopter

Uploaded by

Waleed Tayyab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Autonomous Flight Control for an RC Helicopter

Michael Camilleri Dr. Kenneth Scerri Dr. Ing. Saviour Zammit


Department of Communications and Department of Systems and Control Department of Communications and
Computer Engineering Engineering Computer Engineering
University of Malta University of Malta University of Malta
Msida, Malta Msida, Malta Msida, Malta

Abstract – This paper presents an autopilot system for a Radio evaluation of the same results, together with a brief
Controlled (RC) helicopter, in a simulation environment. The discussion of future work in this area.
controller is designed using Fuzzy Logic in order to achieve
simplicity and cost effectiveness. The system controls the II. BASIC KINEMATIC MODELLING
helicopter from takeoff to landing, allowing the craft to reach The helicopter is represented in 3D space by its position
any position and hover stably with a defined yaw attitude at the (X, Y and Z co-ordinates) and its rotations about the co-
request of the user. The Fuzzy Inference Systems (FIS) in use ordinate axis (yaw, pitch and roll). Due to the six-degree of
were able to allow for these operations with more than
freedom dynamics (6DOF), three frames of reference are
satisfactory results, even in simulated winds.
used. The earth co-ordinate system is centred at the starting
Index Terms — Autonomous Helicopter Flight, fuzzy logic location of the helicopter, and is used to map positions of the
control, Unmanned Aerial Vehicles. helicopter in 3D space. The model axis is positioned at the
centre of gravity (c.o.g.) of the helicopter, and is used to
I. INTRODUCTION define rotations with respect to the initial orientation. This
Although helicopters are some of the most agile (and can be conceptualised as having another co-ordinate axis
thus useful) machines ever invented, they remain some of (spatial frame) at the c.o.g. of the helicopter but with its
the most difficult contraptions to fly and control, with orientation fixed as for the earth frame. Rotations are then
autopilot technology still in its infancy. This stems in part defined between the model frame and the latter one.
from the complexities involved in mathematically modeling In order to use conventional matrix transformations, the
helicopter dynamics [1], which are somewhat unstable and well-known North-East-Down (NED) co-ordinate system is
highly coupled [2] making it very difficult to control them. employed [11]. However, the simulator itself uses a different
Some projects have indeed been implemented in this area representation, with the model facing –X, the left side
([3], [4], [5], [6] and [7]). However most, if not all, involve pointing towards +Z and the pilot head towards +Y. Thus, in
elaborate solutions which are too complex and expensive to retrieving the position/velocity data from the simulator,
be applicable to everyday situations; many are oriented these had to be appropriately converted. Acceleration data is
towards military applications. This project aims to achieve obtained by a first order derivative of the velocity data,
adequate flying performance for a Radio Controlled (RC) utilising the current and previous sample values:
helicopter with a focus on simplicity of design and cost
(1)
effectiveness. Fuzzy Logic Controllers (FLCs) are ideal for
these goals: they are certainly easier to design, requiring
limited insight into helicopter mathematics, while allowing Additionally, a moving average of the acceleration data
for relatively cheap hardware for a physical implementation. is then computed, covering ten sample points, to smooth out
In fact such techniques have already been tested, as any noise. This size appeared to be the best at the sampling
highlighted in [8], [9] and [10]. This project builds upon such rate used, in reducing noise, while not contaminating the
systems to develop a controller which is easy to design acceleration data with values that are too old.
without having to go into complex state-space representation. With respect to orientation, the simulator provides only
The project uses a model of the Honey Bee King II RC the rotational velocities in model co-ordinates. In order to
helicopter [14], in SVK Systems’ Clearview Simulator [16]. get at the attitude, these must be converted into the spatial
The user interacts with the controller by commanding a set frame (as indicated in [12]) and integrated over the elapsed
of positions and yaw attitudes, which the autopilot attempts simulation time. Angular acceleration is calculated in a
to achieve. The control system is modularised according to similar way to linear acceleration. In this way, angular rates
each of the control axes: collective for height control, lateral and accelerations are expressed in the model frame which is
and longitudinal cyclic for horizontal motion and heading adequate, since the control systems act in the same frame.
control through the tail collective. The Fuzzy Logic A further point needs to be noted regarding the angle
Controllers were designed using Matlab®’s Fuzzy Logic values. Obviously, orientation is limited over a range of 2π,
Toolbox, and ported to the C++ application implementing either between 0 and 2π or between –π and +π. As such, care
the controller as Look-Up Tables (LUT). The latter must be taken in the integration process to normalise the
application interfaces with the simulator using TCP/IP. angle to these regions as described hereunder:
The rest of the paper is organized as follows. Section II
introduces the theory regarding the kinematics involved in { (2)
the project: section III briefly covers the software
architecture, following with a description of the control
methodology used, in section IV. Section V presents the Also note that all the Fuzzy Inference Systems (FIS) act
results achieved. Finally the paper concludes with an upon an error in some axis of translation/rotation, defined as:

978-1-4673-0784-0/12/$31.00 ©2012 IEEE 391


(3) inputs are generated (333Hz in the final setup), allowing the
controllers to quickly compensate for coupling through the
In order to start off at a known state, a calibration routine refresh rate of telemetry inputs and control commands, a fact
is implemented before the controller itself starts. In this verified by simulation results. This allowed the control
routine, calibration data regarding the current position is problem to be divided according to the control axis, and a
recorded and used to calculate offsets to decrease from the specific controller designed independently for each.
subsequent readings so that it is as if the model and world
co-ordinate systems are initially aligned. Five FLCs were designed. The Height FIS maintains the
necessary vertical position by varying the collective input,
III. SOFTWARE ARCHITECTURE while the Yaw FIS achieves a desired heading using the tail
The purpose of the controller is to read telemetry data collective. A separate Landing controller takes over from the
Height FIS during landing operations, with the emphasis
given by the simulator, determine the control outputs to pass being on a smooth descent to avoid crashing. X-Y position is
back to the same simulator and log results to secondary controlled through a cascade of two systems: a Hover
storage. Four main classes are implemented, depicted controller which outputs pitch/roll angles in order to correct
graphically in Figure 1. for horizontal errors and a Cyclic FIS which attempts to
achieve these attitudes through control of the cyclic input.
Each of the fuzzy controllers receives feedback from the
simulator in the form of position/angle error, velocity, and in
all but the Yaw and Hover FIS, acceleration. Velocity and
acceleration feedback serve to limit the velocity near the
target position/angle to a reasonable value in an attempt to
reduce overshoots, without suffering in response time. The
details of each controller are listed in Table I. In turn, these
individual FIS act under the overall control of the Autopilot
FSM. Its role is to switch on/off each controller depending
on the current situation and user commands. The choice of
using FIS was based on several factors, foremost being
simplicity of design. Moreover, since the rules are developed
in an intuitive fashion, the controller is generalised and
potentially applicable to different models with minor tuning.
In addition, whereas mathematical models usually fail to
capture all the subtleties of helicopter dynamics (often a
system must be linearized or simplified), the rule-base for an
FIS can incorporate any non-linearities which are intuitively
deduced. Using FLCs also simplified design, for example by
exploiting the similarities between the pitch and roll axis.
Fig. 1. Overview of the Software Architecture
A major design decision was whether to use incremental
The CInterface object implements the TCP/IP socket for or absolute outputs: i.e. whether the FLCs output absolute
communicating with the simulator through strings of control values or changes with respect to the previous ones.
characters. A FlightData object handles the storage and Following appropriate testing, the Height, Landing and Yaw
interpretation of the simulator-generated telemetry. The FIS were implemented using incremental outputs, while
control algorithm itself is implemented within the Controller Cyclic and Hover control use the absolute methodology.
object. This class accepts telemetry information from the
FlightData object and determines the control outputs to vary TABLE I OVERVIEW OF THE FIS SYSTEMS OF THE CONTROL ALGORITHM *
to achieve the user’s requested positions/attitudes. It
Name Controls… Input1 Input2 Input3 Output
implements the separate controllers for each axis as a set of
Height, Height Vertical Vertical Collective
multi-dimensional LUT’s, for efficiency, as well as the main during Error Velocity
HEIGHT Acc. Incremental
Autopilot Finite State Machine (FSM). A further Logger take-off
(57 Rules) 7 MF 5 MF 5 MF 9 MF
object is implemented to abstract the process of logging data and
to file for later retrieval. These are: telemetry, control values hovering ±3m ±7m/s ±15m/s2 ±0.02
and reference/error information, all appropriately time- Vertical, Height Vertical Collective
LANDING position for Velocity Incremental
stamped. Logging is done via binary files, since this was 4 MF -
found to be the most time-efficient method as opposed to (16 Rules) landing 5 MF 7 MF
operations 0/10m ±7m/s ±0.02
text files or C++ data structures (such as lists and vectors).
Yaw Yaw
These are then later analysed and plotted using Matlab®. Heading,
Velocity
Tail Pitch
YAW through Error Incremental
7 MF -
IV. CONTROLLER DESIGN (35 Rules) Tail 5 MF 7 MF
Collective ±3c
±10c/s ±0.05
The objective of the project is to control the helicopter’s
Angle Angular Angle Cyclic
absolute position in space. A human pilot is only required to Error Velocity Acc.
CYCLIC Pitch/Roll Absolute
enter x-y-z co-ordinates, together with a yaw attitude, and
(58 Rules) Attitude 7 MF 7 MF 3 MF 9 MF
the controller attempts to achieve a stable hover at this
±0.5c ±2c/s ±20c/s2 ±0.8
position. Although helicopter dynamics are severely
X/ Y Horiz. Horiz. Angle
coupled, this is most evident in aggressive manoeuvres [13]. position Error Velocity Absolute
For simple flight patterns such as the controlled hover HOVER
through -
required in this project, the dynamics can be assumed to be (28 Rules) 7 MF 5 MF 7 MF
CYCLIC
decoupled. This is aided by the speed at which the control commands ±5m ±5m/s ±0.1c
392
*The values in the Input/Output columns refer to the number of Altitude control was the first axis to be designed. Testing
Member Functions (MFs) with the range of the fuzzy variables results yielded indications as to what the control frequency
underneath them. Any dimensionless values in the Output refer should be (200Hz, and later increased to 333Hz), together
to helicopter control inputs which are limited to ±1.0 full scale. with the need for acceleration feedback, without which the
height suffered from sustained oscillations. Otherwise, the
All FIS use Mamdami Logic, with rules based on the system performed admirably with an overshoot of about
‘and’ method and with a centroid of area defuzzification 20% and no more than one oscillation before settling down.
function. The ranges for the input variables were chosen The Yaw response was the best of the axes controlled,
after tests to determine the maximum dynamic limits of the achieving minimal errors of less than 2%, within 1 second of
helicopter model. The membership functions (MF) are activation, and with minimal oscillations of less than 3%.
usually trapezoidal at the edges, with the exception of the Cyclic control was developed mainly for the pitch axis,
sigmoid for the intermediary ones for a smoother transition.
and then ported out to the roll axis as well. This was done in
Some important features of each FIS should be noted. order to reduce design time, taking advantage of the
The nine MF’s for the output of the Height controller allow similarities in the dynamics of the two axes. However, in the
for very minute and precise changes. Also, the rule-base final implementation, certain features were individually fine-
gives preference to upward thrust to account for the effect of tuned. Very satisfactory resuls were achieved, both for the
gravity. In the case of the Yaw controller, the error input is pitch and roll axes, as shown in Figs. 2 and 3 respectively.
normalised to between ±π so that if the system overshoots
the limit, the controller acts on the shortest distance. For the 0.2
Cyclic controller the positional errors and velocity are 0.1
rotated into the model co-ordinate system, according to [12]. 0

Angle/rad
-0.1
In addition, it was necessary to augment the Hover FIS -0.2
with two integral schemes. The first is enabled when the -0.3 Pitch Attitude
helicopter achieves steady state. It accumulates the error in -0.4
Pitch Cyclic Control
the X (or Y), multiplied by an integral control factor (0.0001 -0.5
Pitch Reference

for the X and 0.0005 for the Y, due to the roll axis having 5 10 15
Time/s
20 25 30

slightly slower dynamics), and adds it to the error input of Fig. 2. Pitch Reference and Attitude, with cyclic commands
the same FIS. The other scheme adds directly to the output
of the Cyclic FIS, and was necessary in windy conditions, 0.3
Roll Attitude
since the limits set at ± 0.1c, although sufficient to provide 0.2
Roll Reference
Roll Cyclic Control
stability, were unable to overcome wind disturbances. In this
Angle/rad

0.1
case, enabled by the user, the integral scheme accumulates
the error multiplied by 0.001 and saturated to ±0.25 only if 0

the error is constant or increasing, and decays by a forgetting -0.1


factor of 0.9 otherwise. This was done to maintain stability.
-0.2
The Autopilot FSM brings the individual controllers 5 10 15 20 25
Time/s
together, feeding the necessary inputs to each and activating
Fig. 3. Roll Reference and Attitude, with cyclic commands
certain aspects on or off as needed. The helicopter starts off
in GROUNDED mode, when all control values are at the The helicopter control system was brought together in a
neutral position. On takeoff command, the controller starts full set-point tracking example, tabulated below (Table II)
to correct for altitude and yaw attitude, while maintaining and the results depicted in Figs. 4 through 7. Table III,
the helicopter horizontal. No correction for X/Y errors is shows some statistics as to the steady state hovering errors.
performed to avoid coupling effects with the collective The results indicate the ability of the FIS coupled with the
controller. Once the desired height is reached, the HOVER integral control scheme to correct for errors and maintain a
status kicks in and the autopilot activates the Hover FIS stable hover with minimal steady state errors in all axes.
together with the associated integral scheme(s) in order to
correct for X/Y positions. The procedure is repeated on TABLE II SET-POINTS COMMANDED WITH TIME STAMP
every call to takeoff. Once the landing command is given, X-Pos/m Y-Pos/m Z-Pos/m Yaw/c Time/s
0.0 0.0 -5.0 0.0 006.9
the FSM transitions to the LAND state, at which point the
Hover FIS continues to maintain X/Y position (integral 0.0 3.0 -7.0 1.0 051.2
control is shut off however) while the Landing FIS is now in 10.0 3.0 -10.0 0.0 080.4
control of the helicopter, as it brings it down to ground. At 10.0 6.0 -10.0 -0.5c 124.7s
this point, the FSM reverts back to the GROUNDED state. 10.0 6.0 0.0 -0.5c 144.3s*
*this is the landing command.
V. TESTING AND RESULTS
Height of Helicopter
Testing was carried out entirely in the simulation 10
Reference Height
environment, and in a modular fashion. The helicopter was 8
instructed to transition to some reference position/attitude
Height/m

6
(keeping all else constant) and the respective controller
attempted to achieve it. During the simulation, data was 4

logged to file, and analysed afterwards to fine-tune the FIS 2


being tested. Finally, the whole control system was brought
0
together in an entire ‘mission’ from take-off, through a range 0 20 40 60 80 100 120 140 160
of set-points and finally landing back to ground. Time/s
Fig. 4. Height of Helicopter

393
15
X-Pos of Helicopter
would render it difficult to manoeuvre in tight spaces. Some
X-Velocity degree of mathematical modelling to account for the axial
10 X-Reference
coupling can aid in this regard. The end goal would be to
Distance/m

physically implement the system. Further studies would be


5
needed in this case, mainly to obtain the same feedback
signals as in simulation. Usually, the main source of
0
telemetry would be an inertial measurement unit composed
of a three-axis accelerometer (measuring linear acceleration)
-5
0 20 40 60 80 100 120 140 160 and a three-axis angular rate sensor (for angular velocity).
Time/s
Fig. 5. X-Position of Helicopter with velocity These would be transformed and integrated as necessary to
get at the position and attitude data: however, appropriate
7
Y-Pos of Helicopter
filtering would be needed to reduce the effects of drifts and
6 Y-Velocity noise which present a formidable problem. It is envisaged
5 Y-Reference that for precise positional control, further sensors such as
Distance/m

4 GPS sensors and ultrasonic range finders would need to be


3
incorporated. Although other techniques such as vision or
2
laser guidance are also possible, these would offset the
1
original goal for a low cost design.
0
-1
VII. REFERENCES
0 20 40 60 80 100 120 140 160
Time/s [1] D. Krol, M. Lower and B. Szlachetko, “Helicopter Intelligence in
Fig. 6. Y-Pos of Helicopter with velocity Hover: Quality Improvement of the Fuzzy Regulator”, in
Proceedings of the Sixth International Conference on Intelligent
1 Yaw Attitude
Systems Design and Applications, 2006, vol.1 pp. 326-331.
Yaw Reference [2] Gareth D. Padfield. Helicopter Flight Dynamics: The theory and
application of flying qualities and simulation modelling. Oxford,
Angle/rad

0.5 Blackwell, 1996, pp 16-36, 437.


[3] М.N. Krasilshchikov, K.I. Sypalo, D.A. Kozorez, “Helicopter
0
Terrain-Following Integrated Navigation & Control System based
on GPS/GLONASS Technique and Technology”, in Proceedings of
the European Conference for Aerospace Sciences, Moscow 2005.
-0.5 [4] Alberto Isidori, Lorenzo Marconi and Andrea Serrani, “Robust
20 40 60 80 100 120 140 Nonlinear Motion Control of a Helicopter”, IEEE Transactions On
Time/s
Automatic Control, vol. 48, no.3, pp. 413-426 March 2003.
Fig. 7. Yaw Attitude of Helicopter with reference values
[5] Eric N. Johnson and Suresh K. Kannan, “Adaptive Flight Control for
an Autonomous Unmanned Helicopter”, in Proceedings of the AIAA
TABLE III STATISTICS FOR STEADY STATE ERRORS IN HOVER Guidance, Navigation, and Control Conference and Exhibit,
Axis Min Max Mean (abs) Std Dev (abs) California, August 2002.
X/m 8.85e-5 0.7929 0.2506 0.1579 [6] R.L.Barron, R.L.Cellucci, P.R.Jordan, N.E.Bearn, P.Hess and
Y/m 3.47e-8 0.3204 0.0795 0.0779 A.R.Barron, “Applications of Polynomial Neural Networks to FDIE
Z/m 1.91e-6 0.0574 0.0189 0.0112 and Reconfigurable Flight Control”, in Proceedings of the IEEE
Yaw/rad 1.46e-8 0.0947 0.0217 0.0163 National Aerospace and Electronics Conference, May 1990, pp
Pitch/rad 4.73e-7 0.0558 0.0175 0.0097 507-519 vol.2.
Roll/rad 9.00e-7 0.0568 0.0172 0.0093 [7] K. Harbick, J. F. Montgomery and G. S. Sukhatme, “Planar Spline
Trajectory Following for an Autonomous Helicopter”, in
The ability of the controller was also tested under windy Proceedings of the 2001 IEEE International Symposium on
conditions. The height controller managed to keep the Computational Intelligence in Robotics and Automation, 2001, pp.
helicopter stable with 5m/s up/down drafts and at 100% 408-413.
turbulence (fluctuations in this speed), although X/Y control [8] Dimitrios Iakovou “Fuzzy Control for Helicopter Aviation”, M.Sc
Project (for Individual module) University of Twente, Netherlands,
suffered. The additional integral control scheme was able to
June 2002.
achieve very good stability and steady state errors of less [9] M. Lower, B. Szlachetko and D. Krol, “Fuzzy Flight Control
than 0.5m with winds of 5m/s (Beaufort Force 3). System for Helicopter Intelligence in Hover”, in Proceedings of the
5th International Conference on Intelligent Systems Design and
VI. CONCLUSION Applications, 2005, pp. 370-374.
The above results show that the aims of the project were [10] Richard D. Garcia, “Designing an Autonomous Helicopter Testbed:
largely achieved. A Fuzzy Logic Controller was designed, From Conception through Implementation”, Ph.D. Thesis,
capable of controlling a helicopter to achieve user-defined University of South Florida, Florida, January 2008.
[11] B. L. Stevens and F. L. Lewis, Aircraft Control and Simulation, 2nd
positions and able to autonomously take-off, hover and land
Edition., John Wiley & Sons, Hopoken, NJ, USA, 2003.
at the user’s demands. Considering that often the helicopter [12] L. Chetcuti Zammit, “Simulation of Flight Control for an
was required to perform changes in various DOF’s (i.e. Autonomous Helicopter”, B.Eng. dissertation, University of Malta,
position and yaw attitude) simultaneously, the response and Malta, 2010.
stability maintained is more than satisfactory. Furthermore, [13] Richard D. Garcia, “Designing an Autonomous Helicopter Testbed:
it must be kept in mind that the rules were developed by a From Conception through Implementation”, Ph.D. Thesis,
non-expert in the field, a testament to the flexibility and ease University of South Florida, Florida, January 2008.
of design of the proposed control scheme. The helicopter [14] Hobby-estore (2011), Esky Honey Bee King II 6CH CCPM Electric
RC Helicopter RTF. [Online]. Available: www.hobby-
responded very well even under 5m/s winds, which is estore.com/Esky-Honey-Bee-King-II-6-CH-Electric-RC-Helicopter-
notable considering the lightweight nature of RC helicopters p/eh-ek-e016.htm
[15]. [15] J. Salt (2011), RC Helicopter Fun. [Online]. Available:
www.rchelicopterfun.com.
Future work would concentrate on improving the [16] SVK Systems (2011), Clearview RC Flight Simulator. [Online].
transient phase of the helicopter, to avoid oscillations which Available: http://rcflightsim.com/
394

You might also like