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 –

Replies

  • Developer

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

    Thanks,

    Jason

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…