Chapter IV
Mahajan M R
Unit 4: Flight controller Boards - Introduction to FCB, various
commands, configuration, connection to different elements like sensors,
ESC, GPS, RF module etc.
Role of FCB
Ability to decode the RC signal that comes from your RC radio.
Different radios and different radios and different receivers. FCB need to
understand them all
Uses PID controllers to drive motors and servos to give stability to UAV
FCBs essentially from STM32 family
Contains Gyro and accelerometers
Needs inputs and outputs
outputs
Optional (OSD On
Screen Display)
External
elements
External
elements
[Link]
In embedded systems, intra-system protocols are essential for establishing
communication between components located on the same circuit board. These
protocols define how microcontrollers, sensors, actuators, and other peripherals
interact and exchange data within the system
Additionally voltage stabilization needed. As batteries have voltages like
2S - 8.4V, 3S - 12.6V , 4S - 16.8V , 6S - 25.2 V
Where as most of electronics run on 3.3 V or 5 V or lesser than this. So step down
needed.
Pixhawk - Specifications
● Processor ● Interfaces
○ 32-bit ARM Cortex M4 core with FPU ○ 5x UART serial ports, 1 high-power
○ 168 Mhz/256 KB RAM/2 MB Flash
capable, 2 with HW flow control
○ 32-bit failsafe co-processor
● Sensors ○ Spektrum DSM/DSM2/DSM-X
○ MPU6000 as main accel and gyro Satellite input
○ ST Micro 16-bit gyroscope ○ Futaba [Link] input (output not yet
○ ST Micro 14-bit accelerometer/compass implemented)
(magnetometer)
○ PPM sum signal
○ MEAS barometer
● Power ○ RSSI (PWM or voltage) input
○ Ideal diode controller with automatic ○ I2C, SPI, 2x CAN, USB
failover ○ 3.3V and 6.6V ADC inputs
○ Servo rail high-power (7 V) and ● Dimensions
high-current ready
○ All peripheral outputs over-current ○ Weight 38 g (1.3 oz)
protected, all inputs ESD protected ○ Width 50 mm (2.0”)
○ Height 15.5 mm (.6”)
○ Length 81.5 mm (3.2”)
● 16-bit: Can address up to 64 kilobytes (2^16 bytes) of memory.
● 32-bit: Can address a significantly larger amount of memory, up to 4
Gigabytes (2^32 bytes).
System Architecture
● 16-bit: Older systems that are slower and less efficient at multitasking.
● 32-bit: More efficient for multitasking, running multiple programs
simultaneously without significant slowdowns.
File & Filename Handling
● 16-bit: Generally supports shorter filenames (e.g., 8 characters plus
extension).
● 32-bit: Supports longer filenames (up to 255 characters) and filenames
with spaces.
PROCESSORS
1. 32-bit ARM Cortex M4 core with FPU
● ARM Cortex-M4 → A microcontroller CPU core designed by ARM, optimized for
real-time applications (like drones).
● 32-bit → The CPU handles data in 32-bit chunks (faster and more capable than
8-bit or 16-bit microcontrollers).
● FPU (Floating Point Unit) → A hardware module for handling floating-point math
(decimal numbers) very quickly.
○ Important for flight control because things like GPS coordinates, IMU sensor
data, and PID calculations involve lots of floating-point math.
○ Without an FPU, calculations would be much slower (done in software).
Why floating point?
Drones rely on math-heavy calculations every millisecond:
1. Sensor Fusion (IMU, GPS, Magnetometer)
○ Gyroscopes give angular rates like 0.0123 rad/s.
○ Accelerometers give values like -9.80665 m/s².
○ These are fractional values, not integers.
2. PID Control Loops
○ Flight control equations involve multiplications, divisions, and small decimal gains (like 0.045
* error).
3. Navigation & Positioning
○ GPS coordinates: 23.456789° latitude
○ Needs lots of decimal precision to avoid drift.
4. Trigonometry
○ Roll, pitch, yaw require sin(), cos(), tan() calculations—these almost always produce
floating-point results.
2. 168 MHz / 256 KB RAM / 2 MB Flash
● 168 MHz → Clock speed of the CPU (168 million cycles per second).
○ Determines how many instructions it can execute per second.
○ Easy multitasking with higher clock speed.
○ High speed = faster response to sensor data and control outputs.
● 256 KB RAM → Temporary working memory.
Stores sensor data, control loop calculations, and running program variables.
○ More RAM means more simultaneous features (EKF navigation, logging,
companion computer communication).
● 2 MB Flash → Permanent storage for firmware (the autopilot software itself).
○ Holds ArduPilot or PX4 firmware plus libraries.
○ Also stores parameters/configuration.
Flash memory stores
Examples of Parameters 1. Flight Behavior 1. Navigation & Sensors
Stored in Flash:
1. Airframe & Vehicle Setup Return-to-home altitude GPS usage settings
Geofence radius EKF/INS fusion parameters
Frame type (quad, hex, fixed-wing, Fail-safe actions (land, loiter, Compass declination
VTOL, rover, boat, etc.) RTL, disarm) Sensor filter settings (cutoff
Motor/servo mapping frequencies)
Sensor orientations (e.g., IMU 2. Calibration Data
rotation, compass orientation) 2. Mission & Communication
Accelerometer/gyroscope offsets Settings
2. Control Gains
Magnetometer calibration Waypoints, loiter times, speed
PID controller gains for roll, pitch, settings
yaw, and altitude Barometer offsets
Radio control trims MAVLink communication baud
Rate limits, maximum tilt angle, rates
maximum climb rate ESC/motor calibration
Telemetry/OSD configuration
Throttle response curves
3. 32-bit failsafe co-processor
● A second, smaller processor inside the Pixhawk that acts as a watchdog and
safety manager.
● Its job is to:
○ Monitor the main CPU.
○ Handle critical safety tasks like failsafe (hover / return to home
pre-programming)
○ [cutting motors if the system crashes, loss of signal, or brownout (brownout -
reset controller in case of low voltage due to sudden motor current draw /
weak battery) ].
○ Provide power management (reset if voltage drops, check battery condition).
○ Run I/O tasks like PWM output even if the main CPU is overloaded.
POWER
1. Ideal diode controller with automatic failover
● What it is:
○ The Pixhawk can accept power from multiple sources (Power Module, USB,
Servo Rail).
○ The ideal diode controller automatically chooses the best source, and if one
fails, it seamlessly switches to another without interruption.
● Why important:
○ Prevents the flight controller from shutting down mid-flight if one power input
fails.
○ Example: If the main battery gets disconnected, Pixhawk can stay alive on
backup power (like USB or servo rail).
2. Servo rail high-power (7 V) and high-current ready
● What it is:
○ The servo rail (where you plug in servos or ESCs with BECs) can handle
higher voltages (up to ~7V) and higher currents than older boards.
Supports modern high-voltage servos (used in planes, copters, and VTOL
drones).
● Why important:
○ You can power larger/more powerful servos directly.
○ Useful in fixed-wing aircraft with big control surfaces or VTOL tilt-rotor
mechanisms. (The rotors can be aligned with horizontal plane for takeoff and
inclined to move ahead, this is done by servos)
servorail
3. All peripheral outputs over-current protected
● What it is:
○ Every output port (like TELEM, GPS, I2C, CAN) has built-in current
protection.
○ If you plug in a faulty device or short a wire, the Pixhawk won’t be destroyed.
● Why important:
Protects flight controller from damage due to wiring mistakes, shorts, or faulty
peripherals.
4. All inputs ESD protected
● What it is:
○ ESD = Electrostatic Discharge (tiny sparks when you touch electronics).
○ Pixhawk has built-in ESD protection circuits on input ports.
● Why important:
○ Prevents static shocks from damaging sensitive chips when
plugging/unplugging peripherals.
Protocols used in drones
SBUS SBUS PWM
Transmitter PPM Receiver PWM Flight Controller Oneshot ESC
DSM2 / DSMX PPM Dshot
I2C (G/A/M) PWM
SPI (high speed) Dshot
UART
Sensors Motors
INTERFACES
1. 5× UART Serial Ports -
● What: Standard serial communication ports (TELEM1, TELEM2, SERIAL4/5, GPS, etc.).
How it works: Two wires → TX (Talk) RX (Listen)
Only two devices can talk at once (Pixhawk ↔ GPS, Pixhawk ↔ Telemetry Radio). Like a private
walkie-talkie channel.
Speed: Medium, but reliable.
● Use cases:
○ Telemetry radios
○ GPS modules
○ Companion computers (Raspberry Pi, Jetson, etc.)
○ Rangefinders or external sensors (RANGEFINDER - LASER TYPE / ULTRASONIC, measure obstacle distance)
(Meaning: Multiple serial devices can be connected at once without conflicts.)
Example (Pixhawk 4 with 5× UART)
You might wire it like this:
● UART1 (GPS1 port) → GPS
● UART2 (TELEM1 port) → Telemetry radio
● UART3 (TELEM2 port) → Companion computer (MAVLink)
● UART4 (RCIN/DSM/SBUS) → RC receiver (if using serial protocol)
● UART5 (GPS2 or Serial5) → Secondary GPS or Rangefinder
UART (Universal Asynchronous Receiver-Transmitter)
SPI (Serial Peripheral Interface)
SBus (Serial Bus)
CAN (Controller Area Network)
I2C Inter-Integrated Circuit
2. Spektrum DSM/DSM2/DSM-X Satellite Input
● What: Input for Spektrum brand satellite receivers (DSM/DSM2/DSMX protocols).
● Use case: Direct connection to Spektrum RC radios for control input.
● These receivers are better than PWM types
● PWM Receiver → multiple wires, bigger, older method.
● Satellite Receiver → tiny, serial digital link, cleaner, faster, modern.
3. Futaba [Link] Input - (Receiver)
● What: Input for Futaba [Link] receivers (digital serial RC protocol).
● Note: Output not implemented on Pixhawk (only input works).
● Use case: Connect Futaba or FrSky [Link]-compatible receivers.
● Can support 16 channels the 1 wire
✅ Meaning: Can take control signals from advanced RC receivers with many channels.
4. PPM Sum Signal
● What: Input for PPM (Pulse Position Modulation) receivers.
● Use case: Combines all RC channels into one wire → simpler wiring compared to PWM (which
uses 1 wire per channel).
✅ Meaning: Allows older or budget receivers to work with Pixhawk.
Feature PPM SBUS DSM/DSMX
Type Analog Digital serial (inverted) Digital serial
pulses (non-inverted)
Channels ~8 16–18 6–12
Latency Higher Very low Low
Wiring 1 wire 1 wire (UART) 1 wire (UART)
Modern Rare/legacy Very common (FPV, Common (Spektrum
usage RC) make transmitter users)
[Link]
C6hZcxnOsp3BE - modulation techniques
[Link] different protocols
5. RSSI (PWM or Voltage) Input
● What: RSSI = Received Signal Strength Indicator. Measured as % - 0.5 V to 2.5 V - 70% plus safe
to fly
● Use case: Lets Pixhawk monitor RC signal quality from the receiver. Can be provided as a
PWM signal or analog voltage from the receiver.
✅ Meaning: Pixhawk knows if your RC link is getting weak → can trigger failsafe (Return-to-Home or
Land).
6. I2C
● What: Communication bus for multiple small peripherals.
● Use case: External magnetometer (compass), airspeed sensors, RGB LED modules, rangefinders.
✅ Meaning: Connects multiple “smart” sensors on the same 4 wires.
7. SPI
● What: High-speed communication bus.
● Use case: Rarely used externally (most Pixhawk SPI sensors are internal).
● Supports certain external sensors (Used to connect onboard sensors (gyros,
accelerometers, magnetometers, barometers, RAM/flash chips).).
✅ Meaning: Provides expansion for advanced sensors.
8. 2× CAN
● What: CAN bus ports (Controller Area Network).
● Use case: UAVCAN peripherals (smart ESCs, GPS, power modules, rangefinders).
● CAN bus allows multiple devices on one pair of wires, with robust noise resistance.
✅ Meaning: Modern, reliable interface for advanced drone hardware.
Sensor Location Protocol
Gyroscope + Accelerometer Internal SPI
Barometer Internal SPI / I²C
GPS External UART (NMEA/UBX)
Magnetometer (Compass) External I²C
Airspeed Sensor External I²C / Analog
Rangefinder (Lidar/Sonar) External I²C / UART / CAN
Optical Flow External I²C / UART
Telemetry Radio External UART (MAVLink)
Smart ESC (DroneCAN) External CAN
Companion Computer External UART / USB / ETH
9. USB
● What: Standard micro-USB port.
● Use case:
○ Firmware flashing (connect pixhawk to PC to load QG, MP etc)
○ Setup/configuration with Mission Planner or QGroundControl
○ Data logging access (Can copy flight data to your PC via USB)
✅ Meaning: Main configuration & programming interface.
10. 3.3V and 6.6V ADC Inputs
● What: ADC = Analog to Digital Converter.
● Use case:
○ Measure analog sensor signals.
○ 3.3V ADC → for low-voltage sensors. (air speed sensor/gas sensors, light sensors)
○ 6.6V ADC → for slightly higher-voltage inputs (e.g., battery monitoring).
✅ Meaning: Pixhawk can read voltages from sensors (like current sensors, analog rangefinders,
battery monitor).
Interfac Wires Device Reliability Drone Use
e s
UART 2 (TX/RX) 1-to-1 Good GPS, Telemetry, Companion Computer
I2C 2 (shared Many Okay Compass, LEDs, Airspeed sensor
bus)
CAN 2 (bus) Many Excellent Smart ESCs, UAVCAN GPS, advanced
sensors
✅ In short:
● UART = Private phone call (1-to-1).
● I2C = Classroom (many devices, one speaks at a time).
● CAN = Group chat with traffic rules (many devices, very reliable).
In electronics and computer science, a bus is a shared communication pathway
that transfers data between components, acting as a central data highway for
devices like the CPU, memory, and peripheral devices. It consists of a set of
parallel conductors or tracks that carry signals for data, addresses, and control,
allowing these different parts of a system to exchange information efficiently and
enabling seamless interoperability through standardized protocols.
Transfers Data:
A bus moves binary data between different components within a computer or a network.
Conveys Addresses:
It carries the address or location information for where data is stored or needs to be sent.
Carries Control Signals:
Buses also transmit control signals that manage the timing and direction of data flow
between devices.
All devices are connected in parallel to the same two wires.
CAN has a built-in priority system so if two devices talk at once, the more
important message gets through first, and the other waits.
That’s why CAN is used in cars and drones → very reliable, even with lots of
devices.
Example:
● ESC says: “Motor 1 is spinning at 5000 RPM”
● GPS says: “Here’s new position data”
● Both use the same two wires, but CAN ensures no collision.
Imagine two devices on the CAN bus (a GPS module and an ESC) start sending messages at
the same time:
● GPS wants to send: 1010 Third bit:
● ESC wants to send: 1000
● GPS sends 1 (recessive), ESC sends
They both put the first bit: 0 (dominant).
● Bus shows 0 (dominant wins).
● Both send 1 → recessive → bus
● GPS notices a mismatch: it sent 1
shows 1. No problem.
but saw 0 → it stops transmitting.
Second bit:
✅ Now only the ESC continues sending its
● Both send 0 → dominant → bus message, and GPS waits its turn.
shows 0. Still fine.
How PWM relates to CAN
● Both are used to control motors, but in different ways:
○ PWM ESCs → Old type → receive only throttle signal by pulse width.
CAN ESCs → Smart ESCs → receive commands over CAN (e.g., set RPM,
not just throttle %), and can send feedback (temperature, current, RPM).
📌 In modern drones:
● PWM is still common (cheaper ESCs).
● CAN ESCs are used in advanced drones (industrial, heavy lift, autonomous).
GPS
GPS (Global Positioning System) is a satellite system that allows you to determine
the precise geographical location of an object anywhere in the world.
Basically, it works thanks to a network of satellites orbiting the Earth that transmits
signals to receiving devices, which use these signals to triangulate their exact
position.
GPS Applications
● Accurate navigation: GPS enables a drone to move precisely and maintain a stable
position. This is essential for high-quality aerial drone video or photography, as well as
for precise mapping of areas, as in the case of drone photogrammetry.
● Autonomous flight: The GPS signal in drones allows them to follow programmed
routes autonomously. This is especially useful in inspection, crop monitoring,
search or rescue tasks, as it can follow a specific pattern. This function is essential
for irrigation and spraying drones in agriculture.
● Safe return home: If a drone loses connection with the remote control or its battery
is low, GPS allows the drone to automatically return to its take-off point.
● Limitations: GPS allows virtual geographic boundaries, known as geofencing, to
be set that restrict the drone’s flight area. This is useful to ensure that the drone
does not stray too far or enter restricted areas, such as SPAs, SACs and SCIs
zones.
What kind of signal do drones use?
Drones use the GPS signal, which is a radio frequency
signal transmitted by satellites. This signal contains
location and time information.
Drones can also use other positioning systems, such as
GLONASS, Galileo or BeiDou, for greater accuracy and
better coverage in different regions of the world.
How the GPS System Works for a Drone
Accurate Time Source: Each GPS satellite carries a highly precise atomic clock.
Signal Broadcast: The satellite continuously broadcasts a signal containing:
Time Information: The exact time the signal was transmitted, according to its atomic clock.
Pseudorandom Code: A unique sequence of ones and zeros that the receiver recognizes.
Satellite Position Data (Ephemeris): Information about the satellite's exact location in orbit at the
time of the signal's transmission.
Signal Reception: The GPS receiver receives these signals from multiple satellites.
Time Comparison: The receiver compares the timestamp from the satellite signal with its own
internal clock's time.
Distance Calculation: The receiver knows the speed of light (c). By calculating the difference
between the time the signal was sent (from the timestamp) and the time it was received, and
multiplying that difference by the speed of light, the receiver can determine the distance to that
satellite.
Positioning: By repeating this process with signals from at least four different satellites, the
receiver can perform trilateration, using the distances to each satellite to pinpoint its own latitude,
longitude, altitude, and time
[Link]
[Link] Triangulation
Can Drone Fly Without GPS?
Yes, some flight modes don’t require GPS. But it will be more challenging to
control the drone, and it will need lots of practice.
Nowadays, almost every drone has GPS. And for flight modes like
position-hold, return-to-home, and autonomous flight, you can’t do them
without GPS.
To fly a drone without GPS, look for areas with no obstacles. The drone will
often drift since it has no idea where it, and you have to control it actively.
Since GPS limits the drone’s altitude to 400 ft, you can fly it without GPS to go
higher.
You can also hold the altitude/hover using sensors when the GPS is off.
But make sure you switch on the GPS once you’re done practicing.
Flying without GPS is also applicable when indoors. If you accidentally
press return to home when indoors, the drone will move to a higher
altitude crashing into the ceiling.
So, it would help if you switched GPS off when indoors or when flying at
low altitudes in areas with several obstacles.
Drones don’t need GPS, but it makes it easier to control them and is a
safety feature when the drone experiences challenges in flight.
GPS module specifications
NEO M8N Ublox/u-blox GPS Module for MWC (basically arduino software) /APM (Ardu Pilot Mega)
These are pre-configured, flashed with the correct settings, and tested making them plug and play.
Position accuracy: 2.0 m CEP
Quick satellite searching, only need 10s to find 6 satellite in open space
Built-in compass, refresh rate up to 10GHz
Support GPS+BD+SBAS, or GPS+GLONASS+SBAS
Nav. update rate1 Single GNSS: up to 18 HZ
Concurrent GNSS: up to 10 Hz
Position accuracy: 2.0 m CEP → The GPS can usually tell where you are within 2 meters.
(CEP means “circular error probable,” basically 50% of the time your position will be within
that distance.)
● Single GNSS: up to 18 Hz → If using only one satellite system (like GPS), it can
update your position 18 times per second.
● Concurrent GNSS: up to 10 Hz → If using multiple systems (GPS + GLONASS, etc.),
it updates your position 10 times per second.
Acquisition2
Cold starts: 26 s
Aided starts: 2 s
Reacquisition: 1.5 s
Sensitivity Tracking & Nav: –167 dBm
Cold starts: –148 dBm
Hot starts: –156 dBm
● Cold start: 26 s → If the GPS has no memory of satellites, it takes about half a minute
to get a position.
● Aided start: 2 s → If it has help (like downloaded satellite data), it can start in just 2
seconds.
● Reacquisition: 1.5 s → If the signal is lost (like flying behind a building), it reconnects
in 1–2 seconds.
●
This tells how well the GPS can “hear” weak signals from satellites:
● Tracking & Navigation: –167 dBm → Can follow very weak signals.
● Cold start: –148 dBm → Needs a stronger signal when starting fresh.
● Hot start: –156 dBm → Can start faster if it remembers last known satellites.
(In short: it works well even if the signal is weak.) The more negative number the
weaker the signal. If GPS module can hear -167 dBm signal it can hear faint signals.
Since satellites are far away signals are weak. 0 dBm - 1miliwatt
–167 dBm ≈ 0.00000000000000002 mW (2 × 10⁻¹⁷ mW)
That’s an incredibly tiny amount of power — about 100 billion times weaker than
what a phone signal uses.
dBm = decibels referenced to 1 milliwatt (mW).
AssistNow GNSS Offline (up to 35 days) receiver downloads satellite data from internet
AssistNow Autonomous (up to 6 days) works without internet
OMA SUPL & 3GPP compliant
Crystal
RTC crystal Built-In
Supported antennas: Passive cheaper, smaller, low power,
Operating temp. –40° C to 85° C
–40° C to 105° C
Timepulse Configurable 0.25 Hz to 10 MHz
Assembly / connections
Can check on mission planner if right
motor is connected as per A, B C D
desired positions
Identify the propeller
There are two methods of connecting the motor outputs. Either connect the
electronic speed controllers (ESCs) directly to the autopilot OR use a power
distribution board (PDB).
When using a PDB, connect the power (+), ground (-), and signal (s) wires for
each ESC to the PDB according to motor number.
Differentiate between red / black and yellow wires. See pixhawk has standby power connection the BEC.
Yellow wire signal wire.
RF Modules
Radio Frequency (RF) technology plays a crucial role in the operation and control
of drones, also known as Unmanned Aerial Vehicles (UAVs).
It is the backbone of the communication system that enables drones to receive
commands from the ground control station and transmit data, such as video
footage, telemetry, and sensor readings.
Radio Frequency (RF) refers to the portion of the electromagnetic spectrum
ranging from approximately 3 kHz to 300 GHz.
These frequencies are widely used for wireless communication, including radio
broadcasting, television, cellular networks, and, of course, drone control and
communication.
Cont…
RF modules are integrated circuits that combine the transmitter and receiver
components into a single package. These modules often include additional
features such as frequency synthesizers, amplifiers, and filtering circuits to
optimize the RF performance.
Licenced bands are more reliable, less susceptible to interference
and longer range. But need licencing and approvals