JJRobots COMMUNITY
LIPO Battery Warning/Shutdown - Printable Version

+- JJRobots COMMUNITY (http://forums.jjrobots.com)
+-- Forum: JJrobots (/forumdisplay.php?fid=1)
+--- Forum: B-Robot (/forumdisplay.php?fid=2)
+--- Thread: LIPO Battery Warning/Shutdown (/showthread.php?tid=46)

Pages: 1 2


LIPO Battery Warning/Shutdown - wfbaron - 06-19-2015 05:07 AM

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.


RE: LIPO Battery Warning/Shutdown - KomX - 06-19-2015 06:07 AM

It is hard to advise you without knowing the parameters of your battery.


RE: LIPO Battery Warning/Shutdown - wfbaron - 06-19-2015 09:16 PM

I am using a 1000mAh 3S 25C Lipo.


RE: LIPO Battery Warning/Shutdown - KomX - 06-20-2015 07:38 AM

Very good! Now we have to tell the voltage of the battery pack.


RE: LIPO Battery Warning/Shutdown - sasa999 - 06-21-2015 01:30 PM

You can solder pot and adjust voltage for shutdown at 10.5v


RE: LIPO Battery Warning/Shutdown - wfbaron - 06-22-2015 06:51 PM

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?
}


RE: LIPO Battery Warning/Shutdown - KomX - 06-22-2015 07:21 PM

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


RE: LIPO Battery Warning/Shutdown - sasa999 - 06-23-2015 09:38 AM

(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.


RE: LIPO Battery Warning/Shutdown - KomX - 06-23-2015 12:10 PM

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.
Куда глядели мои глаза!


RE: LIPO Battery Warning/Shutdown - wfbaron - 06-25-2015 03:44 AM

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