The Ardupilot Mega 2.5 : why it's awesome.

After a good run, we decided it was time for our homemade quadcopter controller board to go. Actually, it had to. It started to wobble in the air pretty violently for no reason while flying. We made no change to the program, nor touched the hardware, and since it was working fine before, we figured that it probably came from an electronic problem somewhere in the tons of wires and soldering we made. Pretty hard to "debug"...

So here we were, on 3D Robotics website, ready to click the famous "Add to cart" button. And we finally did click, after a long time of hesitation. It was not that long, in fact. It was a no-brainer. For 180$, you get a tiny assembled PCB with an accelerometer, gyroscope, magnetic sensor, pressure sensor, GPS, current sensor, with completely open-source software that will let you do basically anything you could want to do with any kind of RC model. Not only this works with quadcopters in + or X configurations, it's also made for RC cars, planes,hexacopters, Y6 copters, octocopters, tricopters, and even helicopters! 180$ seems pretty cheap now, doesn't it? 😉

All the firmwares you can upload to the onboard Arduino mega
All the firmwares you can upload to the onboard Arduino mega
We don't regret having spent so much time on our controller board at all. It was a great experience, it worked pretty well and got us to understand pretty much everything about how these drones fly. We just couldn't make something so small and so well designed ourselves in our garage. Plus, the huge community working on the Ardupilot's software came to something close to perfection, with a dedicated windows program (APM mission planner) that can control every single parameter of the drone, communicate with it in flight via a telemetry module, prepare mission scripts with GPS waypoints and actions to take, read flights logs and export them into Google earth-friendly KML files (and more)!

What comes with the Ardupilot
What comes with the Ardupilot
We ordered the fully assembled APM 2.5 with a Mediatek GPS, and a current sensor. It also delivers with a USB to micro USB cable so you have everything you need to start playing 🙂

The Mediatek GPS,  current sensor and APM2.5
The Mediatek GPS, current sensor and APM2.5
It turned out very easy to setup on our existing quadcopter frame. We followed the instructions given on the arducopter google code project and everything went smooth and fast! The steps are the following:

  1. Download mission planner and install it (it will also install the Arduino mega drivers on your computer)
  2. Plug-in your APM
  3. Start mission planner
  4. Choose from the drop-down list the COM port you APM has (check Windows Device manager to find which one)
  5. Go on the firmware tab, select the one you want to use, upload it!
  6. Press connect and you're ready to configure everything!

The default parameters should be fine for an average quadcopter frame (50cm wide, ~1200kv motors, 1kg). At least they are okay for flying. We lowered a bit the PIDs on ours because it was a bit too nervous but the first flight was still pretty good and the stability in the air was quite amazing, even with high winds!

A log from the the Ardupilot
A log from the the Ardupilot
You can assign any action you want on your radio extra switches and knobs. The most impressive one obviously being the "Auto" mode, where the quadcopter will follow a script of actions the user can write with the mission planer software. Just flick a switch, sit down and let the drone take off, fly to the waypoints you told him at the altitude you told him, and then land where you told him.

Casual flight around the Eiffel tower...
Flying has never been so easy! 😀 Also, it is really, really nice to have the return to launch (RTL) feature, which will bring back the drone where your armed the motors. It is a life saving feature, for those of us who put expensive cameras on their drones and don't want to crash them in case they lose the orientation or the video signal when doing FPV. It actually happened to us in one of our first flights. We were about to test the RTL feature when the drone was so far that we couldn't see its orientation anymore. We were already thinking about the "walk of shame" we would have to take with the broken pieces of our beloved quadcopter. But none of that happened. We flicked the RTL switch, and the drone came back home 😀 This feature really is a must-have! It's awesome and works great. We've only played with it last weekend, and even though it was a pretty windy weekend here, we managed to fly up to 80 meters with no problem whatsoever for the drone!

OMG, we see that the earth is round! No. It's the Gopro fisheye that does that. But everything seems pretty tiny at 80 meters of altitude.
"OMG, we see that the earth is round!" No. It's the Gopro fisheye that does that. But everything seems pretty tiny at 80 meters of altitude.
If there should be a conclusion to this article, it would be : buy the Ardupilot. It's great, works with everything, has a big developer community around it, and is actually not that expensive when you think about all the electronics it contains.
We just ordered the telemetry and OSD module so we can go all FPV on it 😉 We are definitely going to play our quadcopter in the weeks to come, and will try to add a nice video to this article (or to a new one) to show you what you can do which such a powerful tool 🙂

The quadcopter : the flight controller shield

For our new quadcopter frame(article coming soon 😉 ), we decided to create a completely new Arduino shield, using new sensors and trying to avoid having lots of wires floating around.

We bought the 9 DOF stick sensor from sparkfun and the BMP085 barometer (used for altitude hold). When on the  old shield we had the 3 sensors (ADXL345, L3G4200D, HMC588L) on different boards and linked to the shield by  wires, we now have a single breakout board, directly soldered on the shield, which is a much better looking solution. It also avoids long steps of soldering, plugging mistakes etc... The EM406 breakout board is also directly soldered on the shield. We added two 7x2 connectors, in order to plug the RC receiver, SRF02 sonar sensor and possibly 2 servos in order to control a 2 axis gimball 🙂 The schematic looks like this:

The shield schematic

Another novelty of this shield is the connections with LEDs flexible strip. In addition to the aesthetic side, it will also be useful to distinguish the front from the back of the quadcopter, signal the end of calibration, blink during altitude hold mode etc.. These LEDs strip are not directly plugged to the Arduino, since they require 12V input and could be a bit too much power consuming to be fed from the Arduino. So they are controlled by a NPN BC517 transistor of which the base is connected to a digital output  like so:

How to control the LED strip with the Arduino

The last difference with our previous quadcopter is the change from a L3G4200D gyro in SPI mode to a ITG3200 in I²C mode. We did this partly to free all the SPI connections of the Arduino (10-13) because we needed available ports for the LEDs and for the future gimball, and because our L3G4200D was  pretty often giving completely false readings without any reason. We couldn't find the cause of this problem but we found a few people having the same problem  when we googled it... That pushed us to buy this stick sensor.

The final PCB looks like this:

The shield PCB

The holes and the contour were drilled with Benoit's CNC router and after soldering all the parts, the final results looks like this:

The Arduino shield with theEM406 breakout board, the 9 DOF stick IMU, and the BMP085 barometer

We have tried this shield with our old prototype frame and everything works fine, the flight is really stable.We use the LEDs to show the end of calibration and of course to show the front of the aircraft which is a big help when flying.

So as I said in the beginning of this article we are currently building a brand new frame entirely made of carbon fiber, with new motors, new ESCs and new propellers. We hope that we can finish the construction within the month to come (if we receive our order made at Hobbyking 2 weeks ago 🙂 ) and we will of course post pictures on the website! Stay tuned 😉