beautypg.com

A.3 enter battery test state – Campbell Scientific PS200/CH200 12 V Charging Regulators User Manual

Page 73

background image

Appendix A. Advanced Programming Techniques

'Send new battery capacity to the CH200 if different from the presently
'stored value.

If NewBattCap <> BattCap Then
'Save the old and new values before it changes. Store a time stamp.
CallTable BattCap

'Convert the new battery capacity value to ASCII text.
'Specify four digits with one decimal after the decimal point.
'No leading zeroes.

NewBattString = FormatFloat (NewBattCap,"%4.1f")
'Completed string sent to the PS/CH200 must be "WR_BC(nn.n)>" where
'nn.n are the ASCII numeric external battery temperature in Celsius.

xmit_str = WRITE_BATT_CAP_CMD + NewBattString + ")>"
'Send WAKEUP to wake up the PS/CH200.

Call WAKEUP
'Send out the PS/CH200 command followed by a carriage return.
SerialOut (COMPRT,xmit_str,"",1,3)

SerialOut (COMPRT,CR,"",1,3)
'Bring in the result from the command and process it.
'Discard characters in the receiver buffer up to and including asterisks "*"

SerialIn (xmit_str,COMPRT,50,"*",40)
'Capture the PS/CH200 response string after the asterisks and including the
'string terminator hexadecimal zero (&H00).

SerialIn (CH200string,COMPRT,50,&H00,140)
'PS/CH200 should return the new battery capacity sent to it.
SplitStr (ReturnStr,CH200string,"String",1,0)

EndIf
NextScan
EndProg

A.3 Enter Battery Test State

Over time batteries die in two possible ways.

1. Shorted cells due to sulfur crystal growth within the cell. Battery simply

dies and will not hold a charge, or its voltage, but it will pull in all the
current it can get possibly damaging the charging source. The PS/CH200
will detect this problem, set the check battery (CK BATT) light to indicate
a problem, and divert current from going into the battery to protect the
charging supply. Shorted cells are a frequent problem if the battery is
severely discharged and must be replaced.

2. Sulfated cells due to sulfation on the lead plates over time will block the

battery’s ability to fully recharge. This happens very slowly. When a
charging voltage is present the battery will appear to charge up to the
target voltage but as soon as any load is put on the battery it will die. The
key here is that the battery must be put under a load to detect the problem.
Detecting a sulfated cell is easy if the system is running on a solar panel –
at night the battery voltage drops very quickly and if not replaced will
eventually die. Unfortunately systems running on AC power, and float
charging the battery all the time, will not have a problem until it is really
needed – when the AC supply is lost. The PS/CH200 charger cannot detect
this condition. In order to detect this problem a test must be done on the
battery where the charging voltage is removed from it and the battery is
monitored to see how it holds up on its own.

Entering a battery test state causes the PS/CH200 target charging voltage to
drop down to 11.5 vdc – effectively forcing the system to rely exclusively on
the battery to run the system. If the battery cannot keep the system running
then the charging supply will kick back in stopping the system from dying. Not

A-11