Results 1 to 16 of 16

Thread: Attempting to build and code a drone/Quadcopter

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Canada, British Columbia
    Posts
    54

    Attempting to build and code a drone/Quadcopter

    Sooooo guys,
    my dad and I have been thinking of building our own quadcopter straight from scratch. Only problem is, getting all the electronics and all together.
    Now, my dad says that he wants ME to design and code the damn thing :P And i hardly know much about coding other than .NET.......
    So, he says that there's this website called microchip.com. they have microchipDirect which distributes chips and parts, and they have the main website and all....
    Now, i need to know which parts I need to be able to make the brains and motor controls of the quad......if ANY of you know about this topic, and are familliar with microchip, or similar things, help would be appreciated.
    Feel free to ask me any questions you need, and i will try my best to answer them.
    Best Regards
    ~Mister_Meh

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Attempting to build and code a drone/Quadcopter

    Ohhh you should talk to CVMichael. He has been playing with quadcopters for a while now. Let me find his video and I will post it. Pretty amazing views you get from quadcopters.

    After the holidays I am going to look into purchasing a quadricopter to get started.

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Attempting to build and code a drone/Quadcopter

    https://www.youtube.com/watch?v=mIYogu0J16g

    Apparently its a hexacopter not quadracopter.

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Canada, British Columbia
    Posts
    54

    Re: Attempting to build and code a drone/Quadcopter

    ooh, thanks
    ~Mister_Meh

  5. #5
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: Attempting to build and code a drone/Quadcopter

    Hi Mister Meh,

    Building a quadcopter I would rate it as "average" in terms of difficulty, but coding the software for it, it is extremely difficult.

    First you need to get/build a quadcopter and working properly with an existing flight controller (FC), and after you can say that you are expert at flying it, THEN try to make your own flight controller, and trust me, that will be at least a few years from now.

    I don't think a beginner in programming, with no previous concepts about quads (or any flying things) will be able to code a flight controller, so I seriously think you should drop that idea.

    But building a quadcopter with an existing flight controller, that should be OK for you.

    Do you know what are the main components of a quad?

    A hexacopter is not any different from a quad besides that it has 2 more motors; here are the parts for my Hexacopter:

    DJI F550 Frame
    DIY Landing gear (wood sticks, plastic pipes joints, zip ties)
    MultiWii PRO
    NTM Prop Drive Series 28-26A 1200kv
    8x4.5 Carbon Fiber Propellers
    RCTimer ESC 30A SimonK Firmware (OPTO)
    Tarot T-2D gimbal with GoPRO 3 Black
    Turnigy 9X Transmitter
    Turnigy 5000mAh 4S 40C Lipo (8 - 9 mins flight time)
    Turnigy nano-tech 6000mah 4S 25~50C Lipo (10 - 11 min flight time)

    Most of the parts I got from HobbyKing.com

    If you are wondering how did I get that stable video, it's because of the Tarot T-2D gimbal with GoPRO 3 Black recording at 1080p, and 30 fps.

    Here's how my Hexacopter looks like (this was without the gimbal)
    Name:  hexa.jpg
Views: 1824
Size:  52.4 KB

    And here is a closeup with the gimbal attached:
    Name:  2014-12-07 15.40.23b.jpg
Views: 1623
Size:  47.0 KB

    View from underneath:
    Name:  2014-12-07 15.39.16b.jpg
Views: 1840
Size:  74.0 KB


    The MultiWii PRO flight controller is based on Arduino compiler, and you can find the source code here:
    https://code.google.com/p/multiwii/
    So if you want to get an idea on what is involved to code a flight controller, just take a look at the source code of the MultiWii

    I also built a wood quadcopter, and it was relatively easy to do:
    Name:  2014-10-04 20.08.24b.jpg
Views: 1939
Size:  44.8 KB

    Here are the parts for it:
    Motors: NTM Prop Drive Series 28-26A 1200kv
    ESC: RCTimer ESC 30A SimonK Firmware (OPTO)
    FC: Naze32 Acro
    Transmitter/receiver: Turnigy 9X Transmitter
    UBEC (to give power to the FC): 5V/5A UBEC
    ...and A LOT of zip ties!

    The most difficult thing is probably deciding what motors to use, and what propellers, because this depends on the weight of the quadcopter, and also it depends what you want to do with it, how agile you want it to be? for example: do you want it to do quick turns, to fly fast, and do flips with it? (this means a small quadcopter, that drains your battery pretty quick) or do you want a big quadcopter, slow, but battery lasts longer? it all depends on what parts you choose, how big, and how heavy it is... so you have to get motors and proppers that match with the rest of the body and how heavy it is. And also don't forget to count the battery in the weight, because that is actually the heaviest part of the quad!

    There is A LOT to explain how everything works, but I think it's best if I just answer your questions.

    As for my questions:
    What do you want to do with your quad? how big do you imagine it to be? do you plan to record video (like I did)? what about FPV?
    Did you ever work with sensors, like the barometer, accelerometer, gyros, compass, gps?
    How much programming do you know? do you know C programming? do you know what is a Kalman filter? (without the Kalman filter the quad won't be able to stabilize).
    You said something about microchip.com, this means you want to make the flight controller with a PIC microcontroller? (I assume it's a PIC32, because anything else, you really need to optimize the code for speed to make it work with a lower speed PIC)

    Anyways... I will wait for your questions

  6. #6

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Canada, British Columbia
    Posts
    54

    Re: Attempting to build and code a drone/Quadcopter

    Heyo CVMichael,
    I really do appreciate your help
    I'll just answer your questions for now.
    1. First off, I want my quad to be able to film videos from a GoPro Hero4 or a similar camera, and be able to achieve at least 20+ minutes of flight time.
    2. I would like the quad to be around 2 feet in diameter, or somewhere around there.
    3. Like I mentioned earlier, i would like the quad to capture videos, and also do FPV, which i understand incorporates transmitters and receivers.
    4. I have not worked with sensors.
    5, As for programming, i know a little .NET, which I think will not really help me here..... BUT, the opportunity came up at just the right time, because my dad actually told me to get into C coding, and that is what i'll be attempting to learn.
    6. I have not heard of a Kalman filter
    7. and as for microchip.com, that is a website that my dad told me about, and as for the specifics of building the controller from scratch, i do not think I am competent enough as of yet.

    So, those are the answers, i hope i answered accordingly, if you need to know anything more, just ask.
    I was wondering, as you are offering me this knowledge right now, wold you be able to help me throughout my journey of actually designing and building my own quad?
    Thank you.
    My very best regards
    ~Mister_Meh

    One more thing, as for funds for purchasing parts, my budget is not the greatest. My dad can chip in, but all i have in my account is $1K
    ~Mister_Meh

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,038

    Re: Attempting to build and code a drone/Quadcopter

    I would suggest that you try to find a third party as a source for the flight controls, while you focus on what you want the drone to do other than go up and stay up (aside from battery considerations).

    One place you might have a look is this site:

    https://www.sparkfun.com

    They have lots of components for things, such as GPS, Bluetooth, and the like. Whether or not they have anything specifically drone related I don't know, but it sure wouldn't surprise me. You already have a big advantage in that you are allowed to fly the things. We have a great use for this type of drone with our work (we've killed off three friends of mine over the last decade in flying accidents that could have been better done by drones), yet the US FAA is looking like it will impose rules so prohibitive that it will make flying drones essentially impossible (such as them being operated ONLY by a minimum of two certified pilots who are keeping up the same rigorous medical clearances required of flying pilots).
    My usual boring signature: Nothing

  8. #8
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: Attempting to build and code a drone/Quadcopter

    OK, so if you are just starting to learn programming, then there is no chance that you will build a flight controller. There are many very advanced things you need to know to make a flight controller. If you start to learn electronics with PIC32 microcontrollers, how to use sensors, and advanced math (like the Kalman filter), maybe in 5 to 10 years from now you will be able to make something close to what is out there now.
    I know electronics, I worked with PIC microcontrollers (including PIC32), I designed various PCB boards, and and I know C/C++ very well (and also .NET and a few other languages). I started to learn programming almost 20 years ago, and making a flight controller is a big challenge even for me! As I said before, just take a look at the MultiWii code, and see if you understand anything...

    20+ minutes flight time is very hard to do. With my hexacopter I get about 10 minutes, and with my quadcopter (I don't have any camera, or FPV on it, so it is very light), and I get about 15 minutes on it, but as soon as I add those things (camera + FPV), I am sure the flight time goes down to 10 minutes or so. I know there are quadcopters out there (like the DJI Phantom 2) that fly for 20+ minutes, they use very light materials, and very good batery. I wanted to buy a better battery for my hexacopter, that will probably double the flight time, but just one battery is $300. Compare that to the battery I use right now that is $60.

    The GoPro Hero 4 is half of your budget, so I don't see you purchasing high quality parts, therefore it will be difficult to get the 20+ minutes flight time.

    Camera is about $500
    Tarot T-2D gimbal is $116.99 at HobbyKing
    FPV: depending on the video quality you want: minimum $200 to a better quality at $400 (I got a cheap one and it turned out to be USELESS!!, I crashed my drone because the quality of the video was very bad)
    Motors + ESC + Flight Controller + Propellers... lets say about $150
    Frame... depending on how big, and quality... let's say between $30 to $50
    Landing gear (depends on the frame) $20 to $50
    One battery is $50, but one is never enough, so let's say 2 batteries, that is $100
    Power supply for charger and battery charger: about $150
    + small things like, sticky velcro, zip ties, wires, jacks, battery alarm/monitor, UBECs, prop balancer: about $50
    + extra propellers and extra motors (because you will crash over 100 times), that's another $50 to a few hundred dollars depending on how many times you crash of course

    So that's about $1500

    How about you start simple? try go make a quadcopter that flies.... period!
    Last edited by CVMichael; Dec 21st, 2014 at 08:39 PM.

  9. #9

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Canada, British Columbia
    Posts
    54

    Re: Attempting to build and code a drone/Quadcopter

    oooohhh.....damn, well, my dad already has the GoPro 4...but, yeah, i guess i'll talk to him and tell him about what you said.
    I'll also start to learn about coding in C
    thanks again
    ~Mister_Meh

    I was wondering if we could maintain contact and/or keep this thread open so that i can contact you if anything arises and/or i need your input or help?
    ~Mister_Meh

  10. #10

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Canada, British Columbia
    Posts
    54

    Re: Attempting to build and code a drone/Quadcopter

    One more thing.
    I have myself a Hubsan X4 that i recently bought off of ebay (I know, they're usually knock off's) and it has a built in camera in it. (I've never seen one like it) and i'm guessing that's a knock off Hubsan, but hey, it looks and flies like one :P.
    Anyways, I was wondering if you knew of any way that i could attempt to learn the coding of the Hubsan and learn about what's inside of it? All of the specifics, and if i may be able to reverse engineer it and MAYBE build my own from what i learn from the Hubsan??
    Thanks
    Best Regards
    ~Mister_Meh
    ~Mister_Meh

  11. #11

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Canada, British Columbia
    Posts
    54

    Re: Attempting to build and code a drone/Quadcopter

    So, i found this on le interwebs, and i was wondering if the same could be done with a Hubsan X4??????
    https://github.com/alvarop/protox

    Here's his youtube video for his project
    https://www.youtube.com/watch?v=BfAR...ature=youtu.be

    I just need to know if i can do this with a Hubsan, and if i can use a Raspberry Pi as a development board for it....
    and i would need help connecting everything together and setting it all up....as i am, as you already know..an complete noob at all this stuff.....but hey, you have to start somewhere if you want to learn
    Best Regards
    ~Mister_Meh

  12. #12
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: Attempting to build and code a drone/Quadcopter

    Hi,

    Just a few weeks ago I started looking at getting the Hubsan X4, but they don't have it in stock at my local hobby shops, and I don't want to get some other brands that I don't know about. But the intention of getting it was just to fly around the house, and to learn to fly in general. Since the cold weather started, I did not go out to fly and I miss it a lot...

    The video on the Proto-X, he did not do any code modifications to the quad or even the remote control... he modified the remote control physically to take input from another microcontroller that is connected to the computer, so the remote control is basically a transmitter. Then he programmed the microcontroller to give input to the Proto-X remote control. To do this; you need to make a program on the computer (that can be in .NET), and then he used C to program the microcontroller, and both programs need to know to to "talk" to each other.
    PS. I can't see anywhere what microcontroller he used...

    So "yes" theoretically you can do the same thing with the Hubsan remote control....

  13. #13

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Canada, British Columbia
    Posts
    54

    Re: Attempting to build and code a drone/Quadcopter

    Soo...i took apart my Hubsan X4 controller...I noticed that on the bottom of the PCB there's space available for a speaker?
    I'll post pictures later, as my current internet connection speed id too poor for pictures.
    Regards
    ~Mister_Meh

  14. #14
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: Attempting to build and code a drone/Quadcopter

    I went to the hobby shop, and I bought a Ladybird V2 Devo 4 (cost me $73 including tax). Took a long time to charge the battery (about 30 mins?). When finally charged, I had to bind the quad, and started to fly it... I thought that if I have previous experience flying quads I would not crash it... but boy I was so wrong! i crashed the thing like 10 times! and in my last crash the plastic that holds one of the motors broke, and even the motor does not spin anymore! I tried to fix it, and I was not able to so far, I will try again tomorrow... $73 gone in just a few hours... most of the time I was waiting for the battery to charge! by the way... other annoying things about it... I had to bind the quad with the remote every time I turned on/off the remote! very annoying!! also I had to calibrate the quad to make it stable every time I charged the battery....

  15. #15

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Canada, British Columbia
    Posts
    54

    Re: Attempting to build and code a drone/Quadcopter

    ooohhhh.....
    ~Mister_Meh

  16. #16
    Addicted Member arunb's Avatar
    Join Date
    Jul 2005
    Posts
    131

    Re: Attempting to build and code a drone/Quadcopter

    Once you get your quadricopter flying you may want to do some thrilling stuff like controlling the quad through a computer, or say even controlled flight (autopilot).

    For these kinds of applications you could use the Arduino development system, google arduino and check out the robotic projects, maybe you find something interesting. You will find the arduino system easy.

    Microchip has a similar module, I think its called microstix, then there is embed which is also quite popular.

    Of course you can also use a small raspberry PI computer which is also very popular in robotics.

    I just thought you might be interested.....

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width