A Simple Fixed Wing RC autopilot


Introduction:

This is a bit of a proof of concept project. The parts have arrived so now it’s a ongoing project.

What’s the plan – A simple flight controller for fixed wing RC

The plan is to come up with a simple flight controller that can act as a safety backup in case of loss of RC control. It must stabilize the model and fly it back to the original launch location and loiter overhead until control is regained or the battery/fuel runs out. It must be reasonably priced and easy enough to use by anyone with minimal computer skills.

What are the options

Sure, there are plenty of existing flight controllers, but currently they all require extensive computer and other skills to configure and operate. Anyone who thinks they are easy to use has already spent many tens (probably hundreds) of hours coming up to speed.

It does not need advanced features, telemetry, data logging, 25 flight modes or waypoints.

Features:

  • manual unassisted control
  • stability and level flight when commanded or RC lost
  • RTL (return to launch) when commanded or RC lost

Requirements:

  • standard hardware
  • open source
  • reasonable cost
  • minimal computer skills

Why Use Multiwii

This plan uses readily available hardware and the Multiwii Firmware (the programing that makes it work). Why Multiwii? Because it’s well established, well featured and works quite well. It is mainly a multirotor controller but has some options for fixed wing. For multirotor use development of Multiwii has slowed as the community is moving on to more powerful systems. But for this application we need something that works and is stable; we don’t need cutting edge performance and the latest features.

There will always be newer hardware and the latest firmware, but this needs to be stable and not always changing.

Computer skills required

Being open source and based on standard hardware means that you probably cannot buy it pre-loaded and ready to go.

You will need to install Arduino (here) on your computer and be able to plug the flight controller board in to your computer. I’ll explain this later.

The Arduino project that makes it work is a simple download. There will be a few lines to edit in a text file depending on your model; I may simplify this or just provide a few pre-configured options.

One of the biggest complexity problems with existing open source flight controllers is the complexity of working out what is required, where to get it from and what to do with it once you have it. Keeping it simple and all on one web page, files and documentation, should eliminate the confusion.

Bluetooth and the Android App

multiwii EX-GuiThis is a handy way to adjust and monitor and confirm it’s working. You do need a Android phone or tablet with Bluetooth (they all have now).

The App I use is called MultiWii EZ-GUI, here. The basic version is free but for a few maybe $15 you get extra useful features.

Even if you don’t change the configuration, the APP lets you confirm that your model is working correctly and ready to fly.

The parts required

You can get these from a number of suppliers including Ebay and Hobbyking. I went to Ebay, as HK was out of stock of one item. There are differences between the various boards but for a simplified application like this any of them will do.

Hobbyking/Hextronic copy a lot of these boards and change the version numbers. I think a Hobbyking V2 is actually a Crius V1.1 and the Crius V2 includes data logging memory but Hobbyking don’t sell this one. I recommend buying the Legit Crius boards. I’ve found that some Hobbyking/Hextronic copies of flight controller and other boards are older versions, buggy and lacking important documentation when it comes time to sort out any problems that crop up.

Flight controller

Crius AIO V1Crius AIO V1 from Ebay NZ$32, free shipping

There is a version 2 (V2) of this board, but V1 works fine for this application and is a bit cheaper. V2 adds data logging memory. This board is a bit overkill for the application, but it’s reasonably priced, easy to use with USB and the connectors already fitted, and has good sensors on-board. There is also a plastic case available that makes it easier to protect and mount.

Features:

  • Supports MegaPirateNG and MultiWii firmware
  • Up to 8-axis motor output
  • 8 input channels for standard receiver
  • 4 serial ports for debug/Bluetooth Module/OSD/GPS/telemetry
  • 2 servos output for PITCH and ROLL gimbal system
  • servos output to trigger a camera button
  • 6 Analog output for extend device
  • A I2C port for extend sensor or device
  • Separate 3.3V and 5V LDO voltage regulator
  • ATMega 2560 Microcontroller
  • MPU6050 6 axis gyro/accel with Motion Processing Unit
  • HMC5883L 3-axis digital magnetometer
  • MS5611-01BA01 high-precision altimeter
  • FT232RQ USB-UART chip and Micro USB receptacle
  • On board logic level converter
  • Dimension: 50mmX50mm by 11.6mm high
  • Weight: 14.2g
  • Fixing hole spacing: 45mm (3mm diameter)

Notes:

  • The Bluetooth module must be unplugged when uploading code via the micro-USB connector (both on serial port-0)

GPS

GPS, NEO-6M with eepromUBlox NEO-6M with eeprom from Ebay, NZ$17, free shipping.

GPS modules vary a lot in price and the ultimate performance is not required here. Most GPS modules will provide NMEA data by default and will work. Cheap is OK.

Features:

  • Power: 3V-5V
  • Ceramic active antenna
  • With data backup battery
  • With power-down data storing EEPROM
  • Antenna size: 12 * 12mm

Notes:

  • The cheaper GPS modules sometimes don’t include a battery or memory to store configuration setup. This means they default to a basic setup when powered up. The settings can be changed, but it’s usually easier and maybe safer to adjust Multiwii to match the GPS default setup. Often 34800 baud and NMEA format including extra messages that are not always needed but probably won’t cause any problems.
  • GPS takes time after power-on to work out where it is. Generally the longer it sits, the better the position fix.
  • If it hasn’t been used for a while (more than a few days), it can take several minutes to catch up and acquire enough satellites to get a fix.
  • GPS Altitude is not very precise and slow to keep up. Requires 6 or more satellites to be in the ball-park.

Bluetooth module

Bluetooth module

Bluetooth module

From Ebay, NZ$12, free shipping

Features:

  • TTL data transparent transfer with a host Bluetooth device.
  • Works with any USB Bluetooth adapter.
  • Default Baud Rate: 9600,8,1,n.
  • Range up to 30ft.
  • Built in antenna.
  • Power input: +5V DC.

Notes:

  • TXD: Transmit Data (UART Data output), connect RXD of you device
  • RXD: Receive Data (UART Data input), connect to the TXD of you device
  • VCC, GND: power supply, between 3.6V~6.0V, don’t exceed 7V !
  • State: Connection status output, bluetooth connected = output high, otherwise pulses at about 5Hz
  • ON/OFF: Power Control, when low (default), power is on, when high (not less than VCC-0.5V), power is off

Baud rate:

The default baud rate for this module is 9600 baud. This should be changed to 115200. This can be done with a FTDI USB adapter (or cheaper equivalent) and the Arduino serial-monitor (tools menu). Connect the BT module to the FTDI adapter, power and RX-TX and TX-RX. Plug the USB into the computer. The LED on the BT module should be flashing. Select the serial-port (tools menu); the one that most recently appeared. In the serial-monitor, bottom left, select 9600 baud and “no line ending” (this is important). You can enter AT commands in the top line, one at a time, and press enter. The response appears in the main window below.

  • AT+PIN1234 – to change the PIN
  • AT+NAMEmy-quad-1 – to change the name
  • AT+BAUD8 – to change the baud rate to 115200

The default baud rate in Multwii is 115200. This can be changed within the Multiwii code, but is best left at 115200 baud.

Setup

Notes:

  • Won’t Arm : Aux switch/mode settings must have a basic default mode, ie. Horizon mode with no frills.

Advanced Stuff

For basic use you can ignore this and following sections.

Updated as progress allows.

This section is for reference and for anyone wanting to go further into how Multiwii works and how the to use the configuration apps and Arduino.

What is Multiwii? it’s an Adruino project or sketch in Arduino speak.

What is Arduino? – it’s a PC based tool (programming system) for some Atmel micro-controllers.

Installing Arduino on your PC

This depends on your PC. I use Linux (Kubntu), but most will be using Windows. For windows your best bet is to follow the instructions on the Arduino web site. It’s supposed to be simple to follow as Arduino is popular with beginners.

Download and install the Multiwii Sketch

You can get the sketch from this site (below) or to check for the latest version go to the Google code page: here.

.

Reference and Links:

Other information and Links.

Original Multiwii project site here.

Miltiwii Google Code: project code home and downloads and wiki documentation.

Hobbyking AIO flight controller here. Some info under files, but confusing.

RC Groups Crius AIO thread here. A long thread; dates from 2012 to current time.

How to setup a Multiwii Airplane: Patrik Emilsson blog.+ additional information.