How I built my first drone - Part 1 (the hardware)

How I built my first drone - Part 1 (the hardware)

After starting building robots last summer, towards the end of the year I went the extra dimension and started building my first drone. I've never owned a drone before (except for a micro one - the Hubsan X4), so I didn't really know much about it, and had to do a lot of reading, especially about hardware, which was never my strong point. My work was delayed a lot by the winter weather, because it's kinda hard to move your fingers when it's 20 degrees or less, and it's even harder to control a drone in 30mph winds.

I went with ArduCopter architecture, which uses open-source software for its autopilot. The autopilot is a small computer that controls the basic operations of the drone (stabilizing, guided movements, GPS tracking, etc). It basically sends commands to the motors to compensate for winds, to change spin, pitch or roll. The user can control the autopilot with a remote control, or with a companion computer that runs custom programs. My goal is to write programs for an autonomous drone, but before getting to the software part I wanted to nail down the hardware aspect.

So here are the parts that I used:

  1. Pixhawk autopilot ($199): This is a very versatile computer, using a real-time OS, which has the IMU (accelerometer, gyroscope, compass) built-in, as well as a barometer.
  2. uBlox GPS ($89): Integrates seamlessly with the Pixhawk.
  3. Frame and motors: I got the kit from 3D Robotics (they don't sell it anymore, unfortunately, since they discontinued their DIY products). I got the 4 motors, power module, cables and frame parts for about $120.
  4. LiPo Battery and balanced charger: I got the charger for about $20 and a few batteries ranging $20-40.
  5. Remote control: Taranis X9D, which was $199 with the X8R receiver, it's a complex RC which can be heavily customized.
  6. Companion computer: For now I'm using a Raspberry Pi 2 (about $48 with the WiFi dongle), but I just got the new RPi 3 which should be about 30% faster.

Barring the RPi, you have a full featured drone, with all the basic capabilities of a DJI or Solo, minus the cool software features (that I have to program). It's a solid hardware platform, that can hold its GPS-controlled position even in high winds, and can smoothly follow movement commands from the RC.

For my autonomous projects, I won't need the remote since the Raspberry Pi will run my software, but I got the RC for safety. The truth is I still don't trust my drone programming skills. The first time I tried a simple RPi program (takeoff, hover and land), the drone just shot up in the air, out of sight so I was convinced I lost it, but then after a minute it just came back and landed (it was an altitude calibration issue). Since then, everytime my Python programs would crash, the drone would drop to the side (I've been tethering it with a string) and break some propellers (I'm at the 4th set now - luckily they're less than $10 a set). That's why I got the remote, to be able to override the RPi and take control if my program crashes.

For now, I finally have a stable remote-controlled hardware platform than I can develop on. You can also build it by buying the parts (autopilot, frame, motors, GPS, RC), and if you attach a camera (with gimbal) you also have a full video drone. If I were able to do it with almost no knowledge of drone mechanics and hardware, I'm sure any DIY person can do it.

But this is just the beginning and now with the warmer weather (and RC backup) I'm ready to build some cool software. And this is not just about follow-me or planned paths (that many commercial drones do), but deliveries, obstacle avoidance (a big thing, that major companies seem to be "avoiding" to implement), remote-less object tracking, computer vision and more. I will write about all these as they come to life.

As for building the drone form parts, here are some tips from my experience:

  • Make sure the motors are wired correctly to the power distribution board, and then that you always attach the propellers the right way (2 are spinning clockwise, 2 are counter-clockwise).
  • Secure all the screws very tight in the main part of the frame, maybe using Loctite or another screw glue.
  • Start with at least a 4000mAh battery. You'll also need a few of them since they don't give you more than 15-25 minutes. Then experiment with various capacities and watch the flight time varying with the added weight. I'd also go for 4S (4-cells), though 3S seems to be perfectly fine, and at least 20C (discharge).
  • Check the screws every now and then (the ones that you didn't secure, for the more frequently detachable parts), and the propeller screws every time! There's a tremendous amount of vibration in the drone, plus each crash adds additional shock. I keep finding loose (or missing) nuts all the time.
  • Test for interference... Most camera Wi-Fi would use the 2.4GHz band, same as the radio remote. And many IP webcams that you might attach to a companion computer interfere with the 1.575GHz GPS signal. If needed, wrap things in tinfoil.
  • Try the first flights in a wide open area, and enjoy! It's a great feeling the first time everything comes together and the drone flies as commanded!
  • My favorite Pixhawk flight modes are Loiter (which maintain position and altitude, unless you move the sticks), and Drift (a very fast, airplane like flying mode where you use only one stick to "drive"). Besides Land, they are the only two I've actually used so far, even as I programmed the Taranis X9D with six flight modes.
Armin Alibasic

Senior Data Science Director | Data Science Strategy & Leadership | Advanced Analytics & Machine Learning | Ph.D in Computer Science

8 年

Well done Chris Fotache. Impressive work. But I would not agree to this part: "obstacle avoidance (a big thing, that major companies seem to be "avoiding" to implement), remote-less object tracking, computer vision" because Dji 4 has all of these, and they just launched Dji 4 pro which has, even more improvements. Of course, these commercial drones cost way more than 1000$ so that is why I totally support your work and say go for it :)

回复
Fadl I.

Leadership & Management | Engineering & Technology | Critical & Regulated Industries

8 年

Great article. I share your passion and wish you all the best.

回复

They should be illegal!!

回复

I would look into ways to do some testing on the the flight plan sent from rpi to the drone before running it on the actual drone. I wonder if there is any kind of simulator that one could use to see how the hardware will behave given a certain flight plan. Your project sounds like tons of fun. Keep having fun. Thanks for sharing?

Carlos Meneses

Web Design & Development | Graphic Design | Print Production

9 年

You had me at "building robots"

要查看或添加评论,请登录

Chris Fotache的更多文章

社区洞察

其他会员也浏览了