|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Help Programming a Quadrature Encoder
So just to be sure, if phase B lead is forward, then phase B lag is reverse?
|
|
#2
|
||||
|
||||
|
Re: Help Programming a Quadrature Encoder
Yup!
|
|
#3
|
||||
|
||||
|
Re: Help Programming a Quadrature Encoder
That could be true. But, if one encoder is on the right side and one on the left, they could be different. That is not really a problem, just modify your ISRs to meet your needs.
|
|
#4
|
|||||
|
|||||
|
Re: Help Programming a Quadrature Encoder
You mean there's a difference between putting the encoder on the left side or the right side of the gear/wheel?
|
|
#5
|
||||
|
||||
|
Re: Help Programming a Quadrature Encoder
What Bill is getting at is that while the A signal of the encoder on the left side of the drive train might be leading, the encoder on the right side of the drive train might be lagging. You can check the signals coming out of the encoders with an oscilloscope, or what I usually do is just hook it up, look at the encoder counts in a terminal, and reverse the sign bit if necessary.
|
|
#6
|
||||
|
||||
|
Re: Help Programming a Quadrature Encoder
Generally the data sheet for the encoder will specify which signal leads which.
For example, it may say... A leads B in a clockwise rotation. So if it's turning clockwise then A will come first followed by B. Conversely if it's turning counter clockwise the B will come first followed by A. I highly recommend downloading and reading this excellent white paper on quadrature encoders. It explains the A versus B, and provides mostly functional code. The sample code does have 2 bugs, but you should be able to find them. If not PM me. Our team has been using this methodology for the last 2 or 3 seasons very successfully. http://www.chiefdelphi.com/media/papers/1490 Read it, I think you will see the lights go on in your head and you'll have a much better understanding. |
|
#7
|
||||
|
||||
|
Re: Help Programming a Quadrature Encoder
Quote:
Again, this is really simple to handle in the ISR. For the same direction of travel make sure both encoders are incrementing, and decrementing for the opposite direction. Read through Kevin Watson's encoder code, this is all spelled out clearly. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Quadrature shaft encoder source | billbo911 | Kit & Additional Hardware | 7 | 06-01-2008 19:52 |
| Encoder help | E_Unit | Electrical | 5 | 16-02-2007 11:02 |
| Turning a gear-tooth sensor into a quadrature output encoder | Jared Russell | Programming | 4 | 18-01-2006 22:19 |
| Encoder help | Windward | Programming | 21 | 14-01-2006 15:10 |
| shaft encoder help | stephenthe1 | Programming | 2 | 03-12-2004 16:09 |