Activity Replaying The Charge Cycle

This activity involves replaying the charge cycle in a rapid, fast forward manner. Recall from Exp_1_Charge that it took nearly 4 hours to charge the batteries and that during this time, we also took a 64-second average of the Battery Charge Current (BCI) and Battery Charge Voltage (BVI) and stored these values in EEPROM. As a matter of fact, we stored exactly 200 samples, each, of BCI and BVI in EEPROM. This is because DataPtrMax is limited to 400, so 400 divided by 2 samples/ EEPROM entry = 200 EEPROM entries approximately every 64 seconds. Therefore, this effort took nearly 4 hours by computations shown previously.

With our average values stored in EEPROM, we can replay the last charge cycle, over and over, in about 50 seconds. To show you what we mean, simply depress and release the reset button until the yellow LED begins to flash. Assuming that StampPlot is up and running, you should witness something like that in Figure 2-8 below.

If everything is working correctly, you should see the plot of the charging cycle repeating over and over again with the blue plot being the battery voltage (BV) and the green plot being the battery charge current (BCI). The other two plots are at zero since nothing has been recorded for them. To see something similar to the above, you will have to decrease the StampPlot time span to about 2 minutes. Do this by clicking on the second minus icon of the StampPlot toolbar about 2 or 3 times.

Take particular notice of the blue battery voltage plot and the relatively quick jump made from the 3.00 volt level to about 3.20 volts and then back down again slightly. This is indicative of a fully charged set of batteries. The abrupt drop in voltage towards the end of the plot in Figure 2-8 is where charging ends and discharging begins and is not meant to be an illustration of the battery's normal end of charge cycle. The reason the NiCad batteries exhibit this type of plot while being charged is due to the fact that when the charge is complete, the nickel electrode begins generating oxygen. The oxygen then diffuses through the separator and reacts with the cadmium electrode that, in turn, causes the lowering of the cell voltage, which can be used to detect the end of the charge cycle.

Let's look at the code that makes our charge replay cycle work.


LOW ChargeBatt LOW DrainBatt TOGGLE ReplayLed LOW ChargeLed LOW DrainLed

READ dataPtr,avgVolts.LOWBYTE ch2 = avgVolts.LOWBYTE dataPtr = dataPtr+1

READ dataPtr,avgCurrent.LOWBYTE ch3 = avgCurrent.LOWBYTE dataPtr = dataPtr+1

IF (dataPtr => DataPtrMax) THEN dataPtr = 0 HIGH ReplayLed ENDIF

Exp_1_End: RETURN

You've seen the first five instructions before; this is just a variation on them to disable the battery charging and discharging and to flash the yellow LED.

The next three instructions read the average battery voltage stored in EEPROM and set ch2 equal to that value for the Plot_It routine. The dataPtr is incremented to point to the corresponding current value that is read by the next instruction. With ch3 set to the average current the dataPtr is once again incremented to point to the next set of voltage-current readings in EEPROM. Finally, dataPtr is tested against DataPtrMax. If it's at or beyond the maximum, it's reset to zero and the process repeats. And, once again, the only way out of the Exp_1_Replay routine is to depress and release the reset button or cycle power to the Board of Education.

If you started this chapter with brand new batteries and did not have much of a chance to play with the discharge function, you may want to return to Activity #4, and discharge your batteries fully before moving on to the last Activity.

DIY Battery Repair

DIY Battery Repair

You can now recondition your old batteries at home and bring them back to 100 percent of their working condition. This guide will enable you to revive All NiCd batteries regardless of brand and battery volt. It will give you the required information on how to re-energize and revive your NiCd batteries through the RVD process, charging method and charging guidelines.

Get My Free Ebook

Post a comment