fuzzy controller autopilot for a fixed wing unmanned aerial vehicle

Upload: dominic-jordan

Post on 29-Oct-2015

126 views

Category:

Documents


0 download

DESCRIPTION

Matlab simulation of a Fuzzy Controller Autopilot for a Fixed Wing UAV

TRANSCRIPT

  • FUZZY CONTROLLER AUTOPILOT FOR A FIXED WING

    UNMANNED AERIAL VEHICLE

    by

    DOMINIC TIMOTHY JORDAN

    A mini-dissertation submitted for the partial fulfilment of the degree

    BACCALAUREUS INGENERIAE

    in

    ELECTRICAL AND ELECTRONIC ENGINEERING SCIENCE WITH INFORMATION TECHNOLOGY AS ENDORSEMENT

    at the

    STUDY LEADER: MR FRANCOIS DU PLESSIS 2008

  • Table of Contents

    DT Jordan 2008 i

    TABLE OF CONTENTS

    1 CHAPTER 1: PROBLEM STATEMENT ...................................................................................................... 1.1

    1.1 INTRODUCTION AND BACKGROUND ............................................................................................................. 1.1 1.2 PROBLEM STATEMENT .............................................................................................................................. 1.4 1.3 THE PROJECT OBJECTIVE............................................................................................................................ 1.5 1.4 SCOPE OF THE PROJECT ............................................................................................................................. 1.5 1.5 DESIGN METHODOLOGY TO BE FOLLOWED .................................................................................................... 1.5 1.6 DELIVERABLES ........................................................................................................................................ 1.7 1.7 OVERVIEW OF THE DOCUMENT .................................................................................................................. 1.7 1.8 CONCLUSION .......................................................................................................................................... 1.9

    2 CHAPTER 2: REQUIREMENTS ANALYSIS ................................................................................................ 2.1

    2.1 INTRODUCTION ....................................................................................................................................... 2.1 2.2 IDENTIFIED ISSUES AND CONSTRAINTS .......................................................................................................... 2.1 2.3 ASSUMPTIONS AND EXCLUSIONS................................................................................................................. 2.6 2.4 REQUIREMENTS SPECIFICATION .................................................................................................................. 2.6

    3 CHAPTER 3: LITERATURE STUDY ........................................................................................................... 3.1

    3.1 INTRODUCTION AND OVERVIEW ................................................................................................................. 3.1 3.2 STANDARDS AND LEGAL CONSIDERATIONS .................................................................................................... 3.1 3.3 THEORY AND METHODS ............................................................................................................................ 3.1 3.4 TOOLS................................................................................................................................................. 3.23 3.5 SIMILAR WORK ..................................................................................................................................... 3.27 3.6 CONCLUSION ........................................................................................................................................ 3.35

    4 CHAPTER 4: DESIGN .............................................................................................................................. 4.1

    4.1 INTRODUCTION AND OVERVIEW ................................................................................................................. 4.1 4.2 DETAILED DESIGN .................................................................................................................................... 4.1 4.3 DESIGN ALTERNATIVES ........................................................................................................................... 4.15 4.4 CONCLUSION ........................................................................................................................................ 4.15

    5 CHAPTER 5: IMPLEMENTATION ............................................................................................................ 5.1

    5.1 INTRODUCTION AND OVERVIEW ................................................................................................................. 5.1 5.2 INDIVIDUAL SYSTEM INCREMENT IMPLEMENTATION PROCESS AND ISSUES ........................................................... 5.1 5.3 INTEGRATION PROCESS AND ISSUES ........................................................................................................... 5.19 5.4 COST SUMMARY.................................................................................................................................... 5.19 5.5 SETTING UP AND USING THE SYSTEM ......................................................................................................... 5.20 5.6 CONCLUSION ........................................................................................................................................ 5.23

    6 CHAPTER 6: RESULTS ............................................................................................................................ 6.1

    6.1 INTRODUCTION AND OVERVIEW ................................................................................................................. 6.1 6.2 TEST AND EVALUATION STRATEGY, SETUP AND METHODOLOGY ......................................................................... 6.1 6.3 COMPONENT TESTING .............................................................................................................................. 6.2 6.4 SYSTEM TESTING ................................................................................................................................... 6.22 6.5 FURTHER RESULTS DISCUSSION ................................................................................................................. 6.22 6.6 CONCLUSION ........................................................................................................................................ 6.23

    7 CHAPTER 7: CONCLUSION ..................................................................................................................... 7.1

    8 REFERENCES ......................................................................................................................................... 8.1

    9 APPENDIX A .......................................................................................................................................... 9.1

    10 APPENDIX B ........................................................................................................................................ 10.1

    10.1 FUZZY REASONING ................................................................................................................................. 10.1

  • List of Figures

    DT Jordan 2008 ii

    LIST OF FIGURES Figure 1-1 Remote Controlled UAV ...................................................................................................... 1.2 Figure 1-2: Predator Medium Altitude Long Endurance UAV [17] ...................................................... 1.2 Figure 1-3: RQ-4 Global Hawk UAV [19] .............................................................................................. 1.3 Figure 1-4: Iterative development process [13] .................................................................................. 1.5 Figure 1-5: Incremental development process and prototyping [13] ................................................. 1.6 Figure 1-6: Design documentation framework [5].............................................................................. 1.7 Figure 2-1: Simulation environment .................................................................................................... 2.2 Figure 2-2: UAV fuzzy controller autopilot user interface ................................................................... 2.6 Figure 3-1: Human controlled process ................................................................................................. 3.2 Figure 3-2: Fuzzy controller controlling a process ............................................................................... 3.3 Figure 3-3: Example of 15 membership functions: .............................................................................. 3.6 Figure 3-4: Graphical construction of control signal with a Matlab generated interface [12] ............ 3.7 Figure 3-5: One input, one output rule base with non-singleton output sets. .................................... 3.9 Figure 3-6: Example of a Mamdani controller ..................................................................................... 3.9 Figure 3-7: Example FLS controller .................................................................................................... 3.10 Figure 3-8: Interpolation between two lines (a), in the interval of overlap of two membership functions (b) ....................................................................................................................................... 3.11 Figure 3-9: Sugeno interface with singleton output .......................................................................... 3.11 Figure 3-10: Control surface that corresponds to the rule base in Figure 3-4 .................................. 3.12 Figure 3-11: Phase trajectory with matching fuzzy controller output ............................................... 3.12 Figure 3-12: Linear control surface that acts as a summation U=E+CE ............................................. 3.14 Figure 3-13: Fuzzy proportional controller ........................................................................................ 3.15 Figure 3-14: Fuzzy PD controller ........................................................................................................ 3.15 Figure 3-15: Fuzzy PID controller ....................................................................................................... 3.16 Figure 3-16: Fuzzy incremental control ............................................................................................. 3.17 Figure 3-17: Scaling of a FPD controller ............................................................................................. 3.18 Figure 3-18: The axis of movement of a fixed wing aircraft .............................................................. 3.19 Figure 3-19: Aircraft control surface .................................................................................................. 3.19 Figure 3-20: Aircraft yaw control ....................................................................................................... 3.20 Figure 3-21: Aircraft pitch control ..................................................................................................... 3.20 Figure 3-22: Aircraft roll control ........................................................................................................ 3.21 Figure 3-23: Inner loops of the autopilot ........................................................................................... 3.22 Figure 3-24: Outer loops of the autopilot .......................................................................................... 3.22 Figure 3-25: Simple Pitch-altitude hold autopilot .............................................................................. 3.22 Figure 3-26: More complex pitch-altitude hold autopilot ................................................................. 3.23 Figure 3-27: System configuration of a framework fuzzy based UAV navigation and control .......... 3.27 Figure 3-28: Altitude error membership functions Figure 3-29: Change in Altitude error membership functions ....................................................................................................................... 3.29 Figure 3-30: Airspeed membership functions Figure 3-31: Elevator membership functions ....... 3.29 Figure 3-32: Throttle command membership functions .................................................................... 3.29 Figure 3-33: Change of heading error membership functions Figure 3-34: Heading error membership functions 3.30 Figure 3-35: Roll angle membership functions .................................................................................. 3.30 Figure 3-36: Plane passing through a target point ............................................................................ 3.30 Figure 3-37: Change of altitude ......................................................................................................... 3.31 Figure 3-38: Forces acting on a plane during a turning ..................................................................... 3.32 Figure 3-39: Heading error membership functions Figure 3-40: Roll angle membership functions 3.33 Figure 3-41: change of roll angle membership functions .................................................................. 3.33 Figure 3-42: The control surface ........................................................................................................ 3.34

  • Table of Contents

    DT Jordan 2008 iii

    Figure 3-43: Test case 1 ..................................................................................................................... 3.34 Figure 3-44: Autopilot controller structure ....................................................................................... 3.35 Figure 4-1: Aerosonde UAV .................................................................................................................. 4.2 Figure 4-2: Navion general aviation airplane ....................................................................................... 4.2 Figure 4-3: Aerosim UAV Simulink Blockset ......................................................................................... 4.3 Figure 4-4: Internal structure of an aeroplane model within the Aerospace Blockset ....................... 4.4 Figure 4-5: Time variation of the altitude of the UAV during the transatlantic flight ......................... 4.5 Figure 4-6: Aerosim's Simulink Blockset for Flightgear 0.9.8 ............................................................... 4.6 Figure 4-7: Interface to specify controller inputs/outputs .................................................................. 4.7 Figure 4-8: Interface to specify membership functions ....................................................................... 4.7 Figure 4-9: Interface to specify rules ................................................................................................... 4.8 Figure 4-10: High level system block diagram ..................................................................................... 4.8 Figure 4-11: Fuzzy altitude controller with inputs and outputs .......................................................... 4.9 Figure 4-12: Properties of the Mamdani fuzzy controller ................................................................... 4.9 Figure 4-13: Altitude error membership function Figure 4-14: Change of altitude error membership function 4.10 Figure 4-15: Airspeed membership function ..................................................................................... 4.10 Figure 4-16: Throttle membership function Figure 4-17: Elevator membership function ............ 4.10 Figure 4-18: Fuzzy latitude longitude controller with inputs and outputs ........................................ 4.12 Figure 4-19: Heading error membership function ............................................................................. 4.12 Figure 4-20: Change of heading error ................................................................................................ 4.12 Figure 4-21: Roll angle ....................................................................................................................... 4.13 Figure 4-22: Flightgear 0.9.8 properties block ................................................................................... 4.14 Figure 4-23: Starting Flightgear in external mode to accept connections from Matlab ................... 4.14 Figure 5-1: UAV framework setup ....................................................................................................... 5.1 Figure 5-2: Aerosonde UAV block properties ...................................................................................... 5.2 Figure 5-3: Connection with Flightgear setup ...................................................................................... 5.3 Figure 5-4: FlightGear 0.9.8 Interface Blockset properties .................................................................. 5.3 Figure 5-5: Invoking Flightgear to accept UDP connections using the command in the Aerosim User guide .................................................................................................................................................... 5.4 Figure 5-6: Obtaining inputs and outputs for the Altitude fuzzy logic controller ................................ 5.5 Figure 5-7: Altitude fuzzy logic input parameter calculator subsystem .............................................. 5.6 Figure 5-8: Altitude fuzzy logic controller block properties ................................................................. 5.6 Figure 5-9: System with bank angle stabilizing PI controller ............................................................... 5.7 Figure 5-10: Bank Angle to Aileron PI system ...................................................................................... 5.8 Figure 5-11: Loading a FIS structure into the Workspace .................................................................... 5.8 Figure 5-12: Editing the Simulation configuration parameters ........................................................... 5.9 Figure 5-13: Editing the configuration parameters to allow for the execution of FIS systems ........... 5.9 Figure 5-14: Changing the controller properties block to enable execution ..................................... 5.10 Figure 5-15: The controller properties block of the new Sugeno type controller ............................. 5.10 Figure 5-16: Modified Simulink diagram with optimised Altitude controller inputs and outputs .... 5.11 Figure 5-17: Modified altitude error membership function .............................................................. 5.12 Figure 5-18: Modified change of altitude error membership function ............................................. 5.12 Figure 5-19: Modified Altitude fuzzy logic input parameter calculator subsystem ........................... 5.13 Figure 5-20: Control Surface of altitude controller ............................................................................ 5.14 Figure 5-21: Obtaining inputs and outputs for the heading fuzzy logic controller ............................ 5.15 Figure 5-22: Latitude-Longitude fuzzy logic input parameter calculator subsystem ........................ 5.16 Figure 5-23: Latitude- Longitude controller block properties............................................................ 5.16 Figure 5-24: Converting the Roll angle command to an aileron command with a PI controller ....... 5.16 Figure 5-25: Modified Heading error membership function ............................................................. 5.17 Figure 5-26: Final change of heading error membership function .................................................... 5.17

  • Table of Contents

    DT Jordan 2008 iv

    Figure 5-27: Control Surface of latitude-longitude controller ........................................................... 5.19 Figure 5-28: System shown when opening the Fuzzy_controller_for_UAV.mdl file ...................... 5.21 Figure 5-29: Changing the time of day settings in Flightgear ............................................................ 5.22 Figure 6-1: System test plan................................................................................................................. 6.1 Figure 6-2: Indication of UAV banking to the left ................................................................................ 6.3 Figure 6-3: Altitude plot for user interface test Figure 6-4: Bank angle plot for user interface test 6.4 Figure 6-5: The altitude plot for 1050m set point ............................................................................... 6.7 Figure 6-6: The airspeed plot for a 1050m set point ........................................................................... 6.7 Figure 6-7: Output of "current altitude" scope for test 2 .................................................................... 6.8 Figure 6-8: Output of the Current airspeed scope for test 2 ............................................................ 6.9 Figure 6-9: Output of "current altitude" scope for test 3 .................................................................. 6.10 Figure 6-10: Output of the Current airspeed scope for test 3 ........................................................ 6.10 Figure 6-11: Output of "Current Heading" scope for test 4 ............................................................... 6.11 Figure 6-12: Output of the Current airspeed scope for test 4 ........................................................ 6.11 Figure 6-13: Output of "Current Heading" scope for test 5 ............................................................... 6.12 Figure 6-14: Output of the Current airspeed scope for test 5 ........................................................ 6.12 Figure 6-15: Output of "Current Heading" scope for test 6 ............................................................... 6.13 Figure 6-16: Output of the Current airspeed scope for test 6 ........................................................ 6.13 Figure 6-17: Output of "Current Heading" scope for test 7 ............................................................... 6.14 Figure 6-18: Output of the Current airspeed scope for test 7 ........................................................ 6.14 Figure 6-19: Output of "Current Heading" scope for test 8 ............................................................... 6.15 Figure 6-20: Output of the Current airspeed scope for test 8 ........................................................ 6.15 Figure 10-1: Two definitions of the set of "tall people" .................................................................... 10.2 Figure 10-2: Union of two fuzzy sets A and B .................................................................................... 10.2 Figure 10-3: Intersection of two fuzzy sets A and B........................................................................... 10.3 Figure 10-4: Fuzzy compliment of A and B ........................................................................................ 10.3 Figure 10-5: Hedging on the linguistic variable "young" ................................................................... 10.4 Figure 10-6: Fuzzy AND truth table Figure 10-7: Boolean AND truth table ................................. 10.5

  • List of Tables

    DT Jordan 2008 v

    LIST OF TABLES Table 1-1: Deliverables ......................................................................................................................... 1.7 Table 3-1: Relational based format of rule base .................................................................................. 3.4 Table 3-2: Linguistic based table of rule base ...................................................................................... 3.5 Table 3-3: Two input, single output FAM table: ................................................................................ 3.12 Table 3-4: Relationship between the linear fuzzy and PID gains ....................................................... 3.18 Table 4-1: Aerosonde UAV specifications ............................................................................................ 4.4 Table 4-2: Altitude Fuzzy Controller FAM 1 ....................................................................................... 4.11 Table 4-3: Altitude Fuzzy Controller FAM 2 ....................................................................................... 4.11 Table 4-4: Altitude Fuzzy Controller FAM 3 ....................................................................................... 4.11 Table 4-5: Latitude-Longitude Fuzzy Controller FAM ........................................................................ 4.13 Table 5-1: Altitude error membership function linguistic variables and their values ....................... 5.12 Table 5-2: Change in altitude error membership function linguistic variables and their values ....... 5.12 Table 5-3: Elevator membership function linguistic variables and their values ................................ 5.12 Table 5-4: Altitude Fuzzy Controller FAM .......................................................................................... 5.13 Table 5-5: Heading error membership function linguistic variables and their values ....................... 5.18 Table 5-6: Change in heading error membership function linguistic variables and their values ...... 5.18 Table 5-7: Roll angle membership function linguistic variables and their values.............................. 5.18 Table 5-8: Modified latitude-longitude fuzzy controller FAM ........................................................... 5.19 Table 6-1: Sustained forward flight mode test .................................................................................... 6.2 Table 6-2: Procedure to test the user interface ................................................................................... 6.3 Table 6-3: Process to test the accuracy of the controller .................................................................... 6.5 Table 6-4: Process to test the response against different weather conditions ................................. 6.16 Table 6-5: Test results ........................................................................................................................ 6.21 Table 9-1: ECSA engineering outcomes [16] ........................................................................................ 9.1 Table 10-1: Logical operators symbols .............................................................................................. 10.4

  • List of symbols are abbreviations

    DT Jordan 2008 vi

    LIST OF SYMBOLS AND ABBREVIATIONS

    SYMBOL/ ABBREVIATION MEANING

    3-D Dirty, dull and dangerous ACM Association for computing machinery API Application programming interface BOA Bisector of area CAA Civil aviation authority COG Centre of gravity COGS Centre of gravity method for singletons DUBSI Dutchroll Blockset for Simulink ECSA Engineering council of South Africa FAA US Federal Aviation Administration FAM Fuzzy associative memory FDC Flight dynamics and control FINC fuzzy incremental controller

    FP Fuzzy proportional

    FPD Fuzzy proportional derivative

    FPD+I fuzzy proportional integral

    GUI Graphical user interface HIL Hardware in the loop ICAO International Civil Aviation Organisation IDE Integrated development environment IEEE Institute for electrical and electronic engineers INS Inertial navigation system Kbps Kilobytes per second LM Leftmost maximum MALE Medium-altitude long endurance MIMO Multiple-input-multiple-output MOM Mean of maxima method NB Negative Big Neg Negative NM Negative Medium OS Operating systems PB Positive Big PD Proportional derivative

    PID Proportional, integral derivative Pos Positive RC Remote controlled RM Rightmost maximum

    SBC Single boarded computer SISO Single-input-single-output TBA To be announced TCP/IP Transmission control protocol/Internet protocol UAV Unmanned aerial vehicle UCAV Unmanned combat air vehicle

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.1

    1 CHAPTER 1: PROBLEM STATEMENT

    1.1 INTRODUCTION AND BACKGROUND

    The fixed wing aircraft has proven itself extremely useful in many fields since its invention by the Wright brothers. These fields range from military and commercial use, to aiding in the conduction of scientific research. The invention of the unmanned aerial vehicle (UAV) has further expanded the use of the aircraft. UAVs are typically controlled with the aid of programmed flight plans, and onboard control systems. They are usually classified into the following main groups [7]:

    1. Combat: These aircraft are usually used to provide attacking ability for high-risk missions, where it might be dangerous to use a manned aeroplane. This type of UAV is commonly referred to as the unmanned combat air vehicle (UCAV).

    2. Research and development: Here, the UAVs are commonly used to further expand and develop existing UAV technologies. This will allow the UAVs to further expand into other fields. An example of this is the use of UAVs to test aircraft in various detrimental situations. In most cases, the used of a manned aircraft would have probably put a pilots life in jeopardy.

    3. Civil and commercial uses: The scope of UAVs in commercial and civil usage is extremely vast. These range from the hobbyist fling micro RC airplanes, to the use of the UAV to record sports games from a birds-eye-view perspective.

    4. Reconnaissance: In this area, the UAVs are used to intelligently monitor and gather information in e.g. military zones.

    5. Target and decoy: During military training sessions, a UAV might be used to simulate aircraft behaviour. This type of simulation could be used for e.g. target practice.

    For the reasons mentioned above, UAVs are often said to perform the dull, dangerous and dirty jobs, and UAV missions are often called 3-D missions. According to Col. John Burke, a UAV specialist in the United States Army [8], UAVs can perform dull but sometimes necessary tasks like flying a specific flying pattern for reconnaissance. They can go into certain dirty environments, where there are possible threats of been exposed to dangerous environments like chemical, biological or nuclear threats. They can further be sent on missions into dangerous environments. The major advantage of these aircraft is that many limitations associated with manned aircraft are no longer a constraint. With manned aircraft, the flight duration of many missions, as well as the success of the mission is usually dependant more on operator constraints like pilot fatigue. Many aircraft accidents are usually based on pilot error relating to fatigue [10]. Many fixed wing aircraft accidents in the 1980s are related to pilots been awake for more than 12 hours prior to the accident. For this reason, the US Federal Aviation Administration (FAA) has set out strict rules and regulations relating the amount of rest that pilots should have, to the expected flight duration.

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.2

    With more dull missions, fatigue is reached faster in comparison to other more exciting missions, and human performance decreases as a function of flight hours. With UAV missions, the UAV is just as alert in the first hour of flight as in the last. For this reason, the endurance of a UAV aircraft is more dependent on the percentage of fuel burned as a function of total weight. The size of the aircraft is also greatly reduced, since they do not have to have the pilot on board. According to Dr Greg Addington, the air vehicles directorate program manager for propulsion integration [9], the size of a UAV is dependent on three aspects, mainly:

    Mission requirements, such as the range, speed etc. The payload requirements, such as the weapon requirements etc. The propulsion path flow length of the aircraft, which is responsible for providing lift for the

    aircraft. Current UAV research programs are focusing on developing small UAVs (2-5kg) that are capable of taking off from a small truck. Typical remote controlled (RC) aircraft can be easily carried by a single person.

    Figure 1-1 Remote Controlled UAV

    The United States UAV programs are typically associated with using these types of aircraft for surveillance purposes [11]. Using this type of technology is much cheaper than using satellites. A number of air forces have UAVs as part of their fleet. The most popular of these include the Predator and the Global Hawk.

    Figure 1-2: Predator Medium Altitude Long Endurance UAV [17]

    The Predator has been used in the United States military since 1995, and is classified as been the militaries medium-altitude long endurance (MALE) unmanned aircraft system. The Predator has been used in combat in various zones such as Afghanistan, Iraq and Serbia. The aircraft can be used for reconnaissance purposes, and is also capable of carrying two missiles for combat purposes. The total USA military Predator programme consists of four aircraft, a satellite communication link, and a ground control station. The total crew working on the programme consists of about 55 people. The cost associated with the early development Predator is approximately $3.2 million per aircraft.

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.3

    Figure 1-3: RQ-4 Global Hawk UAV [19]

    The United States military added the RQ-4 Global Hawk UAV to her fleet in 2006 as an improvement of the Predator. This UAV has improved surveillance capabilities compared to its predator predecessor, and is mainly used for surveillance purposes. It is also the first UAV to be certified by the FAA to fly on its own. The aircraft has become so popular that many other air forces have shown increasing interest in the UAV. Each Global Hawk costs approximately $132 million. Although the aircraft advantages indicate that there is a vast scope for the uses of UAVs, they also come with their disadvantages. These will usually result if the control system controlling the plane fails, resulting in the possibility of the UAV crashing. This could put the lives of the general public at jeopardy. With the constant improvement of computer processing power, it can be said that the advantages far outweigh the disadvantages of UAVs and that there is scope for developing a system that will encapsulate the advantages. For this reason, most of the current research in UAVs is focused on incorporating autonomy into the aircraft. This is mainly focused on the ability of the aircraft to make decisions without any human intervention. It is said that this is the bottleneck for future developments in the industry. Research into autonomy is separated into the following fields [7]:

    1. Communications: Here, the core focus is handling communication between multiple agents.

    2. Trajectory Generation: Given a certain path from one point to the other, the focus here is to determine the best control manoeuvre to follow the path.

    3. Motion planning: Determine the most optimal path, given certain constraints.

    4. Sensor fusion: This involves combining the information obtained from different sensors to use for further analysis.

    5. Scheduling and task allocation: Using the time and equipment constraints, an optimal distribution of tasks among various agents is addressed.

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.4

    6. Cooperative tactics:

    An optimal distribution of sequences between agents is addressed to increase the success of a mission.

    All of the above can ultimately lead to the ability of the aircraft control to mimic human behaviour. This mini-dissertation will fall under the unmanned aerial vehicle research group at the University of Johannesburg.

    1.2 PROBLEM STATEMENT

    The full power of the UAV comes into their ability to fly without any human intervention. This can be accomplished with the aid of control systems, which will influence the behaviour of the aircraft by changing the outputs according to rules that depict how the aircraft should react. Classical control theory makes use of a mathematical model of the system, in the form of differential or state space equations, to define a relationship that transforms the output of the system to that of a desired state. The major drawback of classical control theory is that it requires a mathematical model of the system. With larger systems, it is often extremely difficult to formulate the mathematical model of the system, as the model is often nonlinear. Modelling the system can become extremely expensive as the size and complexity of the system increases. In most control systems, the common used controller is the proportional-integral-derivative (PID) controller that adjusts the output of the system according to the following equation:

    = + + Where:

    KP Proportional constant KI Integral constant KD Proportional constant e: Error term

    The main advantage of the PID controller is that it does not require a mathematical model of the system, and the constants are easily tuneable using various formalised tuning techniques, however it usually assumes that the system been modelled is linear. Fuzzy controllers also do not require a mathematical model of the system, and rather replaces it with a set of if-then rules. These rules generally only describe a small section of the whole system. The main advantage of using a fuzzy controller is that the automatic process control mimics the conscious behaviour of human operators, whether the process is linear or not. As Lotfi Zadeh, the mathematician regarded to be the father of fuzzy logic, stated "In almost every case you can build the same product without fuzzy logic, but fuzzy is faster and cheaper [20]." In terms of automatic control of a UAV, the problem that arises is if it is possible to develop an autopilot that mimics human behaviour. The controller should also be cheap enough, and should be easy to integrate with the aircraft.

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.5

    1.3 THE PROJECT OBJECTIVE

    Fuzzy logic has made it possible to make decisions with simple if-then rules. This type of logic mimics the human thinking process and forms part of many artificial intelligence solutions. As mentioned in Section 1.2, the main advantages of using fuzzy controllers are

    The mathematical modelling of the system need not be known The controller mimics human behaviour

    The objective of this project is thus to develop a fuzzy controller autopilot for a UAV fixed wing aircraft. The fuzzy controller autopilot should be tested in a simulation environment that will mimic the behaviour of the aircraft in real life. If further time allows, the controller will be verified with hardware in the loop (HIL) simulation. If further time allows, the controller will be physically implemented in the form of a single boarded circuit (SBC).

    1.4 SCOPE OF THE PROJECT

    The project will be limited to developing an autopilot for a fixed wing aircraft to sustain forward flight. The project will also have the following constraints:

    The autopilot controller should be a fuzzy controller The autopilot should be limited to keeping the aircraft in sustained forward flight.

    Furthermore, the main part of the project should be limited to simulating the controller. As mentioned in the section above, the implementation of the controller with a HIL simulation as well as that of a SBC is a growth option of the controller dependant on time constraints.

    1.5 DESIGN METHODOLOGY TO BE FOLLOWED

    The success of any project requires a good design methodology. For this project the agile methodology will be used [13]. This method focuses on the recursive development of increments throughout the lifecycle of the project. Typical approaches involved with processes that use agile methodologies are shown in Figure 3 and Figure 1-4.

    Figure 1-4: Iterative development process [13]

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.6

    Figure 1-5: Incremental development process and prototyping [13]

    In the agile process, each iterative phase consists of planning, design, implementation, testing as well as the documentation of a system increment. Activities involved during each iteration phase should be completed 100% by the end of the process. The main advantage of this is that after completing each phase, it is clearer to see the overall progress of the project. Frequent contacts with the client enable the engineer to have a clear understanding of the requirements of the project. These can range from the initial high level user requirements acquired in the initial phase of the project, to emergent requirements acquired further on in the development process. Traditional design methodologies focus on the initial goal of capturing all the known requirements early in the development process. The main reason for this is because systems are often very difficult to modify after requirements immerge later on in the development process. With agile processes, the requirements evolve during the system development phase. However, the timescale allocated for a project does not change. The requirements for each phase are captured in the most minimal form possible i.e. just enough to allow the development of each phase to be tested efficiently. For any agile development process to work, it is crucial to start development with the core, most important features. These features should be developed as early as possible in the development process. It can be said that the agile method is the constant cycle of the analysing, developing and testing steps. Using this methodology will result in reducing the risk of the overall project, since the engineer is constantly aware of the parts of the project have been completed. The development process often leads to an increased value of the overall product. This is because incremental development results in the possibility of releasing a product when it is deemed well enough, rather than waiting for the entire product to be released. The budget is used more efficient with agile methodology, then with other methodologies. This is because there is still a possibility of releasing an early version of the product, even if the budget is exceeded. Other design methodologies often lead to the scrapping of the entire project if allocated costs are exceeded.

    Part of the purpose of this project is to prove that the student has achieved the first five outcomes as set out by the Engineering council of South Africa (ECSA) [16]. For this reason, attention will be placed on each of these five outcomes during the project life cycle phase. For more information on the ECSA outcomes, please refer to Appendix A.

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.7

    1.6 DELIVERABLES

    The deliverables as given in Table 1-1 will be submitted for evaluation: Table 1-1: Deliverables

    ACTIVITY WHEN DATE

    Hand in chapter 1 and the project management plan

    As soon as possible 3 March 2008

    Hand in chapter 2,3 7 April 2008 Deliver first seminar Conference date to be

    announced TBA

    Hand in chapter 4 Last day of block week 30 May 2008 Hand in chapter 5,6 First Friday day of fourth term 12 September 2008

    Delivery of second seminar Conference date to be

    announced TBA

    Hand in draft version of mini-dissertation (one copy for evaluation by study leader)

    Last day of fourth day 24 October 2008

    Hand in mini-dissertation First day of Exam 3 November 2008 Oral Examination During the normal examination

    time period, to be arranged with study leader

    3-21 November 2008

    1.7 OVERVIEW OF THE DOCUMENT

    The design of the project will be split up into the following sections as given in Figure 1-6

    Figure 1-6: Design documentation framework [5]

    Each phase for the design will consist of the following areas:

    During the project management process, the required management processes are set to successfully complete the design process. Throughout this process, risks are identified and planned, as well as monitoring plans and contingency plans set. The plan will further contain financial considerations, as well as any equipment procurement processes.

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.8

    In the problem statement phase, the problem is introduced. The objectives of the design project are addressed, as well as the context it falls under. The scope of the project is further included in this section.

    The requirements analysis phase follows up the problem statement phase. Here, the

    problem is further analysed. The project requirements are listed, as well as the quality and performance specifications.

    Next, the Literature review phase follows up on the problem statement. Here, the issues

    involved are further understood, as well as available knowledge collected.

    For the design phase, all the previous gained knowledge is used to create design options for the solution. Designs are weighed against the requirements, and one design is chosen as the final design.

    In the implementation phase, the final chosen design is implemented and made to work.

    The results phase consists of a critical evaluation of the chosen design, with constant

    reference to the requirements.

    Finally in the conclusion phase, the success of the project is critically judged. To accomplish all of the above project requirements, the document is to be split up into seven chapters. These will consist as follows: Chapter 1 will introduce the reader to the work to be presented. The reasons for the project are explained, such as the actual problem and why it is a problem. The extent to which the problem is going to be addressed is further addressed, as well as the benefits of solving the problem. Next, the requirements analysis phase will be represented in Chapter 2. This will consist of analysing the problem in more detail. Here, it will be addressed how the problem is intended to be solved, as well as any known constraints that will affect the solution. The literature review will address the current state of technology surrounding the project. This will be represented in Chapter 3. This will entitle the collection of anything that will help in solving the problem. Facts that were collected during the design phase will be used to design the proposed solution. This is to be presented in Chapter 4. Tests to be later performed are also included in this section. A design is chosen, and this is to be implemented during the implementation phase. This section is to include steps in implementing the design, as well as issues that were encountered. This is presented in Chapter 5. The results of the implemented solution are then discussed in Chapter 6. These include indicating that the proposed design actually works. Finally, Chapter 7 is the conclusion of the project, which ties the whole project together, from beginning to end.

  • Chapter 1: Problem Statement

    DT Jordan 2008 1.9

    1.8 CONCLUSION

    Fixed wing UAVs have become a part of the aviation family, and are well suited to perform the dull, dangerous and dirty work that is often needed. For this reason, a lot of research is focused on improving their capability and areas of usage. The ultimate goal of all UAV research fields is to eventually get the aircraft to fly without any human intervention. This would minimise human constraints typically associated with manned aircraft missions, like fatigue. However, the trade-off lies in accomplishing the plane to fly with the accuracy of a human, but without having the constraints typically associated with manned flight. Classical as well as modern control system theory allows for the development on an autopilot. However, the design of most control systems requires a mathematical equation relating the input to the output of the system. With larger systems it is extremely difficult to find such an equation. The power in PID and fuzzy controllers are that a mathematical model of the system is not needed. Although the PID controller is the easiest to tune and is the most common controller used in industry, it does not fully mimic the human way of thinking. Fuzzy controllers are based on the theory of fuzzy logic, and represent the human way of thinking. With the aid of a fuzzy controller, it is possible to model a complex system with a few if-then rules. Fuzzy controllers are often cheaper compared to other controllers. The design of a fuzzy controller autopilot will achieve the requirements of keeping a fixed wing aircraft in sustained forward flight. For the purpose of the project, the initial design will be limited to a simulation based project. If further time allows, the controller will be expanded in terms of implementing the controller with a HIL and SBC. To achieve the objectives of the project, a suitable design methodology has to be in place. In this project, the agile design methodology will be used, which focuses on the iterative process of integrating increments into the project. Attention will also be placed on achieving the first five ECSA outcomes. Furthermore, the documentation part of the project will be separated into seven chapters. These range from the initial problem statement, to the conclusion of the project. This mini-dissertation will fall under the unmanned aerial vehicle research group at the University of Johannesburg department of electrical and electronic engineering science.

  • Chapter 2: Requirements Analysis

    DT Jordan 2008 2.1

    2 CHAPTER 2: REQUIREMENTS ANALYSIS

    2.1 INTRODUCTION

    The purpose of this chapter is to analyse the problem presented in Chapter 1 in further detail. This will be done by identifying the issues and the constraints associated with the project. These issues will have to be addressed in the design. The first type of constraint that will be identified is the technical constraints associated with the project. This will be done by discussing all the issues and constraints associated with the project. The financial and economic constraints will then be addressed which will focus on how the economic environment will impact the project. Since every engineering project will impact the social environment in some form, the social aspects and constraints of the project will have to be addressed. The legal framework of the project will then be further addressed. Safety aspects of the project will also be addressed. The impact on the environment by any engineering project can result in serious legal consequences. The environmental constraints of the project will be addressed. One of the ECSA outcomes is the appropriate application of ethical aspects to projects. For this reason, ethical considerations associated with the project are to be addressed. Usability considerations and limitations are also to be addressed. Since every project makes use of certain assumptions, the limitations of the assumptions to be made will be addressed. Furthermore, the requirements of the projects will be identified and listed. Quality and performance specifications will be set in this chapter. Although it was stated in Chapter 1 that the agile method will be followed that focuses on the constant incremental development of requirements, it is often better to understand all the issues associated with the project at the beginning to ensure that the project life cycle runs smoothly. This will also lead to a better understanding of the project. This document will also set the high-level user requirements. The emergent requirements will be made visible during the project life-cycle phase. Since the agile process will be used, the requirements stated in this chapter are likely to change during the project life cycle phase.

    2.2 IDENTIFIED ISSUES AND CONSTRAINTS

    2.2.1 Technical

    The success of many projects is often related to the technical constraints and the availability of adequate technology to support the project. For this reason the identified issues and constraints are as follows:

  • Chapter 2: Requirements Analysis

    DT Jordan 2008 2.2

    2.2.1.1 Availability of software libraries

    The success of most software and engineering projects is highly dependent on using previously done work and technology. Since this project is highly software based, the availability of software libraries and suitable platforms would result in an efficient use of available technology rather having to redesign them. Procurement of these libraries is often an issue, as legal constraints associated with software usage are often a problem.

    For this project, the software constraint will be limited to making use of open source software, and software that the electronic and electrical engineering department has already purchased. Software already purchased by the department includes Matlab and Microsoft Visual Studio.

    2.2.1.2 Availability of simulation packages

    Since this project is mainly simulation based, the availability of a simulation platform is a constraint and a major issue that inhibits the success of the project. The fuzzy controller as well as the aircraft flight is to be simulation based with the connection between the two sub-systems shown in Figure 2-1.

    Figure 2-1: Simulation environment

    The main purpose of the network connection is to send controller commands between the fuzzy controller and the aircraft simulator, as well as to send current information of the aircraft to the fuzzy controller. The two sub-systems can be run either on the same computer, or be separated on different computers as shown in Figure 2-1.

    2.2.1.3 Accuracy of the controller

    The accuracy of the controller to sustain forward flight is a technical constraint of the project. Since human pilots are able to control the aircraft in most detrimental situations, the fuzzy controlled autopilot will have to be able to do this also. Also, with autopilots on manned aircraft, the pilot is able to disengage the autopilot in cases of emergencies. With UAVs, the fuzzy controlled autopilot will have to respond to dangerous situations, or alert staff on the ground control station that a problem has been encountered.

    2.2.1.4 Processing speed

    Since the controller will be implemented on a desktop or laptop computer, the controller will be digitally based. For this reason it will have to sample the current state of the aircraft fast enough, as well as accommodate for any information delays. Asymptotic analysis [21] on the algorithm used will have to be performed on the algorithm implemented to analyse the run time of the algorithm. Furthermore, the network connection speed will have to be fast enough to make sure that there is no significant delay in the system.

    2.2.1.5 Availability of adequate suitable aircraft model

    In order for the controller to be adequately tested, a suitable aircraft model will have to be made available. This model will also have to communicate appropriate information regarding the current state of the aircraft to the Fuzzy controller. The model should also be able to accept aircraft control commands from the controller.

  • Chapter 2: Requirements Analysis

    DT Jordan 2008 2.3

    The model should also accurately simulate the dynamics of the aircraft in order for the controller to simulate real life response. However, the equations governing the model are not necessary, as fuzzy controllers do not require them. The model is only needed to simulate the response.

    2.2.1.6 Availability of suitable flying conditions

    The fuzzy controller will have to work under the entire spectrum of weather conditions experienced in South African skies. For this reason, the accuracy regarding the response of the aircraft under these conditions is vital in order to accurately control the aircraft, as well as to test its robustness.

    2.2.1.7 Taking off and landing of the UAV

    Since a requirement of the aircraft is to sustain forward flight, in order to test the controller, the aircraft will have to be taken off and landed with the aid of a human controller on the ground control station.

    2.2.1.8 Load Shedding

    South Africas national electricity supplier ESKOM is currently experiencing a problem with the demand exceeding the supply of electricity. For this reason, major technical constraints is the controller as well as the simulation platform failing as a result of the power supply failing. The load shedding can also delay the delivery and the design process.

    2.2.1.9 Fuel availability

    As stated in Chapter 1, the flight duration is usually based on the availability of fuel. For this reason, the controller will have to efficiently use fuel. The amount of on board fuel available is also a limitation on the manoeuvrability i.e. it might manoeuvring the UAV in the non ideal way might result in the uneconomical use of fuel.

    2.2.2 Financial and economic

    Since the majority of costs of the project are associated with procuring appropriate software, most of the budget will be allocated here. The hardware required is mainly desktop computers and laptops. For this project, the computers available at the department will be used, as well as a personal laptop. Since the department has already procured most of the software needed, the costs associated for any additional software needed will be covered by the UAV research groups budget.

    2.2.3 Social

    Allowing computers to perform tasks that are usually allocated to humans has numerous social considerations [22]. These include the constant question that the designer has to ask, mainly: Where is the limitation and borderline on what computers are allowed to do? With autopilots replacing the need for a human controller, the question to ask is whether replacing the human controller with an automatic one will have any social implications? Parties arguing for the use of artificial intelligence [24] comment that the availability of intelligent systems will make expert knowledge available to a wider range of the population. In terms of UAVs, this will mean that trained experts will no longer be needed to keep the UAV in sustained flight, and the UAVs can lead to the beneficiation of society. Experts also argue that artificial intelligent systems will allow humans to focus more on activities that are natural to human nature. In modern society, many people spend too much time working, and do not have time to focus on themselves and their family. However current political and economical situations does not allow for this type of utopian life.

  • Chapter 2: Requirements Analysis

    DT Jordan 2008 2.4

    On the other hand, many people are against the use of using artificial intelligence systems. Replacing the human operator with that of a machine might lead to the potential economic destruction in the form of how society thinks about work, and many people think that a stable economic society cannot exist if only a small fraction of society performs productive work.

    2.2.4 Legal

    The Civil Aviation Authority (CAA) is responsible for ensuring a safe civil aviation environment in South Africa [25]. The CAA sets rules that must conform to those set by International Civil Aviation Organisation (ICAO) which is based in Canada. T here are only very few structured standards set by the CAA for UAVS in South Africa, the standards set by the ICAO will be referenced, mainly the standards set by the United Kingdom [26]. These include legal constraints in terms of the minimum allowed communication link speed between the ground and the UAV, as well as certification procedures. For more information, refer to [26]. The scope of this project is mainly simulation based, and as a result, most of the certification processes associated with certifying the controller will be ignored.

    2.2.5 Safety

    In sustained forward flight, there is a possibility that the aircraft may encounter detrimental situations e.g. engine failure or severe weather conditions. Human pilots are trained to deal professionally with these situations, and thus an equivalent autopilot will have to also. Although UAVS do not have passengers on board, they still pose a safety threat to the general public. This might include hazardous payloads which might pose a significant threat to the general public if the UAV crashes. Even UAVS without payloads are dangerous as they can cause significant injury to the general public if they crash. For this reason, the controller will have to safely control the aircraft.

    2.2.6 Environmental impact

    Society is becoming more aware of environment in the form of air pollution. For this reason, government has set strict laws relating to this. The fuzzy controller should thus efficiently make use of fuel and not make unnecessary manoeuvres. As stated in section 2.2.5 the plane also poses a significant threat to damaging the environment if it crashes.

    2.2.7 Ethical considerations

    In order to investigate the ethical considerations associated with the project, the following key aspects set by professional organisations will be considered:

    The national institute of ethics (USA) nine steps to personal ethical decision making [27] IEEE code of ethics [28] The engineering council of South Africa code of professional conduct[29] The ACM code of ethics and professional conduct [30]

    2.2.7.1 Facts behind the project

    As stated in Chapter 1 UAVs perform the dull, dirty and dangerous work and this is their main reason for their existence.

  • Chapter 2: Requirements Analysis

    DT Jordan 2008 2.5

    However, many people argue that it is impossible to develop an autopilot that has the accuracy of a human operator.

    2.2.7.2 Stakeholders concerned

    The major stakeholders concerned with the project are the companies manufacturing the UAVS, as well as the Governmental organisations. The autopilot to be developed will have to conform to the rules and regulations set by the government.Other parties concerned include human UAV operators. Their main concern will probably be that their job of controlling the aircraft will now be replaced by a machine based autopilot. As stated in Section 2.2.3, the general public is a major stakeholder, as the development of any autopilot will influence and affect the economic stability of country.

    2.2.7.3 Motivations of the Stakeholders

    UAV companies are mainly concerned with the scarcity of human operators. With increasing costs, it is also becoming more difficult to find these operators. The development of an autopilot controller would thus decrease the overall costs needed to operate these UAVs. With a fuzzy controlled autopilot, the controller will mimic a human controller closely, and thus decrease the costs associated with procuring and using human controllers. Flight duration times can increase immensely with an autopilot as fatigue no longer becomes a constraint associated with flight time. A human controller will only be needed to take off and land the aircraft.

    2.2.7.4 Alternative solutions

    The obvious alternative is the use of a human controller to keep the UAV in sustained forward flight. With this approach, flight duration time will become a constraint. Another alternative is to use a traditional controller that makes use of classical control theory methods. With this approach, the equations representing the dynamics of the UAV will be needed i.e. each type of UAV will have a different type of equation. A PID controller can also be used. This type of controller does not require equations representing the mathematical model of the system, and is commonly use in many control solutions. The disadvantage of this type of controller is that it does not mimic the human approach of controlling systems.

    2.2.7.5 Most ethical alternative solution

    It is clear that the controller will have to mimic a human controller in order for the UAV to be safe. In terms of controllers, the best approximation is a fuzzy controller. For this reason, the most ethical alternative solution will be using a human controller.

    2.2.8 Usability considerations

    The user interface of the controller will have to include: An option to engage/disengage the autopilot controller UAV camera shots Information indicating control actions the UAV must take

    A simple user interface of the controller is given in the Figure 2-2:

  • Chapter 2: Requirements Analysis

    DT Jordan 2008 2.6

    Figure 2-2: UAV fuzzy controller autopilot user interface

    2.3 ASSUMPTIONS AND EXCLUSIONS

    In order to successfully complete these projects, the following assumptions will have to be made:

    2.3.1 The use of a simulation based platform

    One of the advantages of a fuzzy controller is that it does not require the equations representing the mathematical model the system. However, in order to simulate the controller and its response with a UAV, the model of the UAV will be need. Due to time constraints, the model of a UAV will not be investigated. The use of a simulation platform will be used, and will be assumed that the model is accurate in mimicking true aircraft dynamics.

    2.3.2 The use of a human controller

    Since the controller will only be used to keep the UAV in sustained forward flight, it will be assumed that a human controller will be used to take off and land the aircraft. The human controller will then have the option to engage/disengage the auto pilot in sustained forward flight mode.

    2.4 REQUIREMENTS SPECIFICATION

    2.4.1 Introduction

    Although it was stated in Chapter 1 that an agile methodology will be used for this project, the baseline requirements that are needed to successfully complete the project need to be addressed.

  • Chapter 2: Requirements Analysis

    DT Jordan 2008 2.7

    During the results phase, the degree to which the requirements are to be filled will be discussed. To perform this, the flowing requirements will be addressed:

    Functional and data requirements Usability and humanity requirements Performance requirements such as

    o Speed and latency o Safety critical requirements o The precision and accuracy requirements o Reliability and availability requirements

    The operational requirements such as: o Expected physical environment requirements o Expected technological environment requirements o Maintainability and support requirements

    Security requirements Cultural and political requirements Legal requirements

    2.4.2 Functional and data requirements

    The controller should have the following functional requirements:

    2.4.2.1 Sustained forward flight

    The controller should be able to keep a fixed-wing UAV in sustained forward flight for a finite amount of time. The autopilot should be in the form of an altitude and heading hold autopilot.

    2.4.2.2 Fuzzy controller

    The autopilot controller should be a fuzzy based controller.

    2.4.3 Usability and humanity requirements

    The following look and feel requirements were identified:

    2.4.3.1 User interface

    The user interface should be a single form based software interface that consists of the following items:

    1. Visual model of the UAV 2. Information indicating control actions the UAV must take

    2.4.4 Performance requirements

    The following performance requirements were identified:

    2.4.4.1 Speed and latency

    1. The fuzzy based controller autopilot should be able to keep the UAV in sustained forward flight, for speeds up to and bellow 105 km/h or 29 m/s. These values were randomly chosen and are subject to change.

    2.4.4.2 Safety critical requirements

    The following safety critical requirements were identified: 1. The controller should not allow the UAV to fly in airspace other than that specified by the

    CAA [26]

    2.4.4.3 Precision and accuracy requirements

    The following precision and accuracy requirements were identified:

  • Chapter 2: Requirements Analysis

    DT Jordan 2008 2.8

    1. The controller should be accurate to 1.5m and/or 1.5 in accordance with the planned flight path. These values were randomly chosen and their suitability for the job will only be discussed in Chapter 6. Since the agile design methodology was used for this project, changing these requirements later in the project will not inhibit the success of the project.

    2.4.5 Operational requirements

    The following operational requirements were identified:

    2.4.5.1 Expected physical environment requirements

    The following expected physical and environmental requirements were identified: 1. The fuzzy controller autopilot should control the UAV for wind speeds up to and including

    0.5m/s blowing in all possible directions. These values were randomly chosen and their suitability for the job will only be discussed in Chapter 6. Since the agile design methodology was used for this project, changing these requirements later in the project will not inhibit the success of the project.

    2.4.5.2 Expected technological environmental requirements

    The following expected technological environmental requirements were identified: 1. The controller should be able to operate on a Microsoft Vista or Microsoft XP operating

    system 2. The controller should be able to operate on a Intel Pentium 4 desktop computer or a Intel

    Centrino laptop processor

    2.4.6 Cultural and political requirements

    The following cultural and political requirements were identified:

    2.4.6.1 User interface resolution

    The resolution of the user interface should be 1024768 pixels to allow for easy visibility.

    2.4.7 Legal requirements

    The following legal requirements were identified:

    2.4.7.1 Compliance standards

    The following compliance standards were identified: 1. The controller should adhere to all the standards as set by the CAA [26]

  • Chapter 3: Literature Study

    DT Jordan 2008 3.1

    3 CHAPTER 3: LITERATURE STUDY

    3.1 INTRODUCTION AND OVERVIEW

    The purpose of this chapter is to provide an overview of the current state of technology surrounding the project. This will mean including all the background theory, applications, and standards applicable to the project. This will contain all that is necessary and relevant to developing the fuzzy-controller autopilot for the fixed wing UAV. The background knowledge and insight gained in this chapter is vital to successfully complete the design phase of the project with an increased confidence. The majority of resources that will be used to complete this project will be book based, as well as previous dissertations and academic journals based. The use of internet based resources will be kept to a minimum, as these are not usually peer reviewed or edited, and thus their accuracy is questionable. To complete this chapter, the relevant background theory and methods will be discussed. Only the theory that has a direct impact on the mini-dissertation will be addressed. Since the implementation of the project will be hardware and software based, these aspects relevant to the project will also have to be discussed. This will also include the availability of the tools, as well as any procurement procedures and problems. An overview of similar work is to be discussed and addressed. This will include a comparison between the previous/existing products and what the dissertation is trying to achieve.

    3.2 STANDARDS AND LEGAL CONSIDERATIONS

    3.2.1 Standards

    Since this mini-dissertation is simulation based, standards and legal constraints are not applicable to this project. However, if the fuzzy controller autopilot to be developed was to be used to control a real aircraft, the standards as set by the CAA of South Africa [25] as well as that set by the CAA regarding the guidance of UAV flight rules and regulations [26] are applicable.

    3.2.2 Legal constraints

    The legal constraints applicable to this project will be limited to making sure that all the software packages used is legally licensed, as well as not infringing intellectual property rights regarding the use of previously down work.

    3.3 THEORY AND METHODS

    3.3.1 Introduction

    The purpose of this section is to thoroughly discuss all the background theory that will be needed to successfully complete the project. For simplification purposes, only the theory which does not form part of the control theory course syllabus at the University of Johannesburgs electronic and electrical engineering department will be discussed.

  • Chapter 3: Literature Study

    DT Jordan 2008 3.2

    3.3.2 PID controllers

    In most control systems, the common used controller is the proportional-integral-derivative (PID) controller that adjusts the output of the system according to the following equation:

    = + 1 + Where:

    KP Proportional gain Integral time Derivative time e: Error term u Controller output

    When dealing with digital controllers, the equation shown above has to be approximated. With a sampling time , the approximation becomes:

    = + 1 + 1 The main advantage of the PID controller is that it does not require a mathematical model of the system, and the constants are easily tuneable with the aid of standardised procedures. For information regarding PID controllers, refer to [40].

    3.3.3 Fuzzy controllers

    3.3.3.1 Introduction

    The main purpose of fuzzy-controllers is to try and make machines understand the natural language associated with human reasoning, and behave similar to a human operator [12]. They have been used since the mid 1970s with their first implication been controlling cement kilns and steam engines. Their main advantage is that they are proven quite effective when trying to control nonlinear systems that are difficult to model and are often accompanied by some uncertainties [33]. Fuzzy controllers make use of fuzzy logic developed by Zadeh [36].This uses if-then rules to describe how a human will reasons. A typical diagram of a control process that makes use of a human controller is given in the Figure 3-1:

    Figure 3-1: Human controlled process

    With fuzzy control, the human operator is replaced with an equivalent fuzzy-controller. A simplified version of this is shown in Figure 3-2:

  • Chapter 3: Literature Study

    DT Jordan 2008 3.3

    Figure 3-2: Fuzzy controller controlling a process

    The method proposed by Jantzen [12] in developing a fuzzy controller consists of the following steps:

    1. Design a PID controller 2. Replace the PID controller with a linear fuzzy controller 3. Make the controller nonlinear 4. Fine-tune it

    3.3.3.2 Fuzzy reasoning

    For more information referring to fuzzy reasoning, refer to Appendix B

    3.3.3.3 Fuzzy controller composition

    Typical plants that makes use of fuzzy controllers, such as the one represented in Figure 3-2, will typically consist of the following two if-then rules (amongst others) [37]:

    1. If error is Negative and change in error is Negative then control is Negative Big (NB) 2. If error is Negative and change in error is Zero then control is Negative Medium (NM)

    There are at least four chief methods for finding controller rules [37]. These are:

    1. Expert experience and control engineering knowledge: In this approach, trained experts and operators are questioned in the form of a carefully set out questionnaire. This approach has been used on the cement kiln described in Section 3.2.3.1.

    2. Based on the operators control actions: Here, the designer observes the operators control actions, or examines the operators control book, which reveals the input-output relation, as well as the fuzzy if then rules.

    3. Based on a fuzzy model of the plant: In this method, the fuzzy control rules are obtained by inverting a fuzzy model of the plant. This is typically only relevant to low order systems, and requires the fuzzy models of the open and closed plant are available.

    4. Based on learning: This is a self organising controller that determines the rules itself.

    Typical fuzzy controllers, like the one presented in Figure 3-2, consists of four overall stages and elements [35]:

    1. A rule based: This consists of if-then rules that describe a human experts natural language description on how to achieve good control of a process.

  • Chapter 3: Literature Study

    DT Jordan 2008 3.4

    2. An interface mechanism: This is also sometimes referred to as the interface engine or the fuzzy interface module. This mimics a human experts decision on how to best control the process making use of the available knowledge.

    3. A fuzzification interface: This part of the controller converts the inputs that the controller has into information that the interface mechanism can interpret and use to activate and apply the available rules.

    4. A defuzzification interface: This converts the outputs of the interface mechanism into inputs for the process.

    3.3.3.3.1 Fuzzification interface:

    The main purpose of this block is to take the controller input, and lookup the relative membership function to derive the appropriate membership grade.

    3.3.3.3.2 The rule based:

    This section of the controller allows for single-input-single-output (SISO) control, as well as multiple-input-multiple-output (MIMO) control. Typical SISO control assumes that the goal of the controller is to regulate the plant to a specific setpoint. If it is assumed that the controller has two inputs, mainly error and change in error, then typical if-then rules of the process are:

    1. If error is Neg and change in error is Neg then output is NB 2. If error is Neg and change in error is Zero then output is NM 3. If error is Neg and change in error is Pos then output is Zero 4. If error is Zero and change in error is Neg then output is NM 5. If error is Zero and change in error is Zero then output is Zero (2) 6. If error is Zero and change in error is Pos then output is PM 7. If error is Pos and change in error is Neg then output is Zero 8. If error is Pos and change in error is Zero then output is PM 9. If error is Pos and change in error is Pos then output is PB

    Where the input signals are:

    Error Change in error

    And the fuzzy sets are:

    Zero Positive (Pos) Negative (Neg) Negative big (NB) Negative medium (NM) Positive big (PB)

    In a simple table based relational format, the rules are as follows:

    Table 3-1: Relational based format of rule base

    ERROR CHANGE IN ERROR OUTPUT

    Neg Pos Zero Neg Zero NM Neg Neg NB Zero Pos PM

  • Chapter 3: Literature Study

    DT Jordan 2008 3.5

    Zero Zero Zero Zero Neg NM Pos Pos PB Pos Zero PM Pos Neg Zero

    In Table 3-1, the two left most columns represent inputs to the controller, while the on the right the controller output. Each row represents a rule. Table 3-1 can be compacted even further in the form of a linguistic table given in Table 3-2. This is sometimes also referred to as a fuzzy associate memory table (FAM).

    Table 3-2: Linguistic based table of rule base

    Change in error

    Neg Zero Pos

    Error

    Neg NB NM Zero Zero NM Zero PM Pos Zero PM PB

    In Table 3-2, the axis represents the inputs; while the values inside the table represent the outputs. The linguistic variables and or or are always defined in pairs. Two common definitions of and and or are given in the relationships bellow: min x, x max x, x

    Or

    x x x + x x x

    Another important aspect is to define the entire universe that contains all acceptable measurements. This might include scaling the measured input to a specific interval Standard universe include [12]:

    The controller might use real numbers over the interval [-1, 1] Due to early computers having limited memory, earlier controllers made use of the variables

    [-6, 6] One could use the interval [-100, 100], which corresponds to the full percentage range of

    measurement The 12 bit conversion of converting an analog signal to its digital representation can be used.

    This will correspond to the range [0, 4095] A shifted 12 bit conversion [-2047, 2048] can be used that accommodates for negative

    numbers The choice of the standard universe to be used is based on the range of the expected inputs to the controller.

  • Chapter 3: Literature Study

    DT Jordan 2008 3.6

    As stated in Section 3.2.2.2, membership functions can take many forms and shapes. The designer is then left to the task of choosing an appropriate membership function. Generic rules of thumb that apply when choosing membership functions are [12]:

    The membership function should have an appropriate range that accommodates the expected range of noise that might be included in the measurement

    Overlap of membership functions is desirable There should be no gap between membership functions The number of sets in a family is dependent on the width of the membership function

    An example of 15 membership functions are given in Figure 3-3

    Figure 3-3: Example of 15 membership functions:

    Equations of some commonly used membership functions include:

    The Gaussian membership function based on the exponential function:

    -./01 = 1 21 134264 7 Where:

    The maximum value is 1 1 is the independent variable on the universe 13 is the peak relative to the universe 6 is the standard deviation

    The bell membership function is given by:

    -89::1 = ;1 + ?@

    Where:

    A is a usually positive extra value that affects the width of the membership function, as well as the slope of the sides.

  • Chapter 3: Literature Study

    DT Jordan 2008 3.7

    3.3.3.3.3 The fuzzy interface mechanism:

    A graphical construction of the interface represented in Table 3-1 is given in Figure 3-4. In this figure, the error is 0 and the change is error is -50

    Figure 3-4: Graphical construction of control signal with a Matlab generated interface [12]

    For each rule, the fuzzy interface engine looks up the vertical line where the vertical line interests the membership function. The firing strength indicates the degree of fulfilment of the rules present. In the case of Figure 3-4, the firing strength is given by: BC = - ,CDDD -,CEAG H DDD Depending on the firing strength, one can determine the activation of a rule. This is typically determined by making use of the multiplication operator * or min. A rule k can be weighted by a weighing factor IC [0, 1] which is the degree of confidence (this is determined by the designer). Using this, the firing strength is now modified too: BC = IC BC In the accumulation phase, all the activated conclusions are activated, making use of the max operator.

    3.3.3.3.4 The defuzzification interface mechanism:

    The resulting set must be converted into a single number. This must be of the form that the plant understands. Several defuzzification methods exist [36]:

  • Chapter 3: Literature Study

    DT Jordan 2008 3.8

    The Centre of Gravity (COG) method uses the centre of gravity value of the fuzzy set. This is given in the following equation for the discrete case:

    = -11 -1 Where:

    1 is a running point in the discrete universe -1) is its membership value in the membership function

    In the continuous case, the summation sign is replaced by the integral operation. The centre of gravity method for singletons (COGS) can be used in the case when the conclusions are singletons. This is given by the following equation:

    = -OO -O Where:

    O is the position of the singleton H in the universe -O) is equal to the firing strength B of rule H

    The bisector of area (BOA) method makes use of the abscissa of the vertical line that divides the area under the curve into two equal lines.

    = P1Q -11 = -11R/SSS

    RT U Where:

    1 is a running point in the universe -1) is its membership value in the membership function VH is the leftmost value of the universe VA1 is the rightmost value of the universe

    For the discrete case, the BOA method is not defined. In the mean of maxima method (MOM), an initiative choice is made to choose the point with the strongest possibility. The leftmost maximum (LM) and the rightmost maximum (RM) method chooses the left most or right most maximum respectively. An example of a one input, one output rule base with non-singleton output set is given in Figure 3-5:

  • Chapter 3: Literature Study

    DT Jordan 2008 3.9

    Figure 3-5: One input, one output rule base with non-singleton output sets.

    3.3.3.4 Rule based controller

    Numerous types of fuzzy controllers have developed over time [12]. This includes the Mamdani, the FLS, and the Sugeno control. The differences between these two will be explained later. With a SISO fuzzy controller, there are the following essential rules:

    1. If error is Neg then control is Neg 2. If error is Zero then control is Zero 3. If error is Pos then control is Pos

    It can be seen that the SISO system has the basic form of a fuzzy proportional controller, as the controller output action has the same sign as the controller input.

    3.3.3.4.1 The Mamdani controller:

    An example of a Mamdani controller is given in Figure 3-6:

    Figure 3-6: Example of a Mamdani controller

  • Chapter 3: Literature Study

    DT Jordan 2008 3.10

    In Figure 3-6, each rule corresponds to one row. A particular instance of error corresponds to the doted vertical line, while the firing strength is indicated by vertical dashed lines. In the Mamdani controller, the activation function min is applied. For defuzzification, the COGS method is used.

    3.3.3.4.2 The Fls controller:

    An example of a FLS controller is given in Figure 3-7:

    Figure 3-7: Example FLS controller

    The difference between the Mamdani controller and the FLS controller is the activation function product is used, which results in a scaling of the conclusion sets. The real FLS controller uses the BOA method for defuzzification, although the one given in Figure 3-7 uses COGS method.

    3.3.3.4.3 The Sugeno controller:

    The conclusions can be linear or complex functions of the inputs [38]. The general rule structure for this is: WX X@ HO Y@ , 4 HO Y4 , , C HO YC [ = G@ , 4, , C A simple example is:

    If error is Zero and change in error is Zero then control y=c

    In the example:

    1. If error is Large then the output is Line 1 2. If error is Small then the output is Line 2

    Figure 3-8 shows the rules interpolating between the two lines, in the interval where the membership functions overlap. The Sugeno fuzzy controller for these rules is shown in Figure 3-9. In this example the controller applies singleton conclusions, where the accumulation operation is + and the defuzzification method is COGS, where the rules interpolate between the two lines:

  • Chapter 3: Literature Study

    DT Jordan 2008 3.11

    Figure 3-8: Interpolation between two lines (a), in the interval of overlap of two membership functions (b)

    Figure 3-9: Sugeno interface with singleton output

    Sugeno controllers thus differs from Mamdani controllers in their defuzzification characteristics. With Sugeno controllers, the output is either linear or constant. This type of controller is used when linear or constant controller outputs are acceptable in terms of the controllers requirements. This reduction of controller complexity when compared to the Mamdani controller also leads to faster controller performance due to simplicity in terms of the number of executions required during each execution loop.