The invention generally relates to position measurement devices, and in particular to measuring positions with absolute encoders.
Position estimation is an important task in industrial automation, and similar applications. Devices, such as numerically controlled (CNC) machines, drill bits, robot arms or laser cutters, and assembly lines need position measurements. Feedback control often uses precision position measurements. It is desired to determine positions at high sampling rates to enable accurate feedback control.
Optical encoders are typically used to measure incremental or relative positions. A scale having regularly spaced marks is used along with a readhead including sensors to estimate the relative position between the marks. Incremental linear encoders can only measure the relative position within a period of the scale. A relative position encoder counts the number of scale periods traversed to determine the absolute position.
An absolute position encoder can determine the absolute position directly. Absolute position encoders are preferred because they do not require a memory and power to store the current position. In addition, absolute encoders provide absolute position at start up, while relative position encoders typically need to locate a beginning point to determine a current position at start-up, which takes time and may not be possible for some applications.
In a conventional absolute encoder, a unique pattern of marks, representing codes of one and zero bits, is used for each position. With one scale, a position change is determined when the bit pattern in the sensed code changes. In this case, the resolution of the position estimate is the same as that of the pattern on the scale, and may be insufficient.
To improve resolution of a incremental scale, one method uses multiple scales aligned in the detection direction with periodic scale patterns including opaque and transparent marks. One scale is mounted in the read head and the other is mounted on the moving part. The scales are illuminated from one side and a photodiode senses the light that passes through the two scales in series to the other side. As the scales moves relative to each other, the signal on the photodiode varies between a maximum value when the transparent marks in the two scales are aligned and a minimum value when the transparent marks on one scale are aligned with the opaque marks on the other. A demodulation procedure can then determine the phase θ of the signal, which is transformed into the relative position estimate. The relative position can be recovered at a higher resolution than the scale resolution. In some encoders, one of the scales can be replaced by a grating inside the readhead.
However, such encoders still only provide relative position. For absolute positioning, linear encoders need additional scales, which increases the cost of the system. Such hybrid encoders infer incremental and absolute position using separate scales. In such designs, yawing of the readhead can result in errors. In addition, such encoders need two readheads, one for sensing incremental positions precisely, and another for sensing absolute positions.
A small number of photodiodes in the readhead of linear encoders need precise radiometric calibration of the sensed signal. Often, non-linearity in the signals results in a bias, and sub-divisional ripple errors during the phase estimation.
One absolute linear encoder uses one scale, and a single readhead. It has two separate mechanisms for reading incremental and absolute positions. The incremental positions are obtained using a filtering readhead technique, which utilizes a grating inside the readhead for generating fringes that are sensed in a photodiode array. The absolute positions are sensed using a different mechanism, which uses an imaging lens and a detector, i.e., a linear image sensor.
To reduce the cost of an absolute linear encoder, some systems use only one scale and only one readhead with a single sensing mechanism. One such system is described in the related application. That system avoids two sensing mechanisms for reading incremental and absolute position. For a real-time implementation, a fast procedure is required to decode the position from the sensed data. The related application describes a system and method for measuring positions that use a procedure based on a correlation of the sensed signal with a reference signal generated using an underlying absolute code. That requires generation of the reference signal for every position. However, correlation based procedures are slow, and cannot achieve rates of several KHz with off-the-shelf low cost digital signal processors (DSPs).
Some procedures interpolate sine or cosine signals for demodulation of the periodic signal from a relative optical encoder into a high-resolution position signal. However, those procedures only work for scales in which the marks on the scale are structured to maintain correlation with fixed sine and cosine signals as described herein.
It is desirable to only use off-the-shelf DSPs or small field programmable gate arrays (FPGA) or application specific integrated circuits (ASICs) to determine the position information from the sensed signal to reduce cost. Therefore, a method that can yield high precision position information at high speed, and can be implemented on low cost chips is required.
The embodiments of the invention provide a method for determining high precision position estimates for absolute single track encoders. The high precision of the method can achieve absolute accuracy within a micron. The high speed of the method achieves rates of several KHz using a conventional digital signal processor (DSP).
The embodiments of our invention provide a method and system for determining high precision position estimates for absolute single track linear encoders.
Absolute Scale
The scale can include a sequence of light reflecting 101, and non-reflecting 102 marks. Each mark is B microns long, which defines a resolution of the scale.
Let the length of each mark be B (microns). In one embodiment, B is 20 microns. A readhead 110 is mounted at some distance and parallel to the scale. The readhead includes a sensor 111, a (LED) light source 112, and an optional lens. The sensor can be a detector array of N sensors, e.g., N is 2048. The array can be complementary metal-oxide-semiconductor (CMOS) or charge coupled device (CCD). The readhead also includes a conventional digital signal processor 115 connected to sensor.
The marks can alternate between opaque and transparent or between reflective and transparent, depending on a relative position of the light source with respect to the readhead.
To achieve relatively high information density on the scale, subsequences are used. Every subsequence has a finite length and is unique, e.g., a de Bruijn sequence 103. A k-ary de Bruijn sequence B(k, n) of order n is a cyclic sequence of a given alphabet with size k, for which every possible subsequence of length n in the alphabet appears as a sequence of consecutive characters exactly once. When a de Bruijn sequence is truncated from front or back, the resulting sequence also has the uniqueness property with the same n.
For a scale with a one meter length with a mark length of B=20 microns, a 50000 bit long sequence is required. A longer sequence of length 216=65536 with an order of 16 can also be used. This sequence can be truncated from the front or back to obtain a 50000 bit sequence. It should be noted that any non-periodic sequence with non-repeating subsequences can be used with this method.
The detector array requires a field of view (FOV) of at least n bits for decoding to be possible. For the mark length B=20 microns and using the de Bruijn sequence of order 16 requires that the FOV is 16×20=320 microns on the scale. In one embodiment, the field of view is designed to be 1-2 mm to have the desired accuracy.
For Nyquist sampling, each bit of the sequence, i.e., each mark of the scale, maps to at least two pixels in the linear detector array. This requires at least 16×2=32 pixels, which is well-within the number of pixels in conventional sensors. To handle optical aberrations, such as defocus blur, the number of pixels per mark can be increased.
The marks on the example scale are arranged linearly. Other configurations of the marks on the scale are also possible, for example circular, oval, serpentine, and the like. The only requirement is that the marks are arranged sequentially for a particular code or non-periodic sequence.
To handle bit errors, encoding schemes, such as Manchester encoding, can be applied to the de Bruijn sequence. This doubles the required bits for decoding. In other embodiment, the de Bruijn sequence can be designed to enable fast position decoding with a smaller look-up table.
In some applications, the recovered resolution of the position should be substantially higher than the scale resolution of B. For example, the accuracy requirement could be 0.5 micron, 40 times smaller than B (20 microns). Thus, we require a super-resolution method that can resolve the position within each mark on the scale. This is referred to as high precision (fine) positioning
It is important that the high precision positioning can work with any scale pattern, such as the absolute scale. This enables the encoder to be useful in variety of applications.
Given a 1D sensor with N, s, a 1D representative signal of the scale is acquired. The length of a block of pixels corresponding to each black or white mark on the scale is F, where F depends, optionally, on a lens magnification. Thus, a mark is B microns in length, which corresponds to F pixels.
Ideally, the intensity (amplitude) of the reflecting (or transparent) region of scale is large, e.g. 200 for a gray scale of 255 levels for an 8 pixel sensor, and the intensity of the non-reflecting region of the scale is be small, e.g. zero on the gray scale.
As shown ideally in
As shown in
One disadvantage of that scale is that it can include extended repetitions of 0. Without edges, it is impossible to estimate position. Gribble simply looks at a longer signal, which must then contain some edges.
Instead one can adopt some other substitution like 0→01 and 1→10, e.g., a “Manchester code” that ensures a good proportion of edges everywhere in the signal as shown in
In practice, several factors result in deviation of the scale image. These include but are not limited to:
For accurate positioning, it is important that the method is resilient to these factors.
An arctangent method is one known method for position estimation using an incremental scale. The arctangent method is based on estimating a phase θ of the signal using a demodulation technique. The sensed signal is multiplied by a sine wave and a cosine wave of the fundamental carrier frequency. The result is low pass filtered and averaged. Then, the arctangent of the ratio of two values is used to determine the phase of the sensed signal. The phase can be converted to the position using the scale resolution B according to
For an absolute scale, this phase can be converted into a position correction and added to PA: P=PA+Pi.
However, that method works only on a scale that has a fundamental carrier frequency caused by correlated marks like an incremental scale or the scale used by Gribble in which all the rising edges are spaced by integer multiples of 2B. Without, power at a fundamental carrier frequency, the arctangent method cannot work because the sine and cosine signals are not consistent along the scale.
Thus, a high precision positioning method that can be used for general absolute scales with non-periodic sequences that may lack a fundamental carrier frequency is required.
Method Description
Position Correction for General Absolute Scale
For general absolute scales, the position correction can be defined using a reference distance in sensor pixels D 501 of the signal with respect to the start of the signal 502, as shown in
The coarse position PA is obtained by matching the underlying code sequence with the known general, non-periodic sequence. The coarse position can be obtained using a pre-determined look-up table. The final absolute position P is the sum of the coarse position PA and the position correction Pi, P=(PA+Pi).
To estimate the absolute position, we estimate D, F and the underlying sequence from the sensed 1D signal S.
Detection of Edge Positions
A threshold m can be subtracted from S and the zero-crossings of the resulting signal (or threshold-crossings) correspond to the edges in the original scale. The threshold can be pre-determined, e.g., for 128 of the gray level, or estimated from sensed signal S, e.g., an average gray value of S. The threshold can be fixed, or refined along with phase and frequency. The signal can be filtered before detection of threshold-crossings to reduce the effect of noise as in conventional edge-detection techniques.
First, we describe the general case, where m is obtained from the signal S and is refined to a higher resolution along with D and F.
The initial value of m is estimated from the signal S. Because the gain of the signal S is unknown, a pre-determined value, such as 128, is incorrect. Therefore, the initial value of m is selected to be an average intensity (amplitude) of the signal S
where N is the number of samples of the signal S.
Detection of Rising Edges
Pixel positions for rising edges are determined such that the signal value S is less than m for the current pixel, and greater than m for the next pixel. Let p be such a pixel such that
S(p)<m, and S(p+1)>m.
Then, the pixels p correspond to the rising edges of the signal.
As shown in
z=a×m+b.
The slope a and intercept b are
respectively, z(1) is determined at sub-pixel resolution using the above equation. Note that a and b can also be estimated using more points near p to achieve higher precision at the expense of more computation.
Detection of Falling Edges
As shown in
S(p)>m, and S(p+1)<m.
The pixels p correspond to the falling edges of the signal.
Using the two pixel values S(p) and S(p+1), a line 801 is fitted to the falling edge, and the slope a and intercept b of the line is determined. The second threshold-crossing z(2) 802 is the spatial location corresponding to the intensity value of m on the line
z=a×m+b.
The slope a and intercept b for falling edges are the same as above.
If there are K threshold-crossings, then z(i) denotes the ith threshold-crossing. Similarly, a(i) and b(i) denote the slope and intercept for the ith threshold-crossing
z(i)=a(i)×m+b(i), for i=1 to K.
Let dz(i)=z(i+1)−z(i), for i=1 to K−1, be the pixel difference of subsequent threshold-crossings. Using the difference of threshold-crossings, an approximate value of F is given by the minimum of dz(i). Similarly, an approximate value of D is obtained as the first threshold-crossing D≈z(1)=a(1)m+b(1).
Joint Refinement of D, F and in
After estimating approximate values of D and F, information from all threshold-crossings are used to refine the coarse values to a higher resolution.
The position correction, Pi, is dependent on D, the offset between the PA and the system of edges. A joint estimation of D, F and m is performed to refine the value of these variables. This estimation uses the idea that the difference between successive threshold-crossing dz(i) is an integer multiple of F
dz(i)=k(i)F,
where k(i) is an integer.
For the relative scale, k(i) are all equal to 1 because edges occur after every F pixels. However, for the absolute scale, the values k(i) depend on the non-periodic sequence, and change with every position of the readhead as shown in
To perform the joint refinement of D, F and m, k(i) are determined using the coarse value of F and threshold-crossings
A linear system is formed to refine D, F and m and optimize the fit of this simple model to the observed edge locations that necessarily are perturbed by various sources of noise. Ideally, each threshold crossing is an integer multiple of F away from the first threshold-crossing D.
Thus each threshold-crossing, z(i), can be written in terms of D, F and m as
With
the number of bits between the ith and the first threshold-crossing is c(i). Thus, the ith threshold-crossing is c(i) times F from the first threshold-crossing
z(i)=D+Fc(i).
Writing z(i) in terms of a(i) and b(i), we obtain
a(i)m+b(i)=D+Fc(i), and
D+Fc(i)−a(i)m=b(i).
Writing the above equation for all K threshold-crossings, we can obtain a K by a three linear system
Solving the linear system provides the refined values of D, F and m. The linear system can be solved using conventional techniques.
Using the refined values of D and F, the position correction Pi can be determined. The sequence k(i) provides the underlying code in the current signal, and can be used to determine the absolute position PA using the look-up table of the non-periodic sequence. The final position P is PA+Pi.
Variations
The method can iterate over the steps of threshold-crossing detection, and solving the linear system. The refined m can re-determine the threshold-crossings, the slopes a(i), and intercepts b(i) of the fitted lines followed by the refinement of D, F and m, and so on.
Instead of initializing m as the average value of the signal S, m can be determined by averaging high intensity pixels and low intensity pixels separately, followed by taking their averages. Any other way of determining m using the signal S is within the scope of the invention.
Other edge detection methods, such as the Sobel operator, Canny operator or any other edge detection method can be used to determine the edge locations in the signal, without the need for determining m. The determined edge locations can be used to refine D and F by solving a K by two linear system
In this case, only D and F are refined.
While the above embodiment describes refining D, F and m to higher resolutions, another embodiment fixes m at the initial value, and only refines D and F. In this case, the threshold-crossings z(i) are determined using the initial value of m as a(i)m+b(i). The refinement of D, F requires solving a K by 2 linear system, as described above. This is useful when the initial value of m is sufficient, or fewer computations are desired.
In the above embodiments, D, the offset of the edge grid from the start of the signal is defined with respect to the first threshold-crossing. However, D can be defined with respect to any threshold-crossing. In particular, the threshold-crossing nearest the center of the signal can be used to describe D and to solve the linear system. In general, the threshold-crossing used to define D could change with the each new position.
In some cases, the plane of the scale can be rotated with respect to the readhead. In such cases, the signal sensed from the scale can have a uniform or non-uniform scaling factor from one end of the sensor to the other end. This scaling factor can be incorporated into the above method by appropriately compensating the determined threshold-crossings.
Optical distortions, such as radial distortion due to the lens, cause shifting of the threshold-crossings. Such distortions can be handled by a calibration step, where the estimated threshold-crossings are appropriately shifted before solving the linear system to compensate for the radial distortion.
Optical distortions can also be handled by augmenting the linear system to have additional parameters. For example, the equation can be augmented to have terms dependent on square of c(i)
a(i)m+b(i)=D+Fc(i)+α1c(i)2+α2c(i)3.
Using this equation, a linear system with five variables (m, D, F, α1 and α2) can be constructed. The parameters α1 and α2 model the deviation of threshold-crossings from the original linear model and can handle optical distortions in the captured image. Additional parameters depend on powers of c(i) or a(i) can be added depending on the specific application.
Thermal expansion of the scale leads to a change in F, i.e., pixels per-bit. A varying expansion across the field of view shifts the threshold-crossings according to the expansion coefficient. The shift in threshold-crossings can be determined during calibration. During run-time, threshold-crossings can be appropriately shifted for compensation, before solving the linear system.
It should be understood that other practical sensing issues can be handled by appropriate modification of the above method, and are within the scope of the invention. For example, other non-linearities in the signal can lead to shift in threshold-crossings, and can be appropriately compensated.
Embodiments of the invention also apply to a relative scale to obtain the position correction Pi. In case of relative encoders, the method can be used to obtain Pi and the coarse position PA can be obtained using other known methods, such as using a second scale or a digital register that keeps a running count of the bits as the scale 100 passes by the sensor 110.
The invention is also applicable to single-track rotary encoders. If the non-periodic de Bruijn sequence is used, then other configurations of the scale can be used, for example, a circular, serpentine, or other arbitrary shapes that conform to the positions to be determined.
Prior art methods are typically based on demodulation techniques, and require a reference sine and cosine signal for demodulation in relative encoders, or a reference waveform depending on an underlying code for absolute encoder as in the related application. This invention does not require generating such a reference signal.
Some prior art methods use a two step process. In the first step, the fundamental frequency is estimated. In the second step, the reference signals are generated using the fundamental frequency. The reference signals are used for demodulation or position decoding. However, the errors in the first step lead to frequency mismatch between the sensed signal and the reference signal. This can lead to significant phase errors. Gribble attempts to address those errors within the framework of arctangent methods.
This invention does not require reference signals. In addition, the bit width, F, and edge offset, D, are estimated jointly, thus significantly reducing the position errors in estimation of Pi.
The invention works independently of the gain of the sensed signal and can recover the position estimate without the knowledge of the gain of the sensed signal.
Although the invention has been described by way of examples of preferred embodiments, it is to be understood that various other adaptations and modifications can be made within the spirit and scope of the invention. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention.
This is a Continuation-in-Part Application of U.S. application Ser. No. 13/367,549 “Method for Estimating Positions Using Absolute Encoders,” filed by Agrawal et al., on Feb. 7, 2012, and incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 13367549 | Feb 2012 | US |
Child | 14850246 | US |