accuracy of rcTime?
Jim_BD
Posts: 3
I'm working on measuring switch contact resistance (with a Javelin) and I think that I want to use rcTime to do it. I've done the math and think that I can use a 1000uf capacitor and 500 ohms in series with the switch contacts (to limit the current, or it'll burn off any film that I'm trying to detect). I anticipate contact resistances of 0.020 ohms. This is a 0.004% of the series resistance; the condition I'm trying to detect might give me 0.1 ohms (0.02%) - resolution might be where I've gone horribly wrong...
I have a 220 ohm resistor going to pin4 (just like the book says!). I've calculated the voltage divider to get the result I expect rcTime to give me, and it's not far off. I expect that the difference has to do with tolerances in the component values, but I haven't calculated it yet. My problem is that I'm getting a large range (34% of the average) of results from the controller.
My questions are:
* What factors limit the accuracy of rtTime measurements?
* What factors limit the resolution of rtTime measurements?
* What factors limit the repeatability of rtTime measurements? My circuit is not repeating.
Another question is:
* Have you ever done accurate, low-resistance measurements with a Parallax microcontroller?
I've thought of measuring voltage drop across my contacts with a 16-bit I2C A/D device, but I'm going to work this out first.
Thank you,
Jim
PS - Here's the program:
import stamp.core.*;
public class PhotoResistor {
final static char CLS = '\u0010';
static int dischargeTime;
static int chargeTime;
public static void main() {
while(true){
CPU.writePin(CPU.pins,true);
CPU.delay(32000);
dischargeTime = CPU.rcTime(32000,CPU.pins,false);
System.out.print(CLS);
System.out.print("RC rise time is: ");
System.out.println(String.valueOf(dischargeTime));
//CPU.delay(10000);
}
}
}
I have a 220 ohm resistor going to pin4 (just like the book says!). I've calculated the voltage divider to get the result I expect rcTime to give me, and it's not far off. I expect that the difference has to do with tolerances in the component values, but I haven't calculated it yet. My problem is that I'm getting a large range (34% of the average) of results from the controller.
My questions are:
* What factors limit the accuracy of rtTime measurements?
* What factors limit the resolution of rtTime measurements?
* What factors limit the repeatability of rtTime measurements? My circuit is not repeating.
Another question is:
* Have you ever done accurate, low-resistance measurements with a Parallax microcontroller?
I've thought of measuring voltage drop across my contacts with a 16-bit I2C A/D device, but I'm going to work this out first.
Thank you,
Jim
PS - Here's the program:
import stamp.core.*;
public class PhotoResistor {
final static char CLS = '\u0010';
static int dischargeTime;
static int chargeTime;
public static void main() {
while(true){
CPU.writePin(CPU.pins,true);
CPU.delay(32000);
dischargeTime = CPU.rcTime(32000,CPU.pins,false);
System.out.print(CLS);
System.out.print("RC rise time is: ");
System.out.println(String.valueOf(dischargeTime));
//CPU.delay(10000);
}
}
}
Comments
Measure the voltage supplies to the them via RCTIME (is it DEAD on?).
What kind of resistor/cap are you using? if you want accuracy and repeatability....go precision.
HAve a head gun? blow hot air across the components and see the results change.
How long are the leads? Are they acting as antenna's and picking up uV or mV's and skewing your results?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Do be aware that the accuracy of the value stated on large (say 100 uF and up) electrolytic capacitors can vary wildly. Typically they are deemed to be "in spec" if they are within minus 50% and plus 100%. Also their effective capacitance varies with themperature, with applied voltage, and they age. Leakage is another issue.
In all, they are TOTALLY unsuitable for what you are trying to accomplish.....you need something much more predictable and stable.
Cheers,
Peter (pjv)
It seems your test leads are a contributing resistance problem that requires consideration.
You might prefer to create your own 'air capacitor' or calibrate some copper clad printed circuit board as a capacitor. In that way, you avoid questions of electrolytic leakages.
Alternatively, it seems that the mylar and foil capacitors are considered high stable. I just not sure if you can easily get 1000uf.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
A mylar capacitor at 1000uF........? What are you smoking?
Cheers,
Peter (pjv)
While technically correct, the concept you have to measure resistance is not practical for small resistances. The components required just don't make sense.
To help you out I suggest the following. The way low resistance (fractions of Ohms) measurements are easily made is to make a DC current source of 10 or 100 mA, or perhaps even 1 Amp (depends on the resistance expected) and push that through the switch (turned ON) you want to measure. Then with separate leads connected at the switch terminals, measure the voltage ....it will be quite low. This way the resistance of the leads supplying the current do not come into play.
The resistance of the switch contacts is calculated by Ohm's Law as Resistance equals Voltage divided by Current. So if you measured 10 millivolts with a current of 100 milliamps, the the resistance would be 0.01 divided by 0.1, so one tenth (0.1) Ohms.
Hope this helps.
Cheers,
Peter (pjv)
If I actually had ample reference books here, I could avoid such blunders.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
No vices......but I do hope you "eat SX's for breakfast".
Cheers,
Peter (pjv)
I'm sorry for not reading this sooner; I had thought that I would get notified by regular email. Anyway...
I've purchased two MAXIM 1169CCUD 16-bit A/D converters, soldered them to adapters and built a circuit to measure voltage across the contacts. Peter (pjv), this is what you suggested and I recognize it as a four-wire "Kelvin" test. I had settled on this when my RCTime experiment failed. Now all I need to do is get this to work! Have any of you done work with this MAXIM component? Does my idea sound sound?
Thank you,
Jim
PS - here's a link to the spec. sheet of the A/D chip I'm using. It was rather cheap ($17.73 ea.)
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3659
I totally agree that RCTIME as you had it set up would not be suitable for measuring small resistances. I have info on limitations of RCTIME (temperature dependence, noise etc.) at www.emesystems.com/BS2rct.htm.
There is also an op-amp circuit there that converts a small voltage into a proportional current that can be read by RCtime. That could work for your measurement, if you pass a current through the resistance so that it develops a small voltage. It works best with an op-amp that has low, stable offset voltage. For example, a CAZ op amp has an offset voltage of only a few microvolts.
That said, the 16 bit ADC should do a great job. I haven't used that particular Maxim part.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com