From 2bb04f2261c75cb48d36ed9f826414871ccfaf2b Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 17 Aug 2020 10:19:07 -0400 Subject: [PATCH] commander: increase COM_ARM_MAG_ANG 35 -> 45 degrees - in practice this is mostly useful for identifying incorrect rotations which we mostly have in 45 degree increments - handling a vehicle on the ground can easily disturb one mag by more than 30 degrees, so this is often distracting noise --- ROMFS/px4fmu_common/init.d/airframes/4250_teal | 1 - ROMFS/px4fmu_common/init.d/airframes/6002_draco_r | 2 -- .../Arming/PreFlightCheck/checks/magConsistencyCheck.cpp | 2 +- src/modules/commander/commander_params.c | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/airframes/4250_teal b/ROMFS/px4fmu_common/init.d/airframes/4250_teal index ba3bac9caf..8c3e8a7c87 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4250_teal +++ b/ROMFS/px4fmu_common/init.d/airframes/4250_teal @@ -49,7 +49,6 @@ then # sensor calibration param set CAL_MAG_SIDES 63 param set SENS_BOARD_ROT 0 - param set COM_ARM_MAG_ANG -1 param set COM_ARM_EKF_AB 0.0032 # circuit breakers diff --git a/ROMFS/px4fmu_common/init.d/airframes/6002_draco_r b/ROMFS/px4fmu_common/init.d/airframes/6002_draco_r index 9527b70a7f..7f6181fcd3 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/6002_draco_r +++ b/ROMFS/px4fmu_common/init.d/airframes/6002_draco_r @@ -91,8 +91,6 @@ then # DSHOT param set DSHOT_CONFIG 600 - param set COM_ARM_MAG 0.2 - param set MIS_TAKEOFF_ALT 1.1 ##################################### diff --git a/src/modules/commander/Arming/PreFlightCheck/checks/magConsistencyCheck.cpp b/src/modules/commander/Arming/PreFlightCheck/checks/magConsistencyCheck.cpp index 8f0d16993f..c5d8c97695 100644 --- a/src/modules/commander/Arming/PreFlightCheck/checks/magConsistencyCheck.cpp +++ b/src/modules/commander/Arming/PreFlightCheck/checks/magConsistencyCheck.cpp @@ -60,7 +60,7 @@ bool PreFlightCheck::magConsistencyCheck(orb_advert_t *mavlink_log_pub, vehicle_ // Use the difference between sensors to detect a bad calibration, orientation or magnetic interference. // If a single sensor is fitted, the value being checked will be zero so this check will always pass. - int32_t angle_difference_limit_deg; + int32_t angle_difference_limit_deg = 90; param_get(param_find("COM_ARM_MAG_ANG"), &angle_difference_limit_deg); pass = pass || angle_difference_limit_deg < 0; // disabled, pass check diff --git a/src/modules/commander/commander_params.c b/src/modules/commander/commander_params.c index c2a63132df..0b038cc50b 100644 --- a/src/modules/commander/commander_params.c +++ b/src/modules/commander/commander_params.c @@ -616,7 +616,7 @@ PARAM_DEFINE_FLOAT(COM_ARM_IMU_GYR, 0.25f); * @min 3 * @max 180 */ -PARAM_DEFINE_INT32(COM_ARM_MAG_ANG, 30); +PARAM_DEFINE_INT32(COM_ARM_MAG_ANG, 45); /** * Enable mag strength preflight check