View Single Post
Old Apr 28, 2012, 09:43 AM
markusb2 is offline
Find More Posts by markusb2
Registered User
Kalmar, Sweden
Joined Apr 2009
63 Posts
Mini-HowTo
MultiWii, Clone WM+ with ITG3205 gyro and a Nunchuck clone with ADXL335 acc chip

This is a mini-howto regarding the rebuild of my TriCopter that was using KK-board before.

This time Im trying out the MultiWii concept as I want level stabilisation as I plan on getting into FPV. I think level will help me alot when learning FPV.

I hade alot of problems soldering together all cloned bits and pieces and trying to get them to work.
All info needed was found on the web, but spread out on various sites/threads that made it very hard to find.
After 12 hours of soldering, reading forums, searching solutions, testing, playing with GUI and so on I got it to work.

I hope this guide can be of use to people with similar set-up problems.




My way of connecting and setting up a clone WM+ with ITG3205 gyro and a Nunchuck clone with ADXL335 accelerometer to the Arduino Pro Mini.


It took me alot of trial and error and searching various forums and threads to get an idea of how to make this work.
Im putting this text together to supply the needed info in just one place, making it easier for people with similar problems to get up and running.


Hardware:
Old TriCopter with its guts ripped out (KK board) The tri is based on rcexplorers build.
Arduino ProMini 5V/16MHz
FTDI breakout board
Clone Wii Motion + with ITG3205 gyro chip
Clone Nunchuck (Nunchuck G edition v1.1 marked on PCB) with ADXL335 accelerometer chip


Original Nunchuck does not work with this setup (only tried SDA/SCL mode) nor does SDA/SCL connection of the clone Nunchuck. ADXL335 clone nunchuck must be connected in analog mode to arduino!


Connecting the WM+ the standard way (using only the original connectors solder pads on the PCB) makes the output to GUI to strong/sensitive. Direct connection of SDA/SCL to the ITG3205 chip makes good readings in GUI.
Connecting the clone or original nunchuck in SDA/SCL mode gives no output at all from the nunchuck to GUI!
Tried removing pullup resistors, feeding +3V and +5V and so on but nothing worked for me.


Only way (for me) to get this to work is a clone nunchuck with ADXL335 chip connected in analog mode to A1, A2 and A3 on Arduino. Power the nunchuck from WM+ 3V by the pullup resistors. WM+ is powered by the arduinos pin 12, but this is not needed in direct connection mode and 5V can be taken from arduino VCC instead.
The VCC is more stable than pin 12 from what I read on forums.






Mount the boards in the directions shown on multiwii.com.
Connect them as my image shows.
Change the following parameters and it should work good, or at least get you started with sensor tuning.


/* The type of multicopter */
#define TRI

Disable pullups
//enable internal I2C pull ups
//#define INTERNAL_I2C_PULLUPS




//#define YAW_DIRECTION 1 // if you want to reverse the yaw correction direction
#define YAW_DIRECTION -1




//if you use independent sensors
//leave it commented if you already checked a specific board above
/* I2C gyroscope */
#define ITG3200



/* ADC accelerometer */ // for 5DOF from sparkfun, uses analog PIN A1/A2/A3
#define ADCACC




//if you want to change to orientation of individual sensor
#define ACC_ORIENTATION(X, Y, Z) {accADC[ROLL] = -Y; accADC[PITCH] = X; accADC[YAW] = Z;}
#define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = -X; gyroADC[PITCH] = -Y; gyroADC[YAW] = -Z;}
//#define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = X; magADC[PITCH] = Y; magADC[YAW] = Z;}








If TX (radio transmitter) stick moves the tail servo (TRI) the wrong way, but Arduino compensates the right way, do not reverse YAW in TX (you will reverse all stick programming to) but instead change the following lines (changes needed marked with red color):


//#define YAW_DIRECTION 1 // if you want to reverse the yaw correction direction
#define YAW_DIRECTION -1


TO THIS:
#define YAW_DIRECTION 1 // if you want to reverse the yaw correction direction
//#define YAW_DIRECTION -1






ALSO CHANGE THIS:
//if you want to change to orientation of individual sensor
#define ACC_ORIENTATION(X, Y, Z) {accADC[ROLL] = -Y; accADC[PITCH] = X; accADC[YAW] = Z;}
#define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = -X; gyroADC[PITCH] = -Y; gyroADC[YAW] = -Z;}
//#define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = X; magADC[PITCH] = Y; magADC[YAW] = Z;}


TO THIS:
//if you want to change to orientation of individual sensor
#define ACC_ORIENTATION(X, Y, Z) {accADC[ROLL] = -Y; accADC[PITCH] = X; accADC[YAW] = Z;}
#define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = -X; gyroADC[PITCH] = -Y; gyroADC[YAW] = Z;}
//#define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = X; magADC[PITCH] = Y; magADC[YAW] = Z;}






Some servos goes CW with rising input and some others goes CCW with the same input.
If the servo behaves the wrong way, try changing Z/-Z in gyro orientation and YAW 1/YAW-1


Connect RX (radio receiver), servo and motors as described on multiwii.com


After getting good readings in GUI and gyro/acc compensation working the right way, go ahead and follow the setup and adjustment guides others have written.
markusb2 is offline Find More Posts by markusb2
Reply With Quote