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)
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?
Replies
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.