diff --git a/libraries/AP_Winch/AP_Winch_Daiwa.cpp b/libraries/AP_Winch/AP_Winch_Daiwa.cpp index d660d15e38..a213b38907 100644 --- a/libraries/AP_Winch/AP_Winch_Daiwa.cpp +++ b/libraries/AP_Winch/AP_Winch_Daiwa.cpp @@ -184,7 +184,7 @@ void AP_Winch_Daiwa::read_data_from_winch() void AP_Winch_Daiwa::control_winch() { const uint32_t now_ms = AP_HAL::millis(); - float dt = (now_ms - control_update_ms) / 1000.0f; + float dt = (now_ms - control_update_ms) * 0.001f; if (dt > 1.0f) { dt = 0.0f; } diff --git a/libraries/AP_Winch/AP_Winch_PWM.cpp b/libraries/AP_Winch/AP_Winch_PWM.cpp index f778255926..7a26f931de 100644 --- a/libraries/AP_Winch/AP_Winch_PWM.cpp +++ b/libraries/AP_Winch/AP_Winch_PWM.cpp @@ -32,7 +32,7 @@ void AP_Winch_PWM::update() void AP_Winch_PWM::control_winch() { const uint32_t now_ms = AP_HAL::millis(); - float dt = (now_ms - control_update_ms) / 1000.0f; + float dt = (now_ms - control_update_ms) * 0.001f; if (dt > 1.0f) { dt = 0.0f; }