Configuration for the FirmwarePidTuner.
More...
#include <types.hpp>
Configuration for the FirmwarePidTuner.
Per-motor analogue of VelocityTuneConfig — the tuner runs a BEMF step response, identifies a FOPDT plant, derives CHR gains, and pushes them to the STM32 firmware MAV-mode PID.
Definition at line 215 of file types.hpp.
◆ accept_improvement_frac
| double libstp::autotune::FirmwarePidConfig::accept_improvement_frac {0.02} |
◆ chr_kd_scale
| double libstp::autotune::FirmwarePidConfig::chr_kd_scale {0.3} |
◆ chr_ki_scale
| double libstp::autotune::FirmwarePidConfig::chr_ki_scale {0.6} |
◆ chr_kp_scale
| double libstp::autotune::FirmwarePidConfig::chr_kp_scale {0.6} |
CHR PID coefficients from the ControlTheory step-response tuner: Kp = 0.6*Tg/(Ks*Tu), Ki = 0.6/(Ks*Tu), Kd = 0.3*Tg/Ks.
Definition at line 230 of file types.hpp.
◆ csv_dir
| std::string libstp::autotune::FirmwarePidConfig::csv_dir {} |
When non-empty, dump every sample of every step response to CSV under this directory. One CSV per (motor_port, phase) plus one summary CSV with plant fits and accept/reject decisions. Lets you replay the raw data offline to iterate on the identification algorithm without re-running on hardware.
Definition at line 247 of file types.hpp.
◆ de_gain_max
| double libstp::autotune::FirmwarePidConfig::de_gain_max {10.0} |
◆ de_max_overshoot
| double libstp::autotune::FirmwarePidConfig::de_max_overshoot {50.0} |
◆ de_output_max
| double libstp::autotune::FirmwarePidConfig::de_output_max {399.0} |
◆ de_pid_steps
| int libstp::autotune::FirmwarePidConfig::de_pid_steps {60} |
◆ de_plant_max
| double libstp::autotune::FirmwarePidConfig::de_plant_max {5000.0} |
◆ de_plant_min
| double libstp::autotune::FirmwarePidConfig::de_plant_min {0.0001} |
◆ de_plant_steps
| int libstp::autotune::FirmwarePidConfig::de_plant_steps {80} |
◆ de_seed
| std::uint32_t libstp::autotune::FirmwarePidConfig::de_seed {0xC0FFEEu} |
◆ de_sim_horizon_s
| double libstp::autotune::FirmwarePidConfig::de_sim_horizon_s {5.0} |
◆ de_weight_ctrl
| double libstp::autotune::FirmwarePidConfig::de_weight_ctrl {0.0} |
◆ de_weight_overshoot
| double libstp::autotune::FirmwarePidConfig::de_weight_overshoot {1.0} |
◆ decel_duration_s
| double libstp::autotune::FirmwarePidConfig::decel_duration_s {1.0} |
Extra samples after raw PWM is set to zero.
Definition at line 226 of file types.hpp.
◆ identification_trials
| int libstp::autotune::FirmwarePidConfig::identification_trials {3} |
Number of full parallel baseline responses used to identify the plant and establish the baseline ISE. Multiple passes reduce BEMF jitter and random floor/contact effects.
Definition at line 237 of file types.hpp.
◆ min_response_frac
| double libstp::autotune::FirmwarePidConfig::min_response_frac {0.10} |
Tail/|command| threshold — skip if smaller.
Definition at line 233 of file types.hpp.
◆ raw_pwm_percent
| int libstp::autotune::FirmwarePidConfig::raw_pwm_percent {70} |
Raw PWM percent used to identify the motor plant. All drive motors run at this power simultaneously so BEMF captures real DC-bus and chassis loading.
Definition at line 220 of file types.hpp.
◆ sample_hz
| int libstp::autotune::FirmwarePidConfig::sample_hz {200} |
Step-response sampling rate (Hz).
Definition at line 227 of file types.hpp.
◆ step_duration_s
| double libstp::autotune::FirmwarePidConfig::step_duration_s {5.0} |
Duration of the raw PWM step-response recording (s). This is the "Sprungantwort": raw power on all motors, no IMU straightening, no velocity PID.
Definition at line 225 of file types.hpp.
◆ step_fraction
| double libstp::autotune::FirmwarePidConfig::step_fraction {0.5} |
Fraction of measured max BEMF used for MAV validation.
Definition at line 221 of file types.hpp.
◆ use_control_theory
| bool libstp::autotune::FirmwarePidConfig::use_control_theory {true} |
◆ validation_trials
| int libstp::autotune::FirmwarePidConfig::validation_trials {3} |
Number of full parallel validation responses after candidate gains are applied. Gains must improve the mean ISE by accept_improvement_frac.
Definition at line 240 of file types.hpp.
The documentation for this struct was generated from the following file:
- /home/runner/work/raccoon-lib/raccoon-lib/modules/libstp-autotune/include/autotune/types.hpp