PID Rate computation

I am wondering why rate PID is computed like this in STABILIZE mode

get_stabilize_roll(long target_angle)

   // Rate P:
    error         = rate - (long)(degrees(omega.x) * 100.0);
    rate         = g.pi_rate_roll.get_pi(error, G_Dt);


but like this in ACRO mode 

get_rate_roll(long target_rate)
    long error;
    target_rate     = constrain(target_rate, -2500, 2500);
    error            = (target_rate * 4.5) - (long)(degrees(omega.x) * 100.0);
    target_rate     = g.pi_rate_roll.get_pi(error, G_Dt);



Where does the 4.5 factor come from ?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • Developer

    That's actually a stand-in for Stabilize_P. I don't fly Acro at all so please suggest a fix!



This reply was deleted.


Chris Anderson liked Zara Mae Pickering's profile
May 21
Azjeg liked Azjeg's profile
Apr 27
Benewake LiDAR liked Benewake LiDAR's profile
Apr 12
Gremsy liked Gremsy's profile
Mar 12