MCP3208 12bit potentiomer position with fault detection questions
dbritta1
Posts: 36
Multiple 5K potentiometers connected to Propeller USB Board via 12" to 24" 22ga twisted cable in noisy environment.
(pots have long levers attached to shafts, users are generating at least 12bit input data)
UI should provide 7 channel 12bit pot position info at 50hz (20hz tolerable).
Minor loss (few percent) of total resolution due to fault detection expected.
SOFTWARE:
Software will provide continuous running average filtering (mods to MCP3208 or MCP3208_fast).
Software will provide scaling and linearization (via look-up tables).
Software will collect and store real-time data for async GET_STATE commands.
ON-BOARD:
AGND and DGND tied at MCP3208 pins.
VDD adn VREF tied at MCP3208 pins.
1uF by-pass capacitor between VDD and DGND pins.
Cable connector adjacent to MCP3208.
CABLE:
Triple bundle of 22ga 3conductor twisted heavy duty servo wire.
1 = AGND, 2 = VREF, 3 - 9 = pot wiper returns.
Cable thins by one conductor after each pot in daisy chain.
AT EACH POTENTIOMETER:
TBD (? 1uF ?) by-pass capacitor between AGND and VREF.
TBD (? 100ohm ?) series resistor between AGND and CCW pin (see below).
TBD (? 100ohm ?) series resistor between VREF and CW pin (see below).
RC FILTERING OF ADC INPUTS:
TBD (? uF ?) RC filter capacitor on each MCP3208 input pin.
TBD (? ohm ?) RC filter resistor between MCP3208 input pin and cable to pot wiper.
INITIAL CONCEPT OF FAULT DETECTION:
Series resistors on CW and CCW pins of pot restrict valid range of input voltage.
This creates upper and lower fault detection bands.
ADC values in these ranges are assumed to result from faults.
Few percent loss of total possible resolution to detect faults.
TBD (? 100K ?) pull-down resistor on each MCP3208 input pin.
This would force ADC values into lower fault detection band under most common fault conditions.
????????????????? QUESTIONS ???????????????????
Do you think this approach will work?
If so, what are appropriate values for the TBD components?
Do you have a better idea, or a different approach to the problem?
(pots have long levers attached to shafts, users are generating at least 12bit input data)
UI should provide 7 channel 12bit pot position info at 50hz (20hz tolerable).
Minor loss (few percent) of total resolution due to fault detection expected.
SOFTWARE:
Software will provide continuous running average filtering (mods to MCP3208 or MCP3208_fast).
Software will provide scaling and linearization (via look-up tables).
Software will collect and store real-time data for async GET_STATE commands.
ON-BOARD:
AGND and DGND tied at MCP3208 pins.
VDD adn VREF tied at MCP3208 pins.
1uF by-pass capacitor between VDD and DGND pins.
Cable connector adjacent to MCP3208.
CABLE:
Triple bundle of 22ga 3conductor twisted heavy duty servo wire.
1 = AGND, 2 = VREF, 3 - 9 = pot wiper returns.
Cable thins by one conductor after each pot in daisy chain.
AT EACH POTENTIOMETER:
TBD (? 1uF ?) by-pass capacitor between AGND and VREF.
TBD (? 100ohm ?) series resistor between AGND and CCW pin (see below).
TBD (? 100ohm ?) series resistor between VREF and CW pin (see below).
RC FILTERING OF ADC INPUTS:
TBD (? uF ?) RC filter capacitor on each MCP3208 input pin.
TBD (? ohm ?) RC filter resistor between MCP3208 input pin and cable to pot wiper.
INITIAL CONCEPT OF FAULT DETECTION:
Series resistors on CW and CCW pins of pot restrict valid range of input voltage.
This creates upper and lower fault detection bands.
ADC values in these ranges are assumed to result from faults.
Few percent loss of total possible resolution to detect faults.
TBD (? 100K ?) pull-down resistor on each MCP3208 input pin.
This would force ADC values into lower fault detection band under most common fault conditions.
????????????????? QUESTIONS ???????????????????
Do you think this approach will work?
If so, what are appropriate values for the TBD components?
Do you have a better idea, or a different approach to the problem?
Comments
capacitive pickup won't be too big a problem, but 12 bits is quite a lot.
What settling time do you want to 12 bit accuracy? That will affect the LPF on the ADC pins.
You probably will benefit from sampling at a rate locked to mains frequency to reject mains pickup.
Could consider having a separate analog supply just to power the ADC and provide its reference. Should not be switched-mode.
This rules out coax, ribbon, shielded multi-conductor or braided shield.
Potentiometers cannot be placed on Prop board.
Environmental noise is TBD, examples: near spot welding assembly line, near multiple unshielded brushed motors, etc.
PS is 6v SLA, may change to LiFe in future.
RC Filtering issues:
User will coarse position pot relatively slowly, ie, 200 - 500ms for large excursions.
Then user will fine adjust continuously before next large excursion.
UI state must be available to system as real time as possible.
Lag includes sample aquisition and software filtering, com delays between boards and wireless to system (then additional delays to effectors).
Target GET_UI_STATE command rate is 50hz, this gives 20ms as initial settling value.
However, settling to last few LSB can occur over longer period, but this adds unwanted mushiness to control system.
Need to inspect MCP3208 or MCP3208_fast to determine moving average window size, TBD at this time, but easy to software update.
Given system feedback lag to user, expect valid user input of only 2 - 5hz.
Thus, settling to last few LSB (including software filtering) should occur within 200ms.
QUESTIONS; Given proposed design:
What are optimal values for series resistors on pot CW and CCW pins?
What is optimal value for by-pass cap across series resistors on pot CW and CCW pins?
What are approprate values for resistor and capacitor for RC filter on ADC input pin?
What is approprate value for pull-down resistors?
Should pull-down resistor be placed on cable or ADC side of RC filter resistor?
MCP 3208
Worked but pots are notoriously not linear. Main problem.
Quality wire would pots would have been much better
7 pots an 5k are a lot of load on the Power. Consider 10K or ever 50K
Harprit
Non-linearity of pots to be handled in software.
Higher resistance pots means more noise succeptable.
Frank,
All cabling is twisted.
All pots daisy chained along cable bundle, share common AGND and VREF conductors.
Unsure how differential input would help?
Just read comment that connecting MCP3208 VDD and VREF pins not as good as RC filter between VDD and VREF pins.
Suggested was 100ohm between pins and 1uF from VREF to AGND with possible addition of 0.1uF cap in parallel with 1uF.
Any comments?
Should by-pass caps at pots connect across CW and CCW pins or connect from AGND to VREF conductors?
Also found "ADC Input Driver" at OBEX, need to evaluate.
http://obex.parallax.com/objects/488/
Still need recomendations for RC filter circuit for ADC inputs.
Only 100ohm series resistors on CW and CCW pot pins.
100K pull-down on ADC input pin.
No caps or RC filter components.
Results are ADC value ranges.
Max CCW Max CW
No fault 053-054 FA0-FAA
Open wiper 008-00B 007-00B
Open VREF 000-000 006-008
Open AGND F59-F67 FF8-FFF
Open AGND Max CCW is less than No Fault Max CW
Need to adjust component values.
Also for some good pre-project reading, Google "Bonnie Baker ADC", and you will find some good info. She is IIRC an applications engineer with TI and writes a lot for EDN and others. A really good book called "A Baker's Dozen" is just jammed full of info for these types of circuits.
Also check this link for a five part series in EDN on EMI.
Decided to use 510K between AGND and ADC input pin.
Need to add ADC input RC filter.
Suspect that series resistor should be between 100 and 330ohms, unsure what optimal RC values should be.
http://forums.parallax.com/showthread.php/146574-MCP3208-Potentiometer-fault-detection-working-RC-filter-questions