Flight Controller


Although there many many commercial and open-source flight controllers available, this section will focus on the APM flight controller.

The flight controller of an UAV takes in sensor data in regards to the UAV’s current position and orientation, and outputs control signals to the flight control surfaces and throttle – in order to effect stable and controlled flight. The flight controller may be programmed to fly the UAV towards a certain waypoint of in a certain way.

Typical flight modes include:

  • Stabilize – the UAV will stablise to fly straight and level, unless commanded otherwise by the RC transmitter
  • Loiter – the UAV will circle around a particular waypoint
  • Auto – the UAV will fly a series of waypoints
  • Manual – the UAV will pass through all RC commands as they are.

Other modes and features (such as automatic takeoff and landing) may be available.


The flight controller may have many sensors attached, in order to determine the current state of the UAV. These sensors may need to be placed in a certain position or method in order to get accurate readings.

Inertial Measurement Unit (IMU)

This consists of 3-axis accelerometers and gyros that measure the linear acceleration and angular velocity.

They are best placed near the centre of mass of the UAV (usually just under the wings, in the fuselage).

Excessive vibrations (from the engine) may degrade the accuracy of the IMU. A anti-vibration pad may be required. In any case, the IMU raw output should be checked for excessive vibrations every time the engine is changed.

Pixhawk flight controller mounted inside the fuselage on a vibration-damped platform

Pixhawk flight controller mounted inside the fuselage on a vibration-damped platform


The Global Positioning Satellites (GPS) are a set of satellites in Earth orbit that emit a radio signal, that when received of Earth allow the user to determine their position. The accuracy (depending on the exact module used) is usually 1-3m.

The GPS module consists of a GPS satellite receiver and the relevant decoding processing capability. Due to the GPS satellite signal being very weak at the Earth’s surface, this module is very sensitive to interference from other radio equipment. Noting that the GPS signal operates in the 1.2-1.6 GHz band, care should be taken with any radio transmitters operating in this band. Also of note is any CPU’s operating at this frequency as they can inadvertently radiate very small (and interfering) signals.

Extensive testing should be carried to to ensure there is no radio interference into the GPS module, even if no other devices are transmitting near this frequency. Intermodulation effects may still be able to produce interference.

The GPS module should be placed at the top of the aircraft with a clear view of the sky.

GPS/Compass sensors mounted at the top of the fuselage

GPS/Compass sensors mounted at the top of the fuselage

Airspeed Sensor

The airspeed sensor uses a pressure sensor to measure the UAV’s speed relative to the wind.

This sensor should be placed along the leading edge of the wing, away from any turbulence generated by the propeller or fuselage.


The magnetometer detects the strength and direction of any magnetic field. It is designed to act as a compass.

To avoid being interfered with by other magnetic sources of the UAV, it should be placed away from engines, servos and high-current circuits.

Due to the magnetometer being susceptible to interference like the GPS module, the two are usually combined into a single package.

Power Meter

A power meter measures the voltage and current of the electrical power system(s).

In the case of battery-powered UAV’s this is essential for determining the remaining capacity of the battery.

It is also useful for monitoring the voltage stability of power supplied to the avionics.

Range Finder

A range finder (Lidar, Sonar, etc) is used for determining the UAV’s height above ground. In this case “ground” include trees and buildings. They are usually accurate to 5cm and have a range of 50m

The data from this is used for precise altitude control of the UAV and can allow for terrain following, where the UAV adjusts it’s altitude to stay at a constant height above ground. This aids in image capture, as the camera and lens can be optimised to work at a particular altitude.

It is also used for a traditional landing sequence, where a barometer or GPS do not provide enough accuracy at low altitudes.

Laser range finder

Laser range finder


The barometer measures air pressure changes to determine the altitude relative to it’s reference point (where the flight controller was activated).

It has the advantage of being able to be used at any altitude from 5m to 40000m. Due to changing weather conditions, the sensor will “drift” over time. A recalibration may be required every hour or so at lower altitudes.

The barometer should be placed in an area exposed to the outside air but not being buffeted by the air stream.


A number of sensors require calibration at varying stages.

The following sensors require an initial calibration before the initial flight:

  • Magnetometer
  • IMU

The following sensors require a calibration before every flight:

  • Airspeed
  • Barometer

The pre-flight checklist should include a check that all sensors are outputting sensible values.


If the flight controller detects an anomaly during flight, it must have a failsafe “plan” in order to reduce the chance of damage to people or property on the ground.

This plan must be pre-programmed into the flight controller (in case of radio loss) and the ground crew must be aware of what to expect when a failsafe activates.

The most common failsafes are detailed below.

Loss of GPS

If the UAV loses knowledge of it’s current position, there are a few options – circle around it’s current position and try to re-acquire GPS lock or use inertial navigation to travel to a pre-determined “home” landing point.

Loss of radio signal

Loss of datalink implies that the UAV is no longer able to be commanded by the ground station. As with the GPS failsafe, the most common options are for the UAV to circle around it’s current point whilst trying to re-establish radio contact or to start flying to the “home” point.

Out of range (Geofence breach)

The flight controller can be setup with a “geofence” – a bounding box of the expected flight area of the UAV. If it goes outside of this area, it would imply that the UAV is not following the mission and should come back to the “home” waypoint. The geofence can be any shape/size and can include maximum and minimum altitudes. Note the minimum altitude geofence should be turned off during takeoff and landing.

Flight controller lockup or software crash

If the flight controller software stop working, there are few safe options other than a backup flight controller. This can be as simple as a small microcontroller that will attempt a basic and rough controlled descent, or a full backup flight controller.


The APM is able to be simulated on desktop PC’s running the Linux operating system.

Full details for setting up the simulation environment are available here.

The benefit of simulation is the ability to test parameter changes, failsafes and missions without risking a real aircraft.