User guide for Mark's charger code

Forum for announcements and discussion of beta firmware.
Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Sat Mar 14, 2015 10:18 pm

Picking the value of the current sense resistor is always going to have to be a compromise between wasted power and having sufficient resolution.

Maximum charge/discharge rates on the USC are 2A for both - but that's only when external power is applied and using external discharge loads. At 2A, the current sense resistors would be dissipating 0.4W - not really something to be concerned about when discharging since the energy is being wasted anyway. For charging, it's only a bit over 10% of the energy being pumped into the cell, so still not a huge deal.

Most users will never charge above 1A and at that rate, the power wasted would be 0.1W - hardly the end of the world IMHO.

When measuring any value with the ADC, it makes sense to use the maximum gain possible that won't exceed the maximum range. For the USC, I'm using a gain of 8 for measuring current - that gives a range of +/- 2.5A which is pretty much perfect for our use.

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Mon Mar 16, 2015 12:49 am

Minimal current sense resistor. I did some further reading and watching of Microchip online resources, which helped clear up few details for me 8-). Glad to learn that in their own li-ion demo charger application they do document in great detail the use of a 0.01Ω shunt resistor, which means that the readings are still accurate enough thanks to the 16uV-resolution.

Op-amp input resistor pair. I noticed that both Dave's uCurrent (old version: 100Ω, new version: 270Ω) and the USC (old version: none, LCD version: 10k) employ a resistor at the chip's differential input. In the USC LCD version they are labeled RN1F and RN1G, both 10k, in the BAT1_I_SENS± lines. In a TINA schematic these resistors are 100Ω. The common mode input impedance of the Microchip is 25MΩ, meaning that hardly any input bias current flows into it. So i am wondering why some designers bother placing parallel resistors ("resistor pair") in there at all. The designer of the Microchip demo charger didn't employ any resistors before the differential inputs of the his current measuring MCP3421. What is the function of the 10k (or 100Ω) resistors in the sense lines? :)

The TINA design also suggests surrounding the shunt resistor with 3 capacitors. Maybe these have a smoothing effect on potential noise? :shock:
Last edited by dino on Sat Apr 04, 2015 10:14 am, edited 8 times in total.

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Mon Mar 16, 2015 1:00 am

If there are a pair of resistors, they're probably there to act as a voltage divider - so that the input voltage to the ADC is within the allowed range.

Capacitors are most likely there for filtering noise.

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Mon Mar 16, 2015 9:27 am

In the old design, R16&R18 and R14&R19 constitute voltage dividers, even though at such low (absolute) voltage input levels a voltage divider is not really necessary. The reference voltage level is 2.048V, which cannot be reached by NiMH batteries:

old.gif
old.gif (25.61 KiB) Viewed 7593 times


So in the new design, the voltage dividers got removed to improve accuracy and cut the current losses through the voltage divider, i see. ( A voltage divider would be needed for Li-Ion batteries. With very high values, > 1MΩ, the current losses would be negligible though. )
But can you see the addition of 10k-resistors in the current sense lines? Other designers (Dave Jones, TINA) place a much lower Ohms resistor "pair" there, 100&100Ω or 270&270Ω, so i am still wondering what the function is:

new.gif
new.gif (9.27 KiB) Viewed 7593 times


C11 and C15 are bypass capacitors in the BATx_V lines, typically for filtering potential noise. When there is noise in these lines, then there will be imo noise too in the BATx_I_SENS± lines, hence a designer could place bypass capacitors for the sense lines too: That's why the TINA design surrounds the sense resistor with the 3 capacitors:

tina.gif
tina.gif (5.09 KiB) Viewed 7590 times


The USC LCD version displays 5 decimals in the voltage measurement, are you able to observe noise at the last digit?

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Mon Mar 16, 2015 10:43 am

Although the schematic for the non LCD charger shows resistors going to ground to form a voltage divider, they weren't actually being placed on the board, so you can ignore them. You are correct that they would only be useful for charging lithium ion batteries.

If I recall correctly, the resistors on the LCD charger are there to protect the ADC and also to limit current going through it if the power is removed whilst batteries are inserted.

There isn't any noticeable noise on the voltage readings whilst doing a discharge - at least not that I've seen. Even during charging, the noise from PWM isn't significant - the voltage readings that matter are taken during short pauses with charging stopped.

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Mon Mar 16, 2015 12:37 pm

Thanks for your informative comments as always :)

I've sometimes heard of the concept of input protection but in this case i still wouldn't grasp the idea because the input impedance of the ADC is already very high with 25MΩ. Absolute ubervoltage at the input pins would damage the chip, that's what i understand from the specsheet. So how would the input protection resistor work in detail? Maybe the 10k are there to help raise this critical level of nominal ubervoltage, namely as seen from the current sense resistor side, where the high side could now tolerate a little more than the 2.048V. Hmm, that's the only technical explanation i could come up with for the moment, how input protection could work in detail here. I need to read up a bit, i guess. :?

I am assuming that the 4-slot USC has 2 of this same chip? I appreciate the chip because it facilitates the designer's life by a lot: no more bothering about and comparing full-blown datasheets of single channel op-amps, in-amps (instrumentation amplifiers), DA's (difference amplifiers), or CSM's (current shunt monitors), and their RL implementation in the circuitry (with resistors, tolerances, noise, high-side vs low-side sensing, etc).

We can only speculate why none of the Chinese charger makers haven't made use of CSM's or this wonderful chip yet.
Last edited by dino on Tue Mar 17, 2015 3:02 pm, edited 1 time in total.

pfeerick
Posts: 12
Joined: Thu Feb 19, 2015 6:52 am

Re: User guide for Mark's charger code

Postby pfeerick » Tue Mar 17, 2015 5:35 am

dino wrote:Thanks for your informative comments as always :)

I've sometimes heard of the concept of input protection but in this case i still wouldn't grasp the idea because the input impedance of the ADC is already very high with 25MΩ. Absolute ubervoltage at the input pins would damage the chip, that's what i understand from the specsheet. So how would the input protection resistor work in detail? Maybe the 10k are there to help raise this critical level of nominal ubervoltage, namely as seen from the current sense resistor side, where the high side could now tolerate a little more than the 2.048V. Hmm, that's the only technical explanation i could come up with for the moment, how input protection could work in detail here. I need to read up a bit, i guess. :?


Just in response to your post about the purpose of how the limiting resistor works, in the first article you linked about input protection, it actually talks about that under 'Current limiting' - between 1/3 and 1/2 of the way down the page. The purpose, how I see it, is to reduce the amount of current that reaches the ADC. If there is no (or negligible) current, then there is no force behind any voltage spikes that occur. It also prevents any sort of 'parasitic backfeed' powering (insert proper term here!) when the batteries are removed.

However, Paul is the only one who can truly say what that purpose is, as he's god as far as this charger is concerned!

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Fri Mar 20, 2015 11:21 am

There are protection diodes in the devices which are designed to prevent damage to the internal circuitry, but if too much current flows through them they will burn out and no longer provide protection and more of the chip will be damaged. Including resistors will limit the current to a level that the protection diodes are able to handle.

For more info, I'd suggest that you have a read of the following page:
http://www.ruggedcircuits.com/10-ways-t ... n-arduino/

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Fri Mar 20, 2015 11:56 pm

Thanks Mark, i've read the interesting Ruggeduino article and learned a bit from it ;)
Much of my knowledge originates from the BET site and i am beginning to understand more about resistors and Ohm's law.

Thanks pfeerick, i am testing the contributions from the set of input protection measures as suggested by the Digikey article. With my SPICE-based simulation tool I am taking a 4kV-standardized ESD event as input, and after varying the part values (e.g. zero'ing) it's instructive to see the resulting changes on the pin voltage (VF1). I'm going to setup my own input protection circuitry now applied to our ADC and simulate it as well. Maybe i am able to improve Paul's "10k input protection" on the paper 8-)

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Thu Apr 02, 2015 9:46 am

Btw to which sampling rate is the ADC set (my guess: 3.75SPS or 3.75Hz for 18bits mode) and what kind of Conversion Mode (One-Shot or Continuous)? Thanks for some internal info on this :geek:


Return to “Beta Testers”

Who is online

Users browsing this forum: No registered users and 1 guest