Shop OBEX P1 Docs P2 Docs Learn Events
MCP3208 12bit potentiomer position with fault detection questions — Parallax Forums

MCP3208 12bit potentiomer position with fault detection questions

dbritta1dbritta1 Posts: 36
edited 2013-03-12 04:58 in Propeller 1
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?

Comments

  • Mark_TMark_T Posts: 1,981
    edited 2013-03-09 18:32
    It sounds pretty reasonable to me except that the lead should be shielded ideally. Since the impedance is quite low (2.5k or lower for each wiper)
    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.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2013-03-10 00:16
    Just how noisy is this environment? Any possibility of locating the pots on the same board as the ADC and then running digital select, clock and data to the mpu? optionally, another solution could be a VCO conversion as a way around noise errors.
  • dbritta1dbritta1 Posts: 36
    edited 2013-03-10 09:40
    Cable bundle must be lightweight, extremely flexible with high multi-axis flex cycle count before failure.
    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?
  • frank freedmanfrank freedman Posts: 1,983
    edited 2013-03-10 11:06
    If the pots can not be located with the ADCs, it may be worth considering using the differential input mode of the mcp3208. This will give 4 channels instead of 8, better noise immunity but at the cost of 4 ADCs per package. Should be able to get around 20ksps per channel. Also twist the leads from the pot to the ADC input.
  • HarpritHarprit Posts: 539
    edited 2013-03-10 12:13
    I made a coordinate measuring machine with 6 pots.
    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
  • dbritta1dbritta1 Posts: 36
    edited 2013-03-10 12:40
    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.
  • dbritta1dbritta1 Posts: 36
    edited 2013-03-10 14:40
    Prelim test results for proposed circuit:
    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.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2013-03-10 15:25
    Differential input mode will help to eliminate common mode noise as the wires will pick up about the same noise levels, The difference function would cancel the noise presented to the + and - inputs so the ADC will digitize only the actual voltage with far reduced noise component. Would require pot wiper lead and separate return lead for using differential mode though.

    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.
  • dbritta1dbritta1 Posts: 36
    edited 2013-03-10 16:05
    Further tests reveal that minimum 470K for pull-down to get desired functionality.
    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.
  • dbritta1dbritta1 Posts: 36
    edited 2013-03-12 04:58
Sign In or Register to comment.