LS7266 Encoder IC Problem

Discussion in 'The Projects Forum' started by valgrind, Sep 5, 2014.

  1. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0
    Hello,

    I use following stuff for reading motor position:

    -LS7266 encoder chip,
    -Arduino Mega 2560,
    - A motor with encoder.

    I can initialize and read the chip properly when I turn the shaft of the motor at very low speed. But at relatively higher speed, the value of the chip counter register does not increment properly.

    This situation does not make sense according to me. So I decided to ask to you. Thanks for any valuable suggestions in advance.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,370
    Put some numbers into your situation. At what rotational speeds does the counter miscount?
    Do you have access to an oscilloscope in order to observe the electrical signals?
     
  3. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0
    - Of course you want me clear about testing speeds, but I turn the motor shaft with my hand :). so you assure you that speed of the motor during my experiments is very low.
    - Yes I observed encoder output pulses with oscilloscope. Signals are at kHzs level.
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,370
    Not good enough.
    What does "Signals are at kHzs level" mean?
    What is the amplitude and shape of the signals?
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,570
    2,381
    What is the nature of the encoder and the type of output? Quadrature incremental? open collector? RS485 differential?
    Counts/turn?
    Max.
     
  6. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
    Hello,

    Is the attached PDF the chip you are using?

    Bertus
     
  7. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0
    Yes, a SOIC. I have 5 chips. I tried all of them. I am suspcious that all are damaged. But I can initialize them appropriately. I tried 4093- schmit trigger- as buffer for A anb B inputs of the chip. But it did not work!
     
  8. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0
    It is quadrature incremental.
     
  9. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0
    They looks well, rectangular . and amplitude is near 5 V
     
  10. RichardO

    Well-Known Member

    May 4, 2013
    1,238
    385
    Have you set the filter clock frequency? Maybe you have it set to filter too much.

    From the data sxheet:

    Filter Clock Prescalers: XPSC and YPSC
    Each PSC is an 8-bit programmable modulo-N down counter, driven by the FCK clock. The factor N is down loaded
    into a PSC from the associated PR low byte register PR0. The PSCs provide the ability to generate independent filter
    clock frequencies for each channel. The PSCs generate the internal filter clock, FCKn used to
    validate inputs XA, XB, YA, YB in the quadrature mode.
    Final filter clock frequency fFCKn = ( fFCK/(n+1) ) , where n = PSC = 0 to FFH. For proper counting in the quadrature
    mode, fFCKn ³ 8fQA (or 8fQB), where fQA and fQB are the clock frequencies at inputs A and B. In non-quadrature mode
    filter clock is not needed and the FCK input (Pin 2), should be tied to VDD.
     
  11. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0

    Arduino generates ~31MHz. clock. I set PSC=4. So it should work.
     
  12. RichardO

    Well-Known Member

    May 4, 2013
    1,238
    385

    I used a version of this part a _very_ long time ago and it was painful to get working. It is hard to tell if you are reading and writing the correct registers. You may have to devise tests to convince yourself that you are in the correct operating mode.

    I agree that your setting should be plenty good for encoder pulses even in very high "kilohertz" frequencies. I am assuming from your description that the counting stops at some unknown high quadrature frequency. Knowing the frequency range over which the counter works correctly would be very useful information. I think you will need to measure this frequency.

    I see a couple of possible ways of doing this...

    Try applying quadrature signals starting at a the low frequency that works and increase the frequency until the counting stops.

    Alternately, you could lower the FCK frequency enough that even very low frequency quadrature pulses will quit working.
     
  13. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0

    I have fixed the problem partly, but it should have not been fixed. Because I set PSC=0 so FCKn frequency is 31 Mhz although the LSI datasheet(chip manufacturer is LSI) says maximum FCKn=17Mhz :).

    I tried this setting because nothing had left.
     
  14. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0
    But it seems this setting didn't work too.
     
  15. valgrind

    Thread Starter New Member

    Sep 5, 2014
    9
    0
    Hello,

    I found the problem: Arduino cant create high frequencies that the chip needs such as 10 Mhz. I achieved to create 2 Mhz. clock with arduino but both frequency and quality of signal are not sufficient.

    The chip has single clock input. Do you have any idea to provide 10 Mhz. clock to the chip?
     
  16. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
Loading...