Electronics and Propulsion System in RC Flying - Part 5 - Flight Controllers.

5. Flight Controllers
  • The flight controller is the nerve centre of a drone ( All RC-Aircrafts fitted with a flight controller can be called Drones).
  • 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.
  • Most of them are open source project for you.
  • 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 alone is not enough for good control – An accelerometer in free fall will measure 0 G’s. Turning forces will confuse a system trying to operate only on accelerometer data. That’s where gyros come in.
  • Gyros measure rate of rotation about an axis.
What flight controller do on RC-Aircrafts?
  • Flight controller supports unique flight modes and stabilisation for RC-Aircrafts, interchangeable remotely from the transmitter during flight, through a designated receiver channel (Aux Channel). Some flight modes are listed below,
  • 1 - Manual mode - Deactivates all assistance from flight controller, passing all servo control signals from the receiver directly to the servos.
  • 2 - Stabilization mode - Uses flight controller gyro stabilization to reduce the effects of wind and air turbulence on the aeroplane. Both rate mode gyros and axis-locked gyros can be used and configured for this mode.
  • 3 - Auto-leveling mode - Uses flight controller's accelerometers to bring back the aeroplane to level flight.
  • 4 - Axis-locked mode - Locks (Heading hold) any or all axis to a particular attitude. This can be adjusted via the sticks for incredible 3D effects.
The 3 axis motion/control for Aircrafts.
Example of Flight Controller Connection for Airplane
Example of Flight Controller Connection for Quadcopter

Power supply requirement.
  • There are often two voltage ranges described in the spec sheet of a flight controller, the first being the voltage input range of the flight controller itself (most operate at 5V nominal), and the second being the voltage input range of the main microprocessor’s logic (ex 3.3V or 5V).
  • Since the flight controller is a fairly integrated unit, you really only need to pay attention to the input range for the flight controller itself.
  • Most multi-rotor aircraft flight controllers operate at 5V since that is the voltage provided by a BEC. 
  • Normally we power the flight controller from the main battery. 
  • The one exception is that, if we want a battery backup in the event that high power is drawn from the main battery so that the BEC cannot provide enough current /voltage to flight controller causing a brownout / reset and we may loose control of the aircraft.
  • If such a chance is there then we use separate power source for flight controller. 
  • In many cases rather than a battery backup however, capacitors are often used.
Sensors Used in Flight Controllers.
  • In terms of hardware, a flight controller is essentially a normal programmable microcontroller, which will have some specific sensors on board.
  • At a bare minimum, a flight controller will include a three axis gyroscope, but as such will not be able to do auto-level.
  • Note that all flight controllers may include all of the sensors below or may include a combination of one or two sensors. 
1. Accelerometer
  • As the name implies, accelerometers measure linear acceleration in up to three axes (let’s call them X, Y and Z).
  • The units are normally in “gravity” (g) which is 9.81 meters per second per second, or 32 feet per second per second.
  • The output of an accelerometer can be integrated twice to give a position, though because of losses in the output, it is subject to “drift”.
  • A very important characteristic of three axis accelerometers is that they detect gravity, and as such, can know which direction is “down”.
  • This plays a major role in allowing multirotor aircraft to stay stable and find out which way is up.
  • The accelerometer should be mounted to the flight controller so that the linear axes line up with the main axes of the UAV (Unmanned Areal Vehicle).
 2.  Gyroscope
  • A gyroscope measures the rate of angular change in up to three angular axes (let’s call them alpha, beta and gamma).
  • The units are often degrees per second.
  • Note that a gyroscope does not measure absolute angles directly, but you can iterate to get the angle which, just like an accelerometer, is subject to drift.
  • The output of the actual gyroscope tends to be analog or I2C, but in most cases you do not need to worry about it since this is handled by the flight controller‘s code.
  • The gyroscope should be mounted so that its rotational axes line up with the axes of the UAV.
  3. Inertia Measurement Unit (IMU)
  •  An IMU is essentially a small board which contains both an accelerometer and gyroscope (normally these are multi-axis).
  • Most contain a three axis accelerometer and a three-axis gyroscpe, and others may contain additional sensors such as a three axis magnetometer, providing a total of 9 axes of measurement.
  4. Compass / Magnetometer
  •  An electronic magnetic compass is able to measure the earth’s magnetic field and use it to determine the drone‘s compass direction (with respect to magnetic north).
  • This sensor is almost always present if the system has GPS input available.
  5. Barometer
  • Since atmospheric pressure changes the farther away you are from sea level, a pressure sensor can be used to obtain a pretty accurate reading for the UAV’s height.
  • Most flight controllers take input from both the pressure sensor and GPS altitude to calculate a more accurate height above sea level.
  • It is preferable to have the barometer covered with a piece of foam to reduce the effects of wind over the chip.
  5. GPS module.
  • Global Positioning Systems (GPS) use the signals sent by a number of satellites in orbit around the earth in order to determine their specific geographic location.
  • A flight controller can either have on board GPS or a separate module connected to it via a cable.
  • The GPS antenna should not be confused with the GPS chip itself, and can look like a small black box or a normal “duck” antenna.
  • In order to get an accurate GPS lock, the GPS chip should receive data from multiple satellites, and the more the better.
  6. Distance Sensor
  • Distance sensors are being used more and more on drones since GPS coordinates and pressure sensors alone cannot tell you how far away from the ground your drone is (think hill, mountain or building) or if you will hit an object. 
  • A downward-facing distance sensor might be based on ultrasonic, laser , radar technology or infrared (infrared has issues in sunlight).
  • Very few flight controllers include additional sensors as part of the standard package.
Flight Modes
  • Below is a list of the most popular flight modes, though not all will be available on all flight controllers.
  • A “flight mode” is the way the flight controller uses sensors and RC input in order to fly and stabilize the aircraft.
  • If you have a transmitter with five or more channels you may be able to configure the software to allow you to change the flight mode via the 5th channel (Aux switch) while in flight.
  • Each mode is defined below.

Software for Flight Controllers
  • Almost all flight controller comes with pre-loaded software.
  • Most of the softwares are open source, so you can download it and use as per your requirement.
  • Most of the flight controller softwares are developed on ardunio based platform, so programming and modifying is simple.
  • Almost all popular manufactures have their own open forum for development of their boards, you can join any of this forums to get latest developments and clarification of your doubts..
PID Control & Tuning
  • Proportional Integral Derivative (PID) control allows you to change the drone‘s flight characteristics, including how it reacts to user input, how well and how quickly it stabilizes and more.
  • PID turning is an important factor for scratch builders.
  • Pre-loaded software will be turned for a particular application or airframe, so when we custom build our RC-Aircraft we have to turn the Flight controller as per our requirement.
  • The PID settings and how the software uses the various sensor inputs are incredibly important, but without seeing and understanding the code which dictates this is not too useful when comparing flight controllers.
  • Manufacturers who produce “ready to fly” kits are able to fine tune the PID settings and equations for their specific platform, which is why most RTF muti-rotors fly quite well out of the box. 
  • Scratch builders of custom drones can use flight controllers which are designed to be suitable for almost any type of multi-rotor aircraft  and it is up to the builder to adjust the values until they are satisfied with the flight performance.
 GUI
  • The GUI (Graphical User Interface) is a great tool for visualising the sensors on your model and to set the PID and other values, also to experiment with PID settings and simulate them on-screen. 
  • A GUI  is what is used to visually edit the code (via a computer) which will be uploaded to the flight controller.
  • The software provided with flight controllers continues to get better and better; the first flight controllers on the market used largely text-based interfaces which required that you understand almost all of the code and change specific sections to suit your project.
  • Now latest flight controller GUIs use interactive graphical interfaces to help you configure the necessary parameters.
Sample GUI screen for Multi Wii Flight controllers
Sample GUI screen for APM Controllers

Additional Features
  • The software used on certain flight controllers may have additional features which are not available on others.
  • Your selection of a specific flight controller may ultimately depend on which additional features / functionality are offered. These features can include:
  • Autonomous way point navigation, which allows you to set GPS way points which the drone will follow autonomously
  • “Orbiting” i.e. moving around a fixed GPS coordinate with the front of the drone always pointed towards the coordinate (useful for filming)
  • “Follow me”: certain drones have a “follow me” feature which can be GPS based (for example tracking the GPS coordinates of a smart phone)
  • 3D imaging: Most 3D imaging is done after a flight using images captured during the flight and GPS data
  • “Open source”: the software associated with certain flight controllers cannot be modified / customized. 
  • Open-source products generally allow advanced users to modify the code to suit their specific needs.
Communication
1. Radio Control (RC)
  • Radio Control (RC) communication normally involves a hand-held (hobby) RC transmitter and RC receiver.
  • For UAVs, you need a minimum four channels and above, more channels are better , even if they are not used. 
  • Normally the basic 4 channels are associated with:
  1. Pitch (which translates to forward / backward motion)
  2. Elevation (closer to or farther away from the ground)
  3. Yaw (rotating clockwise or counter-clockwise)
  4. Roll (to strafe left and right)

  • Additional channels can be used for any of the following
  1. Arming / disarming the motors
  2. Gimbal controls (for camera pan up/down, rotate clockwise / counter-clockwise, zoom)
  3. Change flight modes (acrobatic mode, stable mode etc)
  4. Activate / deploy a payload, parachute, buzzer or other device
  5. Any number of other uses

  • Most drone pilots prefer handheld control, meaning RC systems are still the number one choice for controlling a UAV.
  • The receiver simply relays the values input into the controller, and as such, cannot control a UAV.
  • The receiver must be connected to the flight controller, which needs to be programmed to receive RC signals.
  • There are very few flight controllers on the market which do not directly accept RC input from a receiver and most of them provide power to the receiver from one of the pins.
Additional considerations when choosing a remote control include:
  • Not all RC transmitters can provide the full RC signal range of 1000ms to 2000ms; some artificially limit this since most RC applications are for RC cars, airplanes and helicopters
  • The range / max wireless range (feet or meters) of an RC system is almost never provided from the manufacturers because it involves many factors such as obstructions, temperature, humidity, battery power and more.
  • Some RC systems have a receiver which also has a built-in transmitter ( OSD - On screen Display) for transmitting sensor data (GPS coordinates for example, battery data, video, distance from home, etc..) which are shown on the RC transmitter’s LCD display.
2. Bluetooth
  • Bluetooth, and more recent BLE (Bluetooth Low Energy) products were originally intended to be used to transfer data between devices without the complexity of pairing or matching frequencies.
  • Certain flight controllers on the market can send and receive wireless data via Bluetooth connection, making it easier to troubleshoot issues in the field.
3. WiFi
  • WiFi control is normally achieved using a WiFI router, computer (including laptop, desktop, tablet) or smartphone.
  • WiFi is able to handle both data transmission as well as image transmission, but is much more difficult to set up / implement. 
  • As with all WiFi devices, the range is limited by that of the WiFi transmitter.
4. Radio Frequency (RF)
  • Radio Frequency (RF) control in this context refers to sending data from a computer or micro controller wirelessly to the aircraft using an RF transmitter / receiver (or two-way transceiver).
  • Using a normal RF unit connected to a computer allows for long range two-way communication with a high “density” of data (normally in serial format).
5. Smart Phone
  • Although this is not a type of communication, the question of how to control a drone using a smart phone has come up enough to warrant a separate section.
  • Modern smart phones are essentially powerful computers which coincidentally can also make phone calls.
  • Almost all smart phones include integrated Bluetooth as well as WiFi either of which are used to control the drone and/or receive data and/or video.
6. Infrared (IR)
  • Infrared communication (like what you find in a television remote control) is rarely used to control drones as there is so much IR interference present even in a normal rooms (let alone outdoors) that it is not very reliable.
  • Although it can be done, it is not suggested as a primary option.
Additional Considerations
  • Manufacturers of flight controllers generally try to provide the most features possible – either included as standard equipment or purchasable separately as options / add-ons.
Below are just some of the many additional features which you might want to take a look at when comparing flight controllers.
  • Damping: Even small vibrations in the frame, normally cause by unbalanced propellers and/or motors, can be picked up by the on board  accelerometer, which will in turn send the appropriate signals to the main processor, which will then take corrective action. These minor corrections are not wanted nor needed for stable flight and it’s best to have the flight controller vibrate as little as possible. For this reason, vibration dampeners / absorbers are often used between the flight controller and the frame.
  • Case: A protective case around the flight controller can help in a number of ways. Aside from giving more pleasing look than a bare PCB, a case often provides some level of protection in the event of a crash.
  • Mounting: There are various different ways in which a flight controller can be mounted to a frame, and not all flight controllers will have the same mounting options such as.
          Four holes spaced 30.5mm or 45mm apart in a square
          Flat bottom for use with a sticker
          Four holes in a rectangle (no set standard)
  • Community: Since you are creating a custom drone, being part of an online community may help considerably, especially if you encounter issues or want advice. Obtaining advice from a community, or seeing user feedback regarding the quality and ease of use of specific flight controllers also helps.
  • Accessories: Aside from just the flight controller itself, additional products (accessories or options) may be required in order to make full use of the product. Such accessories may include, but are not limited to: GPS module and/or GPS antenna; cables; mounting accessories; screen (LCD / OLED); 
Development of Flight Controllers
Now 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, most of these are 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 problem to this: 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 crash 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 passed 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, weather vane, 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

Advice When Choosing a Controller
  • All the 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 and  then your budget. 
  • 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 rupees means lower quality components and assembly.
  • Nothing is worse than seeing hundreds of rupees and hours of effort fall out of the sky because of a cracked solder joint or a bad capacitor.
  • As for other electronics parts do a proper comparison and survey before you finaliee your flight controller which suits your requirement and budget.