Fixed Java velocity PID not calculating result when P = 0 (#717)

This commit is contained in:
Tyler Veness
2017-11-08 21:28:09 -08:00
committed by Peter Johnson
parent 6e9d1f55c6
commit 8b2e656bde

View File

@@ -271,10 +271,10 @@ public class PIDController implements PIDInterface, LiveWindowSendable, Controll
} else {
m_totalError = m_maximumOutput / m_P;
}
m_result = m_P * m_totalError + m_D * m_error
+ calculateFeedForward();
}
m_result = m_P * m_totalError + m_D * m_error
+ calculateFeedForward();
} else {
if (m_I != 0) {
double potentialIGain = (m_totalError + m_error) * m_I;