Hardware
Take the permutations of duty cycle, charging current, terminating voltage and measurement requirements, then throw in automated discharge testing, and the need for a microprocessor becomes apparent. If you didn't need to log voltages you could probably do this with a few 555's. Someone will before the year is out and l look forward to reading about their (your?) results.
To terminate the charge I
need something that recognises when the voltage has reached the set
point. A voltage reference and a comparator would do. Controlling a 555
is then possible. But before I talk myself into the 555 approach it's
important to remember I want a repeatable, and adjustable, charging
pulse circuit. And I want to overlay that with a discharge circuit that
lends itself to logging. So I'm still forced into a microcontroller
approach though it's no hardship with a STM8S003 running Forth.
The next issue I ran into was serial flash memory. I use flash memory rated up to 3.6V, with an absolute is 4.6V. To measure a battery terminal voltage of 4V I would need at least a 4V power supply which might be pushing the envelope. After a bit of thought I decided to run everything at 3.3V and use a voltage divider.
I pondered over the temperature stability of the regulator, and hence A2D measurements, being fit for purpose. My chosen micro does not have a band gap reference, it references to the power supply.
A quick cheek in datasheets left me perplexed. The following possible voltage rail variations were noted from the datasheets for ambient temperatures between 0 and 50 degree Celsius:
- TL431 10mV
- LT1460 1.5mV
- AD780 0.5mV
- MC1403 1mV
- MAX8877 8mV
- xx1117 13mV
- 78L05 1mV ???? in one datasheet, 25mV in another
- LM317 5mV
By now I am confused.
I tried to model what impact temperature variation would have with LTSpice at the same time as trying to finesse the resolution. An opAmp was used to subtract a set percentage from the battery voltage to shift it downwards. Then with some gain to stretch the scaled A2D conversions. But I couldn't get temperature variations to work. You just don't have these problems with a 555.
So I reluctantly fired up a spreadsheet to work it out. Lo and behold, it was so easy. There in cell D15 was the answer: 555. Just joking. Really,
The difference in the voltage rail shifting 10mV with temperature was at worst 2 bits in the returned A2D result, or 6mV.
Low | High | ||
Voltage Rail | 3.3V | ||
Measurement Voltage | 3.0V | 4.0V | |
Scaled | 50% | 1.5V | 2.0V |
A2D Range | 1024 | ||
One bit | 0.003V | ||
A2D Returns | 3.300V | 465 | 620 |
3.310V | 464 | 618 | |
Difference in result | 1 | 2 |
I can't see the case for better accuracy in the A2D conversion at this point in development. Hence, for the proof of concept I took my relay testing boards and then hacked it to meet my requirements.
This means the first
iteration will use a simple LM317 regulator. The relay testing board had a constant current source and
an isolating transistor is added to gate the CC giving me a pulse charger.
Three transistors are used to control charging, discharging and voltage measurements. With the three transistors turned off the battery is isolated and can sit there subject to self-discharge only. As I assembled the board I used a small daughter board to hold the few parts I couldn't otherwise include.
Using whatever I had to hand meant it ugly but it will last long enough to prove the concept, or not:
Not shown is the transistor on the reverse side which gates the charging current giving me the required pulses.Software
I decided that logging every moment of every cycle was madness. Discharging at C/2 takes 2 hours. During that period the voltage drops from 4V to 3V. That gives an average voltage drop of 0.14 mV/second. Given my resolution is 6.45mV it appeared sensible to log measurements at 20 second intervals.
A nice graph of the discharge voltage profile is unlikely to be needed for each cycle. For now though I'm letting run for a few days to see what happens.
STM8 eForth made the project so easy. While I can pause a trial at any point, it only makes sense to download the data logged to date during a rest or charging cycle since no data is being logged during these activities. As the trials progress I can adjust set points and timing on the fly via the serial port.
With everything working it's time to test pulse charging.
First Full Run
During Testing my first full run gave me a chart like this:
Which when I integrated the current over time worked out to be around 94mAh.
I look forward to seeing what happens in coming days.
No comments:
Post a Comment