Author Options:

Guidance & Info about Quadcopter Project? Answered

Greetings lads,

I'm new in forum and since I made some research the past days I'd like to get some guidance about constructing & programming a Quadcopter from scratch since I'm completely new on a project like that.

Quadcopter Frame: Thinking about to construct an aluminum 70cm diameter frame which will weight around 500g. What kind of motors should I get in order the frame with the board,motors etc. will be able to lift?

Board: I'm thinking to use Arduino Uno or Raspberry Pi 2.0 ( With a little bit of research I made I conclude that Raspberry could make my life a little bit easier since you can add wifi on it. The quadcopter will be controlled via a pc/laptop through wifi). What can you suggest and why?

ESC: As far as I've seen in most of similar projects people using ESCs in order to control the motors throttle. Can you avoid that, with programming PIDs that make the same job in order not to use more hardware?

About PIDs and Code in General: Thinking about to simulate the whole project in Simulik, Matlab and somehow (if it's possible) to convert the Matlab Code into C++ and download it on the chip. What do you think about that?

About the whole project: I'm trying to minmize the hardware as much as it's possible (use only 4x motors, the board with the chip on it, cables and probably some sensors) in order to minimize the total weight of construction and ofc the price.

That's all for a start. I'm gladly waiting for your answers and ideas.

Cheers  :)



3 years ago

If you really want to develop your own flight controller with arduino, I would still say just pick up a multiwii SE v2.5 and flash your homemade custom firmware to it, taking into account what data is being fed back from the gyro and accelerometer. Once you get that data from the sensor, and you can control the 4 ESCs using the servo library, since they both rely on the same PWM signal.

Now, there will be a need to know a LOTTT of physics, a LOTTT of calculus, and a LOTTTTT of trigonometry, and a LOTTT of closed-loop control theory.

To make a decent feedback control mechanism to take the data from the sensors and make corrective actions in the speed of the ESC, you need to program in a negative feedback loop with a certain, experimental level of gain, for pitch, roll, and yaw. Remember, that the data from the gyro's is a derivative of the actual amount of roll, pitch, and yaw of the quad in the air as well as the speed of the drifting. It also is the 2nd order derivative of the absolute position of the quadcopter in the air. SOOO you will need to use the second fundamental theorem of calculus to integrate that, so you end up with an approximation of the actual position of the quadcopter in the air. As you can probably imagine, you know that +C constant that you always end up with after integrating? Well that is lost information, With just the data from the gyro, we cannot know how the quadcopter is tilted in-flight, only foe fast the tilt is changing over time, since the beginning of flight, when you arm the board. You, yourself, becomes part of the feedback control to keep the quad from drifting like crazy and keeping it stable. Thats why acro mode is difficult to control and cannot self-level itself. If you think about it hard enough, how integration works and all, you can understand why that is!

Anyway, I am sure you know that PID stands for:

Proportional (described above), which directly figures out (by integrating) the tilt of it in the air, and corrects for it proportionally. This is simple: More offset = more correction. The gain is like sensitivity, how sensitive this is to offset. Too high, and it will oscillate, as it keeps overcorrecting. (This is the only control that is required to fly. the I and D are more optional, and just improve things.)

Integral (not the same as what I described up there ^^^) Will integrate the steady state errors, and will gradually increase and increase the amount of correction until the offset is reduced or minimized. Again, you need to have a good understanding of how integrals work to understand this! So if the gain in the proportional is not getting the job done, after a while, the integral will step in more and more to fix that!!!

Derivativecontrols the speed of the motors by figuring out how FAST it is falling out of balance, and correcting that with the speed of the motors accordingly. (it does not care about how tilted it is currently, just how fast things are causing it to change, and correcting for that.) Thus, it sort of maintain level, but if it fails to correct for a offset, then it will maintain the new offset, and not correct it. Thus it is what acro mode is like, where you have to fix that.


Sorry this is getting really long, but one last thing: I believe these 3 P, I, and D controls are multiplied to each other, like (P)(I+1)(D+1) so that when I and D are zero, the P still works, since obviously multiplying to zero means zero feedback. As the P and D kick in to do stuff though, then they will have an effect! And as I said with trig; you do need to have a deep understanding of the output of the gyro, the data from the X, Y, and Z, and translate that to corrections in the 4 motors. I do not even know what math is required to do that, but I do know it will involve vectors and stuff! So absolutly do not take my word for it, I am just explaining the basic functioning of the PID, so you at least know where you want to start.

First of all before doing anything I will make a simulation via Simulink on Matlab of the whole construction (motors/PIDs etc) . Since I found raspberry pi 2.0 more efficient for what I want to do, I can load matlab in it and test how motors, throttle, pitch and roll react real time.

Secondly during my research in web I found that ESCs are actually PIDs controllers but in a board. So I question my self that I could remove the useless hardware and make a PID for each motor which will work the same.

Since Matlab is a powerful tool and I've worked with it a lot i can realize that all the above are possilbe. Mathworks has a demo simulation about making & programming a quadcopter so i guess the info leads me in a similar solution.

Thanks for your time and info m8

Cheers :D

This is where I learned a lot about PID stuff: The creator of that video has done LOTS of work with control theroy. It is all applied here with quads!

There is not a lot you can do in the way of removing hardware from existing boards. You are only eliminating a insignificant amount of weight. Most the weight is in the battery, motors, and wires. You can always download Eagle CAD software, design your own PCB, and send it off the gerber file to a PCB manufacture


3 years ago

Trying to design your own flight controller yourself will be a very huge challenge. There is a board called the Multiwii, which is an arduino board that already has all the necessary sensors on it. The basic version has an MPU6050 gyro and accelerometer, and the code for it is open source and downloadable.

I believe there is a bluetooth module for it available, along with a screen, GPS (which I already have), and other peripherals. Believe me when I say that board is hard and time-consuming enough to get to work properly as is.

The problem with building EVERYTHING from scratch, is that it makes it near impossible to figure out why it does not work, or is not stable. Things like the multiwii have been developed by others over a long time span, and have been continuously improved and expanded upon.

As I mentioned in my topic I want to make it from scratch in order to minimize the cost. It's not a project just for making a drone to play but to experiment in different techs and stuff. Since I've studied Computer Science I have quite a good knowledge about making boards and programming chips. The basic reason I'm posting what I want to do in forums is to get some info about the parts I will need in order to understand the subject. And ofc don't forget that it will be a completely experimental device at least for a start.

Yup,I totally understand. The multiwii is a good development platform, and you get a LOT of stuff at low cost. You can pick up one with a jellybean AVR atmega328p, UART and 2 I^2C expansions, barometer, magnetometer, accelerometer, and gyro for less than $30 shipped, and the 1^2C can be connected to a UBLOX GPS module, and a basic 16x2 character LCD display to see things like PID values. The GPS w/ 1^2C to GPS converter board is a little extra, but not by much.

If you want slightly cheaper, you will lose a LOT of those features with a KK board, or the most barebones multiwii lite, which is like $19, or 34% less costly. The only reason why I say the multiwii is since that is the board I got for the same reasons that you are asking. I did buy the cheapest kit on amazon, which was really a great sounding deal, and it did technically work after lots of frustration, and replacement parts.


I do NOT, however recommend it. The motors are 'you get what you pay for' quality. Although they do work and I am still using them, the bearings are loose fitting, so they are rattly and make lots of noise. On top of that, the bells are horribly unbalanced, and so you will spend many countless hours trying to balance them, and designing a better, stronger frame that what is included in the kit. I did create a wooden frame that has the multiwii suspended with rubber hosing to eliminate the effects of vibrations from the motors. Here you can see my flying it:


Gees, instructables failed so hard with the video link. Here is my flight;


3 years ago

Also, the Raspberry pi (especially the new quad core one) is probably extreme overkill for processing power for just a basic flight controller. (like without fancy stuff like motion tracking, detection and avoidance w/ cameras and sophisticated sensors, etc) Also it is power hungry, drawing at least 7W of power! That will impact flight times in it of itself.

The efficiency and maximum lift and static thrust is a function of the props chosen, motor chosen, and the ESC chosen, as well as the composition of the atmosphere as well as the pressure. Everything is interrelated (except pressure), and so a really high understanding of physics, electricity, and multivariable calculus will be necessary to figure all that out. I tried to do that when I was building mine, but as I researched everything more and more, the deeper I got into nasty things. Even some of the best computer models using the most accurate models of aerodynamics cannot calculate this stuff like turbulence. There is a reason why NASA still make huge wind tunnels and stuff, they are just better.

In other words, it is more economical to buy what others have tested and proved to work. Either that, or do some experiments with different motors and props, and trial and error is the only real option.