the kodel, an rc airplane autopilot for aerial photography
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](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/1.jpg)
My DIY RC autopilot
![Page 2: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/2.jpg)
First try on aerial photography
![Page 3: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/3.jpg)
![Page 4: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/4.jpg)
![Page 5: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/5.jpg)
![Page 6: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/6.jpg)
![Page 7: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/7.jpg)
![Page 8: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/8.jpg)
![Page 9: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/9.jpg)
![Page 10: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/10.jpg)
![Page 11: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/11.jpg)
Conclusion:it’s difficultwithout anAutopilot
• to hold it steady• to aim the camera
![Page 12: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/12.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/13.jpg)
PRINCIPLES
![Page 14: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/14.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/15.jpg)
What is a servo, how does it work ?
![Page 16: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/16.jpg)
![Page 17: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/17.jpg)
Pitch / roll sensingIR sensors (thermophiles)
![Page 18: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/18.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/19.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/20.jpg)
HARDWARE COMPONENTS
![Page 21: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/21.jpg)
KISS : just plug board between servo’s and receiver(dsPIC30F4012 from Microchip)
![Page 22: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/22.jpg)
Paper adhesive tapeprovides intended point of failure uponimpact(crash tested)
![Page 23: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/23.jpg)
Only 3 things to connect and install
IR sensor Autopilot CPU GPS module
![Page 24: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/24.jpg)
CODE SAMPLES
![Page 25: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/25.jpg)
Input pulse collection:Interrupt on change
![Page 26: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/26.jpg)
Output pulse generation:Interrupt on timer
![Page 27: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/27.jpg)
Flight logic:Continious loop
![Page 28: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/28.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/29.jpg)
TOOLS
![Page 30: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/30.jpg)
PIC Programmer:Velleman K8048 (15€)
![Page 31: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/31.jpg)
Programmer software:Freeware WIN PIC
![Page 32: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/32.jpg)
IDE: free MPLAB available from Microchip
![Page 33: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/33.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/34.jpg)
OTHER AUTOPILOTS
![Page 35: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/35.jpg)
Tompycke.be :a Belgian, 10x betterthen I am at this stuff
![Page 36: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/36.jpg)
Paparazzi:Very comprehensive,open source, starts toget a bit long in the tooth
![Page 37: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/37.jpg)
Attopilot:The best, very recent effort by a dedicated ex-intel engineer
![Page 38: The Kodel, an RC airplane autopilot for aerial photography](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/38.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061104/53fc2e648d7f72aa518b45e3/html5/thumbnails/39.jpg)
Let’s go fly!