How to Design, Build and Operate a GPS-Guided Autopilot System for RC Aircraft

A Project Report


Project Report, 2012
190 Pages, Grade: A

Excerpt

Table of Contents

1. Introduction
1.1 Purpose
1.2 Intended Audience
1.3 Overview
1.4 Description
1.5 Principle Theories

2. System Overview
2.1 Schematics, Flowcharts, and Block Diagrams
2.2 Software Development
2.3 Pictures

3. Conclusions

4. Troubleshooting

5. Bill of Materials
5.1 Parts Listing
5.2 Cost Analysis

6. Values
6.1 Ethical Values
6.2 Benefits to Society

7. Team Members
7.1 Nicholas Chaplin
7.2 Don Cornwell
7.3 Jeremiah Jones

Appendix A. Code

Appendix B. Logbooks and Progress Reports

Logbook

Status Reports

Appendix C. Screenshots

References

1. Introduction

1.1 Purpose

This report is to provide oversight to the complete development of the project. The report will include descriptions, schematics, flowcharts, and software code to illustrate the details, methods and thought processes followed during the development of the project.

1.2 Intended Audience

- Development team
- Project Advisor
- Senior Project Review Committee

1.3 Overview

The objective of this project is to design, build, and operate a GPS-Guided Autopilot system for Radio Controlled Aircraft. This product will have to be small, lightweight, aerodynamic, and modular. It will only have to rely on 1 channel input from the aircraft receiver for the RC/Autopilot switching function. It will have to be able to fly a predetermined route while having the ability for the consumer to override the autopilot feature if desired by using their remote control. Our RC aircraft autopilot system will be interfaced with a computer in order to program the waypoints that will make up the flight plan. All of these objectives are critical in order to have a functional RC aircraft autopilot system. Our time frame for completion of this project is 32 weeks and our target for total cost for the build is $500.

1.4 Description

The product that we are proposing is a GPS-Guided Autopilot System designed for radio-controlled aircraft. This project is a modular RC/Autopilot Aircraft System that will be designed for small, inexpensive, and basic radio controlled unmanned aerial vehicles. Although our target market will be RC hobbyists that are interested in flying their airplanes autonomously, our system will also have the potential to expand to larger markets such as hobbyists flying helicopters as well as Unmanned Aerial Vehicles used in the military. There will be three phases to this project, Phase (1) is our goal and is dedicated as the Autopilot function once the aircraft has reached altitude. Phase (2) is the addition of Autopilot landing, and Phase (3) is the addition of Autopilot takeoff. Phases (2) and (3) are left as optional and will be completed if and only if the team has enough time before the end of the series of Senior Project courses. The project can be broken down into three basic modules to perform these tasks. These modules are the Sensing module, the Receiver/Processor module, and a Flight Control module. The combination of these three modules will be assembled to form the autopilot function.

The Sensing module will consist of a GPS antenna and a signal processor along with a 2-axis gyroscope and a 3-axis accelerometer. The GPS signal from satellites will be processed into information that will be used by the receiver/processor module to send flight path corrections to the flight control module to keep the aircraft on the programmed path. The flight controls affected by the GPS signals will be the engine speed and the rudder. The gyroscope and accelerometer will provide information to the receiver/processor module to provide flight stabilization. The flight controls affected by the gyroscope and accelerometer will be the ailerons and the elevators. The Sensing module will have to provide heading, speed, altitude, pitch, and roll information to the receiver/processor so that the aircraft can have the ability to reach a certain height upon takeoff, travel at a stable speed, and maintain the correct heading so that the aircraft can reach a pre-determined destination. Upon nearing this destination, these same sensing signals will be used to bring the aircraft back down to the ground on target and in a safe manner.

The receiver/processor will provide the aircraft the ability to fly in Autopilot mode and Radio-Controlled mode if chosen. These choices will be available at the flip of a switch on the radio controller. The Radio-Controlled mode should also be able to be switched on-the-fly in case of an emergency. This function will be implemented either via a comparator or multiplexer circuit. The receiver/processor will take signals from the Sensing module and process them to make corrections to the flight path. The receiver/processor will also allow the user to program in waypoints that the aircraft will be able to follow in its flight.

The flight control module will take the information from the receiver/processor and send signals to the flight control servos to actuate the flight controls to change aircraft heading and altitude along with maintaining pitch and roll for flight stabilization. The speed of the aircraft will also be maintained through the use of pulse-width-modulation.

This system should provide the RC hobbyist another means to enjoy flying their aircraft.

1.5 Principle Theories

The RC aircraft auto pilot system is going to require a GPS signal that will be interpreted by a microcontroller which will then make flight corrections based on the final destination. The system will also rely on a gyroscope and accelerometer to maintain a stable flight.

Our system will have to be light-weight in order to maintain the balance and normal flight characteristics of the RC aircraft.

The system will have to be low-power, lightweight, and possibly rely on a separate power source as to not decrease the amount of flight time since a lot of the RC aircrafts get limited flight time already. Perhaps a more efficient power source for the aircraft is possible.

The aircraft chosen for this project will have to have enough lift to carry the added circuitry and the additional power source if required. RC aircraft have been utilized to carry much heavier camera equipment such as the aircraft shown here: http://www.leteckafotografie.com/aerialvideo/video_plane.htm

The builders claim that “The camera plane can stay 30 minutes in the air using the energy from two 8000mAh lipo batteries”.

Choosing a similar platform with the same capabilities should be more than sufficient to support the added weight of our system.

The system will have to meet all of the specifications of the standard RC aircraft.

2. System Overview

2.1 Schematics, Flowcharts, and Block Diagrams

Data Flow Diagram for RC Autopilot SystemAbbildung in dieser Leseprobe nicht enthalten

2.2 Software Development

Example Pseudocode :

Init:

Initialize Global functions

Initialize Global variables

Initialize Public variables

Initialize Private variables

Initialize any Static variables

Get PulsIn value of Neutral for the servo

Get Gain Value

Get Servo Direction

MainLoop:

If Autopilot ON then

GoTo Autopilot

Else

GoTo Passthru

EndIf

PassThru:

Pulsin Receiver

PulsOut Rudder

GoTo MainLoop

AutoPilot:

Get GPS Data

Do CheckSum of Data

Fill in Vars

If Correction DoCorrection

GoTo MainLoop

DoCorrection:

If Direction Normal

Turn normal

Else if Direction Reverse

Turn Reverse

GoTo MainLoop

Example of basic fundamental PWM software routine:

void initPwm(void){

PWMPRCLK=0X11; // 24/2 = 12MHz for clocks A and B

// Prescales can be 2^0, 2^1,...,2^7.

PWMSCLA=6; // ClockSA=ClockA/(2X6) 12MHz / 2*6 = 1MHz

PWMSCLB=6; // ClockSB=ClockB/(2X6) 12MHz / 2*6 = 1MHz

PWMCLK=0XF0; // 0xF0 = clock SA fpr PWM chan 4,5 amd SB for 6,7

PWMPOL=0XA0; // high pulse first 7 and 5 high

PWMCAE=0; // Align it left

PWMCTL=0XC0; // Choose Channel 4-5 for 16bit PWM

PWMPER45=20000; // ClockB= Period (PWMPERx)*Freq

PWMDTY45=1690; // Determines duty cycle=PWMPER2 X Duty%.

PWMDTY45=3; // Change to 2 for clockwise

PWMPER67=20000; // ClockB= Period (PWMPERx)*Freq

PWMDTY67=1690; // Determines duty cycle=PWMPER2 X Duty%.

PWMCNT45=0;

PWMCNT67=0;

PWME=0XA0; // PWM chan 5 and 7 enabled

PWMPER67=20000; // ClockB= Period (PWMPERx)*Freq

PWMDTY67=1690; // Determines duty cycle=PWMPER2 X Duty%.}

2.3 Pictures

The following pictures are of our Evaluation Board, IMU Flight Stabilization Board, GPS module, and our aircraft respectively.

Abbildung in dieser Leseprobe nicht enthalten

Abbildung 1 (https://www.sparkfun.com/products/retired/11072)

Abbildung in dieser Leseprobe nicht enthalten

Abbildung 2 (http://www.evbplus.com/MicroDragon_9s12/MicroDragon_9s12.html)

Abbildung in dieser Leseprobe nicht enthalten

Abbildung 3 (http://i1.ymfile.com/uploads/product/uploads/product/01/14/x1_1.1348070400_180_180_5673.jpg)

Abbildung in dieser Leseprobe nicht enthalten

Abbildung 4 (http://www.hobbyking.com/hobbyking/store/__16336__182_light_aircraft_Deluxe_Version_ ARF_.html

3. Conclusions

Don Cornwell’s Conclusions:

In order to come to a conclusive resolution during the long and arduous journey to reach a project’s end, sometimes, one must rely on his or herself to come to fundamental results that are derived from fundamental questions. You cannot always rely on others, such as your instructor, other instructors, or even your teammates. You have to go at yourself too, dig in, and figuratively speaking, put some elbow grease into it. In order to do that, you need to read the manual for whatever hardware device you are expected to configure or move.

Hello, my name is Don, and I was responsible for developing a simple software programming routine written in the “C” programming language with embedded Assembly instruction where needed. It was my job to move four standard grade servo motors that our (Team B’s) Skyartec Cessna 182 RC Airplane was equipped with even though for this assignment, only three motors were needed. In short, to accomplish doing that, I succeeded in graduations, starting with moving one standard grade servo motor configured to run at 16-bit Pulse-Width-Modulation (PWM) at channels 4, 5, 6, or 7 (onboard pin assignments PP4, PP5, PP6, and PP7) on a Dragon12-P-USB-EVAL Microcontroller Board that is equipped with an onboard (MC9S12DG256PVE) microcontroller chip protected by a rectangular shaped prototype board over it. Then I graduated to moving two SG servo motors again at 16-bit PWM, again the designated pin assignments previously stated. I might add here just so everyone understands that channels 4, 5, 6, and 7 are designed to run servo motors at 16-bit PWM.

In order to move four servo motors, you need to resort to 8-bit PWM. The channels used for 8-bit PWM are channels 0, 1, 2, and 3 (onboard pin assignments PP0, PP1, PP2, PP3). After I completed setting up the necessary pin assignments to the onboard prototype board, I was able to plug in four standard parallax servo motors I had purchased, and simulated the necessary 90° degree movements’ left-and-right max and back to center position simulating the wings and rear stabilizer’s flap movements. Once I accomplished writing the software routine for these servo motor functions and movements, I then graduated to testing the software routine with the RC Aircraft. I knew that if I could get the four standard servo motors to move the way I wanted them to with the various Pulse-Width values and delays, that I could do the same with the aircraft itself. Finally, as I conducted further research on the Internet and submerged myself into various engineering forums, I found that I was not alone in attempting to move multiple servo motors. One question that stands out in my mind even to this day, “What does it take to move more than two servo motors, say four servo motors? Does it require increasing voltage or decreasing current to your microcontroller?” The answer lies within the manual for whatever microcontroller board you are using to make whatever hardware you are using to function the way you want it to. The answer is, “No” for either increasing voltage or decreasing current.

Jeremiah Jones’s Conclusions:

Analog inputs can be sampled in order to get a digital visualization of what the sensors are experiencing. The 5DOF outputs are DC volts that vary as the sensor is moved around in a 3-axis environment. Sampling at the highest resolution of 10-bits would yield the most accurate results as the DC voltages can change almost immediately. The reason that a 10-bit ADC function was chosen was due to it being the highly resolution the micro-dragon board is capable of at 1024 steps (210= 1024). The output pins that was utilized were the x-acc, y-acc, and z-acc. The input pins were raw (Vin) and GND. The outputs of the 3-axis accelerometer were interfaced with PAD08 (x data), PAD09 (y data), PAD10 (z data) and the X and Y outputs of the gyroscope feed into PAD 11 and 12 for future development.

The software was a challenge to complete as I had to research what the values of the different registers needed to be with ADC functions. The registers used to setup the ADC functions were ATD1CTL2 through ATD1CTL5. The data that is input into PAD08 to PAD12 can be found in data registers ATD1DR0 through ATD1DR4. An algorithm was used to calculate the pitch and the roll by using the known resolution. Limit functions were setup to control the plane and preventing it from flying uncontrollably ex. Barrel rolls and losing track of which direction is up.

Nicholas Chaplin’s Conclusions:

This proved to be a more difficult project than originally anticipated. The amount of coding required just to use the GPS signal was more than was anticipated for the entire project. Getting the autopilot to function via the remote was not too difficult, but certainly extracting information from the GPS signal was difficult enough to offset any ease that I had anywhere else. All in all, it was a challenging and rewarding project that I loved and hated at times.

4. Troubleshooting

Don Cornwell’s Troubleshooting:

When troubleshooting hardware, such as servo motors, its best to resort to the manual of the type of servo motor you intend to use as well as the manual for the microcontroller board of your choice. In short, when you decide you need to move multiple servos that are beyond that of two servos needed to run on the same microcontroller board; here is the way I look at from now on, in order to cut down troubleshooting time when you’re under time constraints. Just remember to follow this simple rule (equation) I came up with during the troubleshooting process. The manual did not tell me this either, but it helped me derive to this troubleshooting conclusion. If you are using the Dragon12-P-USB EVAL Microcontroller Board or its smaller brother board, the MicroDragon Microcontroller Board.

If the number of servos needed to run are two, then divide by 2 and that will give you 16-bits. At this point you will use channels 4, 5, 6, or 7 (onboard pin assignments PP4, PP5, PP5, or PP7).

If the numbers of servos needed to run are four servos, then divide that 4 and that will give you 8-bits. It takes 8-bits Pulse-Width-Modulation to run beyond two servo motors on the same board of this type. So, you will use channels 0, 1, 2, and 3 (onboard pin assignments PP0, PP1, PP2, and PP3) of the Dragon12 or the MicroDragon Microcontroller Board.

Jeremiah Jones’s Troubleshooting:

The flight stabilization programming ended up being a little difficult at first due to learning how the control registers worked. ATD1CTL2 is used to setup the ATD function using a normal operation and enabling the fast flag clear function. ATD1CTL3 is used to setup the number of conversions. ATD1CTL4 is used to setup the resolution and clock speed. ATD1CTL5 is used to setup the channel that the data is to be pulled from. The values of these registers are set by the HEX representation of the bits that make up the register. Trig functions were initially used to try to calculate the pitch and the roll; however, it was yielding bad values. Using a set standard standards based off of the resolution of 1.6113 degrees per digital count was applied to achieve accurate pitch and roll readings.

Nicholas Chaplin’s Troubleshooting:

A lot of the trouble shooting that I had to do involved the coding required for this project vice hardware problems.

The first problem that I had to troubleshoot was the extraction and saving of data from the GPS signal. In order to verify that the correct information was pulled and saved to the correct variables, I had to use the serial monitor in Codewarrior to view the information. Without software interrupts, I kept losing communication with my microcontroller. I along with my teammates thought that the serial monitor would show you real time data along with any updated values. Unfortunately this was not the case. The only way to view real time values is to implement software interrupts to stop the serial monitor so that values could be viewed without losing communication. Once the issue with the serial monitor was resolved, troubleshooting moved forward at an extremely fast pace.

There were issues with the timing of certain functions that had to be troubleshot as well. One issue in particular was the initial values variables for the GPS. I had a hard time getting the values to save and not be changed the next time the autopilot function looped. On the other side of this, I also wanted to be able to reinitialize the variables when the autopilot function was turned off. It was all a matter of placement and timing.

Another issue I had to troubleshoot was the autopilot enable function. I had a little difficulty with capturing the rise and fall of the PWM positive pulse and then calculating the positive pulse with so that I could compare it with a known measured value to determine whether or not the switch on the remote had been activated to enable the autopilot function.

5. Bill of Materials

5.1 Parts Listing

1 SKY-182 Light RC Aircraft w/ ESC, Servos, & Motor - $54.99

1 HK-T6A 2.4 GHz, 6ch, Tx/Rx Vs Mode 1 Flight Control System - $24.99

1 T1300.3S.30 Turnigy 1300 mAh, 3s, 30c, Lipo Pack - $14.99

1 Turnigy 2S 3S Balance Charger. Direct 110/240v Input - $11.44

TST-SBECPG Turnigy Trust SBEC Programming Card - $3.53

1 20 Channel EM-406a SiRFIII GPS Engine Board with Patch Antenna - $40.00

1 EVAL-USB-128 XMega Development Board - $30.99

1 MicroDragon Project Module - $55.00 (Replacing EVAL-USB Xmega board above)

1 IMU Analog Combo Board - 5 Degrees of Freedom IDG500/ADXL335 - $35.95

1 Mux or Comparator circuit (needed for remote control override still TBD)

Total Cost of Materials - $271.88

Total Cost of Components required for Autopilot function - $130.95

5.2 Cost Analysis

Similar designs do exist, but we are planning to reduce the cost while making the system modular including the autopilot function and retaining the RC function. Comparable systems include:

MP21289 = $6,000.00

MP20289= $5,500.00

MP10289 = $1,500.00

The total cost far exceeds the lowest price of similar systems.

6. Values

6.1 Ethical Values

There are little ethical values that need to be considered by doing this project. However, there are some important ethical values to consider and they would be that of following FCC guidelines by avoiding flying near airports. Also it is advised not to fly above 400 feet. Potential damage to personal property needs to be minimized be not flying where there are trees, power lines, hills, or any other tall structures.

6.2 Benefits to Society

This project benefits society by adding new types of fun to an old hobby. It provides new educational concepts for the novice robotics personnel. Hobbyists will find it very exciting to control their aircraft in a new way. It generates whole new concept to flying RC aircrafts.

7. Team B Members

7.1 Nicholas Chaplin

Nicholas “Nick” Chaplin

I am 33 years old, a father of a 6 year old daughter, a husband of 8 years, and a Marine of 13 years. I am an Explosive Ordnance Disposal Technician (military bomb squad) and I have done this for the last 8 years. I am originally from the Moundsville, West Virginia area but currently live in Stafford, Virginia.

I went back to school nearly 3 years ago to finish something that I had started before I joined the Marine Corps back in 1999. I joined with full intentions on using my benefits to get a degree, only it took me 10 years to get motivated enough to do so. Part of that was my job and finding the time to do so and part of it was that I wasn’t quite sure what I wanted to do.

Four years ago I found myself with orders to Marine Corps Base Quantico, Virginia and things fell into place for me to finally go back to school. DeVry’s online Electrical Engineering Technology degree was right on track with what I had decided that I wanted to do. Being a full time Marine and family man made the online choice easy for me as it gave me the flexibility to work on school when “I” had the time to do so.

My plan is to separate from the Marine Corps this year and use my education to pursue a career in the electrical field. I currently have a job waiting on me as an Instrumentation and Control Technician with Dominion Transmission back in my hometown of Moundsville. Dominion Transmission is a gas subsidiary of Dominion Electric based in Richmond, Virginia. I am very excited for my life to slow down and be normal. The Marine Corps has treated me and my family very well and I am sure that there will be things about it that I will miss, but spending time away from my family has been hard and I feel that it is time for me to move on.

Team B’s project has proven to be a complicated one and all of us have to work together to complete the modules required to make our project function. I don’t feel that any one of us has any particular duty at this point. I worked in Avionics for my first 4 years in the Marine Corps, so I have an excellent background in circuit repair and soldering. I actually had a micro-miniature solder repair certification, so I consider myself as a sound hardware assembler for this team.

I feel that once we get through the roadblocks currently holding our project back we will make some serious progress in attaining our goal of getting our airplane to fly on its own. I look forward to seeing its completion and ultimately the completion of my degree. The last 3 years have been difficult trying to juggle my family, my career, and my schooling. I look forward to taking some time off from school before I go back for my master’s degree.

7.2 Don Cornwell

I am from Louisville, Kentucky and I now permanently live in the Hudson River Valley area of Chestnut Ridge, NY with my fiancée, Jennifer. We do not have children, but together we love our beautiful standard poodle who loves swimming with us in our pool. We plan on having children after we get married. We intend to get married after I get my degree here from DeVry University.

After I won my air assault wings, I served as an artilleryman in the 101st Airborne Division Air Assault the latter 4 years of my 8 years of military service in the US Army with a secondary military occupational specialty (MOS) as a Field Artillery Surveyor. I just liked big guns, drafting, and civil engineering at the time, which is why I went into artillery. In the earlier stages of my military career, I had crossed-trained and performed several MOS’s outside of my primary MOS. Those occupational specialties were: Ammunition Supply, Fire Direction Center (FDC), and Radio Communication Operations with the 3rd Infantry Division. It was in this Division I saw and went to war with in the first Persian Gulf War (Desert Shield/Desert Storm) after I was detached and re-assigned to from the 4/14 FA Brigade as a Combat Lifesaver attached to headquarters. I was a sharp soldier, so I got to serve in special duties such as 1st SGT Driver, XO Driver, and finally Command SGT Major’s Driver. I was an expert rifleman, expert grenadier, and a master gunner of the M60 machine gun.

After Serving eight years in the US Army, I went back to live in Louisville, KY and started attending college at Jefferson Community College where I started pursuing an Associate in Applied Science Degree in Computer Information Systems (CIS) Microcomputer Applications (with the programming option). There I performed student/work-study in the IT Helpdesk where I performed various grunt duties in networking and communications for the college campus, computer repair, and server room and network terminations. I stopped there with one class shy of attaining my degree because I learned that the AAS was a dying degree and I wanted to transfer my college credit towards a higher degree.

Over the years, I have worked as a hardware and software technician at Bellarmine University’s IT Helpdesk Center, Computer Operator for the Data Center at Vencor Hospital for TekSystems, IT consulting with Decision One at GE Appliance, Kentucky Truck Plant as a Technical Writer, UPS Supply Chains Solutions as an Electronic Repair Technician (Computer, Printer, and Handheld Device Repair). After all this contract work (some was permanent), I grew tired of all late hours and 24/7 work and just got burnt out.

After moving back west to Las Vegas I became a Slot Technician for two years until I met my now fiancée Jennifer, moved here to New York to be with her. Together we consider it from here to eternity. After eight months here, I landed a contract position with LeCroy Instruments as Technical Assembler. Since March 2009, I finally transferred most of my credits I earned from JCC in Louisville, KY and have attended DeVry University Online since. Once I earn my degree here with DeVry, I intend to take that degree back to LeCroy Instruments and attain a permanent full-time position in their Engineering Department.

[...]

Excerpt out of 190 pages

Details

Title
How to Design, Build and Operate a GPS-Guided Autopilot System for RC Aircraft
Subtitle
A Project Report
College
DeVry University
Course
ECET 494
Grade
A
Authors
Year
2012
Pages
190
Catalog Number
V298760
ISBN (eBook)
9783656960058
ISBN (Book)
9783656960065
File size
1834 KB
Language
English
Notes
This Senior Project is a documentation of the technical and software programming parameters involved in realizing the projects solutions. There was no factual flight presentation video. It was not practical given the geographical location of the team involved.
Tags
Electronics, Engineering, Electrical, software programming, Remote Controlled Aircraft, Autopilot systems Aircraft
Quote paper
Don Cornwell (Author)Nicholas Chaplin (Author)Jeremiah Jones (Author), 2012, How to Design, Build and Operate a GPS-Guided Autopilot System for RC Aircraft, Munich, GRIN Verlag, https://www.grin.com/document/298760

Comments

  • No comments yet.
Read the ebook
Title: How to Design, Build and Operate a GPS-Guided Autopilot System for RC Aircraft


Upload papers

Your term paper / thesis:

- Publication as eBook and book
- High royalties for the sales
- Completely free - with ISBN
- It only takes five minutes
- Every paper finds readers

Publish now - it's free