zhangni2012 / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

Patch for /ArduPlane/Attitude.pde #729

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
combine attitude control in airspeed mode for Attitude accuracy
decreace NavPitch P if need old logic

Original issue reported on code.google.com by alexeyko...@gmail.com on 28 Aug 2012 at 8:00

Attachments:

GoogleCodeExporter commented 8 years ago
before this path plane try get requeried airspeed going above waypoint while 
airspeed to big  

Original comment by alexeyko...@gmail.com on 28 Aug 2012 at 8:12

GoogleCodeExporter commented 8 years ago
or:

static void calc_nav_pitch()
{
    // Calculate the Pitch of the plane 
    // fine altitude control and prevent crash when excess airspeed limits
    // --------------------------------
    if (airspeed.use() && airspeed_iscritical()) {
        nav_pitch_cd = -g.pidNavPitchAirspeed.get_pid(airspeed_error_cm);
    } else {
        nav_pitch_cd = g.pidNavPitchAltitude.get_pid(altitude_error_cm);
    }
    nav_pitch_cd = constrain(nav_pitch_cd, g.pitch_limit_min_cd.get(), g.pitch_limit_max_cd.get());
}

static bool airspeed_iscritical()
{
int aspeed_cm = airspeed.get_airspeed_cm();
// use fbw limits parameters 
if  (aspeed_cm <= (int)g.flybywire_airspeed_min * 100 || aspeed_cm >= 
(int)g.flybywire_airspeed_max * 100)
    return true;
else
    return false;  
}

Original comment by alexeyko...@gmail.com on 30 Aug 2012 at 7:08

GoogleCodeExporter commented 8 years ago
it sucessfuly tested in fly.

telemery logs:
http://hobby.msdatabase.ru/project-updates/theresultsofoursurvey/apm-arduplane/p
lane_265.rar?attredirects=0&d=1

Original comment by alexeyko...@gmail.com on 31 Oct 2012 at 12:30