RCTime for 1024+ pot divisions?
Kirk Fraser
Posts: 364
The PBASIC Help for RCtime includes:
····· "On the BS2, the unit of time is 2 µs, that time (1.204 x 10-3) works out to 602 units. With a 10 kΩ resistor and 0.1 µF capacitor, RCTIME would return a value of approximately 600."
Does this mean with the BS2p or BS2sx which have time units more than one less than 2 us, the vaule would be about 1200 or so?· I need to have a Stamp detect 1024 or more·potentiometer divisions·-- not less over a full turn.
····· "On the BS2, the unit of time is 2 µs, that time (1.204 x 10-3) works out to 602 units. With a 10 kΩ resistor and 0.1 µF capacitor, RCTIME would return a value of approximately 600."
Does this mean with the BS2p or BS2sx which have time units more than one less than 2 us, the vaule would be about 1200 or so?· I need to have a Stamp detect 1024 or more·potentiometer divisions·-- not less over a full turn.
Comments
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out· the "SX-Video Display Module"
www.sxvm.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
What kind of mechanical setup is being used to deliver these accuracies? (1/3 of a degree implies very little backlash, and an unusually well built potentiometer shaft / bearings...)
(Not discouraging the use of an ADC here, just wondering if that much resolution is actually going to help...)
Steve
Thanks for the larger capacitor and MAX1298 suggestions.
Which means you have to turn them 360 degrees 10 times to get thru the whole resistance range.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out· the "SX-Video Display Module"
www.sxvm.com
·
I hope your idea about the larger capacitor works so I don't have to buy a bunch of A/D chips and use lots of extra Stamp pins. But since I'm taking Digital Electronics this term, maybe I can make a multiplexer to scan a bunch of them using only one set of pins.
I'm not sure I understand your exact requirement here, but take Bean's 10-turn pot idea with an indirect rather than a direct linkage. The indirect, mechanically advantaged linkage might be fine-tooth gear driven to effect the multiple turns, giving you the high resolution you seem to be seeking. A small rotation in the actuator yields a large movement in the 10-turn pot. With a ball bearing pot, and tight mesh gears, the backlash issue should be minimal.
Regards,
Bruce Bates
Interesting but a little to complicated for me. Sorry. I guess a simpler idea on the same lines would be to buy those off-shelf drill pumps and use it to pump hydraulic oil in proportion to the angle of rotation and that could drive a 10 turn pot.
Kirk
What I think we are all getting at is that it is not practical to measure a normal pot to 10-bits, especially with an RC circuit.
It's like trying to measure a 10" thick sponge to a thousandth of an inch. Every measurement is going to be different.
8-bits (256) is realistic with an A/D converter, about 6-bits(64) with RCTime. Just my opinion though...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out· the "SX-Video Display Module"
www.sxvm.com
·
You know, you don't have to buy multiple ADC chips and use as many Stamp pins. You can buy a single ADC with multiple inputs and address it using only two or three stamp pins. For example, the TLC2543 in a 20 pin package has 11 analog inputs, 12 bits (4096 steps), uses 4 Stamp pins, and converts an analog reading in less time than it takes for the Stamp to get from one instruction to the next. Here is some info on the Stamp interface: www.owlogic.com/OL2tlc2543.htm
Here is a URL with information on capabilities and limitations of the RCtime command: www.owlogic.com/BS2rct.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I understand the difficulty but I think in this case it's better to spend a little to test the maximum reliable precision on a sample then build to that instead of just assuming I can't get what I want. Not saying my robot will ever do surgery but if it did, you wouldn't want it operating at 6 - 8 bits (64 - 256 angles) when it could be operating at 10 bits (1024 angles) would you? Industrial pots at $10 are affordable compared to linear position sensors that cost $100+ each. Making a gear system to drive ten-turn pots could become expensive in cost, realignment after abuse, and power drain for multiple joints. Thanks for the effort and details on what resolution to expect with RCTime & A/D.
Tracy,
Thanks much for your referrals! It looks like an ideal choice to test and for production if it turns out I can't get some least significant bits reliably I can throw them away by software -- but if under certian conditions they are reliable then I can program for those conditions. And if I really have to fall back to an 8 bit then I'll have proved it to myself. It could turn out the TLC2543's 11 inputs will pay for it compared to single input ADC's even if I end up using only 8 bits.
All,
This is a great value of this forum, to learn the best ideas before spending money on a poor idea. Thanks.
Kirk Fraser
Yes I agree. A wise man once said "One experiment is worth a thousand opinions". That why in my previous post I said "just my opinion". It you do test it out, please let us know the results.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out· the "SX-Video Display Module"
www.sxvm.com
·
I have the major parts, a new TLC2543 and a new Stamp 2P40 both plugged in to my proto board and Tracy's link http://www.owlogic.com/OL2tlc2543.htm with its wiring plan but I'm a little confused on how to perform the test mechanically. It seems unlikely that I could get the pot to move and return to exactly the same spot from both directions to tell if the bit pattern was the same or if there is backlash or something that reduces the actual resolution. Without that all I can say is the TLC2534 with 11 channels for $4.50 or the MAX1298 Jon suggested with 5 channels for $3.25, both producing 12 bits both seem affordable so even if a few LSB's are wasted, no problem at least I know I have what I need. I like the TLC2543 so far because of Tracy's help page and it's a little cheaper per channel and I have about 70 channels in my final application. Any comments?
Kirk
Upon testing the TLC2543, I find these things:
1) I can manually move the pot through its range to the precise endpoints but inbetween them the LSB's cannot be repeated with manual positioning.
2) I didn't carefully determine how many LSB's are wasted but I expect at least 4.
3) The value of having the help provided by Tracy Allen's webpages in hooking up and programming for the TLC2543 is so wonderful it supercedes less expensive choices.
4) It appears a BS2P can run two TLC2543's at a time, which will provide 22 inputs that will serve my needs very well.
Kirk
Sunflower, I would venture a guess that your problem is either due issolation problems within the PCF8591 (the voltage on an unsampled channel is bleeding into the measured channel) or power supply issues. You have to remember that taking the 8 bit ADC of an analog 5V signal is measuring in 20mV increments. A fluctuation of 100mV can result in >3 bits of error, knocking your useful measurement to nearly half the bits. Do you have a bypass capacitor attached between Vdd and Vss of your ADC?
So that means human error and I can expect when I set it up for AD again it will gain some bits with the shaft expander that will be hooked to my cylinders. But it'll also degrade somewhat as parts loosen over time so I'll play it by ear.