Nowdays, I am trying to understand PX4 Autopilot(Drone Flight Control Open Source) attitude control code. But I can’t understand formula below which is in attitude control code description. Can anyone explain how that formula is induced?

The axis angle can change the yaw as well (noticeable at higher tilt angles).
This is the formula by how much the yaw changes:|
let a := tilt angle, b := atan(y/x) (direction of maximum tilt)|

**yaw = atan(-2 * sin(b) * cos(b) * sin^2(a/2) / (1 - 2 * cos^2(b) * sin^2(a/2))).**
  • $\begingroup$ Welcome to Robotics, PX4Traveler. I've seen some equations similar to this before, especially in some IMU application notes. I'm not sure about this form or your terminology specifically here, though. What are x and y? Angle a is the tilt angle and b is the "direction of maximum tilt?" What does that mean? Can you link the source code for context? $\endgroup$
    – Chuck
    Jul 29 at 23:30
  • $\begingroup$ Thanks to your attention chuck!! This is the link of the code(related line is 167 to 170) * github.com/PX4/PX4-Autopilot/blob/master/src/modules/… * And I am not sure but I think x,y are setpoint pitch and roll of drone for moving to horizontal setpoint position.(or they can be raw horizontal setpoint which is transmitted by rc controller) $\endgroup$ Jul 30 at 14:30

This is probably a formula to model what is called "Adverse yaw" in aircraft dynamics. It is a very popular factor - along with Dutch Roll - in terms of fixed-wing aircraft design and control, as it causes the vehicle to make an undesired movement.

In terms of a quadcopter here is what I think: When you perform a "roll" maneuver, the propellers which contribute to the roll angle in the desired direction will have more speed than the others. That way the quadcopter is going to perform the roll. However, these higher speeds will also cause those propellers to produce more drag (recall the thrust and torque equations). Because of that reason, quadcopter may tend to perform yaw movement in the opposite direction according to other angle inputs (combined with pitch angle input).

As the roll angle increases, the adverse yaw may be expected to increase due to higher speed difference - therefore drag - between the propellers.

This formula might be a simplified version of complex aerodynamical interaction between the vehicle and air. They might have approximated it from a real-life data. Maybe if you do some research on "Adverse Yaw", you might find similar equations.

This may not be the complete answer you were looking for, but I hope that it would direct you towards a more clear way to understand the formula/interaction.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.