
This project implements a simple quadcopter drone flight controller that converts four control inputs (throttle, yaw, pitch, and roll) into power commands for four motors.
The controller mixes the inputs so that each motor receives a different drive level depending on the requested motion. Throttle raises or lowers all motors together, while yaw, pitch, and roll introduce differential adjustments to achieve the desired control.
Both the input and output use a PWM signal with a 20 ms period. A 1 ms duty period represents the minimum value and a 2 ms duty period represents the maximum value.
Apply PWM control signals for throttle, yaw, pitch, and roll at the expected 20 ms frame rate and observe the four motor PWM outputs. Verify that increasing throttle raises all outputs together, and that yaw, pitch, and roll shift power between motors in the expected direction.
The intended final setup uses a radio receiver to receive control inputs from the controller as PWM signals and feeds outputs to ESCs for each motor.
The full system implementation requires a receiver (or other control source) to feed the input control signals, ESCs to receive the output signals, and motors. Many modern transmitters/receivers use protocols other than PWM. I used an ELRS/CRSF RadioMaster transmitter/receiver and a CRSF to PWM converter.
My parts list:
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Motor 1 (FL, CCW) PWM out | ||
| 1 | Throttle PWM in | Motor 2 (FR, CW) PWM out | |
| 2 | Yaw PWM in | Motor 3 (RR, CCW) PWM out | |
| 3 | Pitch PWM in | Motor 4 (RL, CW) PWM out | |
| 4 | Roll PWM in | ||
| 5 | Arm PWM in | Armed LED | |
| 6 | |||
| 7 |