Quad encoder problems


Closed Thread
Results 1 to 40 of 52

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Hi sayzer,

    Thanks for the reply.

    Dont I need direction if I want to know the exact position? 36 slots = 10deg per slot for a total of 360deg. I need it to count up to 36 in one direction until one revoluton where it returns to 1. And count down to 1 in the other direction until one revolution where it returns to 36.

    In other words I need a value between 1 and 36 corosponding to the exact slot it is currently on.

    Smitty

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by smitty505000
    ...I need it to count up to 36 in one direction until one revoluton where it returns to 1...
    Smitty
    As you know, usually in rotary encoders, it won't return to 1. It will always give you ticks as long as it rotates and you count the ticks. You need to use "Reference" signal out of the encoder which gives you a single tick only at the exact same point per revolution. When you get this tick then you know that "one revolution" is complete.

    As you see, you need to also count or check this tick. The safest way, I think, would be to use TMR0 to count reference signal, and TMR1 to count one of the other signals (this is where you do not need to know the direction). The reason why I point out Timer modules is that they work in the background.


    If you had a choice in which your encoder turned one direction and it was enough for you, then you could solve your problem here. But, you say you need both directions. In this case, you will have to use a PORT to read the encoder.

    I added some links to some posts in this forum. Pls check them and see what kind of problems others encountered and how they approach to the similar issues.

    1. http://www.picbasic.co.uk/forum/show...rotary+encoder
    2. http://www.picbasic.co.uk/forum/show...rotary+encoder
    3. http://www.picbasic.co.uk/forum/show...rotary+encoder
    4. http://www.picbasic.co.uk/forum/show...rotary+encoder

    mister_e has a clever approach to a similar encoder issue (Item 4).


    Regards.


    Edit: What you say kind a sounds that you may actually not need the direction.


    ------------
    Last edited by sayzer; - 9th September 2006 at 20:03.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Quadrature encoder and ASM Interrupts. questions..
    By godfodder in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th March 2013, 14:45
  2. Instant Int and encoder (Elect. Gearing)
    By boroko in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 29th November 2009, 02:29
  3. encoder HEDL 5540
    By kutsi in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th June 2007, 14:00
  4. quad encoders
    By cpayne in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th March 2007, 17:49
  5. encoder wowes
    By wallaby in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 6th December 2005, 21:56

Members who have read this thread : 0

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