Hmmmm. Can you point to the exact file you’re using? The repo link provided doesn’t seem to contain robot code… at least not that I could find?
That being said, and making some assumptions about your mechanism and code…
The scenario you describe sounds like the P gain is very high. As the error becomes slightly positive, your P gain attempts to compensate by driving the motor full negative power. The wheel slows down, driving the error slightly negative, at which point the P gain compensates by driving the motor to full forward power. Repeat Ad infinitum.
Note - this is not… technically… wrong… other than the wear and tear (mechanically and electrically ) it puts on the motor. You’ve kinda created a Bang-Bang controller, which is a good way to control heavy rotating mass to a certain velocity.
Assuming you only want to run the motor one direction, you can use the spark max API’s to limit the output range to only drive forward. This will effectively be a true bang-bang controller. Alternatively, cut your P gain down by factors of two until the oscillatory behavior ceases.
As one sample point: Our 1:1 geared, two-NEO shooter has about ten pounds of rotating mass spread over 8-inch diameter wheels, and is tuned with a P gain of 0.0006, and an F gain of 0.0002. I don’t completely know how much you can extrapolate this, but if you told me you have a P gain of 350.0 , I’d definitely say “something’s wrong”.