• AVR Freaks

Hot!18F4431 QEI 360 Degrees opto encoder

Author
Camerart
Starting Member
  • Total Posts : 50
  • Reward points : 0
  • Joined: 2013/04/12 02:19:40
  • Location: 0
  • Status: offline
2020/02/29 03:43:49 (permalink)
0

18F4431 QEI 360 Degrees opto encoder

Hi,
I've programmed an 18F4431 PIC for QEI.  The incremental encoder has 3600 vertical lines/revolution with both QEA and QEB.
I can get the output to be 0 to 359 when the oncoder is turned 90Degrees.
How can I set it to 0 to 359 Degrees for 1x revollution?
I've checked the Data sheet, but haven't found the answer.
Cheers, Camerart.
#1

5 Replies Related Threads

    Mysil
    Super Member
    • Total Posts : 3666
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: 18F4431 QEI 360 Degrees opto encoder 2020/02/29 04:33:39 (permalink)
    +1 (1)
    Hi,
    What about dividing by 4 in software,
    or let resolution be 0 thru 3599, and divide by 10 in software.
     
    The QEI module in that device have a multitude of options in hardware,
    and it is quite impossible to know what you have done, without seeing the code you have made.
     
        Mysil
    #2
    Camerart
    Starting Member
    • Total Posts : 50
    • Reward points : 0
    • Joined: 2013/04/12 02:19:40
    • Location: 0
    • Status: offline
    Re: 18F4431 QEI 360 Degrees opto encoder 2020/02/29 05:10:57 (permalink)
    0
    Hi M,
    I tried dividing x4 in software, and 0 to 3599, but I don't think I did it correctly, as one rev never gave 0 to 359.
    Here is the prorgam I'm using.
    C
    #3
    Camerart
    Starting Member
    • Total Posts : 50
    • Reward points : 0
    • Joined: 2013/04/12 02:19:40
    • Location: 0
    • Status: offline
    Re: 18F4431 QEI 360 Degrees opto encoder 2020/03/01 17:01:43 (permalink)
    0
    Hi again,
    I'm using the 18F4431 PIC, and it's QEI hardware, I think I may have done it before, but with software.
    Does nobody know how to do this using it's hardware?
    C
    #4
    Camerart
    Starting Member
    • Total Posts : 50
    • Reward points : 0
    • Joined: 2013/04/12 02:19:40
    • Location: 0
    • Status: offline
    Re: 18F4431 QEI 360 Degrees opto encoder 2020/03/03 01:16:26 (permalink)
    0
    Hi,
    BIG APOLOGIES for anyone thinking about this.
    The encoder does not have 3600 vertical lines, but 360x4 = 1440.
    C.
    #5
    Camerart
    Starting Member
    • Total Posts : 50
    • Reward points : 0
    • Joined: 2013/04/12 02:19:40
    • Location: 0
    • Status: offline
    Re: 18F4431 QEI 360 Degrees opto encoder 2020/03/15 14:03:15 (permalink)
    +1 (1)
    Hi M,
    After realising that I should have said 1440 not 3600, I divided by 4, and it works, thanks.
    C.
    #6
    Jump to:
    © 2020 APG vNext Commercial Version 4.5