Ardupilot: A Feature-Rich Autopilot for All

Amador UAVs
4 min readJan 15, 2019

You sit down with your team, ready to write all the autonomous software for your shiny new drone, airplane, or wheeled vehicle. And then you realize how much work has to be done to read in sensor data, sort it out, control motor/servo regulation, handle radio input/output, GPS, course correction, telemetry logging, and much, much more. And then the programming task doesn’t seem so exciting anymore. Furthermore, you realize that’s just the base work, on top of which you still need to write the (more interesting) stuff — image recognition, pathfinding, maybe even ML! If you’ve ever been here, or are interested in exploring autonomous vehicles, you should definitely checkout Ardupilot.

What is Ardupilot?

Ardupilot is an open-source project that aims to make autopilot control software for a variety of autonomous vehicles — including plane, copter, and rover. It runs on compatible hardware, including the Pixhawk, APM2, and Emlid Navio (more on that later).

Hoes does the Ardupilot Workflow Work Anyway?

Step 0: We assume that you have already acquired the motor(s), ESC(s), servo(s), and battery/batteries that you need for your use case — each drone/plane/rover is different.

First up, you must purchase some kind of hardware to run Ardupilot on. These controllers run the Ardupilot firmware on a micro controller, have PWM chips, onboard sensors, and interface with ESCs, servos, and radio systems. The most popular controller is the Pixhawk (v4 at time of writing). APM2 is an older but also working controller. Emlid’s Navio+/Navio2 are HATs — specially designed to interface well with the Raspberry Pi, although Pixhawk does as well. Unfortunately, these are not cheap — the Navio2 goes for $156 at time of writing, and the Pixhawk is 200+. One solution to this is to get it used on Ebay — we found a kit of Pixhawk + stuff for $40. According to some research we have done, it is possible to get the Ardupilot firmware running on an Arduino, but we haven’t tried it. I hope to publish another article on that at some point.

Next, connect your ESC(s), battery, and servo(s) to the controller — steps vary based on the controller you are using, so just lookup the docs. Basically, there are 3 pins on the rail — 1 for power, 1 for ground, and 1 for signal.

A word on Radio/RC control:
NOTE: THIS IS ONLY FOR MANUAL CONTROL OF YOUR VEHICLE — NOT SENDING AUTONOMOUS RADIO CONTROL SIGNALS, LOGGING TELEMETRY, TRANSFERRING IMAGES, OR ANY OTHER RADIO TASK.
If you want to control your system via a handheld RC controller, you can connect the receiver of your controller to PPM port of your autopilot hardware. However, chances are your controller/receiver are PWM, not PPM. In this case, you will have to purchase a PPM encoder — I recommend this one here on Amazon. Connect as many 3 pin cables on 1 side as possible to the receiver (depends on the number of channels your RC set has). The cables are numbered on the back of the PCB. Note that only the 1st one will be red, black, and white — connect that to the 1st channel. This cable will provide power to the receiver, as well as read in channel 1 data. The others should also be plugged in in order, but only the value pin will actually be connected to the PCB — this is all that’s necessary because the power is taken care of by the 1st cable. Now plug the other side (one cable) into the PPM slot on your autopilot.

That’s about it for the hardware setup. Next you will want to find a way to connect your autopilot to a laptop/desktop computer which will act as your Ground System. There are a few different GCS (Ground Control Software) systems you can use:

  • Mission Planner is probably the most feature complete application, and we recommend it at least for setting up your system. Unfortunately, (at time of writing) it only runs on Windows.
  • QGroundControl is another very good GCS, and runs on everything — Windows, macOS, Linux, and even Android/iOS!
  • MAVProxy is a much more minimalistic GCS written mostly in Python. It focuses on a simple, configurable command line interface, and it’s GUI is only for Maps/GPS. It is very useful if you want to hook your drone up with a predetermined route that changes based on some other software. However, it can be complex to setup/use.

Now you will also need a way to connect your autopilot to your GCS. There are a few ways to go about this. One is directly via USB cable, but this usually doesn’t work in the long run for most autonomous projects. If your system is indoors, you might be able to setup a TCP/UDP connection to your GCS, although this depends on the autopilot hardware and the stability/reliability of your connection. The 3rd way is to use a telemetry radio system (ignore the name, it is for control as well as sensor logging). Something like this should be good. One end should wire into your autopilot (UART slot or something similar), while the other connects via USB to your Ground Control computer.

Setup for your GCS depends on what software you are using, but it boils down to this — first you calibrate the the sensors, then the radio, then setup which ESCs/servos do what so your system can control itself properly.

Another note on radios: If you plan to fly/drive your vehicle more than ~300 meters away from ground control/where you are standing, you will probably need an amplifier/receiver such as a patch antenna. We will talk about this more in the future.

Conclusion

Well, that’s about it for the basics. To repeat the steps:

  1. Get all your robot hardware/actuators
  2. Get an autopilot controller
  3. Wire it up
  4. (Optional) setup RC control
  5. Choose & setup Ground Control Software
  6. Connect GCS to autopilot (depends on use case)

If you finish these steps with success, you should have a completely automated system for controlling your autonomous vehicle.

--

--