Need some advice on RC characteristics of Slope ADC

Hi All,

As I am working on Slope ADC configuration as described by AN863

formatting link
Microchip application note AN929
formatting link
, page 3 figure 5 shows Ramp Rate Method where by using a single Capacitor and a known ref: resistor, the resistance of any unknown resistor Rx can be measured. The method goes as follows:

  1. Connect the supply voltage through the ref: resistor Rref and let the capacitor chraged until it reaches threshold voltage Vth, the charge time T1 is recorded.
  2. Discharge the capacitor and then connect the supply voltage again through unknown resistor Rx, and let the capacitor charged until it reaches threshould voltage Vth, charge time T2 is then recorded.

And theoractically, Rx = (T2/T1) * Rref

I used C = 0.47 uF, Rref = 200 ohms, Vth = 2.02V, Vsupply = 3.08V (I use PIC18F45k20 port RA1 and RA2 to supply voltage to RC ckt, and RA0 as the comparator input).

Results are not as expected.

When Rref = 200 ohms with C=0.47 uF , time T1 is measured to be 138 us to reach 2.02V. Again, when Rx = 360,540 ohms, with the same capacitor

0.47uF, time T2 is measured to be 200,292 us. The time Ratios T2/T1 does not match the time ratio in this experiment.

I understand that the source characteristics of the I/O port in the MCU affects the charge time behaviour but I am not sure how exactly it relates and I do not know how to model the circuit so as for me to calculate predictable results.

Any suggestions?

Regards

Reply to
Myauk
Loading thread data ...

Notes/00929a.pdf

(I

s

What's the source impedance driving the RC? (most likely pretty low.. but.) What's the input impedance of the comparator input?

George H.

Reply to
George Herold

Hi George,

Thanks for your reply. May I know if there is any way to find out? The Microchip does not give me such details.

Regards

Reply to
Myauk

What are you using for a switch? Electronic switches have non-zero impedances, with some of the less expensive ones (like the CD4051-ish ones) being over 100 ohms. If you're using one that has a 50 ohm "on" resistance, then the math works out pretty well.

It looks like you're using a PIC port to as the switch? Check the data sheet -- if they don't say what the effective resistance of the port is directly, you can approximate it by looking at their rated current and voltage drop for the pin as a current driver. PICs are pretty good about driving lots of current, but I still wouldn't be surprised at 50 ohms.

What are you using for a capacitor? Electrolytic capacitors -- even tantalum caps -- leak, and act like resistors in parallel to the cap. Most capacitors have all sorts of second-order effects that make them act like they have less capacitance at high frequencies than at low, but I wouldn't expect _that_ much unless you maybe used the cheapest possible ceramic. OTOH, both of the effects that I mentioned would make the high resistance time longer, not shorter.

If you're using a capacitor with a high ESR (electrolytic, again) or if you have some resistance in series with the cap after you tap off your comparator input, then the higher current from the 200 ohm resistor would raise the capacitor voltage, and make the comparator pop off quicker.

Basically, you need to draw out your _actual_ circuit, then you need to add in all of the parasitic effects that you can think of, _with values_, and assess each one to see if you can figure out what is screwing you up.

More empirically, you can substitute a number of different resistance standards for the 200 ohms, and plot a time vs. resistance chart, then see if anything jumps out at you.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

ut

h

ttdesign.com

Hello Tim,

Thanks for your kind reply.

I have got a reply from the original author of the application notes. He said the microchip I/O ports have about 50-100 ohms of resistance. Additionally, they have a slew rate limit that prevents them from activating too fast.

For the case of capacitor I am using NPO Capacitors

formatting link

For Modelling such circuits, what are the critical parasitic parameters for my case? ESL? ESR? Just for clarification, they are the lumped parameters calculated by the supplier for modelling the capacitors, right? I mean once I use ESL or ESR I don't need to use parallel parasitic resistance and inductance parameters any more, I guess..

Regards Aung

Reply to
Myauk

formatting link

The uP ports will have some equivalent resistance to Vcc when they are pulling up your resistors. If you short the capacitor and turn on the pullups one at a time, you can measure the DC voltage at the pullup port and calculate the resistance.

It won't be quite the same at different ports, and it won't stay linear/purely resistive at higher currents.

200 ohms is kind of low to measure accurately this way. Port equivalent resistance will start to matter.

Does the uP have an ADC?

--

John Larkin         Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro   acquisition and simulation
Reply to
John Larkin

Even in a 2220 case, I'm mildly astonished at a 470nF C0G cap. Especially if you use the microprocessor ports for switching, I don't think you have to worry about the capacitor. (There's more measurement- oriented folks on the group who may wade in with more info, though).

I would expect that you'd be able to maintain fairly good accuracy over a

10:1 or maybe even 100:1 range -- beyond that, it's probably possible but you'd need to do a ton of work. So I'd choose a resistor that sits at the arithmetic mean (or maybe geometric -- I'd have to do some math) of the expected resistance range you're trying to measure, and use that as a reference.

If you have the room on the board, use some small switching FETS (or analog switches, or even bipolar transistors) to turn things on, actuated by the processor. You can find ones with on-resistances that are much, much less than 50 ohms.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

formatting link

He could buy one for the cost of that cap...

--

John Devereux
Reply to
John Devereux

formatting link

Oh, one should make sure to discharge that cap between measurements.

10 tau, maybe.
--

John Larkin         Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro   acquisition and simulation
Reply to
John Larkin

Software

formatting link

That 50-100 ohms is lethal, if you're trying to measure 200 ohms. Try to find a higher resistance sensor.

The cap doesn't have to be stable, since the math is ratiometric.

ESL shouldn't matter at your speeds, and most film caps will have low ESR. But don't use a ceramic... they are nonlinear on voltage.

Maybe you should use another method. Like an LM71 with a digital/SPI interface.

--

John Larkin         Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro   acquisition and simulation
Reply to
John Larkin

My understanding is that the C0G caps (which is what he's using) are quite well behaved.

But -- "film caps" is the knee-jerk response to the question "what cap shall I use in my slope-ADC?"

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

But big values are physically large and expensive. We stock a 22 nF C0G in 1825 size, and it's expensive and hard to get. Can you actually buy a 0.47 uF in C0G?

Yes! Digikey has stock on one,

formatting link

for $26.91 each. I assume it has good DA performance, which is what we're after. Tempco doesn't matter here.

Using the best cap is "knee jerk?". You prefer, say, oil-filled paper? Leyden jars? Electrolytics? Black Beauties?

--

John Larkin         Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro   acquisition and simulation
Reply to
John Larkin

Operating Temperature -55°C ~ 200°C !!!!!!!!!!!!!!!!!!!

Reply to
hamilton

I was with Semco when they started manufacturing surface mount, fully encapsulated mica capacitors. At that time, our only customers for those were military.

At that time, the Japanese were making these caps mostly by hand and the yield was averaging 50%, yes, I said 50%.. Not good..

Others out there were also making them, but with low yields, too.

I joined them just as they were entering this product line and soon determine that is was a very difficult product to manufacture. so the company invested in some hardware. Robotic X,Y,Z with video eyes and some automation between each step, advanced the process greatly.

By using basic video cams mounted on the arms and corners of the station, the computer program was able to fully comprehend picking through a pile of mica chips with a vacuum finger and wand to sort and pick up each piece. it then was be placed in a contact frame (very small one) where a HI-POT test took place. Then this sample would be transferred over to the next step and inserted into a stacking jig..

etc. the nice part about all of this was, the software was intelligent enough to self correct all the wall to the encapsulation and UV process.

With the use of camera's and software smart enough to know what it's looking for, it made the mechanical end of this process much more reliable because the software could self correct position due to mechanical error or placement error..

All the software was done using Delphi, vender supplied drivers for the cameras, remote Io etc.

It was a huge success and when the share holders saw this, they seized the opportunity to sell the business while they had something to offer and took the money and ran. Ofcourse, it got sold to a India company.

Oh btw, I wrote the main software and did lots of the specialized automation custom circuits to be joined with commonly available automation components.

Jamie

Reply to
Jamie

ND/3079154

You were snarpity-snarking at the guy for using ceramic caps, without bothering to follow the link that he so thoughtfully provided to the C0G (and therefor electrically acceptable) caps.

I merely pointed that out.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

Was not. The snarkiness started with whatever creep used "knee jerk" to describe a technical suggestion.

--

John Larkin                  Highland Technology Inc
www.highlandtechnology.com   jlarkin at highlandtechnology dot com   

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME  analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators
Reply to
John Larkin

Time must flow backward in whatever corner of the universe you live in, then.

Have you notified Stephan Hawkings?

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

I don't know, Jacob Barnett seems to think SH maybe incorrect in his assumptions..

Jamie

Reply to
Jamie

formatting link

Change Rref to 10k and get back to us.

Reply to
John S

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.