LS7266 Encoder IC Problem

Thread Starter

valgrind

Joined Sep 5, 2014
9
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.
 

MrChips

Joined Oct 2, 2009
30,824
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?
 

Thread Starter

valgrind

Joined Sep 5, 2014
9
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?
- 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.
 

MrChips

Joined Oct 2, 2009
30,824
- 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.
Not good enough.
What does "Signals are at kHzs level" mean?
What is the amplitude and shape of the signals?
 

MaxHeadRoom

Joined Jul 18, 2013
28,700
What is the nature of the encoder and the type of output? Quadrature incremental? open collector? RS485 differential?
Counts/turn?
Max.
 

Thread Starter

valgrind

Joined Sep 5, 2014
9
Hello,

Is the attached PDF the chip you are using?

Bertus
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!
 

RichardO

Joined May 4, 2013
2,270
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.
 

Thread Starter

valgrind

Joined Sep 5, 2014
9
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.

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

RichardO

Joined May 4, 2013
2,270
Arduino generates ~31MHz. clock. I set PSC=4. So it should work.

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.
 

Thread Starter

valgrind

Joined Sep 5, 2014
9
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.

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.
 

Thread Starter

valgrind

Joined Sep 5, 2014
9
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?
 
Top