We got back into Adruino after reading up more and seeing that a lot of improvement from the now junk we had back in 2011. We tried out the Multiwii Pro with MTK GPS from Hobbyking.
Here’s a as-of-24-July-2014 Guide that worked for us. All version number/ information are as of writing.
It is still tedious but the information seems a little more tidy and conscience now.
Relax, Watch
Watch this in full:
then
If you have an hour….
Downloads
Go to http://arduino.cc/en/Main/Software
Download and install the Windows driver, version 1.0.5r2 (direct link)
Download and install the MultiWII software, version 2.3 (it is 2.3pre8 as of writing in July 2014, DO NOT use 2.2) (direct link)
Download and install Drivers http://www.ftdichip.com/Drivers/CDM/CDM20814_WHQL_Certified.zip http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx oh we can remember clearly even the driver step was a chore in the past! Anyway, not the point for now. Just download and install that.
Begin
Connect the board.
Start Adruino
Tools > Board > Adruino Mega 2560 or Mega ADK
Then Tools > Serial Port
Choose Open, open the MultiWII 2.3 downloaded above > MultiWII folder and select the multiwii.ino file. All the other files will be open on it’s own. Then on the right drop down list, choose config.h
Frustration Starts…
After going through almost every step, we found our motors to spin at different speeds. Like this:
http://www.youtube.com/watch?v=gnHce81oxoQ
So, clear EEPROM using Adruino > File > Example > EEPROM > clear_eeprom
Then Load the ones we had. The settings are below.
Define IMU
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\mega C:\Users\ETEGRA~1\AppData\Local\Temp\build9069521682101027775.tmp\IMU.cpp -o C:\Users\ETEGRA~1\AppData\Local\Temp\build9069521682101027775.tmp\IMU.cpp.o
IMU.cpp: In function ‘void getEstimatedAttitude()’:
IMU.cpp:189: error: ‘GYRO_SCALE’ was not declared in this scope
Solution > Go back to config.h and select the FFIMUV2.
Define GPS Config – Enable GPS – http://www.hobbyking.com/hobbyking/store/uploads/201779733X365809X32.pdf
/**************************************************************************************/
/*********************** GPS **************************/
/**************************************************************************************//* GPS using a SERIAL port
if enabled, define here the Arduino Serial port number and the UART speed
note: only the RX PIN is used in case of NMEA mode, the GPS is not configured by multiwii
in NMEA mode the GPS must be configured to output GGA and RMC NMEA sentences (which is generally the default conf for most GPS devices)
at least 5Hz update rate. uncomment the first line to select the GPS serial port of the arduino */#define GPS_SERIAL 2 // should be 2 for flyduino v2. It’s the serial port number on arduino MEGA
#define GPS_PROMINI_SERIAL // Will Autosense if GPS is connected when ardu boots.// avoid using 115200 baud because with 16MHz arduino the 115200 baudrate have more than 2% speed error (57600 have 0.8% error)
#define GPS_BAUD 57600/* GPS protocol
NMEA – Standard NMEA protocol GGA, GSA and RMC sentences are needed
UBLOX – U-Blox binary protocol, use the ublox config file (u-blox-config.ublox.txt) from the source tree
MTK_BINARY16 and MTK_BINARY19 – MTK3329 chipset based GPS with DIYDrones binary firmware (v1.6 or v1.9)
With UBLOX and MTK_BINARY you don’t have to use GPS_FILTERING in multiwii code !!! */#define NMEA
Enable PPM – We are using the 9XR with FrSky modules.
/**************************** PPM Sum Reciver ***********************************/
/* The following lines apply only for specific receiver with only one PPM sum signal, on digital PIN 2
Select the right line depending on your radio brand. Feel free to modify the order in your PPM order is different */
//#define SERIAL_SUM_PPM PITCH,YAW,THROTTLE,ROLL,AUX1,AUX2,AUX3,AUX4,8,9,10,11 //For Graupner/Spektrum
#define SERIAL_SUM_PPM ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4,8,9,10,11 //For Robe/Hitec/Futaba
//#define SERIAL_SUM_PPM ROLL,PITCH,YAW,THROTTLE,AUX1,AUX2,AUX3,AUX4,8,9,10,11 //For Multiplex
//#define SERIAL_SUM_PPM PITCH,ROLL,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4,8,9,10,11 //For some Hitec/Sanwa/Others// Uncommenting following line allow to connect PPM_SUM receiver to standard THROTTLE PIN on MEGA boards (eg. A8 in CRIUS AIO)
#define PPM_ON_THROTTLE
Then connect receiver to Channel 1 of the MultiWII pro. Test direction and see if they are reverse.
Immediately Calibrate ESC after this
http://www.multiwii.com/forum/viewtopic.php?f=13&t=3852
1. Undefine that comment like you did.
2. Unpower everything and remove props.
3. plug in battery while transmitter is full throttle with transmitter on
4. quickly after hearing a beep, reduce throttle to zero
5. listen for the beeps to notify you of a successful calibration, if not start over.
6. do not unplug battery
7. plug in USB
8 put the // in front of #define ESC_CALIB_CANNOT_FLY
9 upload sketch
10 unpower everything
We are used to not have the motors spin immediately after arming and so
http://www.multiwii.com/wiki/index.php?title=Config.h#Motor_and_servo_special_configuration
/* motors will not spin when the throttle command is in low position this is an alternative method to stop immediately the motors */ #define MOTOR_STOP /* some radios have not a neutral point centered on 1500. can be changed here */ #define MIDRC 1500
Arming Switch
We chose to use a switch on the 9XR, specifically the AIL as arming.
Just go into the WinGUI 2.3 pre 8 > RC Control Settings > Set AUX2 High to Arm
Modes
http://www.multiwii.com/wiki/?title=Flightmodes
Now we see why the Naza is so popular. MultiWII does gives you options and it’s hell a lot of options with different combinations for all your switches on your transmitter. If you want, you can certainly combine a lot to the MultiWII modes but we simply needed something vis-a-vis the Naza.
One 3 Position for:
1. GPS – Gyro, Acc, Mag On
2. Altitude Hold/ Horizon – Gyro, Acc, Baro On
3. Manual – Gyro On Only.
2 Position switch for:
a. Off
b. GPS Hold – Gyro, Acc, Mag On
2 Position switch for:
a. Off
b. GPS Return to Home – Gyro, Acc, Mag On