MultiWii is a general purpose software to control a multirotor RC model.
It can now use various sensors but was initially developed to support Nintendo Wii console gyroscopes and accelerometers.
We can find these sensors in the extensions of the Nintendo WiiMote: Wii Motion Plus and Wii Nunchuk.
This project was an opportunity to develop my own software on an Arduino platform.
The achieved stability is excellent for FPV and allows any kind of acrobatics.

The software is for the moment able to control  a tricopter, a quadricopter or a hexacopter.

The tricopter mentioned in this article is mainly is the first tricopter I made, based  on a fiber structure.
The structure was reinforced with carbon/kevlar fiber. Some LEDs were also added for a better flying visibility.

 

Wii components

Wii Motion Plus

A Wii game controller is composed of three accelerometers to determine an angular position, and measure lateral accelerations.
It is enough for most games, but an accelerometer is not very accurate for measuring small variations.
For the most demanding games, Nintendo developed the Wii Motion Plus (WMP) extension which uses three gyroscopes and plugs at the extremity of the game controller.
These three gyroscopes coupled with three accelerometers can determine more precisely the attitude of the controller.

There is extensive information on all the extensions here:
http://wiibrew.org/wiki/Wiimote/Extension_Controllers

On a multicopter, the use of accelerometers is a plus but not necessary if you do not want to keep strictly to its angular position in space.
The measurement of angular velocity is sufficient to ensure good stability.

The extension Wii Motion Plus has numerous advantages compared to other gyroscope sensors:

its cost

Invensense is a manufacturer of electronic components, particularly gyroscopes.
Usually, these components are distributed independently and are relatively expensive.
Example from Sparkfun:
http://www.sparkfun.com/commerce/categories.php?c=85

Invensense manufactures (at least 1 of 2) gyroscopes of the Wii Motion Plus: IDG600 or IDG650.
They seem to have been designed specifically with a probably very low wholesale price.
We benefit directly from this situation in the cost of the extension, especially since there are many Chinese copies that can be found for $10 or $15

its dimensions

The Wii Motion Plus extension is made up of two pairs of 2-axis gyroscopes, (only one axis being used on one gysroscope).
Finally, once the PCB is extracted from the WMP case, there is a set of 3-axis gyroscopes in a small space.
More importantly, they are all mounted on a plane surface without additional PCB.
Copies are not all identical, but the dimensions remain the same.

its integrated ADC

When we want to interpret the value of sensors, we use an analog input and then convert it into a digital format usable by a program. Wii Motion Plus extension includes a 14-bit analog-digital converter.

its communication protocol

This extension communicates with the controller on a I2C bus in fast mode at 400kbit/s.
It’s interesting because this bus coupled to the integrated ADC allows for performing conversion that will not be addressed later by the micro controller.
Moreover this bus uses only 2 data wires.

its performance

At that price, performances are not the best among the existing modern gyroscope. Noise (spurious signals in the absence of movement) is important, but we can find 3 MEMS sensors that outperform the piezo gyros still found in many RC gyroscopes.
Properly filtered, the signal is pretty accurate.
FYI, the must have gyro seems to be the ADXRS610, and at that price it has only one axis :
http://www.sparkfun.com/commerce/product_info.php?products_id=9058

Nunchuk

The Nunchuk (NK) is an extension of a WiiMote which is is composed of three accelerometers to determine an angular position, and measure lateral accelerations.
On a multicopter, the use of accelerometers allows to know precisely the angular position of the model.
With some mathematic used to associate gyroscopic sensors (DCM or Kalman like), it is possible to determine very quickly a PITCH and a ROLL angle.
This feature is used to have an auto stable mode which keeps the model in a horizontal attitude.
Like the Wii Motion Plus, the Nunchuk has also numerous advantages:

its cost

It is even cheaper than a Wii Motion Plus extension. We can find the NK extension for around $10 on ebay.

its dimensions

The PCB size of a Nunchuk is a little bit more important than a Wii Motion Plus one. But the component are still mounted is a flat position.
On some versions (genuine for instance) , it is also possible to cut the button circuit (unused for this project)

its I2C bypass mode

When a Wii Motion Plus is already connected to a WiiMote, the Nunchuk can be directly connected to the Wii Motion Plus in a “half bypass mode”.
It also communicates with WMP via a I2C bus.
In this mode, the Wii Motion Plus handles the communication and supply sensor values (from gyroscopes and from accelerometers) in an interleaving alternate way.
One benefit: the arduino has to handle only one extension, the Wii Motion Plus.

It would be possible to retrieve directly data fro a WMP and a NK with the same I2C bus.
Because they share the same I2C addresses, it would require some extra PIN to select the wires.

Arduino

Arduino Pro Mini

Arduino Pro Mini card is a very small version of the well known classic Duemilanove Arduino.
However, all possibilities remain the same.
It now integrates an Atmel 328p and exists in several versions 3.3V/5V and 8MHz/16MHz.
I chose the most convenient and powerful version : 5V / 16MHz
http://www.sparkfun.com/commerce/product_info.php?products_id=9218

There is no more the USB connection for injecting a program, but it’s always possible to program it with a small USB-Serial adapter sold separately.
http://www.sparkfun.com/commerce/product_info.php?products_id=9115

This board is the heart of the multicopter. It runs the software and interacts with everything: RC, ESCs, sensors.
Note that is is also possible to use other Arduino cards if they include an Atmel 328p running at 16MHz: Arduino nano , Arduino pro, Arduino Duemilanove.
Most Arduino clones should also work.

Arduino Mega based boards

In order to support more functionality and have more I/O PINs, MultiWii was ported on Arduino MEGA boards.

Seeeduino Mega

One of the most interesting compatible board is the Seeeduino Mega.
Even if the calculation power is identical to the Arduino Pro Mini,  there is nearly no limitation in term available I/O PINs with this board.
This board also support an integrated USB port.

Flyduino

In order to reduce the size and match the standard 5x5cm flight control size (size of  Mikrokopter boards), one brilliant man Paul Bake decided to design the Flyduino board.
http://www.rcgroups.com/forums/showthread.php?t=1381577

This board is one of the the best Arduino mega based board for multicopter thanks to its size, and because the I/O matches the exact needs.

size comparison

complete board

Recently, we can find now fully integrated boards, with FTDI+10DOF+GPS on the same board.

 

Third party integration

On screen display

Some OSDs are now compatible with MultiWii code and can display artificial horizon based on MultiWii angle calculation + many more features.

MIS OSD

 

Operating the multicopter

The following explanations are agnostic to the mode used.
So it is relevant for both mode 1 and mode 2, the most commons.

Starting the multicopter

The engine launch is done by tilting the yaw stick right while having the throttle stick in minimum position.
(An alternative method was also introduced recently:  roll stick right while having the throttle stick in minimum position.)
For security reasons, the throttle stick must be set to minimum.
Now motors turn at an idle rate and the tricopter is ready for flight.
If you have no ACC connected (Nunchuk or other indivisual ACC), it is not necessary for the multicopter to be positioned flat, the angle does not matter.
Once armed, multiwii should permanently switch ON the status LED.

Motor shutdown

Motor shutdown is done by tilting the yaw stick left while having the throttle stick in minimum position.
(An alternative method was also introduced recently:  roll stick left while having the throttle stick in minimum position.)
Once disarmed, multiwii should permanently switch OFF the status LED.

Gyroscopes calibration

To calibrate the neutral of gyroscope sensors, you must tilt the yaw stick left, tilt the pitch stick back while having the throttle stick in minimal position.
The multicopter should not move during this stage. However its inclination has no influence.
The status LED will blink to confirm this step.

Accelerometers calibration

This step is relevant only if you have a Nunchuk or an individual ACC.
The multicopter inclination should be as horizontal as possible during this step.
To calibrate the neutral of accelerometer sensors, you must tilt the yaw stick left, tilt the pitch stick back while having the throttle stick in maximal position.
This step must be realized at least once, the acc calibration is then stored in the EEPROM.
This step can also be realized directly from the GUI via the CALIBRATE button.
Note this step is very important and is one of the most common issue we can see in feedbacks, please don’t skip it.
If this step is not correctly done, the status LED will blink forever and you won’t be able to arm the motors (security).
The status LED will blink to confirm this step.

Accelerometers trim

With the help of your roll and pitch stick you could now trim the ACC mode.
You must first put the throttle stick in maximal position. (obviously with motors disarmed)
full PITCH forward/backward and full ROLL left/right (2 axis possibilities) will trim the level mode according to the neutral angle you want to change.
The status LED will blink to confirm each ticks.

Some pictures of the first MultiWii tricopter

 

RC equipment used for it

What Reference
Motor 3x Hobbycity Turnigy 3020 Brushless Outrunner Motor 1200kv
- alternative motor 3x Hobbycity Turnigy 2204-14T 19g Outrunner
controller 3x Hobbycity Hobbyking SS Series 8-10A ESC
- alternative controller 3x Hobbycity Turnigy Plush 10amp 9gram Speed Controller
LED 1x Hobbycity Turnigy High Density R/C LED Flexible Strip-Green
Propeller 3x Hobbycity GWS EP Propeller (DD-7035 178x89mm)
Servo 1x Hobbycity Turnigy MG90S Metal Gear Servo 1.8kg
Battery 1x Hobbycity Turnigy 1300mAh 3S 25C Lipo Pack

We can of course take a different configuration for a larger tricopter.

Internet is full of examples.
One example of several working setup: http://warthox.bplaced.net/?page_id=76

Here is a consumption/thrust measurement realized by Joël on the current setup:

Video

Where can we find the components ?

The arduino pro mini, USB interface card and the LCD are available at sparkfun.
Wii Motion Plus extensions are widely available on ebay.
The RC elements are all available at hobbycity.