No Altitude correction at AUTO mode

Hi,

 

I'm at PID tunning phase and using the sw version 2.12.

The parameters are attached.

The problem is that the APM is not correcting the altitude (as figure showing)

3690877405?profile=original

I've been looking at source code and found this part of code:

void calc_nav_pitch()
{
    // Calculate the Pitch of the plane
    // --------------------------------
    if (airspeed_enabled == true) {
        nav_pitch = -g.pidNavPitchAirspeed.get_pid(airspeed_error, dTnav);
    } else {
        nav_pitch = g.pidNavPitchAltitude.get_pid(altitude_error, dTnav);
    }
    nav_pitch = constrain(nav_pitch, g.pitch_limit_min.get(), g.pitch_limit_max.get());
}

 

If I'm not wrong the altitude_error is not computing unless the airspeed is disabled.

 

Some one can help me to understand what is not correct?

 

last.param

alt_err.JPG

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

Join diydrones

Email me when people reply –

Replies

  • Regarding the airspeed_enabled issue, I believe that
    controls whether the energy/altitude loop for the throttle control is
    being used for the altitude or the nav_pitch. The altitude is still being controlled, but the tolerance is within 20 meters. I think this is set by the WP radius variable in the Mission Planner. That is my current understanding, but I'm open to being corrected by someone more knowledgeable.
This reply was deleted.

Activity

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