DIGITAL AUTOPILOT TEST PLATFORM WITH REFERENCE DESIGN AND IMPLEMENTATION OF A 2-AXIS AUTOPILOT FOR SMALL AIRPLANES

By Michael Frutiger and Charles Kim

ECE345 TA: Paul Leisher May 6, 2003 Project #45

Department of Electrical and Computer Engineering

ii University of Illinois at Urbana-Champaign

ABSTRACT
In this report, we present the design and construction of a test platform for digital autopilots, as well as a reference design and implementation of a 2-axis autopilot for use with this platform. The platform is targeted at the educational market (for use in control systems laboratory courses), and builders of unmanned aerial vehicles (such as participants in the annual Aerial Robotics Competition). The platform consists of a micro-controller board, which hosts the autopilot, and a PC running the commercial X-Plane flight simulator. The two components are interfaced via Ethernet. With this set-up, autopilot prototypes can be tested with X-Plane’s sophisticated flight- and atmospheric models. The reference 2-axis autopilot is designed for small aircraft and features altitude control, vertical speed control, as well as a wing leveler. The functionality of the platform is demonstrated by comparing the response of a Cessna 172 under control of the autopilot to the expected theoretical response obtained from SIMULINK simulation using the linearized model.

.................1 1.....................................................................................................................................3...........9 3...........................................19 6 CONCLUSIONS.............................................................................................................................................................................................................................................3 Autopilot...............................................3 Autopilot.....15 4..............................4 2...........1 Microcontroller....................................................................................2 Hardware User Interface.3 Autopilot......................................................................1 Motivation..............................................................................................................................................................................................15 4.............................................................3 Hardware User Interface.................................4 2..................................................................................................................................3..10 4 DESIGN VERIFICATION...........................................................................................5 2.....................................................................................................................2...............................3...........................1.3.........................................................................1 Test Procedure......................9 3.......................................9 3.........3........8 3 DESIGN DETAILS..........................................................20 6...........................................................1 Airplane Control Basics...................16 5 COSTS.........................4 Discrete-Time Implementation...............20 7 REFERENCES...............................................................2 Keypad/LCD.................3.........3...............................................3 1............................2 Autopilot Platform X-Plane Interface Software.......1 Accomplishments.........................................................................................................................................................2 Autopilot Platform...........................................................1 1.........................................................1 Hardware.......................................1............................................................................3.................1 1.........................................................................2 Hardware User Interface.15 4...................................................5 2.........................................................................................1 Autopilot Test Platform..............................................................................................................................................20 6...............................................................................4 2........................................................................2 1...........................................................................................................2 Challenges and Uncertainties...................................................3 Autopilot........5 2.....2......................................................9 3...........................II TABLE OF CONTENTS...........................3..........................................................III 1 INTRODUCTION.........................6 2........................................................9 3............15 4...........................3..................................2 System Overview...................................................................................................................................................................3 2 DESIGN PROCEDURE...............................................................1................20 6..4 2...................................................................................2 Results........3........15 4........3...........................................................................................10 3...................................................................5 2.................................................................................................2 Hardware User Interface...................2 1..................................................6 2.........................2 Project Goals and Overview............................................................................................................................................................21 ......2 Software ...............................................................1.......2 Control Loops.....................................1..................................3 Controller Design....................................................3 Discrete-Time Implementation.......................................2 1.....................................3...................................................................................................................................9 3..........2..............................4 2..............3 Future Work and Possibilities............1 Autopilot Platform X-Plane Interface Software.........................................................................1 Flight Simulator (PC-Based)...............3......1 Main Goals & Subsystems........................................................................................................................................1 Control Loops......................................................2 Controller Design..............................I ABSTRACT.............................................................3 Specifications.................................................................1 Autopilot Platform X-Plane Interface Software............................................................................2........iii TABLE OF CONTENTS DIGITAL AUTOPILOT TEST PLATFORM WITH REFERENCE DESIGN AND IMPLEMENTATION OF A 2-AXIS AUTOPILOT FOR SMALL AIRPLANES.................................................................................................................................................................1 1..............................................................................................1 Component Selection...................4 2........9 3...........................................

Flight-testing is generally used early on to test the newly designed autopilot system. most university laboratory settings do not make it possible for students to gain hands-on experience in the design. In order to address both of these issues. . they generally lack the opportunity to see how their newly designed autopilot performs on a realistically simulated aircraft in a realistic environment.1 Motivation INTRODUCTION There are two situations that motivated the creation of the project: 1. and testing of such systems. since it is used only to make testing of the other controllers possible. We chose to create a 2-axis autopilot consisting of an altitude and vertical speed controller. such flight-tests often result in a crash and damage to the aircraft. Aircraft Autopilots are often used in university control system courses and textbooks as motivating examples. While students could always design an autopilot in a simulation package such as Matlab/Simulink. The purpose of the altitude and vertical speed controllers is to cause the airplane to climb or descend at a desired vertical speed until a desired target altitude is reached and then keep the airplane at this altitude until a new command is issued. implementation. and then implement and test it on the platform. we designed an autopilot for a small airplane and implemented and tested it on the platform.2 Project Goals and Overview 1. a hardware user interface consisting of a keypad and LCD display is also required.2. 1.1 Main Goals & Subsystems The first goal was to create a platform on which digital autopilots can be implemented and tested. Without the ability of testing it first with a realistically simulated version of the aircraft. At the same time. Unfortunately. as the name implies. 2. we designed and implemented a platform for implementing and testing digital autopilots. The design of the wing-leveler will not be discussed in this report. The platform is to consist of a microcontroller that hosts the autopilot code and interfaces with an advanced PC-based flight simulator. To facilitate entering settings into the autopilot.1 1 1. Autonomous Aircraft are rising in popularity. keep the airplane in level flight. Many universities participate in the annual Aerial Robotics Competition [1] in which teams compete against each other in completing certain tasks using autonomous aircraft of their design. By definition. such aircraft require an autopilot. the wing-leveler will. In addition. as well as a wing-leveler. The second goal was to design an autopilot for a Cessna 172SP Skyhawk airplane.

3.1 gives a high-level overview of the complete system.1 Autopilot Test Platform The Autopilot Test Platform has the following requirements: 1.2 The project thus can be viewed as consisting of three subsystems: The Autopilot Test Platform. and the Autopilot. 1. 1. Chapter 4 covers the testing and verification of the system. the Hardware User Interface.2 System Overview Figure 1.1: System Overview The following section discusses the specifications for each subsystem. Needs to allow autopilot to be implemented in standard C language. Chapter 5 itemizes the costs associated with this project. Needs to be able to accommodate high enough and constant sampling rates to make digital autopilot implementation possible . Figure 1. The structure of the following chapters will reflect this view.3 Specifications 1. Needs to provide an interface to a realistic and accurate PC-based flight simulator 2.2. Chapters 2 and 3 discuss the component selection and design in detail. with little knowledge of the underlying flight simulator interface 3. Needs to allow the hardware module (microcontroller and supporting hardware) to be used in an actual autonomous aircraft 4.

1 lists the response specifications of the altitude and vertical speed controllers. it needs to be able to display parameters sent to it by the autopilot.3 Autopilot There is considerable flexibility in defining the specifications for an autopilot. Display the current settings on the LCD 4. Provide an on/off command for the altitude/vertical speed controllers. airplane vertical separation practices.2 Hardware User Interface The Hardware User Interface subsystem is fairly simple. In the specific instance of the autopilot described in the next section. and aircraft performance.3 Items two and three are crucial if our system is to be adopted by autonomous aircraft builders.3. the requirements are: 1. Allow the user/pilot to enter desired values for target altitude and vertical speed 3. and in a standard programming language. and the wingleveler 2. The average vertical speed tolerance listed assumes a desired vertical speed of 500 feet per minute.1: RESPONSE SPECIFICATIONS Controller Altitude (Response to 50 foot altitude change) Characteristic Rise Time (90%) Maximum Overshoot Settling Time (10%) Steady State Error Damping Avg. Display arbitrary messages from the autopilot on the LCD 1. Table 1. More detailed technical specifications for the individual controllers are introduced in chapter 2. The importance of item four will be discussed in some detail in chapter 4. and then deliver these to the autopilot. Its only requirements are to allow the user/pilot to enter autopilot commands and parameters. the standard rate for most small aircraft. since it means that the autopilot code has to be written only once. Similarly. 1. Vertical Speed Specification <10 [sec] < 50 [ft] < 60 [sec] < 25 [ft] “good” 450 – 550 [ft/min] Vertical Speed (500 ft/min climb) . The specifications were set by considering practicality. TABLE 1.3.

one with a serial port as well as a good number of I/O pins was needed.4 2 2. 2. Instead.3. the BS2 is especially attractive because it is easy to program--it is run in PBASIC (Parallax’s simplified version of BASIC). and X-Plane [2].1 Microcontroller The first step in implementing the interface was choosing the microcontroller. was ideal. In addition. And although processor speed was not a priority. This was initially our flight simulator of choice. we chose the RabbitCore RCM2200 C-Programmable Microcontroller Module with Ethernet. The BASIC Stamp 2 (BS2) seemed to offer the best combination of features. The module features the Rabbit 2000. 2. For this reason and because of its small size. in a design that does not particularly necessitate fast processor speed. the microcontroller should be programmable in the standard C language. Even after the BASIC Stamp was chosen. We initially proposed using a Texas Instruments TMS320C67x series DSP board because of our past experience with this architecture and its solid C compiler. FlightGear. The microprocessor would serve to not only operate the keypad and LCD. The BS2 had 16 I/O pins plus 2 dedicated serial pins. X-Plane includes an easy-to-use program for creating one’s own aircraft model. Therefore.1Mhz. Ample memory space was necessary and the 32 Bytes of RAM as well as 2K Bytes of EEPROM offered by the BS2 were sufficient.1. However. In addition to all this. The availability of onboard Ethernet makes it possible to communicate with X-Plane using the UDP (Uniform Datagram Protocol).1 Component Selection DESIGN PROCEDURE 2. there were options as to which version to utilize. However. the 20 MHz speed was nice to have. the BASIC Stamp by Parallax was chosen. However. The major ones are Microsoft Flight Simulator.2 Autopilot Platform As mentioned in chapter 1.3 Hardware User Interface 2. so one that was cost-effective. but to also exchange information with the Rabbit. it was lacking the digital Input/Output capabilities to allow a timely implementation of the connection to X-Plane. we chose the commercial X-Plane simulator for our project because it has the most realistic flight and atmospheric models and has the built-in capability to exchange flight parameters with external applications via a variety of protocols.1.1.1 Flight Simulator (PC-Based) There are various PC-based flight simulators on the market. these microcontrollers can present more drawbacks than benefits. an 8-bit microcontroller with 256Kbytes of Flash memory running at 22. FlightGear is a freely available open-source program. The other viable options were the TI-54 and the Motorola HC-12. This provides builders of autonomous aircraft the ability to quickly create an X-Plane model of their aircraft for use with the platform. The desired functions did not require an overly sophisticated microprocessor. yet versatile.1. . since having the ability to change the source code would guarantee access to any internal flight and simulation parameters we need.

1 is approximately correct for airspeeds close . ρ( s ) 160 s 2 + 512 s + 280 = 4 φ( s ) s + 5. In small airplanes. changing the pitch angle using the elevator can be used to cause a change in the vertical movement.3 Autopilot 2.3.2 Keypad/LCD The keypad’s function was not limited to entering parameter values. however. The airplane’s vertical movement is controlled mainly by the engine throttle. and letters A-D. Using just only the elevator for altitude control results in a fast response. The pilot must therefore make sure that the throttle setting is adequate at all times in order to prevent the airplane from becoming too slow during elevator-only altitude changes. besides cost-efficiency.1 Airplane Control Basics Altitude and vertical speed control both involve controlling the airplane’s longitudinal motion. Increasing the throttle setting will generally cause the airplane to climb. It also had to turn the autopilot on/off and select the mode. star.1 represents the elevator angle to pitch angle linearized transfer function of a Piper Dakota airplane as given in [3]. 2. such as the Cessna 172. We used this model in the design of our Cessna 172 autopilot under the assumption that the two airplanes are fairly similar. The only quality needed in the LCD was enough display space. and passes these on to the autopilot routine. while decreasing the throttle setting will cause it to descend. It has been determined that equation 2. 2. trading airspeed for altitude.03 s 3 + 40 .1) It is important to note that the relationship between elevator angle and pitch angle depends on airspeed.5s + 2. or any other exportable variable.3. the only factor in choosing a keypad was the number of keys it had.3.2 Autopilot Platform X-Plane Interface Software X-Plane has the built-in capability of transmitting flight parameters at a set interval over Ethernet using UDP (Uniform Datagram Protocol). Thus. pound.3. all longitudinal control is accomplished by changing the elevator deflection angle only. Similarly.21 s 2 +1. extracts flight parameters from it. the autopilot does not have access to the throttles. The Alesis G8 is capable of displaying 2 rows of 16 characters each. Equation 2.1. A simple elevatoronly change may also be used without a change in throttle setting for small altitude changes. UDP is well suited for our purpose because it has low overhead. This process then repeats with the arrival of the next packet. which calculates the control inputs for the next time step. X-Plane accepts UDP packets sent to it for modifying X-Plane flight parameters. The X-Plane Interface Software on the Rabbit2000 receives UDP packets from X-Plane. As a result. It then assembles control inputs from the autopilot into a UDP packet and sends that off to X-Plane. The Grayhill 96BB2 was chosen because it offered 16 keys—digits 0-9.3.5 2. Given an adequate throttle setting.4 G (s) = (2.

As a result. The user/pilot doesn’t have the ability to command pitch directly using the pitch controller. The controller outputs a desired pitch angle. Figure 3. Thus. would have several drawbacks: 1. The wing-leveler controls the lateral movement of the aircraft (specifically. The actual altitude is obtained from the airplane’s altimeter. As described in section 2. The airplane’s bank angle is controlled primarily by the ailerons.4 describes how the transformation from continuous to discrete time is done). Each controller’s parameters were then tweaked until the simulated response met or exceeded the time domain response specifications listed in table 2. During a climb or descent. The pitch controller was designed using the frequency domain / Bode method.3 Controller Design Most literature on aircraft control uses continuous control system design techniques. The vertical speed controller’s input is the difference between the desired vertical velocity and the actual current vertical velocity of the airplane.3.1. a Simulink model of the system has been created. 2.3. The outer loops contain non-linear elements in their feedback path. we have at the heart of the longitudinal control the pitch controller. It controls the elevator angle to achieve a desired reference pitch angle.4 at the end of chapter 3 shows these loops. In fact.6 to 90 knots in the Cessna 172. which is fed into the pitch controller. 2. many aircraft still feature autopilots based on analog amplifier circuits. It is merely used as an inner loop for the vertical speed and altitude controllers. Because of this. it tries to maintain zero bank angle). There wouldn’t be a direct way to limit the airplane’s pitch to reasonable limits. For an in-depth treatment of the derivation of this transfer function and longitudinal aircraft motion in general. the vertical speed controller will switch over to the altitude controller when the actual altitude gets close to the target altitude. the reader is referred to [4]. This would potentially degrade the performance of the system The altitude controller’s input is the difference between the target altitude and the actual current altitude.3. Altitude is less sensitive to elevator changes than pitch. letting the vertical speed and altitude controllers directly control the elevator.2 Control Loops The autopilot has a total of three control loops for longitudinal control (vertical speed and altitude). and also due to our background in continuous control. making analytical design techniques difficult. the autopilot makes changes to vertical speed and altitude by changing the pitch angle of the airplane. 2. This inner loop could be removed. even though the software implementation ultimately requires a discrete controller (section 2. This. . The actual vertical velocity of the aircraft is obtained by differentiating the altitude reading and proper scaling. however. we decided to design continuous controllers. This could result in unusual airplane attitudes.3.1.

Adding derivative . contrary to what our model (equation 2.2: RESPONSE SPECIFICATIONS Controller Altitude (Response to 50 foot altitude change) Characteristic Rise Time (90%) Max. as well as zero steady state error under the influence of constant disturbances (though in the discrete approximation. Passenger comfort Passenger comfort Realistic time for vertical speed change in a Cessna 172 Passenger comfort Predictability of timeto-target-altitude Passenger comfort Realistic time for small pitch change in a Cessna 172 Passenger comfort Passenger comfort. Equation 2.2) For the vertical speed controller. since it effectively introduces a high-frequency rolloff). Integral feedback is used to meet the maximum steady state altitude error constraint. such as the constant airspeed assumption.3. and the crude approximation of the pitch-altitude relation. p >z s+p (2. Overshoot Settling Time (10%) Stead State Error Damping Pitch Controller Rise Time (90%) Max. Equation 2. it compensates for the fact that with the real (and X-Plane) airplane. a lead compensator was chosen to increase the phase margin (to meet the damping specification) of the system.1) says.3. In a continuous controller. Integral) control was chosen.3. the pitch angle for zero elevator deflection is not zero. Overshoot Damping For the pitch controller. Overshoot Settling Time (10%) Stead State Error Damping Value 10 [sec] <50 [feet] <60 [sec] <25 [feet] Good / Little oscillation 2 [sec] <100 [fpm] <4 [sec] <50 [fpm] Good / Little oscillation <1 [sec] <10 [%] Good (aim for damping ratio of 0.7 TABLE 2. This constant disturbance immunity also compensates for slight modeling errors. D p (s) = K s +z .7) Basis for choice of specification Realistic time for 50 foot altitude change in a Cessna 172 Traffic separation.3 shows the generic transfer function of the PI controller. outer loop controllers Vertical Speed Rise Time (90%) Max. properly designed PI control guarantees perfect reference tracking. PI (Proportional.3. this is not exactly true. Most importantly.2 shows the generic transfer function of the lead compensator.

4 shows the generic transfer function of the PID controller. better results may sometimes be obtained using direct digital design. both of which are similar in accuracy. One consideration when using an approximation method is the fact that it usually only yields reasonable results with sample rates greater than 20 times the closed-loop bandwidth of the system. It should be noted that due to the dependence on T. Derivative control was added in order to achieve good damping.3.5 in the controller transfer functions.8 feedback theoretically would have resulted in better damping.3. a change in the sample period requires recalculating the coefficients of the difference equation. Da ( s ) = k p + k d s + k i 1 s (2. as described in any digital controls text.3. The Bilinear Transform was chosen for our autopilot since it is easier to calculate. PID (Proportional.3. . The transformation simply involves making the substitution shown in equation 2.4) 2.3) For the altitude controller. Integral. At lower sample rates. Derivative) control was chosen. s= 2 1 − z −1 T 1 + z −1 (2.4 Discrete-Time Implementation In order to implement the continuous controllers discussed above in software.5) After making this substitution. the difference equation describing each controller can be read off from the discrete transfer function in z.3. The actual difference equation for each controller is calculated in chapter 3. Equation 2.3. The constant T is the sample period. Dv ( s ) = k p + k i 1 s (2. they must be converted to approximate discrete systems. but didn’t work well in practice due to the approximate differentiator used. Commonly used approximation methods are the Bilinear Transform and the Matched Pole-Zero Method.

3 show the program flow of the BS2 code. The switches shown are used to switch between the vertical speed and altitude controllers.2.1 shows the circuit schematics for the interface hardware. 3.1 Hardware Figure 3. .2 Hardware User Interface 3.2.1 Control Loops Figure 3. and writing to the LCD. +5V 30k 24 1 TX (Serial Out) 2 RX (Serial In) 1 2 5 6 7 8 18 17 12 EN 14 RS 4 DB7 3 DB6 6 DB5 5 DB4 VDD 1 VDD Keypad 3 4 5 6 7 8 BS2 16 15 14 13 LCD 9 10 11 12 GND 2 GND 23 Figure 3. Figures 3. encoding of the keypad bits.21 and 3.3. The switch from the vertical speed to altitude controller occurs 50 feet from the target altitude.2 Software The BASIC Stamp (BS2) served 3 primary functions: serial communication with the Rabbit.9 3 DESIGN DETAILS 3. Saturation blocks were added to limit the 1 The remaining figures in this chapter appear at the end of the chapter.1 Autopilot Platform X-Plane Interface Software Detailed information regarding the X-Plane Interface Software for the Rabbit is best obtained by examining the commented source code.2: Circuit Schematic 3.4 shows the SIMULINK model of the autopilot. which can be found in the Appendix (see project website). 3.3 Autopilot 3.

15 degrees for safety. this is only about three times the closed-loop bandwidth of the pitch controller (3.1 in each controller transfer function.80 s + 0.3.5 degrees. The switch there is to prevent the integrator from saturating before the altitude controller is switched to.0020 0.04 Hz).3 + 0.10 commanded pitch to +/.2 Controller Design The designed continuous controllers all exceed the specifications (as summarized in table 2. The vertical speed controller is similar in structure. As seen in section 3.5 3 20 0. TABLE 3. A sample period of 0. we obtain the following discrete controller transfer functions.0008 0.80 0.3.1) (3.3.1 seconds was chosen (this is equivalent to a 10 Hz sample rate). Table 3-1 lists the values chosen for the controller parameters.3 Discrete-Time Implementation The sample period was chosen as small as possible. the effects of which are discussed in chapter 4.002 + 0. The limiting factor was the time required for the Rabbit processor to receive and send a UDP packet.3) 3. Preview: Figures 4.p>z s + 20 1 Dv ( s ) = 0.5 Da ( s ) = 0.1). s +3 .3.2.5 shows the inside of the altitude PID controller.3: CONTROLLER PARAMETERS Controller Pitch Controller Type Lead Compensator Parameter K z p kp ki kp kd ki Value 1.3 show the SIMULINK generated responses.30 0. This relatively low sample rate results in decreased damping of the discrete pitch controller. .2) (3.01 Vertical Speed Altitude PI PID The controller transfer functions are thus given by the following equations.3.1 – 4.0008 s D p ( s ) = 1 .3. After making the substitution described by equation 2. 3. but lacking the derivative action.3.01 1 s (3. Figure 3.5 with T=0. and commanded elevator deflection to +/.

425 e pitch ( n −1) (3.005 (3.9 a.11 0.002 + 0.8 a-e) e pitch ( n) = pitch actual ( n) − pitch t arg et (n) y pitch ( n) =0.3.3.0004 (3.3 + 16 + 0.3.7 a-d) ealt ( n) = alt actual ( n) − alt t arg et ( n) alt p ( n) = 0.002 evvel (n) vvel i ( n) = 0.3.575 e pitch ( n) −0.6375 (3.4) z z +1 Dv ( s ) = 0.0004 [evvel (n) + evvel (n −1) + yvvel (n −1)] yvvel (n) = vvel p (n) + vvel i (n) (3.3.3.5) z −1 z −1 z +1 Da ( s ) = 0.008 [ ealt ( n) + ealt ( n −1) + yalt ( n −1) ] alt d ( n) =16 [ ealt ( n) − ealt ( n −1) − yalt ( n −1)] yalt ( n) = alt p ( n) + alt i ( n) + alt d ( n) (3.6) z +1 z −1 D p ( z) = The difference equations used to implement these controllers in software are easily obtained by inspection to be: evvel ( n) = vvel ( n) − vvel t arg et ( n) actual vvel p (n) = 0.b) .3ealt ( n) alt i ( n) = 0.8625 z − 0.

3: Software Flowchart .12 Figure 3.

4: Scan_Keypad Subroutine .13 Figure 3.

14 Figure 3.6: Altitude PID Controller .5: Simulink Model Figure 3.

and as a result.3 Autopilot 4. A crossover Ethernet cable between the Rabbit and X-Plane was used for this test. While the degree to which the altitude profile in response to the autopilot meets the specifications outlined in chapter 1. they were combined. Looking at these additional parameters is helpful for identifying possible problems. were added to accurately display the correct key. a constant sample period is required. For testing sake. Rabbit communication was still simulated (by fixing parameter values). Each of the other functions. Proper LCD operation could not be verified. and clearing the display. Actual communication with the Rabbit itself was allowed for in the code. the time between the arrivals of successive UDP packets was measured. the time between arrivals was accurate to within the clock resolution used (1 millisecond). Minor logic flaws.1 Test Procedure The autopilot was tested by comparing the altitude response to desired altitude change of XPlane’s Cessna 172 controller by our autopilot to that obtained from the SIMULINK simulation. Initially. The LCDwr (LCD write) subroutine was tested by fixing the character value. if/then statements were fixed to ensure the scrolling flight status display was functioning. In order to make sure this assumption is true. When the MODE key was pressed. With the DEBUG window.2 Hardware User Interface The three basic functions of the Basic Stamp 2 (BS2) were first written as separate programs and then tested independently. 4. flight parameters were set constant. the rest of the program was verified to be functional. Displaying flight parameters sent from the Rabbit was the first sub-algorithm tested. The proper flight parameters and status values were displayed and scrolled through. the DEBUG window was used to simulate it. The DEBUG window in the BASIC Stamp Editor was used to mimic the LCD display. These include vertical velocity and pitch.1 Autopilot Platform X-Plane Interface Software The basic operation of the X-Plane Interface Software was verified by simply sending known parameters in both directions and making sure they are received correctly. Once these were entered. with the new values displayed. but was not tested in real-time.15 4 DESIGN VERIFICATION 4. . such as moving the cursor. as well as key reconfiguration. the program was tested for correct column placement. Once this was found functional. were each tested in turn. the LCD was designed to run in 4-bit interface mode. but the rest of the program was tested completely. the scrolling display was interrupted. At our sample rate of 10Hz. the display resumed. other variables were also compared to those from the SIMULINK simulation. the algorithm for encoding the keys had to be tested first. After each of these sub-algorithms was functioning properly. shifting the display. For the keypad. In order for the discrete time approximation of the controllers to perform well. and the user was prompted to enter new altitude and vertical speed values.3. before being implemented together. 4. with no other network traffic. In order to conserve pin usage. testing was focused on making sure the correct row was designated.

3. however.3. Figure 4. After about 40 seconds. 4 The vertical velocity plot from X-Plane data is only valid before the time the altitude controller is switched to.3. the vertical velocity from XPlane has relatively large oscillations compared to the Simulink results. the responses are parallel. The altitude seems to initially increase slightly faster in the XPlane response compared to that from Simulink. in order to get an adequately damped response using the discrete approximation of the continuous controller.4: X-PLANE AND SIMULINK RESPONSE CHARACTERISTICS Response from SIMULINK Altitude Controller (Response to 50 foot altitude change) Vertical Speed Controller (500 ft/min climb) X-Plane (Cessna 172) Altitude Controller (Response to 50 foot altitude change) Vertical Speed Controller (500 ft/min climb) Characteristic Rise Time (90%) Maximum Overshoot Settling Time (10%) Steady State Error Avg. These oscillations can be shown to be due to inadequate damping of the discrete pitch controller. Vertical Speed 5.1 summarizes the response characteristics obtained from this plot. The two responses look very similar.2 shows just the part of the responses for the time after the vertical speed controller is switched over to the altitude controller. The responses from X-Plane and SIMULINK are overlayed. SIMULINK is discussed in section 2. which is in turn due to our low sampling rate (roughly three times the bandwidth). There are some small differences. The reader should thus ignore the constant part at the end. It’s quite obvious that the pitch and.8 [ft] 41 [sec] 5 [ft] 505 [ft/min] Figure 4. Vertical Speed Value 3. The reason for the vertical offset for the pitch angle from X-Plane vs. The most prominent difference is the presence of some slight oscillations in the X-Plane response. . the altitude profile isn’t affected much by this. and it is clear that the autopilot is functional. however.2 Results Figure 4. As discussed in chapter 2. as a result. 2 3 Figures appear at the end of the chapter.8 [sec] 9 [ft] 37 [sec] 0 [ft] 495 [ft/min] Rise Time (90%) Maximum Overshoot Settling Time (10%) Steady State Error Avg. Overall. Comparison with table 1.0 [sec] 13.3 shows plots of the additional parameters mentioned in the previous section: pitch3 and vertical velocity4. the sample rate should be at least 20 times as large as the bandwidth. The difference equations could be easily updated to reflect the new sample rate. since the pitch and vertical velocity match closely on average. A faster microprocessor would allow an increased sampling rate.16 4. This helps explain the initial oscillatory trend in the altitude profile. TABLE 4.1 shows that all specifications have been met.12 shows the altitude profile for a climb from 267 feet to 1000 feet. This is most apparent in the first 20 seconds. and the oscillatory behavior is expected to disappear. Table 4.

7: Altitude Profile (Simulink & X-Plane) Figure 4.17 Figure 4.8: Altitude Response .

9: Additional Variables .18 Figure 4.

20 $16.00 $10.000 $5.00 $49. 0.00 Quantity 1 1 1 1 8 1 1 1 Total Cost $59.5 *2.08 $59.27 BS2-IC 96BB2-006-R 9-40-1381-C 800-0003 Payroll Michael Frutiger Charles Kim TOTAL Payroll GRAND TOTAL Hourly Salary $50 $50 Hours 80 40 *2.00 $439.00 $0.30 .51 RabbitCore2200 Crossover Ethernet Cable BASIC Stamp 2 30kΩ Resistor.25W Keypad (Grayhill) LCD (Alesis) Parallax Serial Cable TOTAL Parts Part Number RCM2200 Unit Cost $59.99 $239.19 5 COSTS TABLE 5.00 $10.00 $1.15 $16.5 Total Cost $10.99 $239.00 $5.000 $15.5: PROJECT COSTS Part Name X-Plane 6.000 $15.08 $59.00 $49.439.00 $5.

In addition. 6. implement it on the platform in the standard C language. it is necessary to increase the sample rate of the system.3 Future Work and Possibilities After resolving the uncertainties mentioned above.20 6 6. . the platform can be advertised and demonstrated to builders of autonomous aircraft builders such as the University of Illinois’ Aerial Robotics team. The platform could also be shown to control system faculty at the University of Illinois in order to explore the possibility of incorporating it into the laboratory for student projects. the hardware user interface unit still needs to be debugged further in order to pinpoint why the LCD was only working intermittently. Another option would be to replace the UDP link with a high-speed serial connection.1 Accomplishments CONCLUSIONS The project successfully addresses the situations mentioned in section 1.2 Challenges and Uncertainties There are still a couple of challenges and uncertainties remaining. While it can be shown using simulations that merely doubling the sample rate results in greatly improved performance for the Cessna 172 autopilot. possibilities must be investigated for linking the autopilot platform to navigational equipment such as a Global Positioning Receiver or even a full-fledged Flight Management System. Whether or not this can be accomplished using the faster Rabbit 3000 microcontroller is unclear at this time. It is demonstrated that it is possible to design an autopilot system using Matlab/SIMULINK. a much higher sampling rate needs to be supported in order for the platform to be of general use. As was seen in chapter 4. The small size and large number of connectivity options of the Rabbit makes it possible to remove it from the platform and use it in an actual autonomous aircraft without having to rewrite the autopilot code. In order to be of the most use in this setting. The exact tradeoffs between the two solutions would need to be explored further.1. and find that it performs using X-Plane’s aircraft as expected. This would eliminate the computational overhead for UDP communications on the Rabbit and may make higher sampling rates possible. 6.

21 7 REFERENCES [1] Association for Unmanned Vehicle Systems. [4] J. 2. pp.x-plane. New York: John Wiley & Sons. “Aerial Robotics Competition. B.html. Blakelock. Georgia Institute of Technology.com/ descrip. 1996. New York: John Wiley & Sons. [5] J. 1991.” April 2003. Russel.edu/AUVS/IARCLaunchPoint. Performance and Stability of Aircraft. 7-61. [2] Laminar Research.gtri. H. “Longitudinal Dynamics.” in Automatic Control of Aircraft and Missiles. .html.gatech.” April 2003. “X-Plane Description. http://www. http://avdil. ch.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer: Get 4 months of Scribd and The New York Times for just $1.87 per week!

Master Your Semester with a Special Offer from Scribd & The New York Times