Files
PX4-Autopilot/ROMFS/px4fmu_common/init.d/rc.mc_apps
T
Jacob Dahl ab59b0bcb8 feat(sensors): barometer thrust compensation with online estimator
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).
2026-03-31 23:43:48 -08:00

57 lines
919 B
Bash

#!/bin/sh
#
# Standard apps for multirotors. Attitude/Position estimator, Attitude/Position control.
#
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#
#
# Start Control Allocator
#
control_allocator start
#
# Start Multicopter Rate Controller.
#
mc_rate_control start
#
# Start Multicopter Attitude Controller.
#
mc_att_control start
if param greater -s MC_AT_EN 0
then
mc_autotune_attitude_control start
fi
#
# Start Multicopter Position Controller.
#
mc_hover_thrust_estimator start
# Bit 1 of SENS_BAR_AUTOCAL enables online thrust compensation (value > 1)
if param greater -s SENS_BAR_AUTOCAL 1
then
baro_thrust_estimator start
fi
flight_mode_manager start
mc_pos_control start
#
# Start Multicopter Land Detector.
#
land_detector start multicopter
if param compare -s MC_NN_EN 1
then
mc_nn_control start
fi
if param compare -s MC_RAPTOR_ENABLE 1
then
mc_raptor start
fi