Hello everyone! Recently my team got an inertial sensor and decided to use jar template for a more consistent autonomous. While working on the autonomous, we ran into a few issues.
- There are times where the robot reaches the target destination, but then it goes backwards a few inches for no reason. This throws off our entire autonomous. This also only happens sometimes and sometimes it works perfectly. I have tried to change the PID values for the drive and even the error settings, but it doesn’t fix it. Its also hard to test it because it only happens every few runs. Heres the code for the part where it usually does it:
As you can see, I tried many ways to fix this. I divided the distance it has to go into two different lines of code to see if that would help, but it doesn’t.
Here is some of my configuration code:
Another issue I have is that sometimes after the code finishes running, the robot will just start driving forward for an indefinite time. For example, after the code below the robot would just start going forward forever unless I add a wait.
The last issue is something that just started happening recently. When the robot reaches the target, it will start slowly reversing for no reason. As with the first issue, this only happens sometimes so its hard to recreate and test.
Here’s my PID tuning.
Any help would be appreciated!