NXT w/Li batt shuts down after ~7 hours hard use

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: 99jonathan, roger, imaqine

NXT w/Li batt shuts down after ~7 hours hard use

Postby joseph.goldstone » Wed Sep 09, 2009 1:26 pm

I have an industrial application built around the NXT in which, frame by frame, I advance through a 250-foot [~4,000 frame] roll of 35mm film. The interval between frame advances ranges from a minimum of around 1/4 second to a maximum of around 30 seconds.

The power draw for marching through an entire roll, though, is too much for a set of 6 AA batteries. I bought a LEGO lithium battery pack, and an official LEGO charger. I place the battery in the NXT, connect the LEGO charger, wait maybe 15 minutes, turn on the NXT, and start the downloaded leJOS program that runs the roll motors, communicates via Bluetooth with the host, etc. [code available on request]

At first this seemed to solve my problem but lately I find that the NXT spontaneously shuts down. I've seen this with three separate lithium batteries, purchased across a span of 15 months, so it isn't just one bad hardware component or run of batteries. I am not sure whether the shutdown only occurs in the 3/4 second or so burst when the motors are active, moving from one frame on the roll to the next, or if it also occurs when the NXT and associated motors are 'just sitting there'. The NXT is slightly warm to the touch at this point.

Is it possible that, even though the power cord is connected to the NXT and drawing current from the mains, that I could exhaust the NXT battery level to the point where the unit would shut down? If that were the case, then:

    is there a way for me to monitor, with lejos, the power level of the battery?

    has anyone ever heard of the NXT collapsing from overwork like this?

    has anyone ever done away with the battery entirely, and just wired the LEGO charger output (or, if that's inappropriate, then output wires from some appropriate transformer) directly to the NXT power terminals?


It turns out it's a serious pain for me to have to restart the measurement in mid-stream, so I would really like to avoid this spontaneous shutdown if at all possible.

One last question. Is there any way a software failure could cause the NXT to completely shut down, instead of displaying the crash data (exception number, PC, etc.) on the LCD? Or is it always the case that software crashes leave the NXT powered on?

This is from a Subversion check-out about midway between the 0.7 and 0.8 releases -- svn rev 2413.

[added a moment later]

I should also mention I've seen this across four different NXT bricks, bought across a 6-month period, so it's not just a flakey NXT or batch of NXTs.
joseph.goldstone
Novice
 
Posts: 52
Joined: Wed Aug 27, 2008 10:27 pm
Location: San Francisco

Postby gloomyandy » Wed Sep 09, 2009 3:02 pm

Hi Joseph,
Interesting application.

Yes I think it is possible to end up with the system shutting down even though you are connected to the mains. If the rate of discharge is higher than the charge rate then it will shut down. There was mention of this happening over on the NXTasy forums a little while ago. I can't be certain that this is happening in your case though (there could be bugs in the software that are causing the problem).

You can monitor the state of the battery using the Battery.getVoltageMilliVolt() call. It would probably be a good idea to monitor the voltage to see if it is dropping...

All the best

Andy

PS The 0.85 release menu system now has a much more accurate battery meter and can detect if the rechargeable Lego battery is in use - this may not help you very much though because you need the battery level while your program is running.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4187
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby joseph.goldstone » Thu Sep 10, 2009 2:25 pm

Thank you. That is an incredibly helpful reply; I had for more than a year just presumed it was impossible that the NXT could consume more power than the battery could pass on from the charger power supply. This also suggests that it might not work well to bypass the battery entirely (just connecting the output of the charger PS to the NXT power inputs). What are the consequences of running the NXT undervoltage? Is there a voltage at which, were I to see it, I should shut down to avoid damaging something?

I have some ideas on reducing friction in the current setup which might let me squeak by before the battery fully discharges. But...

...I will track the battery state with Battery.getVoltageMilliVolt(). Certainly I'll have it as part of my LCD display.

Since I also let the measurement unit run unattended I want some sort of stable storage as well. Are there any downsides to frequent writes to the on-NXT filesystem? I was thinking that about once a minute I'd open up a stream to a voltage-tracking file, write out the result of Battery.getVoltageMilliVolt(), and close the file. Would I need to do anything to flush out the write, or does close() take care of that for me? At maybe 10-12 hours per run, assuming the result of the above call is a 32-bit float, that should still be under 3K of data, so I can't see running out of space on the FS...
joseph.goldstone
Novice
 
Posts: 52
Joined: Wed Aug 27, 2008 10:27 pm
Location: San Francisco

Postby gloomyandy » Thu Sep 10, 2009 3:29 pm

Hi Joseph,
As I said there may be a bug in leJOS that is causing this (who knows?), so it may not be a power problem, but it certainly can happen... From my own use, what happens is that the NXT will simply shutdown if the power gets too low. I guess for you the danger may be that whatever device you are driving may get left in an odd configuration which could damage it (but I'll leave you to worry about that!).

As to writing to a flash file, the thing to remember is that when you write to flash virtually everything has to stop for the duration of the flash write. This can be tens of milliseconds. So it is best to ensure that you only write to the file when you are not doing anything else. To be honest I'm not very familiar with the leJOS flash file system, so I'm not sure what you have to do to be sure that the various meta data is up to date. I assume that a close will do that, but you may be able to get away with less.

I assume that it is not possible to use a Blutooth or USB attached PC to capture the voltage information?

Please let us know how you get on... I'm very interested to hear what exactly is happening.

With regard to using a directly connected supply, you may be able to do that, but you may need a supply that is more highly rated than the Lego charger... But perhaps we should check to see if the problem is battery related first...

All th best

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4187
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff