mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-08-21 12:40:34 +08:00
ab59b0bcb8
Add propwash-induced barometer error compensation. Propellers create static pressure changes at the baro sensor proportional to motor output. Correction: baro_alt += SENS_BARO_PCOEF * mean_motor_output. Thrust compensation in VehicleAirData uses a motor ring buffer (8 samples) with time-matched lookup against baro timestamp_sample. BMP388 timestamp_sample corrected from read time to integration midpoint (- measurement_time/2), eliminating 38ms baro-thrust lag. Online estimator module (baro_thrust_estimator) uses a complementary filter to isolate thrust-correlated baro error at 0.05Hz crossover, and recursive least squares to identify gain K online. Saves to SENS_BARO_PCOEF on disarm. Controlled by SENS_BAR_AUTOCAL bit 1. SENS_BAR_AUTOCAL migrated from boolean to bitmask (bit 0: GNSS cal, bit 1: thrust comp). Includes offline calibration/validation tool (Tools/baro_compensation/baro_thrust_calibration.py).
12 lines
696 B
Plaintext
12 lines
696 B
Plaintext
uint64 timestamp # time since system start (microseconds)
|
|
uint64 timestamp_sample # time of baro data last used for this estimate
|
|
|
|
float32 residual # CF residual: baro minus accel-predicted altitude [m]
|
|
float32 k_estimate # estimated thrust-to-baro gain [m/unit_thrust]
|
|
float32 k_estimate_var # variance of K estimate (P[0][0])
|
|
float32 error_var # RLS prediction error variance
|
|
float32 thrust_std # standard deviation of recent thrust excitation
|
|
|
|
bool converged # true when all convergence criteria are met
|
|
bool estimation_active # true when RLS is updating (soft guards not active)
|