How the Flight Controller Controls Servo Angles
1. What is a Flight Controller
The Flight Control System (FCS), commonly abbreviated as flight controller (FC), can be regarded as the brain of the aircraft and is the core component of the aircraft. Its main function is to send various commands. For example, changes in the aircraft's attitude are transmitted back to the flight controller by various sensors based on the aircraft's own attitude data. The flight controller then issues commands through calculation and judgment, and the actuators complete the movements and attitude adjustments.
2. Basic Principle of Flight Controller Servo Control
The essence of how a flight controller controls a servo is that the flight controller outputs PWM signals to drive the servo through real-time attitude perception and target attitude calculation, enabling the aircraft to achieve the required flight state control. The following is a detailed explanation of the principle, applicable to mainstream flight control systems such as ArduPilot and INAV.

2.1 Flight Controller Perceives Aircraft Attitude
1. Attitude Sensor Input
The flight controller obtains real-time attitude data of the aircraft through built-in sensors, including:
IMU (Inertial Measurement Unit): Roll, Pitch, Yaw, Acceleration, and Angular Velocity
Magnetometer/GPS: Assists in correcting heading and position information.
Airspeed Sensor: Measures the aircraft's speed relative to the surrounding air, enabling precise flight control and speed protection.
Barometer: Measures atmospheric pressure to calculate the aircraft's flight altitude.
2. Receive User/Autonomous Navigation Commands
Users input control commands via the RC transmitter (e.g., turn left, climb), or in autonomous flight mode, the waypoint system provides target attitude/position. The flight controller treats this target attitude and position as the "desired" state.
2.2 Flight Controller Calculates Control Output
1. Error Calculation (Desired vs. Current)
The flight controller calculates the difference between the current attitude and the target attitude in real-time to generate an error signal, for example:
- Current pitch angle is 5°, target is 15°, error is +10°
2. PID Control Algorithm Adjustment
The flight controller uses a PID controller to calculate the required control surface deflection based on attitude error. The PID output is a control quantity representing the direction and magnitude of the servo rotation.
Proportional (P): Rapid response to error (e.g., applying opposite aileron when the aircraft rolls to the right).
Integral (I): Eliminates steady-state error (e.g., correcting long-term wind drift).
Derivative (D): Suppresses oscillation (e.g., preventing excessive aileron flapping).
3. Servo Control Signal Generation
The flight controller converts the calculation results into PWM (Pulse Width Modulation) signals, generally ranging from 1000 to 2000μs, with a center position of 1500μs:
For example: The elevator center position is 1500μs; if the aircraft needs to pitch up (ascend), 1600μs is sent;
If the aircraft needs to pitch down (descend), 1400μs is sent.
2.3 Servo Responds to Control Commands
1. PWM Signal Drives Servo Rotation
After receiving the PWM signal, the servo adjusts its angle according to the pulse width, typically supporting a rotation of approximately ±45°.
2. Control Surfaces Generate Aerodynamic Torque
After the control surfaces (such as ailerons, elevators, rudders) deflect, they change the airflow direction over the wing, generating aerodynamic torque. This causes the aircraft to rotate around the corresponding axis (Roll/Pitch/Yaw), realizing flight maneuvers.
3. Relationship Between PWM Duty Cycle and Servo Angle
PWM Signal Characteristics (Servo Specific):
Frequency: Typically 50Hz (i.e., a period of 20 milliseconds)
Duty Cycle: The duration of the high-level signal, measured in microseconds (μs)
The servo actually responds to the absolute time of the high-level pulse, so modifying the pulse width can change the servo angle.
| PWM High-Level Time | Duty Cycle (of 20ms period) | Servo Angle (Standard) |
|---|---|---|
| 1000μs | 5% | 0° |
| 1500μs | 7.5% | 90° |
| 2000μs | 10% | 180° |
Important
PWM Duty Cycle = High-Level Time / Total Cycle Time, for example 1500μs / 20000μs = 7.5%

Precautions
Pulse Width Range: Exceeding the servo's nominal range (e.g., 500μs~2500μs) may cause damage to mechanical limits.
Supply Voltage: Higher voltage results in faster servo speed, but pay attention to the rated voltage.
Important
The servo output voltage for CoreWing F405 WING V2\SpeedyBee F405 Wing APP, and SpeedyBee F405 Wing MINI is set to 5V by default.
Signal Stability: PWM signal jitter will cause servo jitter.
Multi-Servo Synchronization: Ensure all servos have consistent PWM periods (typically 50Hz) to avoid timing conflicts.
Important
If servo jitter occurs, you can perform the following troubleshooting steps:
Check if the servo header power supply voltage is stable.
Check if the refresh rate of all servos is consistent.
Check if the servo signal line is too close to telemetry, ESC, motor, and other equipment.
Try replacing the servo; poor servo quality can also cause jitter.
Check if the servo is securely mounted.
Technical Support QR Code
