ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: TS-BAT3: understanding the reply

To: <>
Subject: Re: [ts-7000] Re: TS-BAT3: understanding the reply
From: "Michael Schmidt" <>
Date: Thu, 8 Feb 2007 08:44:21 -0700

> Michael,
>
> Thanks for the clarification. Unfortunatly, there are still a few
> questions.
>
>
> --- In  "Michael Schmidt" <> wrote:
>>
>>
>>
>> > Hi List,
>> >
>> > I'm trying to understand the reply while querying the bat3 but there
>> > are a few parts I don't understand.  Looking at
>> > ftp://ftp.embeddedarm.com/bat3/GettingStarted.txt I see the definition
>> > of the struct bat3Info but there are a few field which I don't
>> > understand.
>> >
>> >  float supplyV; // supply voltage
>> >  float regV; // regulated supply voltage
>> >
>> > These return values like 39812(supplyV) and 26623 (regV) when running
>> > from a powersource (24V).  On batteries these values return 1023.
>>
>> These inputs are coming directly from an ADC.   To get the ADC
> output the
>> supply voltage is multiplied by ~0.07, then divided by 3.3V, then
> multiplied
>> by 65536.  This corresponds to approximately 700mV per unit, so 39812 *
>> 700mV is around 28V.  The regulated value is approximately 190mV per
> unit,
>> so 26623 * 190mV is right around 5V.  The values are only
> approximate due to
>> part tolerances and lack of ADC calibration.
>>
>> When you are running on batteries these values aren't valid; use the
>> "onbatt" bit to condition these values.
>
> This makes perfectly sense to me.  It would be nice if this could be
> added to the documentation to.  Just for people like me. :-)
>

I'll make a note to find a place to put this info in the docs...

>>
>> >
>> >  dword pwm1en:1, // set if PWM1 is enabled
>> >        pwm2en:1, // set if PWM2 is enabled
>> >        offset:1, // reserved
>> >        opamp:1,  // must be enabled to read battery current
>> >        buck:1,   // reserved
>> >        led:1,    // set if the LED on the board is on
>> > jp3:1,    // set if JP3 on the board is on
>> >        onbatt:1, // set if running on batteries
>> >        softJP3:1,// set automatically if battery voltage drops too low
>> >        locked:1; // set if bat3 has locked onto the target charge
> current
>> >
>> > What is PWM1 and PWM2 for?  I suppose it's UPS related but that's the
>> > only thing I know.
>>
>> The PWMs control charging; there are two of them in parallel, so
> turning one
>> or both on charges the batteries if power is available (more current
> if both
>> are turned on).  Normally you don't have to worry about this because
> the
>> charging algorithm takes of this.
>
> I was just wondering because you can force them while running bat3.  I
> knew they had something to do with the charging system.
>
>>
>> > softJP3 is supposed to be set when the power drops but it wasn't in my
>> > testcase.  The docs say there's more info while running 'bat3 --help'
>> > but that isn't very clear either.
>>
>> softJP3 is for battery protection, and normally isn't s activated
> until the
>> battery voltage drops below a certain value.  This is to prevent
>> over-discharge.  When softJP3 is active it has the same effect as if
> JP3 was
>> on; i.e. the batteries will no longer provide power.  softJP3 is
>> automatically cleared at the appropriate time, and it can also be reset
>> manually with a jumper on the appropriate pins of the 'ISP' header.
>
> Hm, I'll have to take a closer look.  As far as I remember the test,
> softJP3 stayed active.

Ok I had to go back and check on this one... softJP3 can be set manually by 
software to force the board off.  However it must also be cleared manually 
by software as well, so we don't get in a state where (e.g.) intermittent 
power causes the board to cycle on and off inapprriately; normally the bat3 
daemon program does this when it first starts up.

>
>>
>> Which options are you looking for more information on?
>>
>
> Maybe I could try to explain what we planned to do.  In normal
> situation we want to keep the batteries up-to-date.  When there's no
> external power, we want to keep on working on batteries until the
> power drops "to low".  When the battery power is to low, we unmount
> the SD card where we write our logging and go into some suspend state
> until the power is back or the battery power is completely gone.  When
> the power 's back the system has to be restarted.
> Corrently we have a few issues hanging:
> * using the --shutdown option of bat3 the system goes down and only
> comes back when pressing the reset
> * softJP3 didn't changed but I'll have to take a closer look
> * the --sleep option of bat3 only supports a time while we're looking
> for a option like "--sleep until_power" :-)
>

This is definitely do-able.  When you use the 'shutdown' option, the bat3 
daemon starts counting down from the time you specified when power is 
removed.  When it reaches 0 it issues the 'shutdown -h now' command.   You 
may want to verify that this command works correctly from the command line 
when troubleshooting any problems with the shutdown sequence.  On some 
distros there is a script called right before the system is halted called 
'ups-monitor'.  There is a program (ups-monitor) supplied on the ftp site 
that implements this function using the command packets documented in the 
getting started guide.  It needs to be put in a location that shutdown 
script can call it; it basically just hits the softJP3 bit to turn off the 
board.  It doesn't take any options, probably unlike other programs by the 
same name.  :-)  When power is restored the board should come back up 
automatically.

The shutdown feature is a newer feature that was not around when the Getting 
Started Guide was written, however you can find more information in the user 
manual:

ftp://ftp.embeddedarm.com/bat3/UserManual.txt


> We don't know if it's all possible but we're trying to get it in our
> own version of bat3 which we will post back if everything works fine.
>
> greetings,
>
> wim.

Regards,

Michael



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU