-
Notifications
You must be signed in to change notification settings - Fork 2
Hardware
(written by Jordi Munoz)
- The !ArdupilotMega Board is also known as: APM, the red board, the controller, the main board or the master board. This board is manufactured by !SparkFun.
- The !ArduPilotMega Shield/Oilpan is also known as: APM Shield, APM Oilpan, the oilpan, the shield, the sensor board, the blue board or the slave board. This board is manufactured by DIYdrones.
Front of the board:
http://ardupilot-mega.googlecode.com/svn/ArduPilotMegaImages/d972wmb_2f33fzqft_b.jpg
Back of the board:
http://ardupilot-mega.googlecode.com/svn/ArduPilotMegaImages/d972wmb_3htt634d2_b.jpg
Normally, you will be powering the board from your RC system, either through the RC receiver channels connected to !ArduPilot Mega or through your ESC connected through the throttle out channel on the !ArduPilot Mega board.
However, the APM board also has its own onboard power supply so you can power it with a separate battery (if, for example, you are not using it with an RC system, or want to isolate APM power from your RC system's power). You can do this by unsoldering the SJ1 solder jumper (shown below) on the APM board and connecting a battery (ideally a 7.4v 2s pack) directly to the +- holes shown. The built-in 5V power regulator (LM317) is capable of handling peaks of 1A.
http://ardupilot-mega.googlecode.com/svn/ArduPilotMegaImages/apm14power.jpg
The 5V power line that goes to the rest of the components of the boards (like the Atmega1280, Atmega328, LED's, multiplexer, etc) has a resettable fuse in-between, which will trip if the current exceeds 500mA (it will reset with you power down the board). The separation of the fuse from servos and the ICs allow us to use high current servos without accidentally activating the fuse, which would of course kill all the electronics on board. Just imagine your airplane flying like that... :S The idea of the fuse is to save your board in case you make a short circuit... In the older version of the Ardupilots more than one had this accident, including me...
The next diagram show you the parts I'm talking about:
http://ardupilot-mega.googlecode.com/svn/ArduPilotMegaImages/Drawing1.png
The heart of Arduino Mega is the Atmega1280 microcontroller from Atmel, which has 128kB of flash memory and lots of pins!
This monster has 4 x 16-bits Timers with 3 independent output captures (PWMs) and one Input Capture for each Timer. With some coding tricks we were able to use one timer with 2 output captures and 1 Input captures. The Output captures are used to generate pulse width modulations to control servos, and the input capture is used to decode either PWM signals or PPM signals. In this case we used one timer to decode a PPM signal coming from the Atmega328p that works as a 8channel PPM encoder (We killed 8 birds with 1 shot, actually 10 birds, you will know why later) and the other 2 output captures were used to control servos... We only used 2 output capture for each timer (In total 8 output captures were used) and one input capture to read 8 servo inputs encoded in a PPM frame... In other words we are able to read and write 8 PWM channels by using less than 1% of the CPU power. ;-)
The board also has an ADC with 16 channels and a so-so resolution of 10-bits. These pins can be also used as digital IO pins. We also included spare digital I/O pins, four serial ports (one used for programming and one with a standard EM-406 GPS connector).
With the APM IMU shield, the four serial ports are used as follows:
Port 0: | USB |
Port 1: | GPS |
Port 2: | Dataflash |
Port 3: | Xbee/telemetry |
The Atmega 1280 comes programmed with Arduino Bootloader, but you can mess with the microcontroller internal settings anytime by using the SPI port.
APM board:
A spreadsheet showing all the pin mappings and functions is here