The flight controller of a toy quadrotor in angle mode: it turns the sticks of an RCCommand into rotor speeds.
More...
The flight controller of a toy quadrotor in angle mode: it turns the sticks of an RCCommand into rotor speeds.
- The throttle sets the thrust directly, as a share of the most the rotors can give; there is no height hold, so the pilot holds the height. At hover_throttle() the thrust carries the weight.
- The roll and pitch sticks set the angles to tilt to, up to max_tilt; letting go levels the quadrotor. A PD controller on each angle, with the body rates for the D part, gives the torque \(\tau = J (\omega_n^2 (\phi_{sp} - \phi) - 2 \zeta \omega_n p)\).
- The yaw stick sets the rate of turn, up to max_yaw_rate; a P controller on the rate gives the yaw torque.
- quadrotor_mixer() turns the thrust and the torques into rotor speeds. Disarmed, the rotors stop.
It reads the attitude and the rates of the quadrotor directly; a real flight controller would estimate them from its IMU.