mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-03 19:24:09 +05:30
Added resetPID() call when robot velocities are 0 to fix motion perserverance bug
This commit is contained in:
parent
d03061ae60
commit
2b4567ec08
@ -316,6 +316,7 @@ int runCommand() {
|
||||
lastMotorCommand = millis();
|
||||
if (arg1 == 0 && arg2 == 0) {
|
||||
setMotorSpeeds(0, 0);
|
||||
resetPID();
|
||||
moving = 0;
|
||||
}
|
||||
else moving = 1;
|
||||
|
@ -100,7 +100,7 @@ void doPID(SetPointInfo * p) {
|
||||
/*
|
||||
* allow turning changes, see http://brettbeauregard.com/blog/2011/04/improving-the-beginner%E2%80%99s-pid-tuning-changes/
|
||||
*/
|
||||
p->ITerm += Ki * Perror;
|
||||
p->ITerm += Ki * Perror;
|
||||
|
||||
p->output = output;
|
||||
p->PrevInput = input;
|
||||
|
Loading…
x
Reference in New Issue
Block a user