Introduction: DIY Arduino Controled Multiwii Flight Controller
Tired of spend money on flight controllers? Wanna customize one or just make your own? Ever wondered how to make a PCB? Are you a techie who is simply bored?
If you answered yes to any of those questions, keep reading.
Step 1: Hardware
I used an Arduino Nano for the processing power and a MPU-6050 for the on-board gyroscope and accelerometer readings.
I just love the combination of the two boards since it's simple yet powerful.
Just about any gyroscope and Arduino combo is sufficient for a minimum build though.
Some other good (but not tested by myself) are the BMP180 and the HMC5883L.
Here is the complete list of compatible hardware.
Step 2: Designing
Download Fritzing. Its good for smaller, simpler circuit designs. It is the most simple and straight forward PCB designing software that I could find.
If you want to use or modify my personal design, download the attachment "myPCB.fzz".
Now look at the attachment "designs.pdf". You can create any of the circuits in this attachment depending on your choice of hardware. It even includes connections for external components like the battery and ESC's.
As a side note, if your desired sensor is not available in Fritzing by default, you can find a design (a .fzz file) online, download it, and drag the file into your project.
Its that easy.
Step 3: Fabricating and Assembly
Their are two ways to go about making the controller from your design. I personally used the first option when creating my PCB.
Option 1: Get it fabricated online
This is the easier option and its more likely that the quality will be better.
I used SeeedStudio with pleasing results. Feel free to use any website of your choice though.
On Fritzing, export your project as a gerber file.
You can double check the design by viewing the gerber files here.
Then create an account on seeedstudio, drag your gerber files into SeeedStudio's fabricate page, and order the number of chips you want.
Option 2: Make it yourself
Export your Fritzing design as a PDF and print it out in the best quality possible.
Then cut your copper clad board to a desired size and shape. Then rub the board with sand paper.
Place the circuit printout onto the copper clad. Take your ironing board, set it to the highest temperature, and apply pressure onto the paper, burning the printout's ink onto the copper clad. Do it with caution and ensure you get the edges too.
Place the copper clad with the piece of paper stuck on on it in a tub of lukewarm water and let it sit for around ten minutes. Then slowly peel the paper off. The printout's ink should show on the copper clad board now.
Using a marker, you can make faint traces of ink a bit thicker if required.
Now wear some gloves and fill a plastic container with water. Add some ferric chloride to the water and stir the solution.
Place your copper clad board into the solution for about half an hour until all the exposed copper dissolves.
Use some nail polish on a cotton ball to remove the ink from your PCB and carefully wash it with water and pat dry with some cloth.
Finally, Drill holes where necessary.
Now solder your components onto your PCB. You may want to 3D print a casing for your flight controller.
Now that you've made your flight controller, lets setup MultiWii.
Step 4: Setting Up the Controllers Multiwii Code
I used MultiWii's code simply because its free, easy to use, and it supports many (most) builds.
Plug in your flight controller to your computer. You should see some of the boards LED's light up and blink.
Open the downloaded MultiWii folder and open the Arduino file called "MultiWii.ino".
Go to the tab config.h and delete the "//" at the beginning of the lines that have type of multirotor you want.
Then a few lines below that, enter the minimum and maximum values of your transmitter.
Uncomment the different sensors you used, and anything else that you find suitable.
Just follow the instructions commented throughout the file.
After that, on the top menu, click on Tools, Boards, and select the Arduino micro-controller you're using.
Then click on Tools, Port, and select the port that your controller is on.
Now upload the code by pressing the button shaped like an arrow.
Your boards should flash a bit and the text "uploaded successfully" should appear on the IDE.
Step 5: Using the Multiwii GUI
Open your MultiWii folder, click on MultiwiiConf, application.windows32 (If using windows), and finally open MultiWiiConf.exe.
On the top left of the window, select the port your flight controller is on and click on start. You should start seeing values from your sensors in the graph now.
On the right, you can select your sensor type and calibrate it by slowly moving the flight controller to each side.
You should see a model of an airplane/ multirotor that moves corresponding to how you move your flight controller too.
Feel free to explore the GUI. Once your satisfied with the configuration, move onto the next step.
Step 6: PID Tuning Tips
Attach your flight controller to your multirotor. You may need to use vibration dampeners to reduce vibrations (I used Double Sided Tape for this). Also assemble all other components like batteries and ESCs.
Set the PID values to default and try to adjust your battery position to get the multirotors center of gravity to the center.
Carefully hold your multicopter so that your gyroscope's readings in the GUI is flat. Then put your throttle to around 50%.
If your accelerometer's readings go crazy, you need to fix that vibration problem.
Now while carefully holding your rotor in a safe place increase your throttle until the multirotor feels weightless.
Put pressure (lean) on each axis of the drone. You should feel resistance against that change. Change the P value until the resistance is notable.
Now rock the drone back and forth while increasing the P value until the drone just starts oscillating. Now reduce the P value a bit. Do the same again, rocking it left and right instead.
The values should be suitable for flight now.
For tuning tips for different types of flight, look at the "Advanced Tuning - practical implementation" section here.
Step 7: Fly!
Feel free to further experiment with the PID values with caution.
A special thanks to robobot3112 for aiding me in setting up my flight controller.
If you think this project deserves it, don't forget to vote, favorite, or subscribe.
Feel free to discuss other possible features, ask me a question, or just comment in the comment section below.
Have fun flying!