the kodel, an rc airplane autopilot for aerial photography

39
My DIY RC autopilo

Upload: koen-delvaux

Post on 26-Aug-2014

20.330 views

Category:

Self Improvement


2 download

DESCRIPTION

My efforts to build an autopilot for RC airplanes based upon a gps module, IR sensors and a microcontroller. Presented at Barcamp Antwerp on March 21 2009.

TRANSCRIPT

Page 1: The Kodel, an RC airplane autopilot for aerial photography

My DIY RC autopilot

Page 2: The Kodel, an RC airplane autopilot for aerial photography

First try on aerial photography

Page 3: The Kodel, an RC airplane autopilot for aerial photography
Page 4: The Kodel, an RC airplane autopilot for aerial photography
Page 5: The Kodel, an RC airplane autopilot for aerial photography
Page 6: The Kodel, an RC airplane autopilot for aerial photography
Page 7: The Kodel, an RC airplane autopilot for aerial photography
Page 8: The Kodel, an RC airplane autopilot for aerial photography
Page 9: The Kodel, an RC airplane autopilot for aerial photography
Page 10: The Kodel, an RC airplane autopilot for aerial photography
Page 11: The Kodel, an RC airplane autopilot for aerial photography

Conclusion:it’s difficultwithout anAutopilot

• to hold it steady• to aim the camera

Page 12: The Kodel, an RC airplane autopilot for aerial photography

Autopilot design goals

• User selects object on Google Maps• Plane flies to location and starts circling• Camera takes pictures always pointed to target• Pictures can be “glued together” in viewer

(Not: ortho pictures to add on google maps)

Goal: easy photography of buildings / landscapes

Page 13: The Kodel, an RC airplane autopilot for aerial photography

PRINCIPLES

Page 14: The Kodel, an RC airplane autopilot for aerial photography

Forces on an airplane

Thrust:Controls heigth

Elevator:Controls speed

Rudder:Controls direction

Ailerons:Control roll

Page 15: The Kodel, an RC airplane autopilot for aerial photography

What is a servo, how does it work ?

Page 16: The Kodel, an RC airplane autopilot for aerial photography
Page 17: The Kodel, an RC airplane autopilot for aerial photography

Pitch / roll sensingIR sensors (thermophiles)

Page 18: The Kodel, an RC airplane autopilot for aerial photography

GPS navigation

Yaw/height:calculated

Waypoints:• straight• circular• Failsafe

$gprmc,114019.489,A,5048.9524,N,00511.8268,E,0.00,130.10,190907,,,A*60$gpgga,114019.489,5048.9524,N,00511.8268,E,1,08,01.4,57.9,M,45.6,M,,*52gga = time,latitude,ns,longitude,ew,posfix,sats,precision,altitudelatitude=xxx.zzzz to xxxxx.zzzz (degrees*100+minutes=deel voor komma)longitude=xxx.zzzz to xxxxx.zzzz (degrees*100+minutes=deel voor komma)

Page 19: The Kodel, an RC airplane autopilot for aerial photography

Microcontroller: a computer on a chip (but no OS)

RAM + FLASHEPROM

TimersInterrupts

I/O ports (digital)Analog portsSerial interface(usb, bluetooth)

Bus (I2C, SPI, CAN)

Page 20: The Kodel, an RC airplane autopilot for aerial photography

HARDWARE COMPONENTS

Page 21: The Kodel, an RC airplane autopilot for aerial photography

KISS : just plug board between servo’s and receiver(dsPIC30F4012 from Microchip)

Page 22: The Kodel, an RC airplane autopilot for aerial photography

Paper adhesive tapeprovides intended point of failure uponimpact(crash tested)

Page 23: The Kodel, an RC airplane autopilot for aerial photography

Only 3 things to connect and install

IR sensor Autopilot CPU GPS module

Page 24: The Kodel, an RC airplane autopilot for aerial photography

CODE SAMPLES

Page 25: The Kodel, an RC airplane autopilot for aerial photography

Input pulse collection:Interrupt on change

Page 26: The Kodel, an RC airplane autopilot for aerial photography

Output pulse generation:Interrupt on timer

Page 27: The Kodel, an RC airplane autopilot for aerial photography

Flight logic:Continious loop

Page 28: The Kodel, an RC airplane autopilot for aerial photography

Calculation of stabilisation:Use of floating point

Watch out for th

e math

Error TRAP (code sto

ps)

Page 29: The Kodel, an RC airplane autopilot for aerial photography

TOOLS

Page 30: The Kodel, an RC airplane autopilot for aerial photography

PIC Programmer:Velleman K8048 (15€)

Page 31: The Kodel, an RC airplane autopilot for aerial photography

Programmer software:Freeware WIN PIC

Page 32: The Kodel, an RC airplane autopilot for aerial photography

IDE: free MPLAB available from Microchip

Page 33: The Kodel, an RC airplane autopilot for aerial photography

Alternative microcontrollersGood:• AVR: very powerfull, more expensive/compex• Arduino: pre-integrated, less effort• Ti

Bad:• BASIC stamp: ripoff with lousy programming• LEGO Mindstorms: expensive plastic• PIC16, PIC18: voorbijgestreefd

I stick with dsPIC since the learning curve was not too steep

Page 34: The Kodel, an RC airplane autopilot for aerial photography

OTHER AUTOPILOTS

Page 35: The Kodel, an RC airplane autopilot for aerial photography

Tompycke.be :a Belgian, 10x betterthen I am at this stuff

Page 36: The Kodel, an RC airplane autopilot for aerial photography

Paparazzi:Very comprehensive,open source, starts toget a bit long in the tooth

Page 37: The Kodel, an RC airplane autopilot for aerial photography

Attopilot:The best, very recent effort by a dedicated ex-intel engineer

Page 38: The Kodel, an RC airplane autopilot for aerial photography

ArduPilot:Arduino based andopen source, recentbut very basic SW,From Chris “The LongTail” Anderson (& others)

Page 39: The Kodel, an RC airplane autopilot for aerial photography

Let’s go fly!