Saturday, 14 June 2014

Interfacing Current shunt monitor with 16bit ADC


I am supposed to high side current measurement via shunt resistor (between source and load) and feed it to the microcontroller. For that purpose i have decided to use this IC MAX9922 which is a ultra high precision current sense monitor. The reason for selecting this IC is its high accuracy of measurement. The output of this amplifier would be fed to a 16 bit ADC ADS8319 which would then provide the digital data to the micro-controller via SPI interface.


Now while designing the circuit schematic, i came to find out that ADCs require OP-AMPS (to act as a low impedance buffer) plus RC filters (for filtering out unwanted frequency signals) on their input. And the Amplifier ICs plus the values for RC filter to be used are given in their (ADC's) datasheets normally. For eg in ADS8319 datasheet on pg no. 21 the recommended OPAMP plus the values of RC filter are given.


My question is that, as i am already using MAX9922 (for current sense measurement), is it necessary for me to insert a buffer OPAMP in between the MAX9922 and ADS8319 ? As i think my signal is already coming to the ADC from an Amplifier IC, i could just straight away (with an RC filter) feed it to my ADC input without inserting the buffer. Am i Right about it ?



Also, in MAX9922's data sheet (on page 13) the maxim IC is shown to be connected to a 12-bit ADC as an example circuit. However i would be connecting it to a 16-bit ADC. I hope that it would work as expected in my case as well. There wont be any issue about it. Am i right ?


Your helpful suggestions and comments would be appreciated.


Thankyou!



Answer



Since you've never done this sort of thing before, let me point out a few things. First, you really should have mentioned that you're monitoring battery charging up front, rather than inserting it as a comment - it's important. As a general rule, when asking questions provide more information rather less, especially your overall problem. Context matters, especially in engineering.


1) You really need to incorporate your full system description into your device selection. Using a 16-bit ADC for battery monitoring is, well, it's massive overkill, and is likely to cause you to think you have problems when you don't. To begin with, you will see noise levels which you will think must be a problem when they aren't. Think about this: a 2-volt input range at the ADC will have a resolution of $$\Delta V = \frac{2}{2^{16}} = 30.5 \mu V $$ and if you think you're not going to see millivolt noise levels - that is, 10's to 100's of lsbs - on your signal, I'm afraid you're in for a nasty surprise.


2) By the same token, I don't think you understand accuracy. Sure, your shunt amplifier has very high linearity, but its actual accuracy is limited by the gain-setting resistors you use. I note that you're using 49k/1k to give you a 50V/V gain. Have you tried finding a 49k resistor? The closest 1% is 48.7k, and that value will, of course, vary by as much as +/- 1% if you just grab a part from the box. Compare this to the resolution of the ADC, which is .0015% of full scale. In other words, using 1% resistors will give you an accuracy limit of +/- 1% on your measured current, which is about 6-7 bits. Yes, you can do a system calibration, but keep in mind that this will require that provide a current which you know is accurate to whatever level you're looking for, and this can be much more challenging than you realize. Do some research on temperature coefficients of power resistors, for instance, and keep in mind that DMMs on "current" setting may show any number of digits resolution, but you need to look into the manual to find the accuracy (usually in the vicinity of 1% for non-specialized meters).


3) Since you've not specified your sampling rate, I have to talk in general terms, but I suspect that you don't need a buffer, since sampling at more than 100 Hz is probably overkill for what you're doing. Note that the data sheet for the ADC (p.20) discusses frequency response of a buffer amplifier, and for 500 kHz sampling comes up with a frequency limit of 3 MHz. You can do the math presented in the data sheet, and for a 500 Hz sample rate you only need a 3 kHz capability, and for 100 Hz only about 600 Hz. This ought to be well within the capabilities of the shunt amplifier. Even this is wild overkill for battery charging (1-10 Hz is more reasonable - charging is a slooow process), and you're not trying for any sort of frequency analysis of the data. Plus, like I say, you're going to see a lot of noise.


EDIT - in response to your expansionary answer, I'll try to make myself clear.


First, going to a 16-bit ADC won't hurt anything, but it doesn't guarantee that you'll get the accuracy you want, and I just wanted you to be aware that you need to keep the entire system in mind when you discuss accuracy.



As to your discussion of ADC error sources, taking them in turn,


1)INL - yes, it's important, but modern ADCs ordinarily keep it below 1 lsb, and often do better.


2)Offset - yes, again it's important, but particularly in your application the temperature coefficient is much more important. After all, you can always perform a zero cycle, where you disconnect the load and charger, then measure the resulting zero current level and use this measured offset to compensate real readings. As long as the offset doesn't drift (especially with temperature), offset is not usually that much of a problem. In your system, you apparently have scaled your shunt resistor for a full-scale shunt voltage in the range of 20 mV, so a 1 uV/deg drift will give a .005%/deg error.


3)Gain accuracy - I tried to deal with this in my original answer. In general you can determine gain to any desired accuracy simply by measuring a known input, but particularly for current this gets a bit trickier than you might think. Fortunately, in this case you will use the same amplifier for measuring both charge and discharge currents, and presumably you will use the same measurement device for battery voltage during both cycles. This will allow you not to worry much about gain accuracy, since as long as the gain is linear you can compare the two states by taking a ratio, and any gain inaccuracy will simply drop out.


And while I'm on the subject of error sources


4) Gain linearity - While you have thought about INL in the ADC, you need to be aware that the shunt amplifier is not perfectly linear. From page 3 of the data sheet, a 9922 operating at a gain of 100 has a gain nonlinearity of 0.6% max. Since this is over your target range of 0.1 to 0.5%, you'll need to be careful.


With all that said, a 16-bit ADC certainly won't hurt, but I don't think it's necessary. A 12-bit ADC would probably be just as useful, since its resolution is .025%, so its errors will still be well under your target.


Simply measuring data to 16 bits does not guarantee that measurement is accurate to 16 bits, even if the ADC itself is that accurate. A 4 1/2 digit DMM with 0.1% accuracy which measures 10 volts as 10.000 is not producing a .01% accurate reading, even though .001 / 10.000 equals .01%. It could produce any reading between 9.990 and 10.010 and still be within the rated accuracy of the DMM. Focussing on the resolution of the ADC when this is better than your expected overall accuracy suggests that you are ignoring the forest for the trees. See, for instance error 4) above.


I've tried to point out, for instance, that self-heating in the shunt resistor may cause errors. A 100 ppm/deg resistor which heats up 10 degrees will produce a 0.1% gain error. 20 degrees, of course, will give you .2%. Are you sure your temperatures are all accounted for? Another thing you may not have taken into account is thermocouple errors where you connect to the shunt.


On a larger scale, trying for 0.1% on a battery is certainly ambitious. You'll need precision charging and discharging cycles, along with temperature monitoring of the batteries, not to mention some way of measuring and compensating for battery aging effects. Maintaining uniform timing will be important - don't think you can charge a cell up, leave it overnight, then measure the discharge energy the next day and think it will be the same as if you had just charged and tested immediately.



Just as a note, I'd suggest you don't need to do high side monitoring, assuming your test setup will be custom-made. If you do


schematic


simulate this circuit – Schematic created using CircuitLab


this will work just fine. Obviously, the charger will not be a simple voltage source, and the load may well be a controlled current sink, but you get the idea. Note that the presence of the shunt resistor distorts the battery voltage measurement, but that's OK. You're measuring the shunt resistance and that can be subtracted. Also note that, at the accuracies you want, regardless of the topology you use you need to be careful of IR drops in the wires. This is especially important for the shunt resistor - make very sure you use a Kelvin connection.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...