Wednesday, May 28, 2014

Day One. Objective: Achieve Manual Flight

Note: This is a series of articles in which we document our attempt to build an autonomous drone for the Sparkfun AVC.  The previous post is here.

We owe a proof of concept video to Sparkfun by the end of May.  Since Alex and Matt are leaving town to compete in a regional mathematics competition on Friday morning, that gives us about four days to get a prototype put together and flying.  It's an aggressive schedule, but we like a challenge!

We knew this first day was going to be a rough one.  There's just so much we don't know and all we're starting with is a pile of parts and a lot of enthusiasm.  By the end of the day, we're hoping to see a copter get off the ground under manual control.  So today's agenda was:

  1. Build a hex copter
  2. Get the autopilot module installed and calibrated
  3. Figure out how to get it talking to a transmitter
  4. Learn to fly it

Oh So Many Pieces

My first order of business was to build the air frame.  Step number one is always to inventory the parts and see what we're up against.

Power distribution board, arms, motors, ESCs (electronic speed control - see I'm learning already!), props, and miscellaneous screws and straps.  Check!  Here is a close up of the parts.

That is a lot of parts, but thanks to some great assembly video tutorials, putting it together was pretty easy.  The eagle eyed reader might notice that those ESCs are marked as 30A.  That's A as in amps, meaning that they are capable of providing a continuous current of 30 amps to its motor.  Multiply that by 6 motor/ESC pairs, and you have a system that can draw 180 amps continuous.  If that sounds like a lot of current to you, you're right!  This might be a good time to talk about batteries.

Where do we get a battery that's light enough and small enough for a hex copter but can supply a lot of current?  My solution is a 5000 mAh, 3-cell 25C LiPo battery as shown below with its charger.

A 5000 mAh (milliamp-hour) battery can supply 5000 milliamps, or 5 amps, of current for one hour.  Or it can supply 30 amps for 10 minutes.  Since I expect each motor to draw about 5 amps continuous during flight, I would guess that we'll get about 10 minutes of flight time, which should be enough to accomplish the mission.  If you're wondering, 25C is the battery's capacity rating.  This means that it can safely provide 25 * 5000 mA of current - or roughly 125 amps.  Of course, it could only supply that much current for about 2.5 minutes before draining the battery!

While I was busy assembling the F550 base, Sondra and Matt started trying to figure out how the Pixhawk, the GPS module, the mission planner software, the transmitter, and the receiver all work together.  As with everything, there are a lot of great docs and video tutorials on getting our transmitter to talk to our autopilot.  After trying both versions of the mission planning software, they decided to go with Mission Planner rather than APM planner, at least for now.  Mission Planner is older, but it seems a little more feature complete.

It can take a long time to calibrate accelerometers, compass sensors, GPS receivers, and gyros, but it's not at all optional.  Battling impatience was a theme today.  Below is the assembled F550 with the Pixhawk autopilot temporarily mounted. It's a match made in heaven, we hope.

The next step was to calibrate the sensors on the on the Pixhawk and try to get it talking to the transmitter.  In addition to helping with everything else that was going on, Alex managed to start some OpenCV development on the Jetson board to try to get it talking to the USB camera.

The Jetson TK1 development board is a really incredible piece of technology.  If you haven't heard about it, it's a board that features Nvidia's latest TK1 SoC.  This chip features a 4+1 ARM quad-core configuration in a big.LITTLE arrangement.  That means that it has 4 big, powerful cores for heavy number crunching and 1 smaller, more power-efficient core that handles all of the less time-critical, more mundane work.  In addition, this SoC has a 192-core Kepler GPU so it packs a very serious graphics punch.  We're hoping to try to get OpenCV running in a hardware accelerated mode on this baby in order to give us all the performance we need to find and identify our balloon victims.

In addition, the board runs a version of Ubuntu which means it's really easy to develop right on the board itself.  This makes hardcore Linux development geeks like Alex very happy.

Oh So Many Mistakes

As always it's the things you don't know that you don't know that get you.  Here is a fair sample of our lessons learned for today.
  • Did you know that if you don't bind the transmitter to the receiver, they won't talk to each other?  (that sound you hear is the experienced R/C guys laughing at us... :-)
  • It pays to make sure that the axes on your transmitter match your autopilot's expectation.  It's really tough to fly when an axis is reversed or what you think is the pitch control is actually yaw.
  • Your autopilot will probably want to be mounted on the center axis of your copter.  There is a reason for this (think gyro sensor).
  • Those loud annoying beeping sounds that never quit are your ESCs complaining because they have no signal input from your autopilot.  It will stop once you have things talking properly, I promise.  In the mean time, covering your ears and humming loudly to yourself may help you, but it will also annoy your team mates/family members even more.  Not recommended.
  • If you don't pay close attention and number your motors the way your autopilot expects, your copter will invariably flip over on its back as soon as you try to lift off.  If you don't actually know how to fly a hex copter, you'll probably think "boy, I really suck at this."  And you'll probably be right, but you should also check your motor numbering.
So did we manage to get a copter built and flying after all of that?  Well yes and no, we did manage to achieve level flight for a few seconds, but we definitely have a spinning problem.  Even so, we had a great first day and we made a bunch of progress!  Below is a short video of some of our flight tests.

Hopefully tomorrow we'll achieve some real flight!

Next: Day Two

No comments:

Post a Comment

Please Note: All comments are moderated. That's why you won't see your comment appear right away. If it's not some stupid piece of spam, it will appear soon.

Note: Only a member of this blog may post a comment.