Last chance to enter The Hackaday Prize.

Droning On: Choosing a Flight Controller

do4 The flight controller is the nerve center of a drone. Drone flight control systems are many and varied. From GPS enabled autopilot systems flown via two way telemetry links to basic stabilization systems using hobby grade radio control hardware, there is an open source project for you.

Modern drone flight controllers can trace their roots back to R/C helicopters. Historically, R/C planes were controlled directly by the pilot’s radio. Helicopters added a new wrinkle to the mix: tail rotors. Helicopters use their tail (or anti-torque) rotor to counteract the torque of the main rotor attempting to spin the entire helicopter’s body. It all works great when the helicopter is hovering, but what about when the pilot throttles up to fly out? As the pilot throttles up, the torque increases, which causes the entire helicopter to do a pirouette or two, until the torque levels out again. The effect has caused more than one beginner pilot to come nose to nose with their R/C heli.

The solution to this problem was gyroscopes, heavy brass spinning weights that tilted in response to the helicopter’s motion. A hall effect sensor would detect that tilt and command the tail rotor to counteract the helicopter’s rotation. As the years wore on, mechanical gyros were replaced by solid state MEMS gyros. Microcontrollers entered the picture and brought with them advanced processing techniques. Heading hold gyros were then introduced. Whereas older “rate only” gyros would drift, weathervane, and wiggle, heading hold gyros would lock down the helicopter’s nose until the pilot commanded a turn. These single axis flight controllers were quickly adopted by the R/C helicopter community.

Today’s flight control systems have many sensors available to them – GPS, barometric pressure sensors, airspeed sensors, the list goes on. The major contributors to the flight calculations are still the gyros, coupled with accelerometers. As the name implies, accelerometers measure acceleration – be it due to gravity, a high G turn, or stopping force. Accelerometers aren’t enough though – An accelerometer in free fall will measure 0 G’s. Turning forces will confuse a system trying to operate solely on accelerometer data. That’s where gyros come in. Gyros measure rate of rotation about an axis. Just as our helicopter example above covered yaw, gyros can be used to measure pitch and roll of an aircraft. A great comparison of gyros and accelerometers is presented in this video from InvenSense.

Stay with us after the break for a tour of available flight controllers and what each adds to the mix. 1024px-Flight_dynamics_with_textInertial Measurement Units (IMU) are devices which read these sensors and execute sensor fusion algorithms to determine current position and attitude. Just about every full scale aircraft produced today has some form of IMU inside it. Even your smartphone can act as an IMU. Give an IMU the ability the control the platform it’s riding on, and you have a flight controller. So how does a flight controller take data from gyros, accelerometers, and other sensors, convert it into a stable flight platform? The answer is in some clever mathematics and software. The core of most flight controllers is a software algorithm called a Proportional Integral Derivative (PID) control loop. PID loops and their tuning is such an important topic that I’m going to dedicate an entire column to it, so if you’re having trouble getting your aircraft stabilized, sit tight, help is on the way! Choosing a flight controller There are a number of popular flight controllers used today. Deciding which one is right for your needs can be a tough choice.  We’re covering open source flight controllers here, but I would be lax if I didn’t mention the commercial offerings. The DJI Naza controller is the preeminent commercial control system available. Many professional and hobbyist pilots use this system on a daily basis. Naza gives basic flight control, attitude hold, and return home functionality with a simple interface. Naza isn’t perfect, though. One issue is GPS based flight rejection – DJI autopilot systems will not allow flights over the Forbidden City in China. Undoubtedly this is due to requests by the Chinese government. However, the closed source nature of the system makes one wonder what other “features” might be hiding in the code. The “Big Four” in flight control systems seem to be The KKmulticopter, The Multiwiicopter, The Pixhawk, and the OpenPilot. 54299s7(1)

KK Multicopter

The KK board was designed by Rolf R. Bakke, aka KapteinKuk. The most popular form of the KK board seems to be the HobbyKing KK multicopter board, currently at version 2.1.5 if you can find it in stock. The KK2.1 boards are based upon an Atmel ATmega644PA processor and an InvenSense MPU-6050.The 6050 is an interesting chip in that it not only includes 3 gyros and 3 accelerometers, but also a microcontroller dedicated to handling the sensor output. This takes some of the load off the Atmel chip. There is still quite a bit of work to be done for an 8 bit micro, and Rolf speeds up the process by writing the entire firmware in assembly code. The double edged sword here is that the assembly code limits the number of developers in the project. The interface side of KK board is simple. A small graphical LCD and 4 buttons allow the user to program parameters. KK’s flight control algorithms only use P and I, there is no D on the KK board. There doesn’t appear to be an official website for the KK board, but information (and the latest source) can be found on the RCgroups megathread.  The KK board can be thought of as a bit of a gateway drug. It’s low cost, easy to set up, and it gets the job done. You don’t need a computer to set it up, everything is on the board mounted LCD. The KK board isn’t a standout performer for any of the common drone types, but if you just want to get out there and have a good flight, it’s plenty good. mwc

MultiWii Pro

Next up is the MultiWii. MultiWii’s name comes from its original sensors. The first revision of the MultiWii was designed to use the Nintendo Wii Nunchuck gyros and accelerometers, as they were cheap and easily available worldwide. Things have changed quite a bit since then. The current MultiWii board, MultiWii Pro (MWP) sports a host of sensor upgrades. The MWP board is based upon the Arduino and utilizes an ATmega2560 processor. Software is written in Arduino’s native wiring language, using everyone’s favorite processing based IDE. The board’s current sensor suite is extensive. In addition to the usual gyros and accelerometers, it has a barometer, magnetometer (compass), and an optional GPS. MultiWii also allows for a number of configuration methods. Off board LCD and OLED displays can be connected for field configuration. A full GUI config program is available via the on-board USB port or a Bluetooth daughterboard. MultiWii’s source is hosted on their Google Code page, though there is a Github mirror for you git fans. MultiWii is quite capable of stabilizing an R/C style airplane, helicopter, or multicopter. The board is on the cusp of being a full-fledged autopilot. It’s not as slick as the APM, partly due to the fact that there isn’t a well funded corporate entity driving development in one direction or another. The core developers are active though, which makes this a good board to watch. APM2

Mega 2 (APM2)

The APM is an open source project from 3DRobotics. It began life as the Ardupilot, a fixed wing flight control system based on the Arduino. The project quickly grew to include rovers, helicopters, and multicopters. While the project is still compatible with the Arduino IDE, the dev site gives tutorials for using Visual Studio on Windows, as well as the ‘make’ command in a Linux environment. The current hardware is the APM2.6, which utilizes an ATmega2560 for the main processor. An ATmega32u4 handles USB functionality. The InvenSense MPU-6000 handles gyro and accelerometer duties. The APM2 has an onboard barometric sensor. Interfaces for off-board GPS and magnetometer/compass modules are provided. APM and Pixhawk use similar software builds, so check the Pixhawk below for more information. pixhawk

Pixhawk

APM2 codebase has grown in complexity so much that they’re running out of memory and processing horsepower on their 8 bit ATmega2560. 3DRobotics obviously needed a newer platform with room for further growth. They chose to build upon the hardware platform of the PX4 project. PX4 started in 2009, and current development is based at Swiss Federal Institute of Technology. 3DRobotics ported the APM code to the Px4, and rolled their own version of the hardware called Pixhawk. Pixhawk uses the STM32F427 processor, which is a 32 bit ARM Cortex M4 core with onboard FPU. 3Drobotics also uses a real-time operating system. NuttX is a free open source RTOS. Designed from the ground up as an RTOS, NuttX is much lighter than Linux or other operating systems. It could be compared to VxWorks or other industrial/aerospace RTOS’s. The Pixhawk includes gyros, accelerometers, barometer, GPS, magnetometer/compass, and telemetry. It also has a MicroSD card slot for data logs, which can make things much easier when looking for help online. PixHawk and APM2 both use GUI based Mission software for configuration. They can also operate as full autopilots, with waypoint based missions. On the source side, Pixhawk has a large active developer community behind it. The source is available on the DIYdrones Github.  3DRobotics definitely has a feature advantage here. They have the resources to implement lots of software features, build molded cases, and complete products. Their IRIS drone is possibly the first fully autonomous drone on the commercial market.

OpenPilot CC3D/Revolution

 

openpilot-revolution-kickstarter OpenPilot is another long time flight controller project. Currently supporting two platforms, the CopterControl 3D (CC3D), and their new flagship board, the Revolution (Revo). The CC3D uses a STM32F103 Arm Cortex M3, and a suite of both gyros and accelerometers. Thanks in part to the current mini FPV craze, the CC3D board is still seeing quite a bit of popularity. This has caused quite a few derivative boards to pop up, such as the Lumenier edition and the Acro Naze32. These boards seem to be very good in the “turn and burn” flight style of small FPV multicopters. The Openpilot project is moving to their new board, the Revolution. The Revo uses a STM32F405RGT6 32bit ARM Cortex M4 processor. Revo uses the InvenSense MPU6000 accelerometer/ gyro chip, along with a barometric pressure sensor, and magnetometer. Revo also supports telemetry and GPS. Both CC3D and Revo are configured using GUI based Ground control software. Source code is available on the OpenPilot’s git server. OpenPilot has had some team turnover issues, but they’re making great progress now. The Revo includes some advanced features, like an onboard telemetry radio. Coupled with the current codebase’s ability to handle high speed maneuvers on small, agile multicopters, this board has a bright future.

 Advice When Choosing a Controller

All these flight controllers are quite capable. Deciding which to use in your drone depends on the flight characteristics, and the style of flying you’re looking for. Being open source projects, there are derivative boards and low-cost clones available for all of them. Beware of the lowest cost clones. Some of them are great, but others are sub-par to say the least. Sometimes saving a few dollars means lower quality components and assembly. Nothing is worse than seeing hundreds of dollars and hours of effort fall out of the sky because of a cracked solder joint or a bad capacitor.

Hackaday Testbed Update

The parts are finally here and the build has begun! If you want to follow my progress on the Hackaday Drone Testbed, a quadcopter which will be used to test some of these flight controllers, head on over to the Hackaday.io project page! That’s about it for this edition. Until next time, keep Droning On! [Title image by Joergens.mi/Wikipedia]

Comments

  1. replic8tor says:

    Ever tested out the Naze / Acro Naze 32 FC? These are pretty nice, and its a shame more people do not know about them as viable options.

    • SirPoonga says:

      Actually, many people do know about them. It seems most minis these days are using the Naze32. I plan on putting one in my mini tricopter. Most APM and Multiwii boards are the larger 50x50mm form factor. Only a few boards right now in that 30x30mm form factor that the mini pilots are looking for.
      For my larger tricopter I am using a RCTimer Crius V2 with MegapirateNG firmware. The default firmware for the Crius is MultiWii based. MPNG is a port of APM. I am going with APM because there is a Teensy 3.1 mod out there to convert the telemetry data of APM to FrSky X series telemetry. Several MultiWii ports support FrSky D series telemetry, like the one in the Naze32. Hence why I am going to use the Naze32 on my mini tricopter, I will get a FrSky 4ch D series Rx. I have the FrSky Taranis Tx.

  2. Robert says:

    Autoquad seems to be missing, too. It appears to be one of the most stable platforms when it comes to mission flight. I’m playing around with one at this very moment and so far I am really impressed, compared to multiwii and even the Naza. I’ll probably try my first autonomous mission today.

  3. Yaron says:

    What about using a Raspberry Pi ?
    This thread has some very interesting ideas :
    http://www.raspberrypi.org/forums/viewtopic.php?f=37&t=35746

    For example :
    https://github.com/rpicopter/images
    and
    https://github.com/vjaunet/QUADCOPTER

  4. HobbyKing recently came out with a new version of the KK Multicopter controller that puts it in a hard case and separates the LCD out to a separate detachable unit.

    http://hobbyking.com/hobbyking/store/__39791__Hobbyking_KK2_1HC_Multi_Rotor_Hard_Case_Flight_Control_Board_With_Remote_Programmer.html

  5. Michael says:

    For a beginner the DJI Naza is nice (expensive, but easy to fly/setup).

  6. Lytfyre says:

    Under open pilot: “This has caused quite a few derivative boards to pop up, such as[...]the Acro Naze32.”

    The Naze32 runs baseflight, a “32 bit fork of the MultiWii RC flight controller firmware”
    https://github.com/multiwii/baseflight – I think some people have gotten open pilot running on them, but it’s certainly not the normal way of using the naze.

    I ran a workshop at the vancouver hackspace using a hobbyking multiwii board, and it needs mentioning that the multiwii desktop software is pretty horrific.

  7. xMob says:

    Another shout for the Naze32. MultiWii but on an ARM processor.

  8. Peter Hanely says:

    “KK’s flight control algorithms only use P and I, there is no D on the KK board.”
    Ouch, no on board oscillation damping. For most flight operations I’d much rather have the D and do without the I.

  9. Is this about right?
    APM:
    APM 1.X based on ATMega1280
    APM 2.x is an ATMEGA2560 and ATMEGA32U-2 (for USB) based platform
    ArduPilot Mega (APM) 2.6 running Arducopter 3.0.1 firmware .
    AIOP All In One Pro Flight Controller V2 running MegaPirateNG (MP NewGen) and MultiWii firmware for UAV capabilities
    APM 3.x : future ARM based Arducopter version

    dsPIC Based Platforms:
    AutoPilot UDB5 UAV Development board with IMU, running MatrixPilot firmware
    AUAV3 running MatrixPilot firmware
    Gluonpilot2 (dsPIC33) with Xbee running GluonPilot firmware

    STM32F1 ARM Cortex M3 Based Platforms:
    MultiPilot32 hardware with ArduIMU+V3 Shield, running Arducopter32 firmware (i.e. 32 bit version Arducopter 2.x)
    Naze32 running MultiWII firmware

    STM32F4 ARM Cortex M4 Based Platforms
    PX4 running PX4 firmware, and also Arducopter32/APM2.6 via ATMega emulation
    VR-Brain (MP32F4 v4) running Arducopter32 firmware, and possibly in the future PX4 firmware
    OpenPilot running OpenPilot GPS/GCS software
    AeroQuad32/Baloo running LibMaple firmware
    Quadrino hardware running MultiWII firmware
    AutoQuad6

    ArduPirates SuperStable, Arducopter NG, Ardupirates NG, etc)? Paparazzi / Eva?

    Is the MultiPilot32 the only one that uses an external IMU Shield / FreeIMU while all the others don’t mention IMU / OilPan because it’s built into the main FCB?

    Why do some software packages (OpenPilot, Gluonpilot2, PX4) not run on platforms of similar hardware? These incidentally don’t run software from other platforms either.. why?!

    Will most Ground Station software work with any platform? (AndroPilot, HappyKillMore, etc)

    Would most all frame work with any platform above? For example, the popular frames seem to be X, H, Stretched-X, either 4, 6, 8 motors, but will any of these work regardless of the controller board / software? Is there a sturdy one that is recommended for newbies?

    Would most Radios work with any platform / frame above? PPM-Sum, Fry-Sky on a Futaba, Graupner MX-16?

    What’s recommended to see real-time video from the uav (either via goggles or pc)?

  10. Grawp says:

    From what I read on APM and PX4 forums I don’t think that the APM is really utilizing NuttX. The APM is just running in one thread! Please correct me if I’m wrong.

    I also have a really strong hunch that Pixhawk (HW) was developed as part of PX4 autopilot project and not by 3DR!! as the Pixhawk is direct descendant of PX4FMU + PX4IO boards. PX4 autopilot is also SW primarily meant to be run on Pixhawk. APM was just ported for the board.

    It may be little confusing since Pixhawk is much more frequently combined with APM than with PX4 sw. Once I witnessed somebody asking about APM related problems on PX4 autopilot forums. The newcomer got there via Pixhawk’s mainpage http://pixhawk.org which is actually part of PX4 autopilot website. He was politely redirected to APM webpage.

    • Andrew Tridgell says:

      @Gramp, APM (ie. ardupilot) does use NuttX. It runs in 4 main threads, plus a bunch of lower level “soft interrupt” tasks for sensor drivers.
      Pixhawk was developed as a cooperative project between the PX4 project, 3DR and the ardupilot project. I’m the lead developer on the ardupilot side of things, and I also maintain the plane and rover ports. There is a lot of common code between the PX4 “native” stack and ardupilot and a lot of cooperation between the various projects.
      Cheers, Tridge

      • Grawp says:

        @Andrew, thank you for clarifying it. I haven’t expected much cooperation between the projects.
        Nice to know that Ardupilot really use NuttX. NuttX is IMO really beautiful OS (having VFS, unix like devices/drivers system, POSIX-like APIs while still being very simple and it has wonderful CM4/3 support).

  11. adi says:

    Not enough of flight controllers are described in this article !!
    For example KFC32, this is very good flight controller for only about 110$. It’s very popular in Poland. It has lots of features. Position hold, return to home, altitude hold, flight log, dedicated OSD, and more, check it out:
    http://www.rcgroups.com/forums/showthread.php?t=1832957&highlight=kfc32#post24152191

  12. mikey dee says:

    what are the Cons to the APM 2.5 or 2.6? also there are some cheaper china made ones on ebay.. should i be scared? lol

  13. Dan Jones says:

    I was the one who commented in the previous article.
    http://hackaday.com/2014/06/04/the-autopilot-shield-for-the-raspberry-pi/#comment-1551094
    It seems to have spawned the comment in this article about team turnover. From what I understand, again reading over a few of the public statements during the team turnover, it appears that most of the former OpenPilot teams are now TauLabs.

    I also agree that this list is far from comprehensive. I would like to see AeroQuad added to the list. Some of the Tau Labs boards would be great to see like Quanton – http://www.quantec-networks.de/shop/en/quanton/1/quanton-flight-control-rev.-1 What about naze32? Or the generic KK board from HobbyKing?

    Much has been left wanting.

    • Tim says:

      > it appears that most of the former OpenPilot teams are now TauLabs

      This is false, HostileLabs is a fork of Openpilot with a couple of the old openpilot devs that caused a lot of drama and to this day continue down that negative path, from experience with both groups, the openpilot project improved dramatically once they left.

      I owned a Quanton, like you I bought in to the Taulabs BS initially, it’s garbage, overpriced and the guy behind it is toxic as are all the taulabs people I have had the displeasure to deal with.

  14. Hey guys,

    We have an open source framework for programming drones based on Android.
    We will provide full sdk with high-level functions, simulator for testing your apps and maybe some computer vision in version 1.0
    Hopefully will secure seed funding in the following month and fully commit.
    Will be happy to hear some feedback.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 91,108 other followers