You are on page 1of 9

Proceedings of the ASME 2009 International Design Engineering Technical Conferences & Computers and Information in Engineering Conference

IDETC/CIE 2009 August 30 - September 2, 2009, San Diego, California, USA

DETC2009-86412
DRAFT: UAV Autopilot Design for the AUVSI, UAS International Competition Muhammad M. Mahmood Md S. Chowdhury Rizwan Ihsan Umar M. Yousaf Mohamed W. Afifi Imtiaz M. Chuwdhury Students, Mechanical Engineering Department, American University of Sharjah, Sharjah, UAE

ABSTRACT This paper provides an overview of the first participation of the design developed by the undergraduate students of American University of Sharjah to meet the requirements laid forth in the 2008 Association for Unmanned Vehicle Systems International (AUVSI) Student UAS competition. The overall objective of the competition is to fly autonomously over a GPS waypoint defined route and also to identify and locate ground based targets within a confined area. To meet the objectives an unmanned aircraft is equipped with autonomous functionality and aerial imaging system. A ground station and supportive software to keep track of the aircraft routine and log the raw data gained from the flight is also designed. Achieving complete success depends upon mission elements which include autonomous take-off and landing, autonomous control and waypoint navigation. The onboard equipment used was a flight control computer network, IMU, GPS, an air data system and a camera. Additionally, safety features such as manual override was also installed. Presented in this report are aircraft design and testing, the processes involved in accomplishing the goal, and the results and achievements. 1 INTRODUCTION 1.1 Overview of Minimum Requirements According to the competition rules, it is at least required to build a partially autonomous unmanned aerial system that can navigate a set of given waypoints defined by GPS co-ordinates after a manually controlled take off. Once air-borne the UAV should be able to detect and identify certain target images and transmit back the GPS co-ordinates of their positions, and finally return to the launching point for a manual remote controlled landing. 1.2 Approach In order to accomplish this project, it was first necessary to learn how it can be carried out. This was the very first task of the AUS-Mizari team members. Apart from the basic tutorial sessions, an extensive literature review was done, in which team

members went through all the journal papers available in the competition organizers website. After completing this step we developed the following 3-stage approach:

Monitoring

Basic Autonomy

Full Autonomy

1.) Monitoring: In this stage, sensors like the IMU, GPS, and Air Data unit were tested individually in the lab and their output is obtained in the ground station. These sensors are then mounted in the aircraft and their output is monitored via transceivers in a remotecontrolled (RC) flight test. 2.) Basic Autonomy: In this stage, basic autonomy like altitude hold, speed hold, altitude rate hold, Turn Compensation, Turn Coordination, Turn Rate Control, Bank Angle Hold, Heading Hold etc are developed and tested. This is basically the design and implementation of a lateral and a longitudinal autopilot. 3.) Full Autonomy: This is an advanced level. In this stage, the aircraft navigation capability is developed. These include the path planning and path tracking algorithm development and testing. To accomplish the above objectives from the review of past participants efforts and other work done in this field [1] development in the following areas had to be carried out: Embedded systems Ground station software Control system Navigation (i.e. trajectory planning and trajectory tracking)

Copyright 2009 by ASME

Figure 1: Overview 2.0 AIRFRAME The airframe is an off the shelf high wing trainer. The airframe has been modified so that several rooms have been made for the ease of placement of the air data unit, the IMU and other payloads. Also the wing is reinforced and a Pitot tube for velocity measurements is mounted on it. An aluminum flap to securely fix the wing is also added. The fuselage has been deemed weak and therefore it was strengthened with extra wood. A four stroke engine has been installed to achieve the adequate power to carry the payload. The basic dimensions of the airframe are as follows: Wingspan Fuselage length Chord length Gross weight 214 cm 147 cm 44 cm 6.1822 Kg Table 1: Airframe Dimensions 2.1 Integration of the PCB Boards and Pitot Tube: The following is the layout of how different boards were mounted inside the airframe. The main PCB carries the fight control computer network. The IMU is mounted outside this box along with the serial transceiver for data download and upload. Figure 3: Embedded System (MO = Manual Override, ADU = Air Data Unit, MCU = Micro Controller Unit) 3.1 Flight Control Computer For on board data processing the choice of Motorola HCS12 controllers was made. Initially several choices of a microcontroller existed and a comparison was made with different features in mind that each controller offered. Features Motorola HCS12 A A Atmel Atmega32 NA NA PIC-24F

CAN bus NA Fuzzy Logic NA Commands 16 bit PWMs A A A Evaluation A NA NA Boards Table 2: Microcontroller Comparison (A= Available, NA= Not Available [5] [6]) The above microcontrollers were chosen for their ease of programming and relatively low cost. HCS12 was preferred for its availability of a CAN bus for networking of several controllers and the availability of fuzzy logic commands that can be used for designing a fuzzy logic controller [3] for later advancements. Also many teams have successfully used HCS12 family of controllers in various mechatronics projects [2]. Each HCS12 controller has 128 Kbytes of memory and an 8 MHz processor. The HCS12 processor is mounted on a DIP40 sized chip and this chip offers: 1 RS232 port 1 CAN port 5 PWM channels (8 bit) OR 2 PWM channels (16 bit) 7 analog-digital ports (10 bit resolution) For the implementation of a basic autopilot one HCS12 controller is not enough due to lack of serial ports and also the

Figure 2: PCB Arrangement (a) side view (b) top view 3.0 EMBEDDED SYSTEM The figure that follows gives the overview of the embedded system:

Copyright 2009 by ASME

available processing power. There are three RS232 devices and hence we decided to have three controllers. To share data between the controllers CAN networking was used. CAN networking is very beneficial as several controllers can easily be networked together and in this way processing power can be increased indefinitely if there is a lack of it. Moreover CAN communication is very fast when compared to RS232 communication. Via CAN 8 bytes of data can be transferred (compared to 1 byte for RS232) at data transfer speeds of up to 1 MBPS [7]. 3.2 UAV State Measurement Three Motorola HCS12 16bit microcontrollers (CAN networked) were incorporated due to their ease of use and tremendous support available from the programmers society on the internet. A Microstrain 3DM-GX1 inertial measurement unit is used which gives filtered and gyro-stabilized values. This was used to read the Euler angles and angular rates and acceleration. This IMU is widely used in robotics projects and in challenging applications such as VTOL vehicles [2]. A Garmin 15L GPS unit is used which provides a reasonable accuracy of less than 5m with a refresh rate of 1Hz. An Air-Data unit was produced consisting of a differential pressure sensor (All Sensors pressure sensor) and absolute Figure 4: IMU pressure sensor (SensorTechnics 144S). One is used to calculate the air velocity and the other to calculate the elevation of the aircraft, respectively. These components required amplification and had loading effect that needed to be eliminated using op-amps. The differential pressure sensor for velocity measurements needs calibration and this was carried out in a small wind tunnel. The results are shown: Figure 6: Air Data Unit 3.3 Manual Override: The manual override circuit as seen from the embedded system schematic figure, accepts radio signals from the radio receiver onboard and also it receives PWM signals form the controllers. The manual override circuit is essentially a multiplexer that chooses the signal that has to be passed on to the servos. The multiplexer is controlled by MCU3. Based on the toggle command received from the ground station (Autopilot on/off) via the onboard transceiver the MCU3 controls the multiplexer selection.

Figure 5: Differential Pressure Sensor Calibration Results

Copyright 2009 by ASME

Visual Basic programming language was used in its development. 4.1 Ground Station Capabilities: The existing version of the ground station has the capability of monitoring the orientation of the UAV by several compass-like visual aids and also the position can be monitored by a moving map. The ground station can also be used to upload GPS waypoints to the UAV by simple clicking on the map and it is also integrated with Google earth in order to facilitate easy map loading and saving. Also the ground station has the ability to log all flight data in different file for later review. In order to incorporate various visual sensory gauges and the map function into the software, we used ActiveX components and successfully reprogrammed them and calibrated them. The ground station consists of four parts: 1. Telemetry gauges 2. Telemetry value display 3. Map display 4. Parameter adjustment controls Figure 7: Manual Override 4.2 Telemetry Gauges and Display 3.4 Power Distribution System All the devices used in our system either required a 5V or a 9V supply. This was achieved using two different power regulators. Since the 5 servos onboard at the moment required the highest current in flight, they had a dedicated power regulator in order to prevent overloading and overheating. The other components were powered through separate low current 5V and 9V regulators. Also for sensitive devices like the pressure sensors, op-amps were introduced to cancel the loading effects. 3.5 Battery A variety of batteries and different configurations were used throughout the development of the UAV. At first a single Lithium Polymer 14V battery back was used, however that seemed to produce interference with the transmission. Hence servos, transceivers and the rest of the auto-pilot system were powered by different battery sources. 4.0 GROUND STATION SOFTWARE We are developing an autopilot system of our own and considerable amount of time was spent in the development of reliable ground station software. This software was developed with all our competition specific requirements in mind [9] and also many additional features were added that would help in the development stage of the autopilot. This ground station software was also enhanced by reviewing Virtual Cockpit provided by Kestrel autopilot and other custom built ground stations such as the Mississippi State University XBS. The There are seven air gauges that display the aircraft parameters. These are similar to the standard aircraft cockpit dials and gauges; these are: Heading gauge Turn coordinator Compass Artificial horizon Altimeter Airspeed Climb rate meter 4.3 Map display The Ground Station has a moving map control that can display the latitude and longitude of the aircrafts current position. The map also has a breadcrumb trail and position in the map is displayed by a small airplane, which changes its heading by the value of Yaw angle. 4.4 Parameter Adjustment Controls The function of this control is to change the parameters and tune control loop gains and instantly transmit it to the aircraft. The Control Loops window is a pop up window. As of now the round station can:

Copyright 2009 by ASME

a)

Communicate with the UAV to send and receive data (waypoints, sensor data, etc) b) Display the position of UAV on the map (real-time) c) Display the sensor data d) Display and edit control loop gains e) Show waypoints on map f) Select waypoints by clicking on map g) Display the trajectory generated on the map Using this simulation model, the longitudinal and the lateral control autopilot is created. 5.2 Longitudinal Control Longitudinal control is used to hold the aircraft stable along the longitudinal axis. The air speed controller and altitude hold (ALH) controller comes under the longitudinal control. The air speed control is uses the current air speed from the sensor and a PI-controller to form the control command which is sent to the throttle servo. In addition, the altitude hold controller is using the Pitch rate, Pitch angle from the IMU and two PI controllers to form the control command which is sent to the elevator servo. A figure in the appendix shows the control system in detail along with the gains. Figure 8: Ground Station Software 5.3 Lateral Control Lateral control is used to hold the aircraft stable along the lateral axis. In other words, to control the yaw motion and roll motion for maintaining constant heading. The aileron and rudder controllers come under the Lateral control. The main objective of these controllers is to make the aircraft return to its trim conditions with minimum disturbances in terms of motion. The aileron controller mainly needs the bank angle, roll rate from the IMU and two proportional controllers to form the control command which is sent to the aileron servos. Additionally, the rudder controller needs the yaw rate from the IMU, proportional controller and a washout filter to form the control command which is sent to the rudder servo. The figure in the appendix shows the control system in detail along with the gains. 5.4 Conversion of Simulink Design to Embedded C The methodology that was used in implementing the control loops was mainly to divide the loops into sub-components. It was necessary to clearly define the inputs and outputs of the system, in addition to the type of controller that is used. The PI controller was basically divided into two sub-blocks (proportional controller & an integral controller). In our control loops, we did not use a sampling delay with an integral controller; because we will be tuning the gain within the

5.0 CONTROL SYSTEM There are two basic autopilots; the stability autopilot and navigation autopilot. The stability autopilot maintains aircrafts static and dynamic stability in situations where aircraft becomes unstable due to external changes. There two stability autopilots; longitudinal control autopilot and lateral control autopilot. 5.1 Aircraft Model The autopilots are first created in Simulink/Matlab in order to set the proper gains. In order to do that, it is first necessary to create a model of the aircraft. System identification is a crucial step in the development of the model. Since the airframe used in this project is very similar to the TRI-60 model both geometrically as well as aerodynamically, system identification data available in [3] was used. In addition, the engine, servo motors as well as the propellers are the same ones as [3]. This approximation saved a lot of effort and time and at the same time it wasnt too much off the mark. The longitudinal state space model linearized at 12m/s is: the the the are the

Copyright 2009 by ASME

air therefore all the errors will be eliminated. To be able to use an integral controller, we need to get the sampling time and the height of the input, so that we can find the area. We got the sampling time from the micro-controller by basically toggling a port. Additionally, using computational methods we found that the height will approximately be the ((old input + new input)/2). By finding these two parameters we can perform an integral controller. 6.0 NAVIGATION There are several techniques that can be used for determining the path that will be followed by the UAV. The algorithms available in literature focus on the following Goal reaching: The UAV will only want to reach its target waypoint, without too much focus on the efficiency of the path taken Path optimization: The UAV will take the shortest and most optimal path to its goal, in addition to reaching its goal.

parameters are calculated the lateral acceleration towards the center of the circle which the aircraft is tracking is found by:

Where V is the ground velocity of the aircraft. The roll angle command is then calculated by Once the aircraft reaches the end of the first segment, it has to switch segment to track the second segment. The segment switching is done by comparing the look-ahead distance L1 with the distance to the next waypoint. 6.2 No Fly Zone and Obstacle Avoidance No-Fly Zones are modeled as circles, with known center coordinates and radius, which comes in the way of the aircraft path.

6.1 Approach Used The path planning for the UAV was done using nonlinear lateral guidance control law [8]. This algorithm focuses on just reaching its goal without attempting to optimize the path. The path tracking is first simulated in Simulink Matlab, before being converted to C language and implementing in the microcontroller. The Lateral Guidance System basically uses the aileron to command a roll. This path-planning method generates on-line a flight path based on pre-defined waypoints; it takes into account the aircraft performance in order to calculate the required roll command [8].

Figure 10: Approaching a No-fly Zone or an Obstacle [8] As it can be seen from the figure 3 above, the aircraft has a look-ahead distance, which detects whether the aircraft is approaching a no-fly zone or an obstacle. If the detection line touches the no-fly zone the aircraft goes into avoidance mode. In the avoidance mode, the algorithm creates a circular template around the no-fly zone with a radius a little larger than the radius of the no-fly zone. The aircraft then tracks that template until it is clear of the no-fly zone. 6.3 Test and Simulations: The mathematical algorithm discussed earlier is implemented in Simulink Matlab, and the aircraft path along with the path template is visualized in a XY plot.

Figure 9: Guidance Law Geometry [8] The path template is first created by joining all the waypoints with a straight line. The aircraft then has to navigate and attempt to track the path template. The point P is where the aircraft is trying to reach and the angle eta is the difference between current heading and the desired heading. Once these

Copyright 2009 by ASME

6.4 Implementation of the Algorithm in the Microcontroller The mathematical algorithm was then rewritten in C programming language in order to be incorporated directly into the embedded system. 6.5 Conclusion The nonlinear lateral guidance control law is fairly straight forward and is a very effective algorithm in designing the navigation controller of a small UAV, given the time constrains. 7.0 TESTING The testing phase of the entire system is just begun and flight attempts have shown that all measurements are accurate to proceed further except that of altitude. Work is being done to refine that. Testing has also revealed that PCB boards need reconstruction for in-flight rigidity and they are being remanufactured. 8.0 CONCLUSIONS The competition has given us the opportunity to enhance our skills and creativity and improved our knowledge in vast fields. This paper, in short, describes the way we have proceeded with our design, the obstacles we faced in our project. 9.0 REFERNCES [1] Jung. S. Jang, "Nonlinear control using discrete-time dynamic inversion under input saturation: Theory and experiment on the Stanford Drgonfly UAVs," Ph.D. dissertation, StanfordUniversity, Pasadena, CA, USA, 2003. [2] Ben S. Cazzolato, Jesse L. Sherwood, Michael J. Smith, Allan A. Stabile and Zebb D. Prime, "RC VTOL v22 Osprey," University of Adelaide, Adelaide, Australia, Tech. Rep., 2005. [3] M. Hadi, "Low cost autopilot design using fuzzy supervisory control," M.S. thesis, American University of Sharjah, Sharjah, UAE, 2005. [4] "Mississippi State Universitys Entry for the 2007 AUVSI Undergraduate Student UAS Design Competition, X-ipiter base station (XBS)", Mississippi State University, Starkville, MS, USA, 2007. [5] Atmel Atmega32, Appl. Note (datasheet). [6] PIC-24F Datasheet, Appl. Note (datasheet). [7] Motorola MC9S12C128 Datsheet, Appl. Note (datasheet).

Figure 11: Simulation of the Path

Figure 12: Simulation of the No-fly Zone Avoidance The results show a pretty accurate and fairly simple path tracking and obstacle avoidance. The algorithm discussed in [8] focused more on tracking the straight line segments rather than actually passing through the waypoints. Therefore, in order to make the aircraft pass through the waypoints, a small improvement was done in the segment switching algorithm. The segment switching algorithm kicks in when the UAV reaches the end of one segment. By multiplying the comparison factor in [8] by a 2, the detection is delayed until the UAV crosses the waypoint.

Copyright 2009 by ASME

[8] G. Ducard, K. C. Kulling, H. P. Geering, "A Simple and Adaptive On-Line Path Planning System for a UAV," Proceedings of the IEEE 15th Mediterranean Conference on Control and Automation,, T34-009, pp. 1-6, Athens, Greece, June 2007. [9] "AUVSI final rules 2008", Tech. Rep., 2008

Copyright 2009 by ASME

Appendix A Control System Figures

Longitudinal Control System

Lateral Control System

Copyright 2009 by ASME

You might also like