Claims
- 1. A method of calibrating an optical encoder, the encoder generating two analog quadrature signals, x, y, the method comprising:
a. generating a plurality of digital samples, xi, yi, of the analog signals x, y, i having integer values from one to an integer n larger than one; b. generating a plurality calibrated samples Xi, Yi, according to the equationXi=(xi+Oxi+Pi×yi)×GxiYi=(yi+Oyi)×GyiGxi and Gyi being scaling coefficients, Oxi and Oyi being offset coefficients, and Pi being phase coefficients; c. generating a plurality of magnitude Mi, and phase, Φi, samples according to the equationsMi={square root}{square root over (Xi2+Yi2)}5Φi=A TAN[YiXi], Mi and Φi defining one sample of a phasor Vi, according to the equationVi=Miexp(jΦi),j being the complex number square root of negative one and where Vi may be represented by a line segment having a first end and a second end, the first end lying at an origin of a two-dimensional coordinate system, the coordinate system defining an x axis and a y axis, the origin being located at an intersection of the x axis and the y axis, the second end being displaced from the first end by a length equal to the magnitude Mi, in a direction defined by a angle relative to the x axis equal to the phase Φi; d. providing initial values for the scaling coefficients, Gx1 and Gy1, the offset coefficients, Ox1 and Oy1, and the phase coefficients, P1; e. adjusting the values of the scaling coefficients, the offset coefficients, and the phase coefficients so that
Gxi+1 equals either Gxi or Gxi plus or minus an incremental adjustment, Gyi+1 equals either Gyi or Gyi plus or minus an incremental adjustment, Oxi+1 equals either Oxi or Oxi plus or minus an incremental adjustment, Oyi+1 equals either Oyi or Oyi plus or minus an incremental adjustment, Pi+1 equals either Pi or Pi plus or minus an incremental adjustment; the incremental adjustments being made so that a distance between the second end of a hypothetical phasor V′i and a circle is less than or equal to a distance between a second end of the phasor Vi and the circle, the circle having a pre-determined radius and being centered on the origin, the hypothetical phasor V′i being determined by the following equations:X′i=(xi+Oxi+1+Pi+1×yi)×Gxi+1Y′i=(yi+Oyi+1)×Gyi+1M′i={square root}{square root over (X′i2+Y′i2)}6Φi′=A TAN[Yi′Xi′]V′i=M′iexp(jΦ′i).
- 2. A method according to claim 1, wherein the coefficients Gxi and Oxi, are adjusted once while Vi lies in a half of the circle, and are not adjusted again until Vk lies in the other half of the circle, k being greater than i.
- 3. A method according to claim 1, the circle including a left half and a right half, the left half being left of the origin, the right half being right of the origin, wherein the coefficients Gxi and Oxi, are adjusted once while Vi lies in the left half of the circle, and are not adjusted again until Vk lies in the right half of the circle, k being greater than i.
- 4. A method according to claim 1, wherein the coefficients Gyi and Oyi, are adjusted once while Vi lies in a half of the circle, and are not adjusted again until Vk lies in the other half of the circle, k being greater than i.
- 5. A method according to claim 1, the circle including an upper half and a lower half, the upper half being above the origin, the lower half being below the origin, wherein the coefficients Gyi and Oyi, are adjusted once while Vi lies in the upper half of the circle, and are not adjusted again until Vk lies in the lower half of the circle, k being greater than i.
- 6. A method according to claim 1, wherein the coefficient Pi is adjusted once while Vi lies in a quadrant of the circle, and is not adjusted again until Vk lies in a different quadrant of the circle, k being greater than i.
- 7. A method according to claim 1, wherein the circle is a unit circle.
- 8. A method according to claim 1, wherein the values of the coefficients are adjusted according to the following table:
- 9. A processing apparatus for use with an optical encoder, the apparatus comprising:
a. a digital estimator for generating samples of phase, Φi, according to the equation 7Φi=A TAN[YiXi],Xi and Yi being samples of quadrature signals received from the encoder, i being an integer having values from one to an integer n; b. a fringe counter for generating a count, the count increasing by one every time the phase, when measured modulo two pi, crosses from a fourth quadrant of a unit circle to a first quadrant of the unit circle, the count decreasing by one every time the phase, when measured modulo two pi, crosses from the first quadrant of the unit circle to the fourth quadrant of the unit circle, the fourth quadrant extending from angles 3/2 pi to 2 pi, the first quadrant extending from angles zero to pi/2; c. a state generator that receives the count and the samples of phase Φi and generates in response thereto two burst output signals in A quad B format, each of the burst output signals being characterized at any point in time by either a high value state or a low value state, comprising:
an interpolator that generates an integer number representative of the count and the phase Φi; an accumulator that generates a running sum by counting transitions in the A quad B burst output signals; a comparator for generating a signed difference value representative of a difference between the integer number and the running sum; a burst generator that generates transitions in the A quad B burst output signals until the signed difference value is zero.
- 10. A processing apparatus according to claim 9, the samples of phase Φi being represented as binary numbers having Dmax bits, Dmax being a pre-determined integer, the integer number being represented as a binary number having d bits, d being a pre-determined integer, the integer number having D least significant bits and d minus D most significant bits, D being a user selectable integer that is greater than zero, less than d, and less than Dmax, the interpolator generating the integer number by setting the D least significant bits of the integer number equal to the D most significant bits of the phase Φi, and by setting the d minus D most significant bits of the integer number equal to the d minus D least significant bits of the count.
- 11. A processing apparatus according to claim 9, the samples of phase Φi being represented as binary numbers having Dmax bits, Dmax being a pre-determined integer, the integer number being represented as a binary number having d bits, d being a pre-determined integer, the integer number having D least significant bits and d minus D most significant bits, D being the smallest integer satisfying the equation
- 12. A method of processing signals generated by an optical encoder, comprising:
a. generating samples of phase, Φi, according to the equation 8Φi=A TAN[YiXi],Xi and Yi being samples of quadrature signals received from the encoder, i being an integer having values from one to an integer n; b. generating a count, the count increasing by one every time the phase, when measured modulo two pi, crosses from a fourth quadrant of a unit circle to a first quadrant of the unit circle, the count decreasing by one every time the phase, when measured modulo two pi, crosses from the first quadrant of the unit circle to the fourth quadrant of the unit circle, the fourth quadrant extending from angles 3/2 pi to 2 pi, the first quadrant extending from angles zero to pi/2; c. generating two burst output signals in A quad B format by:
generating an integer number representative of the count and the phase Φi; generating a running sum by counting transitions in the A quad B burst output signals; generating a signed difference value representative of a difference between the integer number and the running sum; generating transitions in the A quad B burst output signals until the signed difference value is zero.
- 13. A method according to claim 12, the samples of phase Φi being represented as binary numbers having Dmax bits, Dmax being a pre-determined integer, the integer number being represented as a binary number having d bits, d being a pre-determined integer, the integer number having D least significant bits and d minus D most significant bits, D being a user selectable integer that is greater than zero, less than d, and less than Dmax, the integer number being generated by setting the D least significant bits of the integer number equal to the D most significant bits of the phase Φi, and by setting the d minus D most significant bits of the integer number equal to the d minus D least significant bits of the count.
- 14. A method according to claim 12, the samples of phase Φi being represented as binary numbers having Dmax bits, Dmax being a pre-determined integer, the integer number being represented as a binary number having d bits, d being a pre-determined integer, the integer number having D least significant bits and d minus D most significant bits, D being the smallest integer satisfying the equation
- 15. A method of generating an index signal for an optical encoder, the encoder generating quasi-sinusoidal quadrature signals indicative of a position of a scale relative to a sensor head, the encoder also generating a window signal, the window signal being characterized by a high value whenever an index mark of the scale is aligned with the sensor head, the window signal being characterized by a low value whenever the index mark is not aligned with the sensor head, the method comprising:
a. setting a first number equal to the value of the phase when the window signal transitions from a low value to a high value; b. setting a second number equal to the value of the phase when the window signal transitions from a high value to a low value; c. if a difference between the first number and the second number is greater than pi and less than 3 pi, then setting a phase index equal to value that is between the first and second numbers; d. generating the index signal whenever the window signal is characterized by a high value and when the phase is substantially equal to the phase index.
- 16. A method according to claim 15, wherein the phase index is substantially equal to a median value between the first number and the second number.
- 17. A method according to claim 15, wherein steps (a), (b), and (c) are only performed when after receipt of a calibration command.
- 18. A method according to claim 17, including a step of providing an indication to a user when the window signal is characterized by a high value.
- 19. A method according to claim 18, wherein the step of providing an indication comprises activating a light source.
CROSS-REFERENCE SECTION
[0001] This application claims priority of provisional application 60/336,038 filed Nov. 2, 2001.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60336038 |
Nov 2001 |
US |