/* called when we change state to see if we should change gains */ void AP_AutoTune::stop(void) { if (running) { running = false; save_gains(restore); } }
/* see if we should save new values */ void AP_AutoTune::check_save(void) { if (AP_HAL::millis() - last_save_ms < AUTOTUNE_SAVE_PERIOD) { return; } // save the next_save values, which are the autotune value from // the last save period. This means the pilot has // AUTOTUNE_SAVE_PERIOD milliseconds to decide they don't like the // gains and switch out of autotune ATGains tmp = current; save_gains(next_save); Debug("SAVE P -> %.3f\n", current.P.get()); // restore our current gains current = tmp; // if the pilot exits autotune they get these saved values restore = next_save; // the next values to save will be the ones we are flying now next_save = current; last_save_ms = AP_HAL::millis(); }
void config_save(void) { save_yawCntrl(); save_rollCntrl(); save_pitchCntrl(); // save_navigation(); // save_airspeedCntrl(); #if (ALTITUDE_GAINS_VARIABLE == 1) save_altitudeCntrlVariable(); #else save_altitudeCntrl(); #endif save_settings(); save_gains(); }
void save_config(void) { #if (USE_CONFIGFILE == 1) save_yawCntrl(); save_rollCntrl(); save_pitchCntrl(); // save_navigation(); // save_airspeedCntrl(); #if (ALTITUDE_GAINS_VARIABLE == 1) save_altitudeCntrlVariable(); #else save_altitudeCntrl(); #endif save_settings(); save_gains(); #endif // USE_CONFIGFILE }