Using a optical coder


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi debutpic,

    Here's one way to do it.
    Code:
    Pulse_Rev  CON  300  ' Pulses per Rev
    Dist_Rev   CON  500  ' Distance per Rev in mm*100
    Position   VAR  WORD
    
    Position = Compteur * Dist_Rev
    Position = DIV32 Pulse_Rev
    And, Ingvar will be along shortly to show you how to do it with "*/"
    <br>
    Last edited by Darrel Taylor; - 27th December 2005 at 11:24.
    DT

  2. #2
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    he he It work fine Darrel !!

    perhaps a another question,the optical coder has only one output TTL.
    I count the pulses with the pin RB0/INT but how to know if it turns in a direction or the other?

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Unless you have some other way of knowing which way it's going, I don't think you can.

    If it needs to keep track of absolute position in both directions, you'll probably need a "Quadrature Encoder".
    <br>
    DT

  4. #4
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Talking

    I try hard not to ......

  5. #5
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hello all

    1) Which is the method of programming used for to know the directions of rotation with these optical coders?

    2)the next opticals coders agree?

    thank's
    Attached Images Attached Images  

  6. #6
    Join Date
    Oct 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default

    2) I don't think the encoders in the picture are direction sensing (Quadrature). You need an encoder with two output signals, out of phase with each other.

    1) With a quadrature signal (phase a and phase b, offset by 90 degrees) you can tell direction by watching which phase goes high first. Count pulse for distance, just like you are doing now. Google quadrature encoder ...all kinds of info available

    You can get "absolute" encoders, which give a unique bit pattern for each position of rotation. I think there are some encoders which give a step and direction signal also, but I might be thinking of stepper drivers!
    Last edited by dmairspotter; - 28th December 2005 at 15:50.

  7. #7
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Ok but which is the fonction of green wire called "index"?

  8. #8
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by debutpic View Post
    Hello all

    1) Which is the method of programming used for to know the directions of rotation with these optical coders?

    2)the next opticals coders agree?

    thank's
    The encoder in the photo is not a quadrature encoder. quadrature encoders have two channels (usually called A and B) and sometimes also an index as full revolution reference, and as you see (read) in the photo, it has only the full revolution reference (index) and 1 channel (channel A). you can get nice and cheap motors with quadrature encoders in the surplus market.

  9. #9
    Join Date
    Jul 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default My 2 cents

    You may want to have a look at US Digital website, to find appropriate encoders.

    I would also suggest you to use PIC18FXX31 family. They have built-in quadrature encoder interface module with distance, direction and speed. Much easier to deal with and with extra features like noise protection too. I'm personally using PIC18F4331 and it work great with stepper + quad. encoder.

    Hope this can help!

    J-P

    Huh? Last question was 8 months ago ? (Ooooooops)
    Last edited by GrandPa; - 13th October 2007 at 15:41.

  10. #10
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by debutpic View Post
    Hello all

    1) Which is the method of programming used for to know the directions of rotation with these optical coders?

    2)the next opticals coders agree?

    thank's
    That one in the photo won't let you get rotation direction, has only one channel and that doesn't output quadrature code.

Similar Threads

  1. 2 Beam Optical Pulse Generator
    By WOZZY-2010 in forum Schematics
    Replies: 8
    Last Post: - 6th April 2010, 04:03
  2. Home made optical rencoder issues
    By Elnino in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2009, 22:17
  3. USB Optical mouse as motor encoder
    By RodSTAR in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 24th August 2008, 15:09
  4. optical voice link
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th May 2008, 21:11
  5. Using the optical sensor from a ball mouse
    By lsteele in forum General
    Replies: 5
    Last Post: - 5th September 2007, 16:45

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