Saturday, 5 April 2014

MultiWii 328P Flight Controller with FTDI & DSM2 port (MWC_328P)

I've been waiting a while to get my hands on one of these flight controllers, but the airmail shipping times from the US to Singapore seem quite variable. Luckily, I know a student at Nanyang Technological University who was able to buy one through his department and meet up in a Changi car park to exchange goodies. Very clandestine. Thanks Sherman.

So, in essence, this is a circuit board that tries to incorporate the various sensors needed to stabilise a remote-control aircraft in flight. There is a three-axis compass from Honeywell (HMC5883L), similar to the ones found in mobile phones. The Bosch barometer (BMP085) should be able to detect an altitude change of 25cm, although these devices are susceptible to wind and vibration. An InvenSense three-axis gyroscope (ITG3205), similar to the one found in Nintendo Wii game controllers, measures angular velocities down to about one-tenth of a degree per second. Finally, a Bosch three-axis accelerometer (BMA180) is used to detect changes in tilt.

As a group, the sensors are pretty good selection of low-cost components. The board sells for less than US$30 at HobbyKing, which is a bit of a bargain.

As you can see, the board has a USB port for serial communication, enabled by the FT232RL USB to serial UART interface (U2). This can be used to program the microcontroller through the Arduino IDE, or through avrdude directly, if you prefer.

This setup of microcontroller and USB is similar to the Arduino Duemilanove, and so in the Arduino IDE you need to choose the board "Arduino Duemilanove w/ ATmega328" or the equivalent from the tools menu before uploading. If you forget, you'll be presented with sync errors.

From avrdude, the only points to remember are setting the correct baud rate (57600) and mcu (atmega328p):

avrdude -F -V -c arduino -p atmega328p -P /dev/ttyUSB0 -b 57600 -U flash:w:blinkenlights.hex

U2 - FT232RL - USB to serial UART interface
U3 - ATmega328P - AVR microcontroller
U4 - [marked IL341] - 3.3V regulator
U5 - HMC5883L - 3-axis compass
U6 - BMP085 - pressure sensor
U7 - ITG3205 - 3-axis gyro
U8 - BMA180 - 3-axis accelerometer
U9 - TXS0102 - 2-bit bidirectional voltage-level translator (hidden in this photo behind the white plastic Spektrum satellite connector

There are two main collections of pin headers directly connected to the microcontroller. The pins to the right of the USB connector are connections for the RC receiver. The pins below the microcontroller are signals for the motors (on the right), and three columns of pins on the left for stabilising a camera mount.