From 64e7301c9fe3a8a2b1ad9b96fc620f7122966f44 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Mon, 30 Dec 2024 15:51:32 +1100 Subject: [PATCH] CarbonixCommon: bit_esc: suppress nil warnings These are caused by two well-understood race conditions and we don't need to put them up on the messages tab anymore. This will be fixed properly in a future PR. Also, driveby fix for resetting the nil counters. These should be done every time we get good data, not just when recoving from telemetry loss. --- .../hwdef/CarbonixCommon/scripts/modules/bit_esc.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/scripts/modules/bit_esc.lua b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/scripts/modules/bit_esc.lua index eadc59ae5a..1ef7fa91fa 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/scripts/modules/bit_esc.lua +++ b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/scripts/modules/bit_esc.lua @@ -93,27 +93,27 @@ function ESC:update() elseif not esc_rpm then self.esc_rpm_nil_counter[i] = self.esc_rpm_nil_counter[i] + 1 if self.esc_rpm_nil_counter[i] < self.NIL_WARN_THRESHOLD then - cx_msg:send(cx_msg.MAV_SEVERITY.INFO, "ESC " .. i .. " RPM nil") + -- Don't warn about this case at all anymore elseif self.srv_rpm_in_err_status[i] == false then - cx_msg:send(cx_msg.MAV_SEVERITY.CRITICAL, "ESC " .. i .. " RPM nil") + cx_msg:send(cx_msg.MAV_SEVERITY.CRITICAL, "ESC " .. i .. " Telemetry Lost") self.srv_telem_in_err_status[i] = true end -- Nil check for servo output elseif not servo_out then self.servo_out_nil_counter[i] = self.servo_out_nil_counter[i] + 1 if self.servo_out_nil_counter[i] < self.NIL_WARN_THRESHOLD then - cx_msg:send(cx_msg.MAV_SEVERITY.INFO, "ESC " .. i .. " Servo Out nil") + -- Don't warn about this case at all anymore elseif self.srv_rpm_in_err_status[i] == false then - cx_msg:send(cx_msg.MAV_SEVERITY.CRITICAL, "ESC " .. i .. " Servo Out nil") + cx_msg:send(cx_msg.MAV_SEVERITY.CRITICAL, "ESC " .. i .. " Telemetry Lost") self.srv_telem_in_err_status[i] = true end -- Telemetry data is fresh and valid else + self.servo_out_nil_counter[i] = 0 + self.esc_rpm_nil_counter[i] = 0 if self.srv_telem_in_err_status[i] == true then cx_msg:send(cx_msg.MAV_SEVERITY.INFO, "ESC " .. i .. " Telemetry Recovered") self.srv_telem_in_err_status[i] = false - self.servo_out_nil_counter[i] = 0 - self.esc_rpm_nil_counter[i] = 0 end -- If armed, check that the motor is actually turning when it is commanded to if arming:is_armed() then