Pot jitters during ADC capture


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    Took the average of middle 4 entries, still jittered.

    Gradually dropped off low bits until I was down to 6 high bits.

    It jitters a LOT less. It's at a level that would be acceptable.

    I guess that's the price I have to pay when I use the "most affordable new pots from China".
    Last edited by Demon; - 5th August 2024 at 23:48.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    did you do a test with a different regular pot instead if slider, and did you try, say a, 1 microfarad across Vss and slider tap ?

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    Quote Originally Posted by amgen View Post
    did you do a test with a different regular pot instead if slider, and did you try, say a, 1 microfarad across Vss and slider tap ?
    I had made tests a few days ago using various ceramic and electrolytics up to 10uF with no improvement.

    I have one last thing to test, gonna report back.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    Quote Originally Posted by Demon View Post
    Gradually dropped off low bits until I was down to 6 high bits.
    Well, 4 bits down means the jitter is max 15 counts of the ADC... This is too much!

    Cannot understand how can a pot have so much bad connection of its wiper... If you use this port in audio circuit, it should make a lot of noise! Even old and dusty pots, if stationary, do not have such behavior

    But then you said that with rotary pots you do not observe any jitter. All the sliders do the same?

    If yes, better dump them and get decent ones.

    Ioannis

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    Sorry for the delay but the thread is a decade old so....
    What's the value of the pot in question? Link to actual product or datasheet?

    It certainly sounds like a hardware issue. If it works OK with a rorary pot, of the same value, then the slide pot is crap - obviously.

    But, do you really NEED 10 bit resolution? Even if you throw away say 3 bits you still have 127 discrete values. On a 70mm long pot that's about 0.5mm movement. If the sim software expects 10bits then just shift the value left three digits.

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    if the slider pots had been sitting around for a few years then the wiper windings could be tarnished (not good electrical contact). might be able to spray/squirt some contact cleaner and vigorously move slider to get better contact

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    Quote Originally Posted by HenrikOlsson View Post
    Sorry for the delay but the thread is a decade old so....
    What's the value of the pot in question? Link to actual product or datasheet?

    It certainly sounds like a hardware issue. If it works OK with a rorary pot, of the same value, then the slide pot is crap - obviously.

    But, do you really NEED 10 bit resolution? Even if you throw away say 3 bits you still have 127 discrete values. On a 70mm long pot that's about 0.5mm movement. If the sim software expects 10bits then just shift the value left three digits.
    No rush here Henrik.

    It's a linear 10K slide, my rotaries are 5K, but that shouldn't matter. If anything, the slides should be even more smooth since they have more distance to produce a variation in resistance.

    I have 3 uses for these:

    - flaps, 45mm with 4 detents (created with 3D printed housing since it cost a gazillion to add in pot).
    - mixture, 60mm, doesn't require that much precision.
    - throttle, 100mm, this is the important one since players can tweak their throttle in very small increments when landing.

    6 bits would give me 64 values, like I said, I could make due with that if I have to.

    This isn't old stock. I had to wait a month for manufacturing. Then they had quality control issues (housing pins not completely bent horizontally so the pot wobbled on PCB). They redid the order, but still, was not impressed.

    The pots passed static tests, but now I'm starting to code and the first thing I tackled was pot debounce since that was left "unanswered" when I was testing stand-alone switch debouncing.

    I'm just disappointed in the low quality straight from the manufacturer.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    I had one last thing to test:

    The slide pot was soldered onto a new PCB from JLCPCB. It's just the pot with a connector, nothing else to interfere (I do this to test all my devices).

    I had used a 3-pin header to connect to the breadboard (brand new, very tight, no jiggleness in connections).

    I tried again, but this time using a female header socket, and used jumper wires to connect straight to the PIC on the breadboard.

    Same jitters, so I've eliminated the header connector as possible issue (the PCB only holds by those 3 pins, so it had some
    movement).

    Looks like I'm down to stripping the bottom 4 bits.

    One last possibility, finding a PIC on JLCPCB with at least 8 pins with 12-bit ADC. Not my favourite idea; I was looking at using the TQFP-64 16F1937 for my LEDs, switches, pots and encoders. If I have to buy PICs in bulk later, I wanted to limit my use to 1 for USB, 1 for I/O to limit costs.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  9. #9
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    969


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    I am not sure if my comments will help. I am putting in some check points for you to look at.

    Is it possible you are reading the ADC too fast / very frequently ? Usually, you need to allow a settling time between setting the ADC channel to read and acquiring the channel value. If that is not handled correctly, you may see such problems that you describe. usually, a 1 or 2 count variation on an averaged value is reasonably steady for a 10bit adc.

    If it is not in firmware (since you say so - the rotary pots do not exhibit such jitter), you could possibly look towards the hardware. Are the pots you compare - rotary and slider - of the same value? Are they both LINear or LOG types? A review of these will help

    Thridly, you should ensure that your grounds do not form what is known as a ground loop. This can disturb the ADC acquisition if the ground currents change the measured voltage by a few mV (for 10bit @5V, it is approx 5mV for LSB). So, ensure that any heavy currents are properly routed to the power supply. Examples of such current - 7 segment display currents passing through a sink device (maybe a ULN2003 or such) whose ground is connected to the CPU which then connects to the power ground. The current flow should ideally be from CPU ground to ULN2003 ground to power supply ground. To identify such a ground loop, I would connect a fly-wire to the power ground and then touch various grounds in the circuit to identify where the error is mitigated.

  10. #10
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: Pot jitters during ADC capture

    Tried shifting out low 4 bits.


    ...mostly stable


    But now the high range only goes up to 976 or so.
    kinda makes me wonder how that can even work

    perhaps show your code
    Warning I'm not a teacher

  11. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    Quote Originally Posted by Ioannis View Post
    ...All the sliders do the same? ...
    I have 3 sizes, 45, 60 and 100 mm, all the same mediocre performance.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Using hardware capture
    By Bruce in forum Code Examples
    Replies: 14
    Last Post: - 25th March 2012, 05:52
  2. Capture woes...
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 22nd May 2011, 08:36
  3. Capture with PIC16F88
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th March 2010, 13:05
  4. Capture without CCP
    By boroko in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th March 2009, 23:09
  5. Capture
    By SlotH in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th May 2005, 19:17

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts