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.
This commit is contained in:
Matthias Grob 2023-06-13 15:51:10 +02:00
parent ae678e8e2f
commit db89bd5b5e
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}