Robot keep drifting to one side

Our robot keeps drifting to one side whenever we try to move straight. We know that this problem is not a mechanical issue however we can’t find anything wrong with the code that would lead to this.

This screenshot is from the log file from the driver station.

Here is a link to our code
GitHub code

Please post photos of your chassis. How did your team determine that it is not a mechanical issue? What tests have been done?

Here’s what’s been done so far:

  • checked friction on both sides via hand
  • disabled and * kicked * the bot travels straight
  • disassembled and verified the same gear ratio on both sides
  • checked and corrected an initial wire issue

We did find that one motor is drawing more than the others and are trying to trouble shoot that one atm

Are you using the KOP chassis? If you are, check that all the pinion gears on the 4 motors are the same. We had a similar problem many years ago and struggled with it all season. After the season ended, we found out it was possible for a pinion with fewer teeth to fit. We had re-used motors from previous years.

all pinion gears are 14 teeth

1 Like

How much is the drivetrain drifting by? How much more current is the anomalous motor pulling?

If someone check the code, please. The code was updated with restore Factory Defaults for the Spark Max motor controllers. It is updated through the GitHub link.

Definitely this. We need a more quantitative description of what’s going on