Lets build an Arduino based flight controller that can do wireless PID tuning, Orientation lock and altitude hold and position lock with the help of A GPS. Ok So this DIY flight controller is an educational Arduino based module. It's simple to make, easy to program and is a great project for experienced hobbyist like me. The program is open source and easy to configure.
This Flight controller will have features like those of NAZA and APM the only difference here is the PID wherein you will need to be patient in getting your drone tuned. To make tuning easier I included a Bluetooth module to ease the tuning step with out the use of your computer.
NOTES ABOUT THE BUILD
You Will learn how to fabricate PCB's! Always check your connection.
Why make one?
Because I'm board and I dont have time going to hobby shops and just to find that its out of stock. + I have dozens of these sensors, why not make your own right? there is the excitement and rewarding feeling as you finish the project.Lastly you get to understand whats going on the flight controller.
I guess I'll cost this by the amount i've spent this week for this project only
1x pre synthesized PCB 6x6cm almost 1.8$ here in the Philippines
3x 1mm Drill bit $1
1x Gizduino Mini $8.58
2x Pinheaders 1$
Proceed to the next step for more price info
Step 1: Parts and materials
As I started arduino 3 years ago I guess I've piled up some extra sensors such as the MPU6050 , BMP180, and the HMC5883L now getting frustrated of my old Flight controller for my quadcopter I decided to make my own similar to those of MULTIWII "CRIUS SE"
So here are the main parts
An Arduino mini.... or something similar like mine from our local electronics shop exclusive on in the Philippines
I got these sensors for 22.31$ only!
1xBMP180 or 085
1x Bluetooth module HC 05 or HC02
1x TTL converter such as the FTDI programmer module
2x Pin headers 1x40
1x pre synthesized PCB 6x6cm
A lot of female to female wires~
TOOLS and Chemicals FOR PCB fabcrication
1mm Drill bit
Exposure lamp or 10W florescent lamp
2x small Glass Plates "see through"
2x Containers big enough for the PCB and chemicals
Step 2: Understand the connection
Important pins to enable Sensor communication the I2C pins "A4 asSDA" and A5 as "SCL"
As you connect your sensors you will need to connect each pin to the same pin on the arduino mini
Example "Sensor SDA" to "ARduino SDA A4" ... then Sensor SCL to Arduino SCL
Easy right? Just remember All sensors must connect all of their SDA and SCL pins to the proper terminals on the arduino mini
To enable Motors~
D3 for the 1st motor
D10 for the 2nd motor
D9 for the 3rd Motor
and D11 for the 4th motor
To enable controller inputs
(ROLL) AIL D4
(PITCH) ELE D5
(YAW) RUD D6
AUX2 D12 (optional)
Do not use 7805 regulators USE a 5V UBEC
UBEC is an efficient Voltage regulator that can handle more than 7805
Connect the + and - to the respective terminals on the arduino board.
Step 3: Redesign the PCB if you'd like
Download the RaR file and open up your eagle CAD if you are using a Legit Arduino mini cuz you will need to redesign the connection
If you live in the Philippines and you have the same parts just like mine feel free to skip this step.
NOTE for your MPU6050
Y AXIS is your forward direction!
Step 4: PCB fabrication first
To Tell you the truth this is not the hard part of this build its actually easy as long as you follow the steps.
Prepare the following
Print out the PDF in HIGH Quality
Prepare the baby OIL
Prepare pre synthesized PCB 6x6cm
Prepare a container filled with ferric Chloride
Prepare a container with developer powder ... 3 tsp developer 1cup tap water (agitate until the powder dissolved)
Prepare 10 Florescent lamps
1.Cut out the PCB layout and apply a small amount of baby oil and gently spread the fluid around the paper.next gently remove any excess baby oil by wiping it with any cloth
2.Get your pre synthesized PCB 6x6cm, Remove the film and place the print side of the paper facing the green side of the PCB "that is important". Get your glass plate and stack the PCB and paper in between.
3.Get your florescent lamp and Elevate by at least 3 inch
4.Get your Phone-> clock and then Timer... Set it to 5 minutes
5. Place the GLass plate with the PCB under the Florescent lamp and immediately turn on the time and the lamp..Turn the lamp of as your phone rings.
6. Remove the glass and the paper go to the sink and run the exposed PCB with running water make sure the oil is removed.
7. Get your container with the developer solution dip the whole PCB "Copper side facing you" and agitate untill the ink is removed
8. Rinse the PCB again with water to remove the developer solution on it
9. Get your Container with Ferric Chloride and dip the PCB until unwanted copper is removed.
10. DONE!! all you have to do now is to drill the holes.
Step 5: PCB done whats next?
Get your soldering Iron and start assembling duhh....
Step 6: Casing
Now printing a casing is highly suggested because your barometer sensor is sensitive to external factors like air and temperature.
1 Print a casing
2 Cut a small sponge and glue it near the Barometer sensor "do not glue the barometer sensor as is" apply hot glue on the sides only just to make the sponge act as a filter.
Step 7: Lets start Testing!
Connect the following onto the flight controller. The HMC5883L, TTL converter, and might as well connect the wire to the receiver module.
To start initial testing connect your FC to your computer.... the Arduino mini should light up as well as the MPU 6050 after that its time download some stuff over the internet.
Multiwii arduino program and and Multiwii Config
And the latest ARDUINO IDE which you probably have.
1. Open the Multiwii.ino inside the Multiwii Folder once done go to the tabs within the arduino program and go to "config.h" this is where you will start
2. Scroll down and follow through from //#define QUADX to "#define QUADX only" removing the "//" uncomments the line
3. scroll down and uncomment #define MINTHROTTLE 1064 if you are using SimonK ESC and add // to the default setting which is #define MINTHROTTLE 1150 // (*) (**)
4. scroll down a little #define MAXTHROTTLE 2000
5. #define I2C_SPEED 400000L
6. Combined IMU Boards -> uncomment //#define GY_521 to #define GY_521
7 sroll down I2C barometer and uncomment //#define BMP085 to #define BMP085
8. I2C magnetometer uncomment //#define HMC5883 to #define HMC5883
9. Once done Go to Arduino Tools on the upper left -> Board -> Duemilanove or UNO depends on your arduino MCU.
10. Tools and then set your port where the Flight controller is connected.
Step 8: MULTIWII
Now that you are done uploading its time to use the Multiwii GUI
Open the MultiwiiConf folder
application.windows32 for Windows 64bit or 32bit do not use the application.windows64 since it is not working
1.select com port where the flight controller is connected and click on "start"
after that it should now have readings .
2. To make the dashboard move calibrate the Acc first by putting your FLight controller on a flat surface and hit the calibrate ACC leave it for 10 seconds or so and then calibrate your Magnetometers, After clicking CALIB_MAG you are given 30 sec to rotate your Flight controller in all axis make sure it reaches 360 rotation.
3. Once done explore the GUI and proceed to the next step.
Step 9: Replace that old flight controller
Let lessen the detail and just get to the point here
Replace your old flight controller in my case CC3D
Install your DIY Flight controller
Position your Magnetometer somewhere on the frame wherein its not affected by the motors or battery.
For Bluetooth Programming replace the FTDI programmer with an HC 05 or HC 02 Bluetooth module Note that some BLuetooth modules need to be reconfigured to 115K baud for it to work
Step 10: Program your Drone with your phone!
Programming with a Wire sucks lets go to the next level which is a lot better
Download this on your android phone
For apple devices try looking for some multiwii programs because I have no idea about apple~
This app is very useful, It eliminates all the drag of bringing a laptop and tuning it on the field and then testing the values all over and over again through a "cable and a laptop" ..that sucks. So here I wish you a safe flight and have nice day!
BTW For me the hardest part to tune here is the barometer or ALT HOLD PID nonetheless everything can be search through Youtube and Google for PID tuning tips and tutorials.
Step 11: Go FLY!
Fly safe guys dont fly your drones on streets or crowded areas, Tune your drone on an open area like a soccer field or something.
Step 12: Video~
commin right up