Building a Quadcopter from scratch (no Ardupilot) - hardware help needed

Hi all!
I'm completely new to Arduino (haven't even bought my first kit yet), but I'm an Aerospace student and have experience with writing control algorithms for quadcopters.
I want to build and program my own quad from scratch- beginning with a normal arduino board (no ardupilot, as it might spoil some of the fun 8) ), an IMU, a GPS module, a telemetry module, and mabe later an LCD monitor and a few buttons (and obviously 4 ESC's, 4 brushless motors, a battery and a frame :stuck_out_tongue: ).

I'd love your help figuring out exactly what hardware I need to get in order to get this thing running (well... flying):

-What kind of arduino board will be best for my needs? (some advice about the other components I mentioned would also be appreciated)
-Is there a limitation on the kind of ESC's and motors I can use?
-What kind of cables and connectors do I need to connect the arduino with all the other hardware?
-Anything else you think I need to know on the arduino side before buying my kit?

shayelk:
I'm completely new to Arduino (haven't even bought my first kit yet)

With no other information given, you've basically told us that you want to compete in the triathlon, but you haven't learned to crawl yet.

That said - what is your experience with electronics and microcontrollers? What is your programming experience (you say you "have experience with writing control algorithms for quadcopters" - but you don't mention what language(s) you wrote those algorithms in).

If your experience with either electronics or microcontrollers is limited - then you are going to want to keep your feet on the ground - so to speak - and work on understanding those areas before you jump into building something as complex as a quadcopter. Get a solid knowledge base and learn what works for you (as far as your development routine is concerned) then go forward with the quadcopter plan.

For a basic quadcopter, you'll want to have a solid understanding of the batteries, current usage, how to calculate what you'll need to size your motors, props, ESCs, etc - how to know what wire gauge to use, how to control a servo with an Arduino (because you'll be doing that in order to control the ESC), how to read data from the IMU, GPS, radio receiver (or whatever you plan to use there), etc. Each of these (well, other than the servo control, maybe) is a task to master in itself - and you want to get those basics under your belt, then gradually bring them together for a successful "final project".

So - start with an Arduino UNO - and go through all of the examples, and then some. Find various tutorials and play with them. Get a "starter kit" together, and learn the basic concepts of what resistors are for, how to control an LED, how to read a switch, how to print to an LCD, how to control a motor, how to control a servo, how to read a potentiometer, and so forth. Play with the code. Learn serial communications. Learn how to interface and read data from your IMU and GPS modules (which might require learning how to use SPI and/or I2C).

All of this can be done with the basic Arduino UNO. When you have all of that down and are ready - then work on the quad.

As far as your questions:

shayelk:
-What kind of arduino board will be best for my needs?

Ardupilot can be used on an UNO. Depending on the size of your quadcopter (which will determine how much you can lift) - you might be able to stick to the standard UNO, or you may have to go with something scaled down, like a Pro Mini or a Nano (both which use the 328 as on the UNO). Or - get the Ardupilot board, and wipe the controller software off of it and code your own (that might be the best route, actually).

shayelk:
(some advice about the other components I mentioned would also be appreciated)

That will all depend on your budget and how much weight you need to lift and move, and how long of a flight time you want. Don't say "under $100.00 USD" for your budget. Forget that right now, unless you want a very small quadcopter. For something about the size of a DJI Phantom (for instance) - expect to spend around $500 USD (maybe a bit more). A lot will depend on how much you can scrounge, what you can build yourself, and where you find your materials and parts. Too many variables to give an exact answer.

shayelk:
-Is there a limitation on the kind of ESC's and motors I can use?

Only your budget. That said, you want BLDC motors meant for airplanes - not cars or boats (you need the motors to have proper bearings).

shayelk:
-What kind of cables and connectors do I need to connect the arduino with all the other hardware?

For something like this, you'll want to ultimately solder most everything. You don't want anything vibrating loose that will interrupt control or power to the motors (which would be a bad and expensive problem). So - if your soldering skills aren't the best - put that on the list as well.

On the bench, though - for testing - just use a breadboard, some header pins/sockets, and dupont jumper wires (or something similar) for connection between the Arduino and other components. Of course, the ESCs, batteries, and motors will require high-current wiring meant for such purposes. Also - make sure when you are testing your BLDC motors that you mount them in a vice securely, and have a propeller mounted on the shaft (ie - a load) - and practice safety (keep away from the motor/prop when it is running, and wear safety goggles!).

shayelk:
-Anything else you think I need to know on the arduino side before buying my kit?

Well - I've already said it, but I'll say it again - learn to walk before you run: Get a proper starter kit, and learn that before jumping into the deep end of the pool.

Good luck, and enjoy yourself with learning how to use the Arduino!

:smiley:

Thank you for the thorough answer, it's not often that you see such answers in online forums :slight_smile:

cr0sh:
With no other information given, you've basically told us that you want to compete in the triathlon, but you haven't learned to crawl yet.

Well, I'd say it's more like I've run a half marathon, swam a mile , and competed in some cycling contests, but I have no Idea how a triathlon works, and would like to start working towards one:

  • I know how to choose and assamble components for a quadcopter to handle a desired mission
  • I have a lot of theoretical and some hands-on experience with electronics (both analog and digital)
  • I wrote apart of a control algorithm for a quadcopter using both C and LabVIEW- I used a ready-made controller (a KK2) and modeled the quadcopter as a black box which gets stick commands and outputs hight and attitude change rates, to control the quad position. (the computer was connected via D2A converter to the remote control and position and attitude feedback were obtained using a set of IR cameras - so basically I programmed a pilot) and I have a pretty solid understanding of the inner model (the part between the command and the change rates, which I overrode the last time)
  • I know how to use IMU data to calculate attitude and position
  • I'm a decent solderer :stuck_out_tongue:

However, I didn't get to use microcontrollers before, so I think most of the knowledge I'm lacking is about how to get inputs and write outputs with the arduino (how to translate IMU serial input to QT's and QV's for example), though there are some other things you mentioned that I still need to learn (i.e. choosing wire gauge)

cr0sh:
So - start with an Arduino UNO - and go through all of the examples, and then some. Find various tutorials and play with them. Get a "starter kit" together, and learn the basic concepts of what resistors are for, how to control an LED, how to read a switch, how to print to an LCD, how to control a motor, how to control a servo, how to read a potentiometer, and so forth. Play with the code. Learn serial communications. Learn how to interface and read data from your IMU and GPS modules (which might require learning how to use SPI and/or I2C).

All of this can be done with the basic Arduino UNO. When you have all of that down and are ready - then work on the quad.

sounds like a good way to go :slight_smile:

cr0sh:
That will all depend on your budget and how much weight you need to lift and move, and how long of a flight time you want. Don't say "under $100.00 USD" for your budget. Forget that right now, unless you want a very small quadcopter. For something about the size of a DJI Phantom (for instance) - expect to spend around $500 USD (maybe a bit more). A lot will depend on how much you can scrounge, what you can build yourself, and where you find your materials and parts. Too many variables to give an exact answer.

I'm looking at something a lot smaller then a DJI Phantom to start with, but I'll probably change my mind once I see all the pretty toys :wink: the budget is not too serious of a problem

Thanks again for all the input! You've been a great help!

shayelk:
Thank you for the thorough answer, it's not often that you see such answers in online forums :slight_smile:

No problem - if you look at my posting history (here and elsewhere) - you'll find that I am a fan of writing books...

:smiley:

shayelk:
Well, I'd say it's more like I've run a half marathon, swam a mile , and competed in some cycling contests, but I have no Idea how a triathlon works, and would like to start working towards one:

  • I know how to choose and assamble components for a quadcopter to handle a desired mission
  • I have a lot of theoretical and some hands-on experience with electronics (both analog and digital)
  • I wrote apart of a control algorithm for a quadcopter using both C and LabVIEW- I used a ready-made controller (a KK2) and modeled the quadcopter as a black box which gets stick commands and outputs hight and attitude change rates, to control the quad position. (the computer was connected via D2A converter to the remote control and position and attitude feedback were obtained using a set of IR cameras - so basically I programmed a pilot) and I have a pretty solid understanding of the inner model (the part between the command and the change rates, which I overrode the last time)
  • I know how to use IMU data to calculate attitude and position
  • I'm a decent solderer :stuck_out_tongue:

Ok - so it sounds like you have the chops for this kind of a project; just like anything else, take it slow, break it into achievable sub-tasks, and don't get overwhelmed.

Since you've use the KK2 - you know it is based around the ATMega644P. While there aren't any official Arduino boards which use this microcontroller, it is supported in the IDE. There are small modules of this nature available if you look - for example (I know nothing about this vendor, btw - just showing it as an example ONLY):

Larger boards (using PDIP packages) are also available - look under the term "sanguino" - a popular use for them is for a hackable "game console" called the UzeBox (Open-design movement - Wikipedia). Such is likely too big for anything but the largest quadcopters, but it might work for a dev platform in a pinch.

It is also possible to find out there (with some digging) different "Mega Mini" devices - basically small breakout boards with the basics of the surface mount ATMega2560 on board.

There is also this device:

I know - it's got everything there - including the software - but nothing says you have to use it! Just think of it as an Arduino optimized for a quadcopter.

Note that on many of these oddball "Arduinos" - what you are really getting is more akin to a "barebones" system. You will likely have to install your own bootloader - or leave it off entirely and learn how to upload using an ICSP programmer or similar (btw - a standard UNO can act as such a programmer - the software to do so is available in the examples with the IDE). If this is unfamiliar territory to you - then stick with the UNO and get comfortable with it, first. Then move on to these other creatures.

shayelk:
However, I didn't get to use microcontrollers before, so I think most of the knowledge I'm lacking is about how to get inputs and write outputs with the arduino (how to translate IMU serial input to QT's and QV's for example), though there are some other things you mentioned that I still need to learn (i.e. choosing wire gauge)

sounds like a good way to go :slight_smile:

Given what you've written about your skills and exposure, I don't think you'll have too much of an issue picking things up.

shayelk:
I'm looking at something a lot smaller then a DJI Phantom to start with, but I'll probably change my mind once I see all the pretty toys :wink: the budget is not too serious of a problem

Thanks again for all the input! You've been a great help!

Look into something called the "DJI Flamewheel" chassis (Hobby King sells a similar chassis - it's duped all over the place by chinese resellers). From what I have seen of it, when you have things fully outfitted on it - you basically get the equivalent of a DJI Phantom for about 2/3s of the price - if you don't mind having a wires and bits dangling and no sleek outer body, of course. Parts, of course, for that size of a quad aren't cheap (your largest expense will be in the motors and ESCs - then the batteries, not counting a charger system, of course).

However, given what you want to do - you might think about going a bit larger with your quad.

Now - that all said: What is your experience with flying a quad?

If you've played extensively with toys or actual quads, etc - then great, go forth and prosper with your project.

However, if you haven't - then go out there and get a cheap quad or two to play with and crash. There are plenty out there to choose from, but do your research: There are good ones, and not-so-good ones out there.

Hubsan makes some really decent toy quads - but they tend to be small things:

http://www.amazon.com/Hubsan-Channel-2-4GHz-Copter-Camera/dp/B00EXBDWZC

But they have great reviews all over the internet. People love 'em.

Another quad that people like (I own one of these - disclaimer here - but I am not an expert on quads by any means, and I can barely fly this one I own):

http://www.amazon.com/Version-Syma-Quadcopter-Helicopter-E-Trade/dp/B00L811EIW

It's called the Syma X5C - there are currently the original version ("version 1") - just called the "Syma X5C" - then there's a recent new version, called the "Syma X5C-2" - its supposed to be more stable, and was released last winter, IIRC. I got mine last summer, so mine is the original - and it really isn't too bad - but if you can find version 2 - go for that.

It's much bigger than the Hubsan quad - while it is possible to fly it indoors (in a house, for instance) - it's better to do so outside (which the Hubsan quad is small enough to fly well indoors decently).

Either one of these won't set you back much money, and they will give you a valuable learning experience - and if you crash and break the thing, you've only lost $50.00 or so - rather than potentially hundreds from your homebrew machine. That isn't to say it will make flying your custom quad foolproof - but it may help.

Good luck - and post back to us your success (or failure, and questions, etc - we can learn and help for just about anything - it's all useful!)...

:smiley:

Thanks again for all the input!
I did forget to mention that I have built and fly a few quadcopters (and have some glorious crashes to sing of), so I should be okay there.

I ordered a starters kit as you suggested- so I'll start nice and slowly, but I'll be sure to report back when interesting stuff happens :slight_smile:

shayelk:
Thanks again for all the input!
I did forget to mention that I have built and fly a few quadcopters (and have some glorious crashes to sing of), so I should be okay there.

I kinda thought you might have - but I wasn't completely sure. Even so, maybe the advice will come in useful for somebody else in the future!

shayelk:
I ordered a starters kit as you suggested- so I'll start nice and slowly, but I'll be sure to report back when interesting stuff happens :slight_smile:

Sounds great! Which kit? Hopefully one of the official ones...?

I actually didn't know there was an official kit - just searched ebay for "arduino starters kit" and ordered the one that looked best.
I went for this one:

Any reason why I shouldn't have?

shayelk:
I actually didn't know there was an official kit - just searched ebay for "arduino starters kit" and ordered the one that looked best.

By "official" (and I should have clarified this) I mainly meant a kit with an official Arduino-brand Arduino. The other parts don't really matter.

shayelk:
I went for this one:
Other Consumer Electronics for sale | eBay

Any reason why I shouldn't have?

The main reason to buy an official Arduino - at least as your first board - are mainly two-fold:

  1. By purchasing an official Arduino - the money you spend goes toward helping to make new Arduino products and toward keeping this forum site running.

  2. With an official Arduino - you are almost guaranteed not to have any issues with setup and use of the Arduino.

There are basically 3 kinds of Arduinos out there:

  1. Official Arduino Boards - made in Italy (though this will be changing soon), tend to be more expensive than others - but are high quality. Sold by the larger known retailers and smaller maker retailers (like Sparkfun and Adafruit) - Only these boards can use the trademark labels of "Arduino" and "Uno" - etc.

  2. Clone Arduinos - These are Arduino boards which likely have all the same capabilities of official boards, and in some cases have better. They tend to be lower cost - and quality varies (everything from high quality stuff like from Seeedstudio - to low-end crap off ebay). Overall, they tend to be a good buy, and you can sometimes get features and other things that the official boards don't have. If the seller is legit - they will NOT use any trademarked names, logos, or terms - many will even go so far as to use different PCB colors. In some cases, the boards won't even have the same layout or pinout as an official board - and will instead marketed as "Compatible with the Arduino" or similar.

  3. Counterfeit Arduinos - You find these almost exclusively on Ebay - and sometimes on Amazon - but they are everywhere, so don't use that criteria to rule any out. In short, these boards may look like an Arduino, but they usually use the trademarked logos and names on the PCB, in the marketing, etc. Quality varies - from junk you should stay far away from, to top quality stuff. Prices tend to be bottom barrel - but not always!

Another thing to note - and this applies to both counterfeit -and- clones (but not official Arduinos) - these boards, because they tend to be lower cost - may or may not use the same chip for USB serial communications. Many of the clones and counterfeits are currently using the CH340 chip - others will use the FTDI chip (but most are moving away from that because of the earlier fiasco FTDI pulled - damn, that was as stupid as what Sony pulled a long while back), which was the chip that the official Arduino used to use. Official Arduinos now use the ATMega8U2 or 16U2 for USB comms:

http://www.arduino.cc/en/Hacking/DFUProgramming8U2

These chips tend to be more expensive than other solutions, but they have the bonus of where you can reprogram them! That means you can do much more interesting things with them (Act as a USB host, for one thing - or emulate a keyboard or other controller, for another) than you can with the other chips (because they are "fixed" for serial communications only).

Sometimes, getting the drivers to work with those other chips can be hit-or-miss - but in general things tend to work.

Sadly - it appears that your kit's board falls into category #3. I couldn't tell what USB chip it uses.

You're not going to be penalized or anything, but take it as a learning opportunity, and try to get an official board for your next go-around. Just think of it as a way of saying "thanks" to the creators (and to a much lesser extent, the community). Then - do your research on clone boards - there are some great sellers out there. Seeedstudio (which I mentioned) recently became a partner with the founders of the Arduino for manufacturing under the Genuino brand in China for sell/distribution in Asian markets ONLY - but they have always manufactured and sold their own custom Arduino and similar boards, at really low prices. IIRC, they were one of the first to use a low-profile mini USB connector (instead of the full-size USB A connector) - that, coupled with other features, made for a much more low-profile design - and you no longer had to stick a piece of tape on top of the USB port casing in order to plug in a prototyping shield (or other shields) - which could short out on the metal.

Lastly - did you happen to see this mega-thread about the "BlueCopter" - an Arduino-based quadrotor:

http://forum.arduino.cc/index.php?topic=184503.0

If you dig thru the thread (sometime after page 20, IIRC) - you'll find a GitHub dump of code for using an Arduino Uno or Mega2560. Note that it seems like that quad uses custom programmed (aka - hacked) ESCs from Hobby King - but I wasn't able to find the instructions for doing so (I didn't look at every page of the thread, though). From what I can gather, the ESCs use an Atmel microcontroller, and you reprogram them so that they can take PWM (instead of PPM) input. Then - the code on the Arduino translates the PPM signals from the RC receiver into PWM signals for the ESCs. Supposedly, this allows for a faster update rate for the motor speeds, ensuring more stable flying and hovering, etc - than is possible using standard PPM output.

The parts that are listed come to around $100.00 USD for the motors and ESCs - the remainder of the parts would put the whole craft at somewhere between $200.00 and $250.00 USD (I think) - which isn't bad at all for what you ultimately get.

Just something to look into and get inspired by, I suppose!

:smiley:

BTW - as a result of this whole convo - I ended up getting Hubsan X4 for indoor practice. Then, I'll move on to playing more with my Syma X5C - then maybe build my own quad - likely something based on the BlueCopter...