decoding quadrature encoders


Closed Thread
Results 1 to 40 of 94

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: decoding quadrature encoders

    Hey guy's, Why not just use 2 external interrupt lines (int0 & int1) in high priority mode, and just increment or decrement a counter? I have used this approch for years on my mill and I haven't lost a count yet. I have attached a URL for the front end circuit I used. I have NO problem a tracking 1000 Rpm, 720 CPR encoder using LONG's.
    Here is the URL: http://electronicdesign.com/analog/s...ation-encoders

    I eliminated the caps and just use 10k resistors. Read the artical as it is informative.
    Dave Purola,
    N8NTA
    EN82fn

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


    Did you find this post helpful? Yes | No

    Default Re: decoding quadrature encoders

    Because INT0 and INT1 trips on EITHER the rising OR falling edge which means that you either get x1 decoding or that you need to reconfigure the interrupt edge every interrupt. The IOC feature handles that automatically since it interrupts on change - any change.

    The circuit in your link provides up/down count but still only x1 decoding, see the pink trace only pulses on the rising edge of the yellow trace, same thing for the green trace. It's effectively using only 25% of the encoders available resolution. A 720CPR encoder, when "properly" read will give you 2880 "pulses" per revolution.

    If that's enough resolution it's perfectly fine but in that case I probably wouldn't use interrupts to count the pulse. I'd have hardware timer/counters in the PIC count the pulses and periodically update the position register.

    /Henrik.

  3. #3
    cbrun17's Avatar
    cbrun17 Guest


    Did you find this post helpful? Yes | No

    Default Re: decoding quadrature encoders

    Hi Dave,

    I did see this article, however, as Henrik mentioned, the circuit described does not interpret quadrature encoding (grey code) to gain accurate angle measurement. I also looked at another solution using an LS7183 which does interpret the output to two separate clock signals (see datasheet here: http://www.lsicsi.com/pdfs/Data_Shee...083_LS7084.pdf), this looks promising if I can't successfully make my code work properly.

    I truly appreciate your suggestion.

    Chris

Similar Threads

  1. Quick thoughts: DT Ints with encoders
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 7th January 2010, 02:01
  2. PMDC SERVO MOTOR WITH quadrature encoder DRIVE ?
    By phoenix_1 in forum Schematics
    Replies: 37
    Last Post: - 22nd November 2009, 20:45
  3. 32-bit Quadrature Counter With Serial Interface
    By precision in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th June 2008, 03:49
  4. quad encoders
    By cpayne in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th March 2007, 18:49
  5. "momentary" IR decoding
    By sporker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th June 2005, 02:53

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