To start with the new Hardware set-up you need the following:
- Multipilot32 from www.virtualrobotix.com (more info here: http://www.virtualrobotix.com)
- OILPAN rev H or older revision Foxtrap.
Before you can use the AC32 firmware you MUST solder two pin headers on the connectors shown below. You then need to short them in order to upload new firmware and fly! (you can use an old motherboard jumper plug to short the connector so you would be able to reuse your OILPAN on the old ATMEGA)
- USB to RS232 cable like this one Sparkfun USB to TTL or this: DROIDS USB to TTL
If you have an xbee working on your actual setup, you can use that instead of the USB-->serial, just hook it up to the Telemetry port as usual.
- Telemetry pins soldered on the OILPAN see:
- 4 cables female female to connect the usb adapter to the OILPAN on the Telemetry Port
- a Magnetometer(Optional) HMC5843 or HMC5833L soldered on top of the Oilpan
- a GPS(Optional) like this one: http://store.diydrones.com/MediaTek_MT3329_GPS_10Hz_Adapter_Basic_p/mt3329-02.htm
- a cable for the GPS module like this one (should have come vith your GPS module):http://store.diydrones.com/EM_406_uBlox_Adaptor_Cable_10_cm_p/ca-0001-06.htm
- You also need a bind plug to put the MP32 in firmware upload mode(see later...). Or you can use one female-female cable like the ones posted above.
First download and install software and drivers
Download the latest VRIDE Framework. At the moment it is the 0.0.4.5.7 link here VRIDE.0.0.4.5.7 unzip it and place it in a folder like C:\MP32
- You need to install drivers for your USB to serial adapter from here
- You need to install DFU drivers for your MP32 board. You can find the drivers in the C:\MP32\drivers\mapleDrv\dfu\ folder of the VRIDE just downloaded.
- Download the specifically modified firmware for the OILPAN from here OILPAN firmware. Unzip and overwrite the libraries folder in your C:\MP32 folder and the ACopter32 folder under the C:\MP32\Firmware\ folder
Installing the Mediatek GPS (DIYDrones)
At the time of writing only the Mediatek GPS from DIYDrones with firmware 1.6 is fully tested. The GPS needs to be attached directly on the MP32 board. To do this there are several ways. What I chose was to get a GPS cable adapter like the ones DIYDrones store sells and cut off one end that I solder directly on the board. You could also solder connector pins on both the MP32 and the GPS board and use a 4 wire cable.
This is a picture to explain what I did:
The 1st and last wire of the cable are not used, so you can cut them off. This is the schema on how to connect them:
MP32 | Cable Wire # / Pin | GPS Adapter Circuit Board |
JP19-2 (GND) | (2) | (GND) |
JP19-4 (5V) | (5) | (5V) |
JP19-6 (Ser4 Tx) | (4) | (IN) |
JP19-8 (Ser4 Rx) | (3) | (OUT) |
This is where you will find the JPs on the board:
A picture shows were you can find the connectors:
Compiling and uploading the firmware
Configuring the VRIde
VRIDE is the "32bit version of Arduino". Is based on the LeafLabs? Maple IDE and uses a language much similar to the Arduino framework.
Once your hardware i ready and your drivers are finally set up you can start to open the vrobotix-ide.exe and in File-->Preferences choose the folder where you unzipped the VRIDE rar (eg. c:\MP32)
Then choose from the menu File-->sketchbook the Firmware-->Acopter32 sketch like in the Arduino framework.
This is your new firmware ready to be uploaded. But before we can continue we have to check and modify a few parameters in the code.
Modifying the code before the upload process
To let the compiler know you are using the OILPAN and not the VRIMU we need to make a few changes in the code. Nothing too difficoult.Future developements will not require you to make all this modification, so keep up for the news! So follow these steps:
- Locate the libraries folder in your C:\MP32 folder and open with a text editor like Notepad++ the following files:
- AP_ADC\AP_ADC_ADS7844.cpp: be sure to comment out the #define VRIMU so the line would be //#define VRIMU like this:
//#define VRIMU
- If you have the old compass HMC5843 you have to open the file AP_Compass\AP_Compass_HMC5843.cpp and add a new line at the end of the defines: #define HMC5843 otherwise if you have the most recent mag, leave as it is.
- Open the file AP_IMU\AP_IMU_Oilpan.cpp and comment out the //#define VRIMU and //#define VRMIMUIDG5000 line and add (if not present the line #define IMUOILPAN:
#define A_LED_PIN 69 //37
#define C_LED_PIN 71 //35
//#define VRIMU
//#define VRMIMUIDG5000
#define IMUOILPAN- Open the file AP_IMU\AP_IMU_Oilpan.h and do the same of before: comment out the //#define VRMIMUIDG5000 and add if not present the line #define IMUOILPAN:
#include "IMU.h"
//#define VRMIMUIDG5000
//#define ADC_OBJECT
#define IMUOILPAN
- Locate the folder Acopter32 in the Firmware subfolder (C:\MP32\Firmware...\ACopter32). Then open and modify the following files:
- In config.h:
- locate the //MAGNETOMETER section and modify the #define MAG_ORIENTATION as follow:
//////////////////////////////////////////////////////////////////////////////
// MAGNETOMETER
#ifndef MAGNETOMETER
# define MAGNETOMETER DISABLED
#endif
#ifndef MAG_ORIENTATION
# define MAG_ORIENTATION AP_COMPASS_COMPONENTS_UP_PINS_BACK
#endif
#ifndef MAG_PROTOCOL
# define MAG_PROTOCOL MAG_PROTOCOL_5843 // Default Setting
#endif - locate the "Developer Items" section and modify as follow:
//////////////////////////////////////////////////////////////////////////////
// Developer Items
#ifdef MP32
//#define VRIMU
# define IMUOILPAN
//#define VRMIMUIDG5000
#endif
- locate the //MAGNETOMETER section and modify the #define MAG_ORIENTATION as follow:
- In config.h:
Ok, so now the code is ready to be uploaded.
Uploading the code
- Now Plug the Bind Plug or one female-female jumper cable into the second input from the left of the MP32 (Called JP4_7, JP6_7 and corresponding to the 7th input of the old ATMega).
This is used tu put your MP32 in firmware upload mode. When in this mode (and board powered) you will see a green led blinking on the MP32 board. This means you can start the upload process.
- Plug the USB cable directly into the MP32 USB port. This is used as a power source and as a communication port.
Like the Arduino IDE, before uploading the firmware check that the code compiles correctly by clicking the Verify button. If code compiles, you can click on the Upload to board button.Wait for the completed upload message in the VRIDE message window.
Setting up the firmware for first use
Once the code has been uploaded you will be able to interact with it using the USB-->serial adapter shown above, you have to connect the adapter to the Telemetry port on the OILPAN. To get into the CLI you will not have to switch the slider. This mode is disabled!
You need to use a Hyper Terminal to get to connect to the CLI the first time. This can be found in Windows XP in START-->All Programs-->Accessories-->Communications-->Hyper Terminal. For Windows7 and Vista you need to download the Hyper Terminal program from here:http://www.megaupload.com/?d=J31857IQ. This is the original Windows XP program.
So now that you have the USB-->Serial connected to the telemetry port and Hyper Terminal connected to the COM, power up the MP32 using for example the usb port on it. As soon as you connect you will see a message saying to press S to enter interactive mode. You have five seconds to press S after boot up. This will let you in the CLI mode. Use the the SETUP-->Reset to reset the parameters, configure your radio, level, calibrate ESC as you will do in old ATMEGA chip.
Using the Planner to finish configuration
Once you have done first configuration, you will be able to connect to the MP32 using the AC2 planner found here
For all the rest of the Arducopter Wiki.
Frames supported by the code:
- Quad X mode
- Quad + mode
- Hexa X mode
- Hexa + mode
Features actually not supported by the code:
- sonar is not implemented
- camera mount stabilization is not working
HAVE FUN!!