Peak Performance on TLC2543
Kirk Fraser
Posts: 364
The TLC2543 is a 12 Bit 11 input Analog to Digital Converter with a 4 line serial output buss·which can be connected to a Stamp.· Previous threads helped get it going and reduced errors by regulated and reference power supplies, adding 0.1 uF capacitors, and input averaging by 8 which delivered one degree in 360 fairly reliably.· Now after a question to the manufacturer in August, we have a response showing new ideas which I hope can get·my ADC circuit to deliver tenths of a degree, which other posters already get.· The email from TI support:
I now have the·samples ready to test.· I thought throwing away some data would help but I didn't imagine the formula 2).· Prior to testing I'm doubtful the buffer will help more than·forum advised 1M resistor & filter capacitor but I'll try it.· I don't know what the unity-gain follower configuration is but the data sheet shows a diagram feeding an ADC so I'll wire that and post results.
·
Can you please run a test for me. Make the following two changes to your circuit: 1) Add an OPA350 buffer (in the unity-gain follower configuration) between your pot and the MUX input. Use the same power supply for the OPA350 as used for the ADC. Be sure to add P/S bypass. If the cap on the wiper continues giving trouble add a simple RC filter between the OPA350 and the MUX input instead to filter the noise. Free samples of the OPA350 are available at: [url=http://focus.ti.com/docs/prod/folders/print/opa350.html][u][color=#0000cc]http://focus.ti.com/docs/prodhttp://forums.parallaxinc.com/folders/print/opa350.html[/color][/u][/url] 2) Any time you address the MUX or change the channel, first do two conversions and throw away the data of the TLC2543. Keep the 3rd conversion and up; your accuracy will improve if you do multiple conversions and do an average in your Stamp uP. I hope this helps. If you have further questions please email or call me at 972-644-5580.
I now have the·samples ready to test.· I thought throwing away some data would help but I didn't imagine the formula 2).· Prior to testing I'm doubtful the buffer will help more than·forum advised 1M resistor & filter capacitor but I'll try it.· I don't know what the unity-gain follower configuration is but the data sheet shows a diagram feeding an ADC so I'll wire that and post results.
·
Comments
In the mean time I'm thinking: just plug in a few loose capacitors and see if there's any benefit. However I'm not sure if I can use electolytics in this and what +- orientation to use. Anyone please advise.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Need a TV Module?
Newzed@aol.com
·
The variable capacitor is for the OPA350 which TI recommended putting between the potentimeter and TLC2543 input.
BTW, what is that TV Module in your signature? I am looking for a better than ATI tv on pc converter as I've burned out two different models of ATI in under 10 years.
Kirk
PS: Still looking for variable capacitor advice as above.
I also have a VGA Module, again a duplicate of the VGA circuitry on the Demo board.· It has an 8-pin header which plugs into Pin 0, 8 or 16.· Plug it in, attach the cable from your VGA monitor and it displays the output of the propeller.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Need a TV Module?
Newzed@aol.com
·
Values to tenths appear to be within 3 which means I'm getting example values of 3566 3567 3568 which is 356.7 degrees. So in my application that's accuracy to 0.3 degree or about 0.3 to half an inch, which is great. Getting it down to a tenth of an inch would be better yet.
I'm not finding a variable capacitor centering around 0.1uF online yet -- all I found from DigiKey was in the pF range, not uF but I would like to be able to tweak one to try for the last tenth. Any other suggestions?
Thanks,
Kirk
PS: Here's the software implementing TI suggestion 2.
' {$STAMP BS2px}
' {$PBASIC 2.5}
' {$PORT COM1}
'Test A/D Inputs
' A/D pins
ADclk PIN 11
ADdati PIN 10
ADdato PIN 9
ADcs PIN 8
'VARIABLES
a VAR Nib
ADch VAR Nib
ADout VAR Word
avg VAR Word
DO
GOSUB Read_Inputs
'PAUSE 0 ' Future: Check time for 200 Hz loop
LOOP
Read_Inputs:
FOR ADch = 9 TO 10 'Read analog inputs as digital 0 to 4095
avg = 0
FOR a = 1 TO 10 'Get 10 per channel to toss 2 average 8
LOW ADcs ' select chip
SHIFTOUT ADdati,ADclk,MSBFIRST,[noparse][[/noparse]ADch<<8\12] ' output AD channel #
SHIFTIN ADdato,ADclk,MSBPRE,[noparse][[/noparse]ADout\12] ' input pot value
HIGH ADcs ' deselect chip
IF a > 2 THEN avg = avg + ADout : ENDIF
NEXT
ADout = (avg ** 57630) / 8 'convert average to degrees
DEBUG "Ain #",DEC ADch, " ADout ",DEC ADout, REP 32\5,CR
NEXT
RETURN
On the good side, it may not make any difference. The signals you are acquiring are basically DC. A lot of the stability issues arise when you are trying to acquire signals at a very high rate. The Stamp is not capable of pushing the TLC2543 anywhere near its top rate. The example given in the OPA350 data sheet is a 500 khz ADC, but the Stamp may at best be sampling at 100 hertz. A switched capactior ADC like the TLC2543 produces small pulses of current as the input capacitor is alternately attached and detached from the ADC input. That capacitance and those pulses of current are reflected back onto the external circuit that is attached to the input of the ADC. This is called "charge injection". and averaged over time into an external impedance it causes a DC error. The OPA350 has a very fast responding output circuit (38 megahertz bandwidth), and that enables it to respond changes without "ringing" and it has a low output impedance to minimize DC errors . The challenge is difficult when the pulses are coming out at 500khz but much much less so at 100 hertz. At low frequencies, when the charge injection pulses arrive very seldom, there is little DC error even with a passive RC circuit at the input. I hope that did not confuse the issue too much.
The circuit shown in the data sheet (figure 5) has a gain of x2. Is that what you are using?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Hi Tracy,
I now have learned to keep one circuit on the white prototype board until I've got a duplicate built in my application and drawing. That way I don't forget some important detail. Thanks for the tip on the variable capacitor range. I have the single OPA350 because it comes in DIP instead of the harder to use SMD. As noted above, I may not need it. I hope a variable capacitor will enable compensating for the parasitic impacts or other interferrences a little better. Would the picoFarad range still apply without the op-amp?
The ringing you described may explain an occasional long-term or restart shift of one tenth or so in the result. I'm not yet considering it a problem. Is it possible ringing is responsible for most or all of the remaining +-0.1 degree error? It doesn't seem like it but with that much difference in chip frequencies....
BTW, how can I achieve 200Hz? I was told that's what the whole system needs for a biped robot, so individual channels should be processed faster. I'm thinking the Stamp 2px might be going a little faster as it seems to start slow then pick up speed in the debugger. But if I can't possibly get 200Hz with it, what should I do?
I hoped to use multiple TLC2543's using the same 3 wire buss but seperate chip select pins on a Stamp with a network of Stamps enabling control of 70 channels to be passed through a USB port, possibly with only one Stamp. Now it's looking like I'll be lucky to run one or two channels per TLC2543 + Stamp, maybe only one on a network. Any suggestions?
Thanks,
Kirk
PS: Yes the op amp data sheet diagram 5 is what I was using. Thanks, that 2x explains why I was only getting about half the range from my pot. What diagram or change is needed to get 1x or "unity gain" - if it would help on a 6' line between pot and chip?
PPS: It seems almost too easy now, with regulated and·reference power,·3 0.1 uF caps between the potentiometer leads, the pot driven by either 5v supply, and nothing between the pot and TLC2543 input pin apparantly giving a varibility between two adjacent tenths.· Yet there is still a bug.· How do I get the range back to 0-360.0 instead of 2.1-357.9?· These were measured from direct wires to the regulated buss to seperate ADC pins.
Post Edited (Kirk Fraser) : 10/8/2006 7:12:05 PM GMT
Does anyone get the full 0-360.0 range? How?
Thanks,
Kirk
These answers show little hope for getting better results than +-0.1 degree.· Tweaking didn't restore the 2·degrees·on each end·which is annoying since one of my·applications requires 360 degree rotation.· Maybe it's·a degraded chip?· The tips on the op-amp should be useful if performance degrades with a long line to the potentiometer.
The collection of information thus far isn't all that I'd like but it's definitely enough to proceed to my applications with.
You asked if anyone gets better results than +/- 0.1 degree and a full 0 to 360 degree range.
You can't expect to get much better than 0.1 degree resolution, one part in 3600, because that is commensurate with the resolution of the TLC2543 converter, which is 12 bits, one part in 4096.
Just to check it out and give you some figures, I hooked up a wind vane to a TLC2543 on one of my data loggers. The wind vane is a potentiometer that rotates freely through 360 degrees, and this one has an end to end resistance of 20 kohms. The vane is mounted on a 40 foot cable, and for this test I strung it across the room, over the top of the oscilloscope and over the top of a refrigerator. The cable is unshielded 4 conductor telephone wire. There are no capacitors at the potentiometer itself, but I experimented with different capacitors at the input to the converter, that is, input channel to ground. I set the vane at 180 degrees, so the output is at the halfway point, Vref/2. There are no op amps in the signal path. Aside from the zap protection network, it is straight through from the potentiometer to the TLC.
with no capacitor, +/- 6 degrees.
with 0.1 uF, +/- 0.2 degree
with 10 uF, +/- 0.1 degree (somtimes rock steady in both millivolt and degree readings)
Also ran it through averaging algorithms synched to the power line frequency, with no capacitor (compare to +/- 6 degrees)
4 samples, +/- 2 degrees
8 samples, +/- 1 degree
16 samples, +/- 0.5 degree
So it seems to me you should be able to get your 0.1 degree resolution. Note that the capacitor has more of an immediate effect than the averaging algorithm. It's always best to start with a clean signal!
With regard to other questions:
-- No need to use the picofarads variable capacitor if you are not using the op-amp. The purpose of the capacitor is to stablize the feedback loop of the op-amp. I doubt if "ringing" is affecting your result. It can happen though, with circuits that have trouble driving capacitive loads. For example, the LM34 temperature sensor output can "ring" significantly when loaded with certain values of capacitance. But the OPA350 is specifically designed to drive capacitive loads.
-- You asked for the circuit for a unity gain buffer, but I see that you found the one in the OPA350 data sheet.
-- Regarding the loss of 2 degrees at each end, Op-amps can never push their outputs exactly to the supply rails. The OPA350 can get within 20 or 30 millivolts of the rails, but no closer, and that cuts 2 degrees of the end of the range. One way to get around that is to use a higher supply voltage for the op-amp.
-- With regard to throwing away two samples when changing channels. I haven't found that necessary. However, always throw delay and throw away the first sample when the TLC2543 is first powered up or when it wakes up from its sleep mode.
-- How to acheive 200 hertz? It's not clear, what repetitive task needs to be done at that rate? On a BS2pe, it takes about 3 milliseconds to acquire a reading from one channel of the TLC2543. Compare that to the 5 milliseconds, the period at 200 hz. The BS2p or px could go faster, but not by orders of magnitude Maybe you should be looking at the Propeller?
I hope your persistence will pay off!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Thank you very much! I'll try your 10uF suggestion as soon as I can get some. On the 2 degree loss at both ends, it appears the chip on the whiteboard has degraded as an equivalent circuit on my application returned 3600 with the same program today.
On the 200 Hz, the repetitive task that needs to be done is causing a biped robot to stand up. That is fighting gravity with about 7 actuators per leg while each actuator is potentially moving during a walk or run as well as standing and fighting wind or a shove or whatever. So it must sense the position of each actuator and compensate to maintain the desired position. The complete cycle of 14 actuators must be handled 200 times every second according to a professor who has already done an electric biped. I view that as an achievable target but I'll reevaluate that figure after seeing the performance of my own equipment.
Taking 3ms out of 5ms for just one reading obviously won't work without at minimum a Stamp per actuator and from trying a network of 2 on Stamp 1's, I expect the network could take a comparable amount of time to process even on px's. I'm not sure what a Propeller does. Is it like 8 Stamps in one? Or is it some other parallel processor?
I also hope my persistance will pay off. As you know I've been working with this electronic circuit for years -- so long that if I were hiring myself to work on it, I'd have fired myself by now. The lack of knowledge and skill I have on this is a sad thing. But I think the robot project is important enough that it's the only hope I have for a business. It has a built in guarantee if I finish. Even if nobody buys my robot, I can program it to make things in my garage which are currently being imported and sold successfully. Of course I may need more resolution than tenths, more like one ten thousandths of an inch to match current CNC machines. That will take something different like a radio position sensor which some power gloves use.
Thanks again,
Kirk