Battery Regulation in Program

Hi my team and I were wondering if there was to regulate battery voltages in the program. For example if you’re using a battery expander and you have a 8.3 volt battery and a 8.6 volt battery is there a way in the program to tell both batteries to run at 8.3 volts to match the lowest volt battery.

You can’t change the voltage of the battery by any means other than charging it/discharging it (at least, without custom electronics). If your autons are being messed up by higher/lower voltages, I’d suggest implementing a PID loop or other feedback loops to compensate for different voltages.

No that’s impossible without modifying the circuitry of the cortex and power expander themselves, which would certainly be illegal for competition. This is something that’s beyond the realm of what programming can do with the current suite of sensors available. Instead, use PID/feedback loops in your code like @discovery said, as they will automatically compensate for differing voltages if tuned right.