Pot jitters during ADC capture


+ Reply to Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,910

    Default Pot jitters during ADC capture

    SOLVED: Henrik figured it out, this 18F26K22 doesn't like 10K pots on ADC.

    https://www.picbasic.co.uk/forum/sho...893#post155893

    ================================================== ===


    Posts moved from here: https://www.picbasic.co.uk/forum/sho...or-adc-reading



    Henrik,

    Do you think your routine would help potentiometer jitters?

    I have new slide pots that have random jitters along the entire range of motion. ADC readings seems to vary by 10 points at times.
    Last edited by Demon; - 12th August 2024 at 19:46.
    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
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,955


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    I have not seen Henrik's piece of code, but as he noted it is not a sort or fast one.

    In the mean time, maybe you can:

    1. find the reason of the jitter/noise of the pot output.
    2. try getting 10 samples, sort them, keep the middle 4 or 5 ones, add and divide by 4 or 5 to get the average.

    seems a lot but is fast enough for most of the cases.

    For a sorting routine see here: https://www.picbasic.co.uk/forum/sho...highlight=sort and this https://www.picbasic.co.uk/forum/con...orting-Numbers

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    It's a hardware issue, the pots are brand new. The slider overlaps multiple resistor changes. I don't get these jitters using my rotary pots.

    I read the big ADC thread:
    https://www.picbasic.co.uk/forum/sho...eading-Routine

    - using 10-bit ADC on 18F26K22
    - take 16 readings into a table
    - sort using Melanie's routine
    - take the median average
    - add previous average twice and divide by 3 for exponential average

    ...still jitters.

    I placed a small cap across VSS and wiper.

    ...still jitters.

    I tried this low-pass filter with 16K and 10uF:
    https://www.instructables.com/Smooth...iometer-Input/

    ...still jitters.

    Tried shifting out low bit.

    ...still jitters.

    Tried shifting out low 2 bits.

    ...still jitters.

    Tried shifting out low 3 bits.

    ...still jitters.

    Tried shifting out low 4 bits.

    ...mostly stable

    But now the high range only goes up to 976 or so.

    I'd have to convert to a ratio of 1023 for my variables (MS Flight Sim variables=0-1023).
    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
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,910


    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!

  5. #5


    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 ?

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,910


    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!

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,955


    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

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,562


    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.

  9. #9
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,910


    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!

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,910


    Did you find this post helpful? Yes | No

    Default Re: New software filter for adc reading

    Quote Originally Posted by amgen View Post
    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
    Nah, not even new-old-stock.

    These were built for me.
    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 : 11

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