Arduino quadcopter pilot - electronics questions

Hi all,

(also posted a similar question on rcgroups.com)

I spent the last couple of months reading up and researching quadcopter builds and I thought I’d use up my Christmas free time to actually start putting one together. I think I’m now at the stage where I know enough to start asking some semi-intelligent questions! Please bear in mind that I’m a beginner not just in quad copters but also in electronics!

My main build components are the following :

  • Arduino Nano
  • 4x motors (3.7V DC, 90-100mA, coreless, 6x14mm, 48000RPM)
  • LiPo 240mAh, 1S
  • GY-521 (MPU-6050) 6DOF gyro
  • NRF24L01+ tranceiver module
  • DC Step Up converter to bring the LiPo’s 3.7V to 5V for the Arduino
  • LiPo charger module

First complication is that the Arduino runs on 5V but I have a battery producing 3.7V. For that I’m hoping to using a DC step up module (I think it can produce enough current).
I also need to interface with a couple of modules that operate at 3V (gyro, rf, etc) but from what I’ve seen I might able to just about do without one.

So, I’ve put together a schematic for the electronics in Fritzing that I was hoping someone here would be able to review.

Also, some more specific questions on that schematic :

  • Should I be connecting all the GND together and the to the -ve of the battery?
  • Is the DC Step up board wired in correctly? It has 4 connections (IN+, IN-, OUT+, OUT-). Should I connect both IN- and OUT- to GND?
  • Anything else fundamentaly wrong with it? 8]

Many thanks in advance!

Vassilis

No that's not really how you would do it. Even if you want to use brushed motors, I think you'll want to use a separate speed controller unit and control that with a PWM signal.

However, what are you trying to get out of this? That will define your approach. If you're trying to learn coding, I would suggest not starting at square one with this kind of project. Do you just want to fly a quad copter? Do you want to experiment with auto-pilots? I don't think trying to build a quad from scratch with a Nano is a good approach for a beginner.

You're gonna hear this on RC Groups too, but basically, you aren't gonna be able to jump in the deep end without drowning here. You have many skills to learn before you have a remote chance of success with a project like this. There's the basics of electronics and programming, but the thing many people forget about is the basics of RC aircraft, and the basics of flying a quad copter. Wouldn't it suck to spend a year building this thing and get the code all right and everything working, and then crash and rip it to shreds after three seconds?

So, my suggestion is to get into the basics of RC quads with a good radio and a cheap ready-to-fly quadcopter. I review stuff like that on Youtube and I think this new quad from Blade is perfect for beginners, and it works with quality radio equipment.

So... how much can you spend? Do you have local hobby shops that carry RC planes and stuff? Do you have any experience flying quad copters or building RC anything?

Hi Jasmine,

thanks for your reply.

With regards to controlling the motors, I based my decision on other people building quadcopters. From what I've seen, people use ESCs for larger builds using brushless motors. Mini quads, using brushed, coreless motors (e.g. crazyflie and similar) use 'custom' motor control systems (using a transistor, diode and resistor). So, lacking any advice for the contrary, I went with something along the lines of this : Use Arduino With TIP120 Transistor to Control Motors and High Power Devices - Instructables. I have some questions on that system in itself, but I'll probably post seperately about it. Can you give me some reasons why this wouldn't be a suitable motor control system (or why a separate controller unit would be better)?

You express some valid concerns about jumping in on the deep end, especially because I know next to bugger all on electronics! I must admit when I started it looked like it would be a simple case of wiring up a few components, slapping them on some cardboard/plastic/balsa housing, strap on some motors and away we go! :slight_smile: Yes, the reality is obviously different, there is a very good chance this will just be a waste of time and money, but...it's fun, I get to learn a few new things and hey, it might actually work!

My ultimate purpose is to build something that be used indoors and is controlled via a computer (rather than traditional RC controls). This already limits my choice of ready made copters (or even designs). Furthermore I'd like to experiment with attaching different range finding/positioning components. I thought it would be simpler to do that on a design that I've made myself (and therefore, hopefully understand better) than a 3rd party solution.

So, with that all said, any more comments or suggestions on the schematic that I posted?

Yes, that is a perfectly valid way to run motors, but I think it puts a lot of load on the processor - if you use an ESC you can send PWM signals to that, and it will manage the high speed processing to run the motor, leaving your code more time to calculate the necessary changes, and you don't have to change your code to run brushless motors if you want. You are right though, running an ESC requires more work than running the motor directly.

I think the idea of controlling the copter from a computer ground station is realistic, but I don't think you realize how hard that actually is. Go look at the code for "Mission Planner" to get an idea - just the computer-to-quad communications is more than you can probably handle right now, not to mention all the user interface stuff. If you pile on top of that, all the coding required to create the aircraft itself, you're looking at something that would probably take one developer many years to do - and in fact it did.

It would be much better to start with some combination of devices which will allow you to play with coding at a really high level. The UDB auto-pilot system has some features like that - you can program your flight path in LOGO, for example. I believe the AR.Drone has some high level programming you can do as well. It would be much better to start with something like that. When we start little kids with robots, we use robots that are already built and programmed and we have the kids give the robot very high level instructions - "walk forward 10 feet" - we don't have them start with programming the low level code of running a servo or a motor.

The idea I'm trying to get across is experimentation is best done with "known good" components. You wouldn't test a new ground station with a new quad - if something went wrong you would have no idea which thing caused it. You would test a new ground station with an old war-horse quad that you've flown for many hours and you know is reliable. Don't put yourself in the position of having to make odds on which thing failed. As you progress through this project, make something and test it until you know it's good, and only then will you add another component. First step is making a manually controlled quad - actually there's many first steps before that - how to read an RC receiver, how to read an MPU, etc, etc... before you can have a manually controlled quad. Once the thing flies well enough manually and you're convinced it reasonably reliable, then you can add more features.

There are absolutely plenty of ready-made quad-copter control board which would start you at that point. APM, MultiWii, etc - those can both interface with an RC radio and a computer. APM is designed for that. Still, most APM flights are done manually - I would say less than half of APM users ever get to the point where they can reliably fly in auto modes.

If you must do it yourself, here are some suggestions:

  1. Run the Arduino at 3.7V, not 5V. You can't afford the weight of a boost converter. In fact, it if is a small quadcopter, it won't be able to carry the weight of a full Arduino board anyway. So prototype it on an Arduino, then migrate it to a bare-bones design when you have it all working.

  2. TIP120s are rubbish for this application because of their saturation voltage. Instead, pick a small mosfet that needs only 3.5V gate voltage to switch it fully on. You must be building a small copter if you are not using ESCs, so you had better use SMD mosfets to keep the weight down. Maybe TSM2314CX.

dc42, those are the details I'm talking about. All that stuff has been figured out already, and I don't understand why you would want to burden yourself with all that, when you want to learn some coding techniques. I think if you want to learn to program robots... well, I love my Lego bot... start with something like that...

I'm not sure about the increasingly violent themes coming from Lego these days, but these robots do teach programming skills...
http://www.lego.com/en-us/mindstorms/products/ev3/31313

Leader of the LEGO® MINDSTORMS® Robots. Superior intellIgence and fighting power with his blasting bazooka and spinning tri-blade.

WHAT? Robots is not about fighting!

Hey guys, thanks for the replies!

The coding aspect is not a major concern for me at the moment. My day job is C++ programming and I also have a background in computational modelling of structures (think buildings, bridges, etc), so I should be ok for getting something basic going. It's the electronics that I'm really lacking on! Having said that, I'm really not after a super polished, fully functional result here, just a bit of fun and learning! :slight_smile:

  • Operating voltage
    dc42, I'm using an Arduino Nano, which is quite small. I weighed all the components, including motors, battery, stepup module, etc etc and it came in at ~50g. I'm hoping that the motors I have will provide enough lift. Furthermore, I believe that the Arduino is able to run at 3V, but it drops to 8MHz and you a couple of other bits that I need (can't recall what now, but it was something that was a show stopper for me).

  • transistors
    Good call on that, thanks for the advice. I did notice that a couple of other builds also used MOSFETS but I had a bunch of TIP120's around from a previous project. I'll need to read up on MOSFETS to understand the differences.

A couple more specific questions :

  • Do I need a capacitor in parallel to each motor? I've some people put one and others not.
  • For the step up module, is it correct to connect both the IN- and OUT- to GND?

Thanks again for your help!

I think the thing you haven't taken into account is the fact that you have no current background knowledge or experience of how a quadcopter flies and that means you can't know what needs to go into the code to make it work, how to interpret problems or even to know whether a problem is due to code or operator error. Having a PC as the operator will be even more challenging as PCs know [rude-word]-all about flying.

As others have said either learn to fly first with an off-the-shelf quadcopter OR choose a project which doesn't depend on operator skill.

...R

vaspoul:

  • Do I need a capacitor in parallel to each motor? I've some people put one and others not.

This is an example of where the two worlds collide. For normal purposes, you don't need a cap across the motor, but when you have RC radios operating near brushed motors, you DO need that unless you use certain frequencies. The purpose of the cap is to 'soak up' high frequency interference caused by the brushes, so it doesn't affect the radio. IF you are not using a radio, or if you're using infrared control or certain RC frequencies, this is not a concern.

Jasmine : Thanks, that’s good info.

Robin2 : You’re right, but I just want to build the thing, set it in motion and have some fun making some software to control the motors with input from the gyro. I’ll be quite happy if it lifts up and manages to stablise itself! I’ll leave all the fancy tricks, loops and spins for next week (LOL)!

Happy New Year everyone :slight_smile:

You know... it would be nice if there was a "minimal" quad-copter code-base out there. Most of the code for existing control boards is available - you can get the assembly code from a KK board, you can get the C code for MultiWii, and you can get all the APM code too - but go take a look at the APM code, it's far from minimal, so far in fact that it isn't instructive to look at it.

I would be interested in helping with that - for instructional purposes, I think there should be a minimal code-base out there. A project where if someone says "can we add a feature" we say "no" :slight_smile:

But, these are some starting points I know of... these are fairly well developed though.
https://code.google.com/p/multiwii/ (copter from Wii units and Arduino Pro)
https://code.google.com/p/ardupilot-mega/ (APM)

OH, I've also been playing around with this: SparkFun UDB5 - PIC UAV Development Board - GPS-11703 - SparkFun Electronics

That's a PIC-based autopilot controller, and the copter code for it is just being started. One good way to learn is to contribute...
https://code.google.com/p/gentlenav/

Ooh, that board looks nice! And you're right about the existing libraries....they are quite big and (it seems to me) most people tend to use them 'as-is'.

vaspoul:
Ooh, that board looks nice! And you're right about the existing libraries....they are quite big and (it seems to me) most people tend to use them 'as-is'.

It is a nice control unit, seems to work really well. The purpose of that project was to kinda create a "minimal" system, and get by on as little as possible in terms of hardware - all it needs is a GPS (no baro, no compass). They've done a pretty good job of keeping it under control. So that, and the fact that one of the developers is a friend of mine, is why I chose to work with that one a bit more. I have an APM copter, but the code for APM is "impenetrable" to me right now, so I don't plan to mess with it.