Method for decoding a quadrature encoded signal
First Claim
1. A method for decoding a first channel and a second channel wherein each of the first and second channels is output by a quadrature encoder, comprising:
- calculating a position associated with the first and second channels in response to an encoder independent interrupt;
comparing a speed associated with the first and second channels to a predetermined threshold; and
enabling edge-triggered interrupts corresponding to the first and second channels if the speed is below the predetermined threshold.
22 Assignments
0 Petitions
Accused Products
Abstract
A method of decoding a quadrature encoded signal where position tracking is implemented which decouples the position calculations from the encoder edges. In one embodiment of the present invention, a uni-directional pulse accumulator is used to count encoder edges, and a periodic interrupt timer is used to update the position information, where interrupts are generated independent from encoder edges. At slow speeds, the mode switches to monitor each encoder edge to check for direction reversal without requiring position information. This decodes bi-directional quadrature position information using a uni-directional counter and a count compensation method for resolving changes in direction.
59 Citations
31 Claims
-
1. A method for decoding a first channel and a second channel wherein each of the first and second channels is output by a quadrature encoder, comprising:
-
calculating a position associated with the first and second channels in response to an encoder independent interrupt;
comparing a speed associated with the first and second channels to a predetermined threshold; and
enabling edge-triggered interrupts corresponding to the first and second channels if the speed is below the predetermined threshold. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
determining whether a direction change occurred in response to an edge-triggered interrupt; and
if the direction change occurred, calculating a change in position and updating a direction corresponding to the first and second channels.
-
-
3. The method of claim 2, wherein calculating the position associated with the first and second channels uses the change in position.
-
4. The method of claim 2, wherein determining whether the direction change occurred comprises determining a state corresponding to the first and second channels.
-
5. The method of claim 2, further comprising:
if a plurality of direction changes occurred, calculating a change in position corresponding to each direction change and updating a direction corresponding to the first and second channels.
-
6. The method of claim 5, wherein calculating the position associated with the first and second channels uses the changes in position.
-
7. The method of claim 1, wherein the first channel is input to a uni-directional counter, wherein the uni-directional counter increments in response to one of a rising edge and a falling edge of the first channel.
-
8. The method of claim 7, wherein calculating the position associated with the first and second channels uses a value of the uni-directional counter.
-
9. The method of claim 7, wherein the uni-directional counter includes a pulse accumulator.
-
10. The method of claim 1, wherein the edge-triggered interrupts are triggered by the rising and falling edges of the first and second channels.
-
11. The method of claim 1, wherein the first channel and second channels are quadrature waveforms.
-
12. The method of claim 1, wherein the encoder independent interrupt is generated by a periodic interrupt timer.
-
13. The method of claim 12, wherein the periodic interrupt timer is programmed with a predetermined sample rate.
-
14. The method of claim 1, wherein calculating the position further comprises calculating the speed associated with the first and second channels.
-
15. A computer readable medium comprising a plurality of instructions for performing the method of claim 1.
-
16. A data processing system comprising the computer readable medium of claim 15.
-
17. A decoder for decoding a first channel and a second channel, wherein each of the first and second channels is output by a quadrature encoder, comprising:
-
a control unit;
an edge-triggered interrupt generator having a first input to receive the first channel and a second input to receive the second channel, and capable of being enabled to provide edge-triggered interrupts to the control unit;
an encoder independent interrupt generator coupled to provide encoder independent interrupts to the control unit;
a counter, coupled to the control unit, having an input to receive the first channel; and
a memory unit coupled to the control unit, comprising;
a first plurality of instructions for calculating a position associated with the first and second channels in response to an encoder independent interrupt, and a second plurality of instructions for enabling the edge-triggered interrupt generator if a speed associated with the first and second channels is below a predetermined threshold. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24)
a first timer coupled to receive the first channel and having an output to provide an edge-triggered interrupt corresponding to an edge of the first channel; and
a second timer coupled to receive the second channel and having an output to provide an edge-triggered interrupt corresponding to an edge of the second channel.
-
-
23. The decoder of claim 17, wherein the memory unit further comprises:
-
a third plurality of instructions for determining whether a direction change occurred in response to an edge-triggered interrupt; and
a fourth plurality of instructions for calculating a change in position if the direction change occurred.
-
-
24. A data processing system comprising the decoder of claim 17.
-
25. A method for decoding a first channel having a series of edges and a second channel having a series of edges, wherein each of the first and second channels is output by a quadrature encoder, comprising:
-
updating a uni-directional counter in response to the series of edges of the first channel;
calculating a position associated with the first and second channels in response to an encoder independent interrupt;
selectively enabling encoder dependent interrupts; and
adjusting a value corresponding to the uni-directional counter in response to the encoder dependent interrupts if the encoder dependent interrupts are enabled. - View Dependent Claims (26, 27, 28, 29, 30, 31)
determining whether a direction change occurred; and
if the direction change occurred, calculating a change in position and using the change in position to adjust the value corresponding to the uni-directional counter.
-
-
30. The method of claim 29, wherein if the direction change occurred, updating a direction corresponding to the first and second channels.
-
31. The method of claim 25, wherein the series of edges of the first channel includes rising and falling edges, and the uni-directional counter is updated in response to one of the rising and falling edges.
Specification