Battery Difference mess up Alton

My team tried are first run of Alton after a little work it 95% of the time. When we changed out the battery it would start going way to fast/far I know this is because of the battery but is there any to change stuff in the code to help with differences in battery charges. We did not change anything in code after changing the battery.
Please let know if there is any we can do.
Thank you

I’d use a PID loop to fix this.

If you really don’t want to get into PID loop stuff (I recommend it but it’s your call) then one of the things we did that helped is to use a power expander and put all your drive motors on one battery and put everything else on the other battery. Also, in your programming don’t do ANYTHING with timers(except for wait times, thos are fine). But if you have it so that the robot will turn left for a certain amount of time then the battery power will affect the timer and thus effect the robot’s accuracy. Rather you should use encoders(or other sensors) for all of your robots movement if you aren’t using them already.

+1 to this. For a good auton program and faster programming, encode everything.