See here for problem explanation and replication instructions: https://xrp.discourse.group/t/should-this-code-work-as-designed/690/8?u=sparkfro
I suspect the PID controller is not being reset correctly when set_speed() is called. If I add self.speedController.clear_history() to the end of set_speed(), then I get consistent behavior. Not sure if that's the "right" solution, but it does seem to imply that's where the root problem is.