How To Use MultiWii as a Servo-Based Gimbal Stabilizer

This post explains the different steps necessary to use a MultiWii compatible board for two axis servo-based stabilization. Many people try to make projects that require stabilization and don’t really want to have to worry about programming; fortunately MultiWii comes to the rescue and helps you get this done fast and even at a low cost. The following tutorial will be based on RobotShop’s inexpensive MWC MultiWii Flight Controller for UAV (Arduino Compatible), but anyArduinowith a compatible accelerometer could be used for this project.

https://www.robotshop.com/blog/en/files/arduino-mwc-multiwii-flight-controller-uav-1-300x300.jpg https://www.robotshop.com/blog/en/files/arduino-mwc-multiwii-flight-controller-uav-300x300.jpg

“MultiWii” is an Arduinoproject that was created to control multi-copters (such as quadcopters, hexacopters and even planes) and was originally based on the Nintendo Wii hand-held remote’s sensor. This project evolved and now features a lot of additional options, and the code has been adapted to work with most major sensors as well. The board we use here includes the MPU6050 sensor from InvenSense which has a three axis gyroscope as well as a three axis accelerometer.
The first thing to understand is that the MultiWii is an Arduino project that is highly customizable, so it needs to be configured to the hardware you use as well as the intended use (flight control, stabilization etc). It’s all done in the Arduino IDE programming environment and for this project there is little to know about it other than how to upload the project to the board.
Here are the steps:

]Download:[list]
]Download and install the USB drivers for your board./:m]
]Download and install the Arduino IDE Software./:m]
]Download the MultiWii_2_3 – MPU6050 – Gimbal – 23-10-2014.zip project and unzip the whole project as it is in a know location on your computer./:m]
]Download and install JAVA if it’s not already on your computer (needed for the MultiWiiConf configuration software)./:m]/
:m][/list:u]
]Open the MultiWii project:[list]
]Open Arduino IDE software/:m]
]In the top menu, click on “File” then “Open” and browse to the known location where you unzipped your MultiWii files. There you can search for “MultiWii_2_3 – FLIP – Gimbal – 23-10-2014/MultiWii/MultiWii.ino”/:m]/
:m][/list:u]

https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWii-Open-300x300.png https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWii-250x300.png

]Configure Arduino IDE :[list]
]Select the type of board that you have (in our case it is the Arduino Pro Mini w/328)/:m]
]Select the COM port for your board (the number may be different from the example shown below)/:m]/
:m][/list:u]

https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWii-Board-273x300.png https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWii-Serial-254x300.png

]Upload the project to your board :[list]
]Click on the arrow pointing “right” just under the top menu of Arduino IDE (shown below in yellow), there should be a progress bar on the bottom with “Uploading” and after some seconds it should say “Done uploading”./:m]/
:m][/list:u]

https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWii-Upload1-250x300.png https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWii-Uploaded-250x300.png

]Connections to the MWC MultiWii Flight Controller (see illustration below) :[list]
]Provide power to the board: it works on 5-6VDC and this supply will power the board as well as the servos. All the GND and +5V pins are linked together on the board./:m]
]Connect the ROLL servo to A1./:m]
]Connect the PITCH servo to A0./:m]
]Connect TRIGGER (if needed, but this requires the use of an RC remote to trigger a camera) on A2./:m]/
:m][/list:u]

https://www.robotshop.com/blog/en/files/MultiWii_2_3-MPU6050-Gimbal-Pinout-298x300.jpg https://www.robotshop.com/blog/en/files/MultiWii-MWC-Connection-300x146.jpg

Once all the steps above are done, you should get movement on your servos connected to A0 / A1 when you move your MWC Flight Controller. You can adjust the maximum / minimum movement of each servos as well as the startup position to be optimal for your application.

]MultiWiiConf[list]
]Open the MultiWiiConf.exe that is located in the same directory that you unzipped your MultiWii files “MultiWii_2_3 – FLIP – Gimbal – 23-10-2014/MultiWiiConf/application.windows32/MultiWiiConf.exe”/:m]
]Select your COM port and click on “START”/:m]
]Click on the “SELECT SETTING” button, this will enable the “SERVO” tab near Top Left of the program/:m]
]Click on the “SERVO” tab and once in that page on “GIMBAL”/:m]
]Now to change those values, just click in the case and the value will change (like a graph bar).[list]
]MID – Middle starting position/:m]
]TILT_MIN – Minimum value for the TILT servo (pitch)/:m]
]TILT_MAX - Maximum value for the TILT servo (pitch)/:m]
]TILT_PROP – The multiplier between the sensor signal and the actual reaction of the servo/:m]
]ROLL_MIN – Minimum value for the ROLL servo/:m]
]ROLL_MAX - Maximum value for the ROLL servo/:m]
]ROLL_PROP – The multiplier between the sensor signal and the actual reaction of the servo/:m]/
:m][/list:u]/
:m][/list:u]

https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWiiConf-Open-300x176.png https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWiiConf-Start-300x176.png

https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWiiConf-select-setting-300x176.png https://www.robotshop.com/blog/en/files/Arduino-IDE-MultiWiiConf-Gimbal-300x176.png

We hope this will get your started with your servo-based gimbal or stabilization project

(Source from RobotShop Blog HERE)

This is my little project so far.

Hopfully it will look like this at the end.

img.photobucket.com/albums/v489/r32combat/OptrisGimbal_zps4377e918.png~original

It is to fit on here

img.photobucket.com/albums/v489/r32combat/Andy/48c36cea-3770-4395-ba6c-1b8856abb607_zpsbcbcf9b4.jpg~original

This is very nice.
Is it as jittery if you don’t have the camera on the gimbal ?

Here is one of mine i did a while ago (sorry for my face…)
It’s driven with the same board…

Yes, my setup is gittery all the time. Any ideas on the cause? I have followed the above instructions.

Jitter come from the servo’s internal mechanics.
There is a positioning PID system inside and it try to keep its position.
If the torque is too high or if the servos are bad quality and/or have play inside it will jitter.

Ah, ok. I have bought some metal geared coreless digital servos to try. The camera weighs 331g, so it’s a bit heavy but the gimbal is well balanced.
I wonder if driving the tilt platform with 2 servos might smooth things out.
Is it possible to mod the software to run 2 servos for tilt, running in oposite directions?

I have considered this a couple of time and don’t really know how.
Some Digital Programmable servo can have the rotation reversed but will never be 100% electronically and mechanically perfect i think.

You can take a look at my thread for the gimbal HERE

Very cool. What did your gimbal weigh?

Honestly, i don’t remember. Don’t think i even weighted it.

Ok, cool. I am maxed out with payload so I am looking at a lightweight gimbal. Maybe 150g

One thing - mine has is a belt & pulley.
This gives the servo gearing down and smooths the system. It will reduce the amount of travel as well.
My servos were programmable so I changed some settings inside such as the maximum travel.

You might want to just go with a bigger servo ? Which brand and model are you using ?

I am looking to use a ‘h-king HK1530A’ from hobby king for the tilt.
I have a ‘GOTECK DC1511SG’ for the roll. As I say, I’ve not tried it with these yet.

I think my issue is power supply. I think I will have to power the servos not from the pcb. I’ll have a play next week and see if that fixes it. Certainly a 9g servo with no load does not gitter but a digital one with load gitters like mad. When it gitters, the LEDs on the PCD flicker too leading me to that conclusion.

Yes, that can be an issue.
The MWC however is only a distributor, Might look at the power source, BEC?

Ah, ok. It’s currently powered from my USB port on my laptop.

Oh… Only USB?
Definitely hook a 5-6vdc source

So I just run 5v and GND to the same row of pins as the servo use to power everything?
For some silly reason I thought it had to be powered via the USB. Can I use 6v instead of 5v? I have a choice on my BEC.

If you take a look at this image, it show the connection. All the GND pins are connected together and all the +5V also.
Signals, of course, are all isolated.

The board take the internal regulator to use what is suplied to any +5V and GND pins. At the same time, all the pins get the same power.
You can go for 6VDC no problem, just be sure your servos can handle it. The board will without problems.

That’s what I thought. Thanks for clarifying.

No problem
Sure it is one of your problem.