Expand description
PID autotune: measure a loop, turn the measurement into gains, and run it per loop.
Probe: one loop’s excitation and measurement, run inside the tick: aStepProbewhoseStepMetricsdescribe the loop’s step response, or anIdentifyProbethat fits its axis’sRateModel(a wing’s: aWingIdentifyProbeand itsWingModel).design_rateanddesign_angle_p: gains from aRateModelby loop shaping.Tunable: a stabilizer that hosts a probe on one of its loops (CopterStabilizer,PlaneStabilizer).autotune::Autotune: the copter supervisor, run between ticks: executes each stage’s procedure (which probes to run, what gains follow), guards the envelope, and commits or reverts gains.
Method and rules: docs/architecture/autotune.md#autotune.
§Examples
use stable_flight::tuning::autotune::COPTER_RATE_STEP;
use stable_flight::tuning::{LoopSignals, Probe, ProbeConfig};
// A 1 rad/s step on a rate loop at rest: the loop runs on the stepped setpoint.
let mut probe = Probe::new(ProbeConfig::Step(COPTER_RATE_STEP));
let setpoint = probe.step(0.004, &LoopSignals::default());
assert_eq!(setpoint, COPTER_RATE_STEP.amplitude);Re-exports§
pub use design::DesignError;pub use design::LoopShapingConfig;pub use design::design_angle_p;pub use design::design_rate;pub use identify::IdentifyAbort;pub use identify::IdentifyConfig;pub use identify::IdentifyExtension;pub use identify::IdentifyProbe;pub use identify::IdentifyStatus;pub use identify::MAX_DELAY_TICKS;pub use identify::RateModel;pub use probe::LoopSignals;pub use probe::Measurement;pub use probe::Probe;pub use probe::ProbeAbort;pub use probe::ProbeConfig;pub use probe::ProbeStatus;pub use probe::Progress;pub use step::Stat;pub use step::StepAbort;pub use step::StepConfig;pub use step::StepMetrics;pub use step::StepProbe;pub use step::StepStatus;pub use step::StepSummary;pub use wing::design::WingDesign;pub use wing::design::WingDesignConfig;pub use wing::design::WingDesignStatus;pub use wing::WingIdentifyProbe;pub use wing::WingModel;pub use wing::WingStatus;
Modules§
- autotune
- The autotune supervisor (
Supervisor), generic over the loops it tunes (Side); a copter’s isAutotune. - design
- Gains from an identified
RateModelby loop shaping: seedesign_rateanddesign_angle_p. - identify
- Closed-loop identification of a rate axis: see
IdentifyProbe. - probe
- What an autotune stage runs inside the tick: see
Probe. - step
- Step-response measurement of a loop: see
StepProbe. - wing
- Closed-loop identification of a wing’s roll or pitch axis: see
WingIdentifyProbe.
Traits§
- Tunable
- A stabilizer that hosts autotune stages: one of its loops handed to a
Probeinside the tick, then handed back.FlightLoopforwards these between ticks (FlightLoop::start_probeand friends), so a supervisor never needs&mutaccess to the stabilizer itself.