19
ArduPilot and the Atmega328 Ben Mihevc, Scott Thompson

ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

  • Upload
    lamnhu

  • View
    242

  • Download
    3

Embed Size (px)

Citation preview

Page 1: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

ArduPilot and the Atmega328

Ben Mihevc, Scott Thompson

Page 2: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

Agenda• ArduPilot Overview• History of the Arduino• Architecture Overview

o Atmega328o AVR

• Peripheralso GPS/IMU

• Comparisons• Conclusions• Questions

Page 3: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

What is the ArduPilot?• ArduPilot is an Arduino based autopilot

o A microcontroller to interpret and respond to a number of sensors

• Want to make UAV?o ArduPilot is an Open Source hardware and software

controller• What is open source?

o An open source project is a project licensed under the agreement that all uses of it will be fully documented and free to use.

o No inaccessible black boxes.[8]

Page 4: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

History of Arduino• Released in 2005 for students at a small school in Italy• Massimo Banzi

o Frustrated with BASIC Stamp educational boardsExpensiveLacking Computing Power

o Arduino took a more creative approachSet a goal for $30 per boardNamed after a bar in Ivrea, ItalyThe “Bar di Re Arduino”

arduino.cc

[10][15]

Page 5: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

An Open Arduino• Arduino is the largest Open Source Hardware project

o One of the first real 100% open source boards.o Licenced under Creative Commons as a cultural product

• Exploded for DIY projects worldwide• Not just a company selling boards

o Many other companies make products based off of the Arduinoo Using their open source licence.

[15]

Page 6: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

The Arduino Autopilot• Made by Sparkfun Electronics

o Based off the Arduino architectureso An autopilot to control an unmanned vehicleo Can interface with other computing devicesfor input and output

[8]

Page 7: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

Required HardwareWhat do you need to use this board?•The Board: ArduPilot

o $24.95•A GPS Module: 50 Channel GP-635T GPS Receiver

o $39.95•An Airspeed Sensor: MPXV7002DP

o $24.95•An XYZ orientation sensor: ArduIMU+ V3

o $79.95•Total: $169.80

o Not counting wires and airframes

[2][8][7][9]

Page 8: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

ArduPilot System Overview

[19]

IMU: ArduIMU+ V3

GPS: GP-635T

Airspeed: MPXV7002DP

Page 9: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

ATMega328• 8 - bit AVR CPU• 32 kB Flash Memory • 2kB SRAM • 1kB EEPROM• 20 MHz• 3 Timers• Peripherals

o 23 I/O pins o 8 ADC Channels (10 bit)o 1 SPIo 1 UART

[20]

Page 10: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

AVR Core History• Atmel, first 8-bit Flash microcontroller (1993)

o Eliminated ROM programming during fabricationo Based on Intel 8051

• AVR architecture (1997)o In-System-Programmable memory

• MegaAVR with self-programming Flasho Write to program memory while running from

boot sectoro Increased security: lock bits and encryption

[12]

Page 11: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

AVR Architecture• 8 - bit AVR CPU• Two buses (Harvard)

o Instruction (16bit)o Data (8bit)

• 32 General Registers• Status• Control• 64 GPIO Registers• Watchdog Timer

[5] [20]

Page 12: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

AVR Instruction Set• “AVR Enhanced RISC”

o 16 bit instructionso 131 instructionso Single level pipeliningo 13 Addressing Modes

Flash (Program Memory)Data Memory (SRAM, Register File, I/O Memory)

o 32 single byte registersFirst 32 addresses mapped (0x0000 - 0x001F)

o 64 single byte I/O registersMapped to (0x0020 - 0x005F)

o 2048 bytes SRAMMapped to (0x0100 - 0x08FF)

[20]

Page 13: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

GPS Receiver GP-635T • Made by ADH Technologies• USB, UART, DDC, SPI• Uses U-blox 6 chipset

o 6.5 x 8 x 1.2mmo World’s smallest standalone GPS Moduleo 50 channels

• 35 x 8 x 6.5 mm• Horizontal accuracy 2.5m• Time to first fix (TTFF)

o Hot Start: 1s o Cold Start: 27s

[2][3]

Page 14: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

Inertial Measurement Unit• DIYDrones ArduIMU+ V3

o Inertial Measurement Unit [IMU]o Used to determine 3 dimensional orientation to the

horizon.XYZ OrientationGyroscopes and Accelerometers

o This is the most expensive unit involved in building an autonomous vehicle.

o ArduIMU+ V3 costs $79.95o Also utilizes the ATmega328o Based off Arduinoo 38.1 x 25.4mm [9]

Page 15: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

Comparisons• 3DR Pixhawk

o $199.99 (IMU included)o Relatively Heavy (38g)

• The Raspberry Pio $40 (~120 with IMU)o Relatively Heavy (45g) o Not a dedicated autopilot

• ArduPiloto $24.95 (~$105 with IMU)o extremely lightweight (<20g)

[16][17][20]

Page 16: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

Conclusions• Inexpensive solution to creating an autopilot• Wealth of documentation and instructions• No unnecessary hardware.• Lightweight• Note: To receive telemetry from an aircraft,

communication is neededo Hard wire (not practical)o Wireless (Xbee)o Wait till the end of the flight.

Page 17: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

References[1] "3D Robotics Products," 3D Robotics, [Online]. Available: https://store.3drobotics.com/products. [Accessed 10 12 2013].

[2] "50 Channel GP-635T GPS Receiver," SparkFun Electronics, [Online]. Available: https://www.sparkfun.com/products/11571. [Accessed 10 12 2013].

[3] "AMY-6M - u-blox 6 ROM-Based GPS Module," Alpha Micro Components, 25 10 2012. [Online]. Available: http://www.alphamicro.net/franchises/u-blox/amy-6m.aspx. [Accessed 10 12 2013].

[4] "APM Multiplatform Autopilot," 3D Robotics, [Online]. Available: http://ardupilot.com/. [Accessed 10 12 2013].

[5] "ATmega48PA/88PA/168PA/328P Manual," 10 2009. [Online]. Available: http://www.atmel.com/Images/doc8161.pdf. [Accessed 10 12 2013].

[6] "ATmega328," Atmel, [Online]. Available: http://www.atmel.com/devices/atmega328.aspx. [Accessed 10 12 2013].

[7] "Airspeed Kit with MPXV7002DP," 3D Robotics, [Online]. Available: http://store.3drobotics.com/products/airspeed-kit-with-mpxv7002dp. [Accessed 10 12 2013].

[8] "ArduPilot - Arduino Compatible UAV Controller w/ ATMega328," Sparkfun Electronics, [Online]. Available: https://www.sparkfun.com/products/8785. [Accessed 10 12 2013].

[9] "ArduIMU+ V3 kit," 3D Robotics, [Online]. Available: http://store.3drobotics.com/products/arduimu-v3. [Accessed 10 12 2013].

[10] D. Kushner, "IEEE Spectrum," IEEE, 26 10 2011. [Online]. Available: http://spectrum.ieee.org/geek-life/hands-on/the-making-of-arduino.[Accessed 10 12 2013].

[11] "ATMega328 - TQFP," Sparkfun Electronics, [Online]. Available: https://www.sparkfun.com/products/9261. [Accessed 10 12 2013].

[12] O. J. Svendsli, "Atmel’s Self-Programming Flash Microcontrollers," 10 2003. [Online]. Available: http://www.atmel.com/Images/doc2464.pdf. [Accessed 10 12 2013].

[13] "Using an Airspeed Sensor," DIY Drones, 23 03 2013. [Online]. Available: https://code.google.com/p/ardupilot-mega/wiki/Airspeed. [Accessed 10 12 2013].

Page 18: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

References Cont.[14] J. Vasconcelos, "Brief Guide to the AVR Architecture," Johns Hopkins University, 22 06 2009. [Online].

Available: http://www.cs.jhu.edu/~jorgev/cs333/usbkey/guide.htm. [Accessed 10 12 2013].

[15] "Arduino Products," Arduino, [Online]. Available: http://arduino.cc/en/Main/Products. [Accessed 10 12 2013].

[16] "RASPBERRY PI MODEL B 700Mhz; 512Mb RAM," Amazon, [Online]. Available: http://www.amazon.com/RASPBERRY-MODEL-700Mhz-512Mb-RAM/dp/B009SQQF9C. [Accessed 10 12 2013].

[17] "3DR Pixhawk," 3D Robotics, [Online]. Available: http://store.3drobotics.com/products/3dr-pixhawk. [Accessed 10 12 2013].

[18] "Raspberry Pi FAQ," Raspberry Pi Foundation, [Online]. Available: http://www.raspberrypi.org/faqs. [Accessed 10 12 2013].

[19] ArduPilot 2.x manual, 2009.

[20] "Atmel 8-bit Microcontroller with 4/8/16/32KBytes," 02 2013. [Online]. Available: http://www.atmel.com/images/atmel-8271-8-bit-avr-microcontroller-atmega48a-48pa-88a-88pa-168a-168pa-328-328p_datasheet.pdf. [Accessed 10 12 2013].

Page 19: ArduPilot and the Atmega328meseec.ce.rit.edu/551-projects/fall2013/4-4.pdf · Agenda • ArduPilot Overview • History of the Arduino • Architecture Overview o Atmega328 • o

QuestionsQuestions??