JJRobots COMMUNITY

Full Version: LIPO Battery Warning/Shutdown
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm using a LiPo battery, and I'd like to use the code that warns and shuts down when low voltage is measured. I think I understand the necessary changes in the code, but I'd like to be very sure since it's a safety issue. Could someone provide a list of the changes needed?

Congratulations to Jose and Juan. B-Robot is a real achievement; the smoothness and stability are amazing.
It is hard to advise you without knowing the parameters of your battery.
I am using a 1000mAh 3S 25C Lipo.
Very good! Now we have to tell the voltage of the battery pack.
You can solder pot and adjust voltage for shutdown at 10.5v
I was looking for definitive information on how to adjust the Arduino code so that the warning and shutdown are in effect.

For example, I'm assuming that this section of the code needs some minor changes, as follows:

// Battery management [optional]. This is not needed for alkaline or Ni-Mh batteries but usefull for if you use lipo batteries
#define BATTERY_WARNING 110 // (11 volts) aprox
#define BATTERY_SHUTDOWN 104 // (10.4 volts)
#define BATTERY_CHECK 1 // 0: No check, 1: check
#define SHUTDOWN_WHEN_BATTERY_OFF 1 // 0: Not used, 1: Robot will shutdown when is off (_CHECK SHOULD BE 1)

Note that I've made these changes:
BATTERY_CHECK is set to 1
SHUTDOWN_WHEN_BATTERY_OFF is set to 1

Are any other changes needed?

Also, it looks like the battery warning feature has not been implemented. See this code at the very end of the sketch:

else if (BROBOT.battery < BATTERY_WARNING)
{
// Battery warning
// What to do here???
Serial.print("LOW BAT!! ");
Serial.println(BROBOT.battery);
//moveServo(SERVO_AUX_NEUTRO+300); // Move arm?
}
It's good that you do the sketch code, but ... If you need help with more demanding operating conditions LiPO batteries, give at least a link where you bought the battery, if you do not want to specify the voltage of the battery Smile
(06-22-2015 07:21 PM)KomX Wrote: [ -> ]if you do not want to specify the voltage of the battery Smile
3S
.
Not less than 3.2V for cell, but I recommend 3.5V for safe usage and battery life. So for 3S that will be 10.5V.
That true. You can safely discharge a lipo till 10.5V.
But it is better to leave the battery in 10-20% of capacity (11.1-11.4V).
You should also store the battery with 60-70% capacity (11.9-12.1V).
Never store the lipo fully charged. You should only fully charge it before using.

So,
#define BATTERY_WARNING 111 // or 114
#define BATTERY_SHUTDOWN 105

Hope this helps.

P.S. for sasa999.
Куда глядели мои глаза!
I tried to use the battery management code and ran into a problem. If I try to turn the battery mana like this:
#define BATTERY_CHECK 1 // 0: No check, 1: check
#define SHUTDOWN_WHEN_BATTERY_OFF 1 // 0: Not used, 1: Robot will shutdown when is off (_CHECK SHOULD BE 1)

I get these compile errors:
D:\Users\Bill\Documents\Arduino\libraries\JJROBOTS_BROBOT/JJROBOTS_BROBOT.h: In function 'void loop()':
D:\Users\Bill\Documents\Arduino\libraries\JJROBOTS_BROBOT/JJROBOTS_BROBOT.h:9: error: 'int BROBOT_Class::battery' is private
BROBOTReverseServoBatteryCheck:775: error: within this context
D:\Users\Bill\Documents\Arduino\libraries\JJROBOTS_BROBOT/JJROBOTS_BROBOT.h:9: error: 'int BROBOT_Class::battery' is private
BROBOTReverseServoBatteryCheck:785: error: within this context
D:\Users\Bill\Documents\Arduino\libraries\JJROBOTS_BROBOT/JJROBOTS_BROBOT.h:9: error: 'int BROBOT_Class::battery' is private
BROBOTReverseServoBatteryCheck:790: error: within this context
Pages: 1 2
Reference URL's