Battery Life vex v5 robot

"We are using the VEXcode V5 Text IDE to program our VEX V5 robot. We are not using any additional add-ons such as the LED lights. The IDE has a built in API that has methods that gets information from the battery. The methods are: Brain.Battery.capacity(), Brain.Battery.current(), Brain.Battery.voltage(). The formula I currently have is double ENERGY_CAPACITY_OF_VEX_BATTERY = 1.1;
double secondsToHours = Brain.Timer.value()/3600;
double batteryLife =((ENERGY_CAPACITY_OF_VEX_BATTERY - (Brain.Battery.current() * secondsToHours))/ENERGY_CAPACITY_OF_VEX_BATTERY) * 100;

1 Like

Ummm, what exactly are you asking here?


I think he/she is explaining how to show battery life on a robot.

uuuh… doesnt the controller already show battery life?


It does but maybe on the brain screen if the controller screen has a different image since you can Put different images on the controller screen like a smiley face.

1 Like

I think the problem is that you use instantaneous value of current to estimate battery life. If you want to calculate total energy you need to integrate instantaneous current values over very small intervals of time. That is not easy to do accurately.

It is much easier to deduce battery life and remaining capacity by the voltage of the battery, because it gradually drops as battery discharges. I think that is how capacity function calculates the value.

uint32_t vex::brain::battery::capacity(percentUnits units=percentUnits::pct)


The battery already calculates its remaining capacity. Here is some background.

The biggest change to the V5 Robot Battery Li-Ion 1100mAh is the higher 12.8v nominal voltage. The battery charges up to 14.6v and runs down to 10v. Due to the very steady output voltage of these batteries, the Robot Brain cannot determine remaining capacity using the typical method of measuring voltage and estimating capacity. Instead, the V5 battery pack has an intelligent battery management system that measures changes in electrical charge (coulombs) into and out of the battery during charge and discharge. From this data, the battery determines the actual amount of remaining power.

This is from the V5 System Architecture page.


Happy Half Cake Day!

1 Like