Good day, I have just finished tuning the Pitch and Roll PID's. I did this by setting the throttle such that the quad is weightless. I did the tuning of each axes separately.

I would just like to ask what is the best way to tune the PID for maintaining an altitude setpoint.

Is it best to turn off the Pitch and Roll PID controllers while tuning the altitude PID or is it best to have them already active while tuning the latter controller?

I am going to use a cascaded PID controller using the Velocity along the z-axis calculated from the accelerometer output for the inner PID loop (150Hz) and the altitude measurement of the HC-SRO4 ultrasonic sensor (20Hz) for the outer PID loop.

  • 1
    $\begingroup$ See also, robotics.stackexchange.com/q/4409/350 $\endgroup$
    – Ian
    Commented Mar 4, 2016 at 19:20
  • $\begingroup$ Can you guys please share the codes? thanks $\endgroup$
    – Andy
    Commented Jun 2, 2021 at 5:02

1 Answer 1


Currently I am performing my research on that, and in my case I decided to tune all the PIDs. Angles of the quadrotor tend to zero, while altitude controller tend to the objective height. That's habitual in bibliography.

In my particular simulations on the computer, PD parameters were enough and all the controllers adapted the same Proportional and Derivative parameters.

  • $\begingroup$ I just finished implementing a PD controller earlier and it works like a charm, thank you :) $\endgroup$ Commented Mar 25, 2016 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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