diff --git a/source/Core/Threads/PIDThread.cpp b/source/Core/Threads/PIDThread.cpp index e7183248ac..b8e0530ac7 100644 --- a/source/Core/Threads/PIDThread.cpp +++ b/source/Core/Threads/PIDThread.cpp @@ -130,7 +130,7 @@ template struct PID { // Thus we multiply this out by the interval time to ~= dv/dt // Then the shift by 1000 is ms -> Seconds - integration_running_sum += (target_delta * interval_ms * Ki) / 1000; + integration_running_sum += (target_delta * (T)interval_ms * Ki) / 1000; // We constrain integration_running_sum to limit windup // This is not overly required for most use cases but can prevent large overshoot in constrained implementations