From 11712df9e2665b5b684a286196eba29195a710e4 Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 9 Jan 2022 20:48:46 -0500 Subject: [PATCH] comments --- src/Romi32U4Motors.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Romi32U4Motors.cpp b/src/Romi32U4Motors.cpp index 3c74371..c7e8d27 100644 --- a/src/Romi32U4Motors.cpp +++ b/src/Romi32U4Motors.cpp @@ -124,7 +124,8 @@ void Romi32U4Motor::setTargetSpeed(int16_t target) if(ctrlMode != CTRL_SPEED) { - //when new target speeds are set, reset the error integral + // Reset the error integral if we are switching from another mode + // Otherwise, the robot may jump due to residual integral pidCtrl.resetSum(); }