EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: skillz21 on February 05, 2016, 11:35:10 pm

Title: RC Quadcopter
Post by: skillz21 on February 05, 2016, 11:35:10 pm
I want to make a RC quadcopter with Arduino. I found some videos online about some circuits you can use but I couldn't find them. so if anyone has any suggestions please leave them below. if not I want to use the Arduino, or two of them. one for the controller and one for the device itself. but here is the goal: I want to do it on my own. the problem? I don't have a lot of experience with Arduino. So can you guys help me find somewhere I can learn more about Arduino for free? and if you can, can you find some examples of how to build a quadcopter. I still need to find out what to use as the structure and the hardware. Any help is seriously appreciated.

Thanks :)
Title: Re: RC Quadcopter
Post by: Skimask on February 05, 2016, 11:41:50 pm
Google must be broken down under.
Title: Re: RC Quadcopter
Post by: skillz21 on February 05, 2016, 11:44:13 pm
well then can you point out some search terms?
Title: Re: RC Quadcopter
Post by: JimRemington on February 06, 2016, 12:58:30 am
DIYdrones.com has everything.
Title: Re: RC Quadcopter
Post by: denneyaa on February 06, 2016, 02:37:47 am
I have dealt with quads for about 4 years now. It is quite an undertaking to do everything you are planning on just by the shear size of the project. A few suggestions to get you started. Focus on a single area first either frame building, main flight control or accessories. They all have their rabbit holes and can all have time and money commitments.

Flight controls I would suggest kk multi copter or multi Wii as they started off with the atmega328.

Frames all depends on the size and danger you can deal with. I would suggest a 250 size to get started as they are on the smaller size but can still handle quite a bit.

I hope this helps.
Title: Re: RC Quadcopter
Post by: Mechatrommer on February 06, 2016, 04:57:12 am
I want to make a RC quadcopter with Arduino. I found some videos online about some circuits you can use but I couldn't find them.
you cannot find an arduino? thats the only circuit afaik. the rest is RF receiver, esc, motors and propellers. everything can be bought off-the-shelf...
Title: Re: RC Quadcopter
Post by: skillz21 on February 06, 2016, 05:10:59 am
I want to make a RC quadcopter with Arduino. I found some videos online about some circuits you can use but I couldn't find them.
you cannot find an arduino? thats the only circuit afaik. the rest is RF receiver, esc, motors and propellers. everything can be bought off-the-shelf...
could you point out what I need and where I could get it?
Title: Re: RC Quadcopter
Post by: crispy_tofu on February 06, 2016, 05:13:39 am
Have you checked out HobbyKing for buying quadcopter parts?  :)
(no affiliation)
Title: Re: RC Quadcopter
Post by: Mechatrommer on February 06, 2016, 05:21:41 am
I want to make a RC quadcopter with Arduino. I found some videos online about some circuits you can use but I couldn't find them.
you cannot find an arduino? thats the only circuit afaik. the rest is RF receiver, esc, motors and propellers. everything can be bought off-the-shelf...
could you point out what I need and where I could get it?
feel free...
http://www.hobbyking.com/hobbyking/store/RC_PRODUCT_SEARCH.asp?strSearch=quad (http://www.hobbyking.com/hobbyking/store/RC_PRODUCT_SEARCH.asp?strSearch=quad)
Title: Re: RC Quadcopter
Post by: skillz21 on February 06, 2016, 05:22:38 am
here is a question I have always had: if you had the motors connected to motor controllers and the motor controller connected to the Arduino, how would you actually control the speed of rotation. I know how to control the side of rotation but how can you control the speed?
Title: Re: RC Quadcopter
Post by: crispy_tofu on February 06, 2016, 05:41:43 am
here is a question I have always had: if you had the motors connected to motor controllers and the motor controller connected to the Arduino, how would you actually control the speed of rotation. I know how to control the side of rotation but how can you control the speed?
This might help: https://en.wikipedia.org/wiki/Electronic_speed_control
Title: Re: RC Quadcopter
Post by: skillz21 on February 06, 2016, 10:49:10 am
here is a question I have always had: if you had the motors connected to motor controllers and the motor controller connected to the Arduino, how would you actually control the speed of rotation. I know how to control the side of rotation but how can you control the speed?
This might help: https://en.wikipedia.org/wiki/Electronic_speed_control
Ok I read the page. it explains ESC modules. I have seen people do this with just the Arduino. CAN the Arduino be used as an ESC? if it can, is there a specialised library to set the speed of a motor? one more question: how do you control the speed of a motor through a motor controller? I know that there are two wires that control the direction of the motor. But how do you control the speed, do you vary the voltage of the control pins of the motor controller. if so, can you use the Arduino to vary the voltage of a pin. (I originally thought you couldn't do that)
Title: Re: RC Quadcopter
Post by: Mechatrommer on February 06, 2016, 04:41:11 pm
here is a question I have always had: if you had the motors connected to motor controllers and the motor controller connected to the Arduino, how would you actually control the speed of rotation. I know how to control the side of rotation but how can you control the speed?
speed of rotation is controlled by giving the ESC a PPM pulse, thats easily programmed with arduino, just find any quad controller code. if coding is so hard, buy dedicated flight controller...
lmgtfy... http://www.hobbyking.com/hobbyking/store/RC_PRODUCT_SEARCH.asp?strSearch=quad+controller (http://www.hobbyking.com/hobbyking/store/RC_PRODUCT_SEARCH.asp?strSearch=quad+controller)

CAN the Arduino be used as an ESC?
no! ESC has dedicated motor drivers aka bunches of mosfets, and it also has its own dedicated MCU for BLDC algorithm...
Title: Re: RC Quadcopter
Post by: skillz21 on February 06, 2016, 09:56:58 pm
here is a question I have always had: if you had the motors connected to motor controllers and the motor controller connected to the Arduino, how would you actually control the speed of rotation. I know how to control the side of rotation but how can you control the speed?
speed of rotation is controlled by giving the ESC a PPM pulse, thats easily programmed with arduino, just find any quad controller code. if coding is so hard, buy dedicated flight controller...
lmgtfy... http://www.hobbyking.com/hobbyking/store/RC_PRODUCT_SEARCH.asp?strSearch=quad+controller (http://www.hobbyking.com/hobbyking/store/RC_PRODUCT_SEARCH.asp?strSearch=quad+controller)

CAN the Arduino be used as an ESC?
no! ESC has dedicated motor drivers aka bunches of mosfets, and it also has its own dedicated MCU for BLDC algorithm...
So where do you introduce the PPM pulse to? and one more question: isnt it Pulse WIDTH Modulation? Did you do PPM By accident.
(Googled it!)
Title: Re: RC Quadcopter
Post by: Mechatrommer on February 07, 2016, 04:52:20 am
So where do you introduce the PPM pulse to?
the ESC's input port?
isnt it Pulse WIDTH Modulation? Did you do PPM By accident.
(Googled it!)
no design is by accident, you need to code it.
Title: Re: RC Quadcopter
Post by: skillz21 on February 07, 2016, 07:59:08 am
So where do you introduce the PPM pulse to?
the ESC's input port?
isnt it Pulse WIDTH Modulation? Did you do PPM By accident.
(Googled it!)
no design is by accident, you need to code it.
firstly i meant how to you introduce it to a motor controller (though i am not going to use one!) there are two pins to control the side of rotation, right? and secondly i have no idea what you are talking about (no design is by accident, you need to code it.) please explain more
thanks!
Title: Re: RC Quadcopter
Post by: Mechatrommer on February 07, 2016, 10:20:23 am
Quote
there are two pins to control the side of rotation, right?
wrong, only one pin only. be it unipolar ESC (for flying object) or bipolar ESC (for land object like rc car or boat)...
Quote
how to you introduce it to a motor controller
its hard to imagine when you dont have the item, there is wire poking out, just connect it to arduino pin. you'll know when you have one. and if you pay enough attention, in many item shown in the link i provided, you can see the wire in the ESC pic, usually white,reds,black (PPM,V+,GND)
Quote
Did you do PPM By accident.
what are you talking about?
Quote
(though i am not going to use one!)
so is it worth the time? or i'm just wasting my time here...
Title: Re: RC Quadcopter
Post by: skillz21 on February 07, 2016, 10:34:17 am
Quote
there are two pins to control the side of rotation, right?
wrong, only one pin only. be it unipolar ESC (for flying object) or bipolar ESC (for land object like rc car or boat)...
Quote
how to you introduce it to a motor controller
its hard to imagine when you dont have the item, there is wire poking out, just connect it to arduino pin. you'll know when you have one. and if you pay enough attention, in many item shown in the link i provided, you can see the wire in the ESC pic, usually white,reds,black (PPM,V+,GND)
Quote
Did you do PPM By accident.
what are you talking about?
Quote
(though i am not going to use one!)
so is it worth the time? or i'm just wasting my time here...
it is definitely worth your time! as I said, I'm a beginner and I am very interested, and I am learning
Title: Re: RC Quadcopter
Post by: Galenbo on February 07, 2016, 11:51:37 am
... as I said, I'm a beginner and I am very interested, and I am learning
Break your "wanted result" up in parts you understand.

It looks like the first step you still have to take is "blink the led"
This is done by putting code in the arduino controller.

If you want it to blink faster/slower/... your code will have to be different.
There are also multiple possibilities to get the same result. Learn all of them.

Then learn about input/output and serial communication.
Then PWM and interrupts
Title: Re: RC Quadcopter
Post by: Blackwarrior on February 07, 2016, 10:01:23 pm
I agree with Galenbo, learn the basics of the arduino first. Programming a FC for any aircraft is a massive undertaking. I've been flying helicopters and quads for many years now and although it would be an interesting, but lengthy project, it not for the novice.. Much easier to buy a ready made FC like the Naze or similar...
Title: Re: RC Quadcopter
Post by: hendorog on February 07, 2016, 10:40:55 pm
This may be of interest - although it is for the psoc 4 and not the Arduino.

https://www.element14.com/community/community/design-challenges/smarter-life/blog/2013/10/28/psoc-4-tricopter-smarter-life-challenge-part-1 (https://www.element14.com/community/community/design-challenges/smarter-life/blog/2013/10/28/psoc-4-tricopter-smarter-life-challenge-part-1)
Title: Re: RC Quadcopter
Post by: markhing on February 08, 2016, 04:52:58 am
Take a look at http://www.instructables.com/id/Easy-Android-controllable-PC-Interfaceable-Relati/?ALLSTEPS (http://www.instructables.com/id/Easy-Android-controllable-PC-Interfaceable-Relati/?ALLSTEPS)

It shows you how to build a quadcopter (and octocopter) as well as control it with Arduino.
Title: Re: RC Quadcopter
Post by: skillz21 on February 10, 2016, 04:36:36 am
... as I said, I'm a beginner and I am very interested, and I am learning
Break your "wanted result" up in parts you understand.

It looks like the first step you still have to take is "blink the led"
This is done by putting code in the arduino controller.

If you want it to blink faster/slower/... your code will have to be different.
There are also multiple possibilities to get the same result. Learn all of them.

Then learn about input/output and serial communication.
Then PWM and interrupts
I Know how to blink a led.( I build an led chaser too!) I would say that I know a bit about serial communication. But I DO need to learn about PWM and interrupts. (NO idea what interrupts are, but I'll google it!)
Title: Re: RC Quadcopter
Post by: Galenbo on February 10, 2016, 11:06:37 am
...I Know how to blink a led.( I build an led chaser too!) I would say that I know a bit about serial communication. But I DO need to learn about PWM and interrupts. (NO idea what interrupts are, but I'll google it!)
This is exactly what I mean. No offence, but the way you know how to blink a led, is by copy/paste internet text into some software, connect a cable and push the "send" button.
The time when I didn't know about interrupts, I considered myself being on level "zero" in the world of microcrontrollers.

You will now have to start learning all the other ways to blink that led.

-try this: close internet, the books and examples, and write/type your software yourself, from zero, without libraries.
-blink 8 leds, all together, but at another frequency.
-blink a led at 1HZ, but make sure input from a pushbutton is always immediately sent to rs232.
-blink the led at a rate that is received by serial communication.
-make a led dimmer with pwm.
-Make it blink or dim using interrupts, so less processor performance is used, and other software can run also.

After that, you are ready to take another step, and ready for start thinking about measurement and control.
Title: Re: RC Quadcopter
Post by: LHelge on February 11, 2016, 09:39:13 am
Just to give an idea of the work you need to put in. I have a long time project going on to create a flight controller for a multicopter. I've build one revision several years ago and started rev 2 maybe a year ago. Working on several projects at once but I guess I have at least 250 h put into the flightcontroller yet and it's still bodged together breakout boards on a demo board and it hasn't been up in the air yet. I'm guessing my starting point is a little better than yours with a daily work in embedded software developing and a M. Sc. degree in control theory.

With that said, I don't think it is impossible, and it's extremely fun and rewarding work so i definitely think you should keep on. It has been done with an Arduino before so it should be possible. One thing though that I would strongly recommend is to use a microcontroller with enough Capture/Compare modules and timers for all your PWM signals. I use a STM32F405 which gladly takes 8 PWM input signals and 8 PWM output signals with barely any CPU load. I've got all those 168 MHz with floating point capability left for sensor fusion and control calculations.
Title: Re: RC Quadcopter
Post by: skillz21 on February 12, 2016, 10:28:35 am
Ok guys, i have so far been mind blown at how much people are willing to help me. OK so i did  a bit of research about RF modules they are cool and all but... i would need another arduino (or something similar) for that and that means more code. i was wandering whether i could use a Bluetooth module. is saw a video where someone changed the color of an led by writing in text on an app on their phone. is there any chance that i could do almost the same thing?( not exactly the same.) i want to make like an easier interface (like arrows instead of typing in text.) any app that i could do this with? in my opinion i think this will be much simpler if i could do it(would it not be?). anyway i am looking forward to hearing your advice about this!

Thanks! ;)
Title: Re: RC Quadcopter
Post by: Rerouter on February 12, 2016, 10:52:08 am
Work on one thing at a time... android phones is another language, but what you would likely have seen is an emulated com port through Bluetooth, after all Bluetooth is just wireless serial that can drop packets,

As for one or multiple arduinos, it comes down to how well you write it, No matter how you approach it, you will likely need a form of PID to keep the thing stable, now one thing to know is that the normal uno does not support floating point natively, so its slow to run, there are ways to run approximations much faster, but there is some heavier math behind it,

As for your inputs and outputs, like a previous poster said, get familar with the timers and counter peripherals on the micro, and let them do the heavy lifting,

My own attempt started on a due, simply because it was much faster,

In both cases (uno and due), the IMU and PID didnt fill or overload the single micro, but like many before me, i started to stall out from lack of not seeing immediate results infront of me,

I've attached what i had, not sure how much of it is useable as i abandoned it some time ago, but see if any is helpful, pretty sure i went a bit overkill on the self cal,
Title: Re: RC Quadcopter
Post by: skillz21 on February 12, 2016, 11:31:02 am
Work on one thing at a time... android phones is another language, but what you would likely have seen is an emulated com port through Bluetooth, after all Bluetooth is just wireless serial that can drop packets,

As for one or multiple arduinos, it comes down to how well you write it, No matter how you approach it, you will likely need a form of PID to keep the thing stable, now one thing to know is that the normal uno does not support floating point natively, so its slow to run, there are ways to run approximations much faster, but there is some heavier math behind it,

As for your inputs and outputs, like a previous poster said, get familar with the timers and counter peripherals on the micro, and let them do the heavy lifting,

My own attempt started on a due, simply because it was much faster,

In both cases (uno and due), the IMU and PID didnt fill or overload the single micro, but like many before me, i started to stall out from lack of not seeing immediate results infront of me,

I've attached what i had, not sure how much of it is useable as i abandoned it some time ago, but see if any is helpful, pretty sure i went a bit overkill on the self cal,
OK so why cant i just tell the arduino that is controlling the quadcopter to rise up one level when it receiver the serial data through the Bluetooth module?
Title: Re: RC Quadcopter
Post by: skillz21 on February 12, 2016, 11:39:11 am
Wait a sec... Just from memory, is a PWM pulse an ON/OFF pulse(similar to the one generated by a NE555? Or am i just stupid?
Title: Re: RC Quadcopter
Post by: Mechatrommer on February 12, 2016, 12:30:10 pm
duh i guess what he meant a flowchart graphic based ide in an android smarphone, is there even a place like that in here? :palm:
Title: Re: RC Quadcopter
Post by: skillz21 on February 12, 2016, 09:04:34 pm
duh i guess what he meant a flowchart graphic based ide in an android smarphone, is there even a place like that in here? :palm:
excuse me? I don't understand. so do you mean that I can't get a graphical interface on an android phone? just clarifying my last question, so is a PWM pulse an ON/OFF pulse?
Title: Re: RC Quadcopter
Post by: bxh on February 12, 2016, 10:23:28 pm
When you say you want to do it yourself, to what extent are you referring? Over the past few years I've worked on different components of a typical multicopter, starting with a DIY flight controller electronics and algorithms and moving through to the DIY ESC. I did it all for the experience, and definitely wouldn't recommend it if you just wanted to get something in the air.
Title: Re: RC Quadcopter
Post by: FreddyVictor on February 12, 2016, 10:27:35 pm
if you want to start with simple elctronics, then this controller (http://www.hobbyking.com/hobbyking/store/__27108__MultiWii_SE_V2_0_Flight_Controller_w_FTDI.html) is effectively an arduino with gyro+accelerometer plus correct pins for ESC's, Receiver etc

this can be programmed using Arduino IDE and flashed the usual way (as Aduino Pro 16MHz 5v)
it's call MultiWii and there's alot of code available - not all good tho'  :-X

it's a good learning exercise and can be made to fly reasonably well.
It does have it's limitations which you will find out as you go along
Title: Re: RC Quadcopter
Post by: Audioguru on February 13, 2016, 12:06:04 am
I bought a quadcopter for $25.00 and it has 6 gyros and includes the 2.4GHz RF remote controller and Li-Po battery. It flies fine. I does not have a camera.
I would not want to spend a couple of years designing and building one.
Title: Re: RC Quadcopter
Post by: skillz21 on February 13, 2016, 01:35:18 am
I did a bit of research on flight controllers, I have been really interested in the Openpilot cc3d. I watched a few videos on it. I saw once where a person had a  Taranis to control it. I had a look at it online and it was a bit costly ($50AUS minimum). My budget is around $30. I don't want to go over 35. any info on any flight controllers that I can use that I can buy for under $25?(Including controller, and I think it will take around $5 for the frame. I can make one with an Arduino, but the controller problem...
Title: Re: RC Quadcopter
Post by: skillz21 on February 13, 2016, 02:03:02 am
I bought a quadcopter for $25.00 and it has 6 gyros and includes the 2.4GHz RF remote controller and Li-Po battery. It flies fine. I does not have a camera.
I would not want to spend a couple of years designing and building one.
I have not found any quads for under $40 where i live. anyway, i do not want to buy one. the problem with quadcopters and helicopters that you buy is mainly the battery it rund out pretty fast( I know its only with some of them but with the ones i have bought, its always the same.) anyway the main point of me making this is that i can change the way it works anytime. and also the pleasure of it. i'm going to have to do this-> |O a few times through my build. but in the end it is so cool when you get to fly it and think, i built that!
Title: Re: RC Quadcopter
Post by: RobertBG on February 13, 2016, 05:24:16 am
There's been quite a bit of very good advice so far but I think you dont quite grasp how complex of a scratch build this can be ;) and I'm not trying to be a prick.

What I'd suggest is a kit like Flite Test sells for example,choose your parts,get it flying and then reverse engineer it in a sense.Build the ESC's,controller and so on.

This way you'll have a flying copter to compare and test each part on along the way and if one task is too much at the time you'll still have the other parts in  flight ;)
Title: Re: RC Quadcopter
Post by: Brumby on February 13, 2016, 05:32:27 am
... just clarifying my last question, so is a PWM pulse an ON/OFF pulse?

Yes.

PWM - Pulse Width Modulation.  You just change the 'on' time - like this:

(https://hekilledmywire.files.wordpress.com/2011/08/pwm1.png)

And, yes, it's the sort of thing the NE555 can do.
Title: Re: RC Quadcopter
Post by: FreddyVictor on February 13, 2016, 09:26:56 am
I have not found any quads for under $40 where i live. anyway, i do not want to buy one. the problem with quadcopters and helicopters that you buy is mainly the battery it rund out pretty fast( I know its only with some of them but with the ones i have bought, its always the same.) anyway the main point of me making this is that i can change the way it works anytime. and also the pleasure of it. i'm going to have to do this-> |O a few times through my build. but in the end it is so cool when you get to fly it and think, i built that!

you need to just re-adjust your expectations here, you won't be able to build a quadcopter for $40 or less
the cost of 4 Electronic Speed controllers (ESCs) plus 4 motors plus frame plus all the other bits'n'pieces (battery, connectors, wire, Tx, Rx) needed will easily blow that budget
making your own always costs more ....
Title: Re: RC Quadcopter
Post by: crispy_tofu on February 14, 2016, 02:10:27 am
you need to just re-adjust your expectations here, you won't be able to build a quadcopter for $40 or less
+1, you could probably only get toy-grade for that price...  :-[
Title: Re: RC Quadcopter
Post by: Teledog on February 15, 2016, 07:07:36 am
Interesting threads..

Tried a DIY myself..printed out a quad on the 3D printer, got a controller, motors, ESCs & yada -yada ..
Gave up after it spontaneously(?) attacked me... several times ..(and bloody parts to prove it)

Know what's fun?
A CX-10!!
The dog goes crazy for it....won't hurt a flea..AND.. it's only ~$20
Title: Re: RC Quadcopter
Post by: Mechatrommer on February 15, 2016, 07:45:18 am
Tried a DIY myself..printed out a quad on the 3D printer, got a controller, motors, ESCs & yada -yada ..
Gave up after it spontaneously(?) attacked me... several times ..(and bloody parts to prove it)
probably because that you bought a crappy controller, be it you code yourself, the quad may kills you, so you know the dirt and dust of building an controller algorithm..
Title: Re: RC Quadcopter
Post by: Kilrah on February 15, 2016, 09:20:22 am
My budget is around $30. I don't want to go over 35. any info on any flight controllers that I can use that I can buy for under $25?(Including controller

You're dreaming wildly there.

The cheapest you could do is something like using one of the Chinese toys that have open source code that has been written for it:
http://www.rcgroups.com/forums/showthread.php?t=2278850 (http://www.rcgroups.com/forums/showthread.php?t=2278850)

Still the quad with its remote will already near or exceed your budget, and you still need to buy the required programming and configuration interfaces, which while cheap will set you back another $10 at least.

Any custom build will shoot straight above $100.
Title: Re: RC Quadcopter
Post by: crispy_tofu on February 15, 2016, 09:36:34 am
Know what's fun?
A CX-10!!
The dog goes crazy for it....won't hurt a flea..AND.. it's only ~$20

Oh look, another person who flies the CX-10!  :) :-+
Title: Re: RC Quadcopter
Post by: Skimask on February 22, 2016, 03:02:43 am

Oh look, another person who flies the CX-10!  :) :-+
Never seen one of those before.
Just ordered 2.