From 6225fae1d63554a6e3bebe730327cb4c57adebaf Mon Sep 17 00:00:00 2001 From: Junwoo Hwang Date: Tue, 3 May 2022 13:03:27 +0200 Subject: [PATCH] Increase Battery level emergency shutdown time delay from 300 ms to 60 seconds, to give enough time for the user to configure the vehicle in the mean time. This is needed especially when the battery cell count setting is wrong (when it should be 3, but set to 4 for example), since then whenever you boot the vehicle, it will shutdown after 300 ms, which leaves the user puzzled as to exactly what's happening. And it also prevented the user from changing the Parameter since it's shutting down so quickly. 60 second window is intended to be a reasonable time that will allow the user to figure out what's going on (via checking the battery level on QGC, etc) but also not deep discharge the battery to a dangerous level. --- src/modules/commander/Commander.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index f2298b02f1..5a3627e746 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -3967,8 +3967,8 @@ void Commander::battery_status_check() if (_battery_warning == battery_status_s::BATTERY_WARNING_EMERGENCY) { #if defined(BOARD_HAS_POWER_CONTROL) - if (shutdown_if_allowed() && (px4_shutdown_request(400_ms) == 0)) { - mavlink_log_critical(&_mavlink_log_pub, "Dangerously low battery! Shutting system down\t"); + if (shutdown_if_allowed() && (px4_shutdown_request(60_s) == 0)) { + mavlink_log_critical(&_mavlink_log_pub, "Dangerously low battery! Shutting system down in 60 seconds\t"); events::send(events::ID("commander_low_bat_shutdown"), {events::Log::Emergency, events::LogInternal::Warning}, "Dangerously low battery! Shutting system down");