From db89bd5b5eaf368732ee926f370b0b1ac8e93b6d Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 13 Jun 2023 15:51:10 +0200 Subject: [PATCH] esc_calibration: allow to calibrate ESCs without battery detection Before this the ESC calibration aborts if battery detection doesn't work. The problem is if the user still connects the battery as he gets instructed and the calibration aborts then the ESCs are in calibration mode and after abortion calibrate to the wrong value. Also I realized there's no additional safety by aborting the calibration if the battery cannot be detected during the timeout because a pixhawk board without power module will report a battery status from the ADC driverand in it that no battery is connected which is the best it can do. In this situation the motors will still spin if the ESCs are powered. --- src/modules/commander/esc_calibration.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/esc_calibration.cpp b/src/modules/commander/esc_calibration.cpp index e0b882dbed..250df52a35 100644 --- a/src/modules/commander/esc_calibration.cpp +++ b/src/modules/commander/esc_calibration.cpp @@ -133,8 +133,9 @@ int do_esc_calibration(orb_advert_t *mavlink_log_pub) } if ((now - timeout_start) > 6_s) { - // Timeout, we abort here - calibration_failed = true; + // Timeout, we continue since maybe the battery cannot be detected properly + // If we abort here and the ESCs are infact connected and started calibrating + // they will measure the disarmed value as the lower limit instead of the fixed 1000us break; }