Allow negative differential pressure if parameter enabled (#24434)

This commit is contained in:
Andy Wheatley
2025-03-24 08:42:36 +00:00
committed by GitHub
parent fdebdc447d
commit ca2ed655b8
10 changed files with 85 additions and 2 deletions
@@ -168,7 +168,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub)
/* do not allow negative values */
calibration_log_critical(mavlink_log_pub, "[cal] Negative pressure difference detected (%d Pa)",
(int)differential_pressure_pa);
calibration_log_critical(mavlink_log_pub, "[cal] Swap static and dynamic ports!");
calibration_log_critical(mavlink_log_pub, "[cal] Swap static and dynamic ports or set SENS_DPRES_REV");
/* the user setup is wrong, wipe the calibration to force a proper re-calibration */
diff_pres_offset = 0.0f;
+12
View File
@@ -87,6 +87,18 @@ PARAM_DEFINE_FLOAT(CAL_AIR_TUBED_MM, 1.5f);
*/
PARAM_DEFINE_FLOAT(SENS_DPRES_OFF, 0.0f);
/**
* Reverse differential pressure sensor readings
*
* Reverse the raw measurements of all differential pressure sensors.
* This can be enabled if the sensors have static and dynamic ports swapped.
*
* @category system
* @group Sensor Calibration
* @boolean
*/
PARAM_DEFINE_INT32(SENS_DPRES_REV, 0);
/**
* Differential pressure sensor analog scaling
*