JAR-Template PID off by random amounts

So, I am using Jar Template PID for my programming skills. My issue is in random measurements, my robot will be randomly off by a couple of inches ( 6 - 8 ) or 10 - 15 degrees. I have tried tuning the constants but I still have the problem.

I forgot to add that I am coding on a field that is on carpet ( the tiles are set up on a carpet )