Measuring ~65V with about 25mV precision - Page 1
Forum section: electronics / projects

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 11:18:45 am
content: Hi everyone.I've been twisting my mind on how to design a circuit that can measure a relatively high voltage with decent precision. This is a followup to my previous thread,https://www.eevblog.com/forum/projects/how-to-make-a-controllable-~55v-voltage-source/msg981049/#msg981049.I have a LDO that produce a voltage centered around 55V, +- 10V. This voltage must be measured by a µC and then used to close the loop digitally by controlling the current on the reference pin of the LDO. The problem lies in measuring the output voltage with high enough precision. I thought of simply using a precision voltage divider to get 65V down to 5V, and then measuring this with a 12-bit ADC. However, even when using precision resistors with 25ppm/C temperature coefficients and calibrating the voltage divider so that only the temperature drift remains as an error source, I get a worst case scenario of ~+-0.45% (~+-300mV at 65V) at 14 degrees from the calibration temperature. I could use 10ppm resistors, but that's getting expensive and would only lower the worst case uncertainty to ~+-0.18%.Is there an easier way to do this?EDIT: I should mention that I only need to measure voltages from 45V to 65V, which will be the operating range of the LDO. Temperature range will be +-14 degrees.

author: tggzzz
author_rank: Super Contributor
timestamp: July 26, 2016, 11:40:30 am
content: Are you ensuring that both voltage divider resistors are at the same temperature and the same type? If so, then the division ratio should remain more or less constant.Consider putting the resistors in a temperature controlled oven, or using resistor arrays, or mechanically clamping them together, thereby thermally coupling them.

author: Kalvin
author_rank: Super Contributor
timestamp: July 26, 2016, 11:48:45 am
content: Possibly something like this with the tggzzz's remarks about the voltage divider:https://www.eevblog.com/forum/projects/$5-voltmeter-with-5-digit-(0-1mv)-resolution/?action=dlattach;attach=134473;imageThe original thread:https://www.eevblog.com/forum/projects/$5-voltmeter-with-5-digit-(0-1mv)-resolution/

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 12:07:39 pm
content: Quote from: tggzzz on July 26, 2016, 11:40:30 amYeah they will be the same temperature and type. The problem is that the temperature coefficients are given as positive or negative, so in the worst case they will go opposite ways, and the division ratio will change.Quote from: Kalvin on July 26, 2016, 11:48:45 amI will take a look. Thanks!

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 01:09:28 pm
content: Quote from: EmmanuelFaure on July 26, 2016, 01:03:55 pmOh, you're right. Messed up and only used a single TC in the calculations. You are correct that on a 14 degree span, the voltage divider will have an error of 0.07%. This error will still be multiplied by 14 (1/0.07) to get the actual voltage out of the LDO, giving an error of 0.98%, which is around 650mV at 65V. Way above my 25mV goal. Even with 10ppm resistors, I can only get down to 260mV.

author: PA4TIM
author_rank: Super Contributor
timestamp: July 26, 2016, 01:35:39 pm
content: Something to think about when you use a voltage divider is the Rin from the ADC. That is in parallel with the resistor of the voltage divider you use to measure the voltage over. Use an opamp as follower. That is also saver for your ADC .

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 02:02:19 pm
content: Quote from: EmmanuelFaure on July 26, 2016, 01:10:34 pmThis error is incorrect anyway, see my previous post, and is the total error I would get when calculating the actual undivided voltage.Quote from: PA4TIM on July 26, 2016, 01:35:39 pmYeah, that's worth remembering. Bluh, this is a lot more tricky than I first imagined. Perhaps I am going about this the wrong way.

author: Kalvin
author_rank: Super Contributor
timestamp: July 26, 2016, 02:11:12 pm
content: Quote from: Fulcrum on July 26, 2016, 02:02:19 pmDepending on how fast the control loop needs to be, you can possibly get away with a capacitor parallel to the low-side resistor and the ADC input. If you need a fast control loop, the op amp may be required. Check the ADC datasheet about the input requirements.

author: Ice-Tea
author_rank: Super Contributor
timestamp: July 26, 2016, 02:11:19 pm
content: Keep in mind the error of the voltage divider is not the only source of error. You will find the ADC datasheet to be riddled with it

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 03:08:24 pm
content: Quote from: EmmanuelFaure on July 26, 2016, 02:34:19 pmOh, I'm a fool! I have been multiplying the error with the divider ratio, assuming it to be correct without thinking too much about it. Thanks a lot for this eye-opener. 10ppm will be more than enough even in the worst case scenario.Quote from: Ice-Tea on July 26, 2016, 02:11:19 pmUnfortunately!

author: richard.cs
author_rank: Super Contributor
timestamp: July 26, 2016, 03:17:42 pm
content: I have a stable <0.1% error in a 1000:1 divider in current production built entirely from 1% SMT resistors. The trick is to use all the same value resistors (in suitable series and parallel arrangements) and take them all from the same reel. The errors and tempcos all correlate to a large degree and you do a lot better than you would with the same number of resistors and a random error distribution.

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 03:26:52 pm
content: Quote from: Marco on July 26, 2016, 03:18:52 pmI looked into this, but the accuracy of the references are not good enough. The ones I saw had about 1% accuracy.Quote from: richard.cs on July 26, 2016, 03:17:42 pmThat is interesting. I thought this might be the case, but wasn't sure. In that case, the "worst case scenario" is actually very unlikely.

author: Marco
author_rank: Super Contributor
timestamp: July 26, 2016, 03:27:31 pm
content: Shit was to late removing it, yeah it was a bit too silly.

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 03:31:42 pm
content: Quote from: Marco on July 26, 2016, 03:27:31 pmNot at all, I was considering it myself for a while.Also, one thing I can't really understand, is how a resistor of a certain resistive material can have a tempco that can both be positive OR negative. The physics behind it isn't ambiguous, so why would the result be? All materials change resistivity by temperature, and it's usually well defined. So why can two resistors of the same material either increase or decrease in resistance by temperature?

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 04:18:11 pm
content: All right guys, found my solution. Gonna post it for anyone who comes by in the future to read this thread.So I'll use a 1MOhm and a 76,8kOhm resistor for the divider. Settled on a Panasonic line for their low cost (http://www.farnell.com/datasheets/2059650.pdf?_ga=1.81782231.1180173967.1467721356). Both are +-25ppm/C which will give +-45mV in the absolute worst case (14 degree range). It's not quite 25mV, but I'll live with it especially since it seems the worst case is unlikely to actually happen. The 1MOhm resistor will drop 60V in the worst case, meaning 3.6mW power dissipated in it. I'm going to assume the self heating will be negligible, and in addition connect the common pins to a large pcb copper pad to act as a heatsink. I'll manually measure the actual divider value with a precision voltmeter at a set temperature to circumvent the 0.1% uncertainty in resistor values.Since the ADC that will sample the output voltage from the divider has an input leakage current of +-1uA (which would create a voltage error of +-70mV), I take it through a buffer (MCP6001U) and measure the input bias voltage so that I can compensate for it in software.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 26, 2016, 05:11:05 pm
content: Quote from: Fulcrum on July 26, 2016, 03:31:42 pmMaybe because they are not the exact same material. Manufacturers try to minimize the tempco by creating special alloys/mixtures/whatever, but in real production, there are limits how uniform the alloy can be, hence some samples could have positive, some could have negative tempcos. The alloy could also drift slowly, but otherwise, the tempco is indeed either negative or positive, it doesn't change suddenly.This being said, I think that the typical way they describe it (think about "+/- 50 ppm/degC") is just some sort of laziness; in reality, something like "(20 +/- 30 ppm) / degC" could be more accurate way to describe their actual sample population.But indeed, it's very probable that two SMD resistors out of the same reel have tempcos very close to each other, and are unlikely to drift too far from each other in the same environment.

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 07:25:50 pm
content: Quote from: Siwastaja on July 26, 2016, 05:11:05 pmThanks for the explanation. It would be nice if the manufacturers could be more precise and maybe also give some characteristic curves.

author: Ice-Tea
author_rank: Super Contributor
timestamp: July 26, 2016, 08:25:16 pm
content: Just a thought: you could cook up a very precise 55V reference and make the measurement relative to that. So the required accuracy becomes 0.025/20 rather than 0.025/65

author: Vgkid
author_rank: Super Contributor
timestamp: July 26, 2016, 09:06:44 pm
content: Quote from: Ice-Tea on July 26, 2016, 08:25:16 pmthat was the the method I was going to suggest. Using the external voltage source to approach(in voltage) the measured voltage. Then use the adc to take the difference. Similiar to using a potentiometer, and null detector to find annunknown voltage.

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 09:32:49 pm
content: Quote from: Ice-Tea on July 26, 2016, 08:25:16 pmYeah, thought of that. But the idea of making such a precise and high voltage reference was daunting.

author: Dave
author_rank: Super Contributor
timestamp: July 26, 2016, 09:42:41 pm
content: It doesn't even need to be a 55V reference. You could quite easily reuse the low voltage reference that is going to feed the ADC.There, an opamp, some resistors and your voltage gets scaled from 45-65V down to 0-5V.

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 10:03:44 pm
content: Quote from: Dave on July 26, 2016, 09:42:41 pmClever circuit. Might actually use it and get rid of the extra 12-bit ADC I had to slap on my board and just use the built-in 10bit one in the µC. But this solution still doesn't get rid of the need for very precise voltage dividers, does it?

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 10:14:36 pm
content: Quote from: EmmanuelFaure on July 26, 2016, 10:08:21 pmStill, if I can get the errors down to manageable levels of +-50mV or less, it's a quite nice solution. It basically removes the need for the 12 bit ADC, which is very positive. I don't have too much board space to play with, and would also like to get the cost and complexity down. Are there any handy equations for opamp output errors based on feedback divider error? I could probably derive them myself, but why reinvent the wheel.

author: tggzzz
author_rank: Super Contributor
timestamp: July 26, 2016, 10:22:58 pm
content: Quote from: Fulcrum on July 26, 2016, 10:03:44 pmDo you mean "precise", or "stable", or "accurate"? (All often confused with "resolution")The three areverydifferent and, depending on which you need, different solutions are appropriate in each circumstance.For example, people on the next bench to me developed and sold a test instrument that was stable to 0.001dB - but only accurate to 0.1dB (think about it). The customers didn't care about the accuracy, but they did care about stability.

author: Fulcrum
author_rank: Regular Contributor
timestamp: July 26, 2016, 11:00:17 pm
content: Quote from: tggzzz on July 26, 2016, 10:22:58 pmYou raise some valid points. I think what I mean is "stable" with temperature. It doesn't matter how precise my measurements are if I can't be sure they are within specs over the full temperature range of +-14C. If I understand accuracy correct, it's a kind of offset from the actual value. A measurement system can measure a value very precisely, but if it is not accurate then it will just be off-value by a very precise amount. Stability is how this offset changes by time, temperature, or other variables.If I can get my circuit to be precise, and stable with temperature, then the accuracy can be brought down by calibration after the circuit is built. The precision shouldn't be a problem since the 20V range will be sampled by a 10bit ADC on the µC, giving +-20mV resolution. Calibration is done with precision lab equipment to really pin down the actual offsets, divider values, etc. at room temperature. It's the stability with temperature that worries me, and what also has been my problem so far.