​ ​ ​ ​ ADC speed problem? - Page 2
Page 2 of 2 FirstFirst 1 2
Results 11 to 17 of 17

Thread: ADC speed problem?

  1. #11
    Senior Member
    Join Date
    Jan 1970
    Location
    Colorado USA
    Posts
    3,053

    Default

    PICAXE wins again - you just have to treat it right... ;-0 Have fun learning...

  2. #12
    Senior Member
    Join Date
    Feb 2010
    Location
    Don't Mess With My Texas!
    Posts
    2,197

    Default

    If I only had a $ for every time that has happened to me. Hope your whole project is a success!
    - Tex
    __________________________________________________ _______________________
    "Truth lies dormant in our future history." ― Tex Clodhopper LXV
    “Confidence is ignorance. If you're feeling cocky, it's because there's something you don't know.” ― Eoin Colfer, Artemis Fowl

  3. #13
    Senior Member
    Join Date
    Feb 2012
    Location
    London
    Posts
    2,658

    Default

    Hi,

    Quote Originally Posted by Hairy Animal View Post
    Because the pot is 60k, connecting it directly to the input probably wouldn't work because the input needs to see less than 20k source impedance.
    A 60k pot wired as a potential (supply voltage) divider has a maximum source impedance (at the centre of its track) of only 15k. Effectively, the power supply rail has a very low impedance to ground (otherwise it couldn't deliver the hundreds of mA or Amps that might be required) so the "source" impedance is two 30k resistors in parallel, or 15k. Microcochip "recommend" a maximum of 10k, but in all normal conditions 15k will be satisfactory, particularly if only using READADC (instead of READADC10) and/or put a small capacitor across the ADC input pin to ground.

    IMHO the Op Amp buffer is completely unnecessary and this thread a good example of the merits of the Keep It SimpleS approach.

    FWIW you can sometimes use the same principle to emulate a "Log" Potentiometer (strictly a misnomer as the output response is normally exponential) for an audio volume control (and other applications related to human senses). For example, connect 10k between the wiper and lower end of the 60k pot. Now at the centre of track, the top resistance will still be 30k, but the lower is now 10k in parallel with 30k, or 7k5, so the output voltage would be only 7.5 / 37.5 or 20% of Vdd. But at the top and bottom of the track the output must still be 100% and 0%.

    Cheers, Alan.

  4. #14
    Member
    Join Date
    Mar 2014
    Location
    United Kingdom
    Posts
    32

    Default

    Quote Originally Posted by AllyCat View Post
    IMHO the Op Amp buffer is completely unnecessary and this thread a good example of the merits of the Keep It SimpleS approach.
    I absolutely agree about KISS and am grateful for the reasoned suggestion.

    However, as I have already got the buffer circuitry in place:
    HA142039rcs.JPG
    I probably won't now take it off.

    Also, it's presently driving about 18" of cable which might be more prone to interference without the low impedance buffer? I'm not sure at present how close the PICAXE will be to the pot/buffer so to be on the safe side I'll leave it in as there's minimal risk of failure of the few extra components involved.

    And I'd like to reiterate what a pleasure it always is being a part of this forum. There are other places on the internet where, if one made a mistake as I did, some people might be downright rude, but here everyone is polite and more than helpful.

    Thanks again.

  5. #15
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    23,741

    Default

    As this appears to be part of a safety critical application you should take multiple ADC readings so you don't misinterpret any noise picked-up on the signal line. You may also want to smooth out any variations, probably even prevent any unexpected large throttle increases. You should add a pull-down resistor at the PICAXE end to keep a zero input should the cable become detached.

  6. #16
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    23,741

    Default

    Quote Originally Posted by Hairy Animal View Post
    However, as I have already got the buffer circuitry in place: I probably won't now take it off.

    I'll leave it in as there's minimal risk of failure of the few extra components involved.
    If you do a failure mode analysis you will discover that there are far more possibilities of failure with the op-amp in place than there would be without it. Having the op-amp in place does not seem to add anything other than increasing the potential for problems. In that respect it may be wiser to remove it than keep it.

  7. #17
    Member
    Join Date
    Mar 2014
    Location
    United Kingdom
    Posts
    32

    Default

    Quote Originally Posted by hippy View Post
    As this appears to be part of a safety critical application you should take multiple ADC readings so you don't misinterpret any noise picked-up on the signal line. You may also want to smooth out any variations, probably even prevent any unexpected large throttle increases. You should add a pull-down resistor at the PICAXE end to keep a zero input should the cable become detached.
    Very helpful suggestions, thanks.

    The throttle control I'm currently working on is the second of two, essentially similar, units but with different hardware for the actual throttle itself. The first one (to be used at the back of the boat) is more or less complete and uses a custom made APEM joystick. In theory, I could have connected it directly to the motor's control box as it has microswitches which actuate as it's moved from the centre (off) position to set either the forward direction, or reverse. The control electronics it connects to only require a 0 - 5V signal (from a pot or other source) defining throttle 0 - 100% and a 72V level switched to either forward or reverse inputs.

    However, because it requires quite a light touch to move it from the centre-off position, it might be all too easy for someone brushing past to accidentally suddenly put the boat in full forward (or reverse). So I have three (illuminated) pushbuttons for Forward, Stop & Reverse confirmation and when the 20M2 detects that the control stick has been moved away from the centre stopped position, flashes the relevant Forward or Reverse pushbutton for confirmation that forward or reverse mode is intended, and only when the relevant button is pushed does it actually switch the relevant signal through to the control box.

    The Stop pushbutton also acts as an emergency stop at any time which is potentially quicker than moving the joystick. I haven't yet programmed an emergency reverse option, which might be more beneficial than just stopping the motor.

    The second throttle control for use at the front of the boat is designed to look more in keeping with the age of the the boat (1926):
    DAV9626-BR.jpg
    but is less easy to configure than the APEM joystick.

    Thanks though to many really helpful suggestions from this forum back in 2014, I have a relatively simple mechanical arrangement whereby the lever controls the 60k sealed pot. It's not full range but as the DAC output only has 32 steps anyway, the resolution of the ADC in 8-bit mode is fine and just happens to be almost exactly twice the required resolution. Since getting it working (on the right pin), I have some basic maths working nicely to convert the 0.66V level to full reverse, 2.06V (+ a deadband) to stop, and 3.33V to full forward, and of course linear levels in between.

    So that's it in a nutshell. I shall definitely look at software smoothing of the ADC signal, though I haven't seen any sign of problems so far. But of course pots do wear with age and become more noisy so it is a very sensible and helpful suggestion, thanks.

Bookmarks

Posting Permissions

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