Flight Controller
The Flight Controller is the heart of the Air System and is responsible for -
- Controlling and stabilizing the UAV.
- Communicating with the various components on the UAV, the GCS, and the RC.
- Logging data & events.
Composition
The Flight Controller consists of hardware and software working together to accomplish its goal. Its primary constituents are -
Hardware
- Microcontroller (MCU)
- Blackbox
- Indicator LEDs
- Sensors (IMU, Magnetometer, Barometer and Temperature).
- Communication Interfaces (USB, ESCs, Rc Receiver, Telemetry, Battery and GPS/GNSS).
- Power regulator, oscillator, ESD/EMI protection ICs etc.
Software
- Firmware
- Bootloader
Interfaces
To connect with other components of the Air System, the Flight Controller exposes the following interfaces -
- USB Interface: Receives firmware upgrades and also used for debugging.
- Blackbox Interface: Stores FC Logs persistently.
- ESC Interface: Communicates with ESCs using PWM to control motor speed.
- Radio Control Interface: Receives uni-directional control signals from the RC.
- Telemetry Radio Interface: Communicates bidirectionally with the GCS.
- GPS Interface: Receives position and timing data for navigation.
- Peripheral/Payload Interfaces (I2C, SPI, UART, CAN): Connects with external peripherals and payloads to enrich UAV operations.
Firmware
The firmware executes on the MCU and is responsible for carrying out the functions of the flight controller. The firmware has the following responsibilities -
- System State Management -
- Ensuring only valid System State transitions are performed, only after checking guards.
- Enforcing the behavior of the 3 aspects of the System State - Activity, Error and Flight Control Mode.
- Component Management -
- Initializing, reading sensors and processing raw data into pose.
- Managing indicator LEDs.
- Receive and parse data from RC Receiver and Telemetry Radio.
- Flight Stabilization & Control -
- Stabilize UAV based on raw and filtered sensor data.
- Calculate setpoints from RC values based on Flight Control Mode; calculate errors based on current pose and setpoints.
- Calculate motor speed commands from errors and send to ESCs.
- GCS Communication -
- Discover and establish connection with GCS.
- Send/Receive telemetry data from GCS (including RC values, pose, battery level, position etc).