A Lens-array-based Measurement Technique For Spatial Angle

The accurate measurement of spatial angle is the key technology for the plane flatness and guide rail straightness detections. This paper presents a lens-array-based optical system and an analytical model for micro spatial angle measurement. In this system, a collimated light beam passes through a four-array-lenses arranged in pyramid shape and forms a regular array spots on CCD (Charge Coupled Device) sensor. The angels with respect to the axes of X, Y are calculated by analyzing the distance of these spots on the CCD, the distance between adjacent apertures on the lens array and the inclination angle between the lens array and the CCD. Using the Coordinate value of array spots on CCD, the angle around Z axis also can be calculated simultaneously. Finally, the accuracy of the proposed method is verified by comparing the measured results with the autocollimator, and it is shown that the proposed approach enabled to achieve RMS≤0.1″. Additionally, this measurement system which is consists of a laser source, lens arrays and CCD, compared with other methods, is smaller in volume and more convenient to carry.

unit is an unknown parameter, laser autocollimators with diffraction gratings can only be used to measure the relative angles. In this method [15], the femtosecond laser and diffraction grating are used as the measurement source and reflector, and the one-dimensional angular displacement can be accurately identified by using the light emitted by the reflector and the first-order diffraction beam of the femtosecond optical comb. Fresnel double prism can be used to make a compound interferometer. Under the background of double beam interference fringe, four beam interference patterns can be obtained, and then the Angle measurement or calibration can be realized by changing the relative axial position of the double prism relative to the shear direction. However, the measurement system of Fresnel prism is relatively complex, which limits the application of this method. These methods usually have the advantages of high sensitivity and precision, but their optical system is relatively complex, the system volume is large, the environmental adaptability is relatively poor, and generally can only measure the relative Angle of pitch or azimuth. In many engineering application fields, Angle measurement still has some key technologies that need to be further studied, such as real-time measurement, high precision, miniaturization, etc. Optical method is one of the effective ways to solve the problem of Angle measurement. In this paper, a micro spatial angle measurement optical system based on lens array is proposed. The system mainly consists of laser source, lens array and CCD. By this method, three angles of pitch, azimuth (yaw) and roll can be obtained simultaneously. To make the measurement, the collimating beam passes through a pyramid of four arrays of lenses that serve as emits, and the CCD forms an array of spots that serve as receivers. Then the digital image is processed to obtain the pitch Angle and yaw Angle of the transmitting end to the receiving end lattice, and the roll Angle of the incident beam can be determined by the rotation of the lattice on the CCD. Finally, the position Angle in three dimensional space can be obtained. The measuring system presented in this paper is portable and smaller in volume.

II. MEASUREMENT PRINCIPLE
In the measurement, the incident angle between the laser collimating beam and the receiving surface of CCD can be measured by combining the lens array with the CCD camera. As shown in Fig. 1, the lens arrays are positioned in front of the CCD receiver in a pyramidal arrangement. When the focal plane of the array lens is at a certain angle to the receiving surface of CCD, the distance between the array spots varies with the Angle of the incident beam. Therefore, the mathematical relationship between the array spot distance and the angle of incident beam can be established to measure the small angle. In this measurement method, two more system parameters are introduced than the traditional measurement method, that is, the inclination Angle between the focal plane of the array lens and the CCD receiving plane and the lens distance. This measuring system can be widely used in the engineering application field of Angle measurement.

Reducer
The motor (b) Schematic diagram of system application and structure FIGURE 1. Schematic diagram of the system structure As shown in Fig. 1(a), four lens arrays labeled 1 to 4 for measuring Angle information in three-dimensional space are symmetrically distributed in horizontal and vertical directions. The lens arrays 1 and 3 are distributed in the horizontal direction and the rest are distributed in the vertical direction. The Angle between each lens array and the CCD receiving surface is equal, and the Angle between the focal plane and the CCD surface is equal. Lens arrays 1 and 3 in the horizontal direction are used to measure the Component of incident Angle in the X direction, and other lens arrays 2 and 4 in the vertical direction are used to measure the Component of incident Angle in the Y direction. As shown in Fig. 1(b), the application scenario is the detection of deviations in axis pairs. The transmitting unit of the angle measuring device is installed on the motor connected with the driving shaft at the right end, and the receiving unit is installed on the reducer connected with the driven shaft at the left end. The pitch angle, azimuth angle and roll angle of the reducer relative to the motor are obtained by measuring the incident Angle between the laser collimating beam from the transmitter and the CCD receiving surface of the receiver, and by reference conversion. VOLUME XX, 2017 9

III. THE ANALYTICAL MODELING
The mathematical analytic relation of incident inclination in the X direction is consistent with that in the Y direction. In this section, we only describe the establishment process in the Y direction and around the Z axis.

A. FOR THE PITCH AND YAW ANGLES
As shown in Fig. 2, when the incident beam is only tilted in the Y direction (rotated about the X axis), the centers of the two lens arrays are represented by O1 and O2, and the normal lines of the CCD receiving surface are represented by O1A1 and O2A2. β is the inclined angle of the measured beam, that is, the included angle between the optical axis of the incident beam and the normal of the CCD receiving surface. C1 and C2 represent the position of the spot's centroid on the CCD, respectively. FB is the focal plane of the lens array, O2F is perpendicular to FB, where F is the intersection point. As for other parameters shown in Fig. 2, f is the focal length of the lens array, l is the distance between the lenses in the lens array, α is the relative Angle between the lens array and CCD, and h is the distance between the center of mass of adjacent spots. According to the geometric relationship shown in Fig.  2(a), the incident angle β of the measured beam can be calculated by using (1), sin tan cos Then the incident angle βy of the beam in the Y direction can be expressed by using (2) sin arctan cos The schematic diagram for the downward case is shown in Fig. 2 The results show that only positive and negative values are different in calculating the incident angles of the measured beam in different directions. The positive and negative signs in both equations indicate the incident direction of the measured beam.
Therefore, the angle βy of the incident beam in the oblique Y direction can also be calculated by using (4), sin arctan cos

B. FOR THE ROLL ANGLE
Roll angle is the tilt angle around the Z axis, which is the angle of the beam base plane relative to the CCD base plane. Ideally, when the roll angle is 0, the schematic diagram of the spots array received by CCD is shown in Fig. 3(a). The centroid coordinates of the spots array in the same column or row are the same, the position of the center of the spot can be regarded as the reference position. When the roll angle occurs, the coordinates of the array spot will be offset, as shown in Fig. 3(b). Thus, the roll angle can be calculated from the offset of the spot's centroid. The roll angle can be expressed as (5), Where (x0,y0) and (x1,y1) are the centroid coordinates of spots A0 and A1 respectively.
By changing the coordinates of multiple array spots, multiple groups of roll angle data can be obtained. In order to reduce the random error, the average value of roll angle is introduced, and the systematic error caused by manufacturing and assembly also can be obtained through the calculation of multiple array spots.

C. FOR THE ANGLE 
In order to measure the beam incidence angle, it can be known from (2) and (3) that the beam incidence Angle is related to the center distance between adjacent lens elements in the lens array, spot distance, and the relative Angle between the lens array and the CCD receiving surface. While the center distance between adjacent lens elements in the lens array is a fixed value which can be calculated and the spot distance can be obtained through image processing, but the angle α (the relative angle between the lens array and the CCD receiving surface) belongs to the installation parameter. During the first measurement, the value of α needs to be calibrated. In order to ensure the accuracy of the measurement system, the optimal compensation value of α can be obtained through data fitting of relevant experimental data.
As can be seen from (2) and (3), when the beam incident angle β is unknown and the spot distance h is known, the value of α cannot be calculated by a single variable h. Therefore, multiple groups of data can be used to calculate α together and make compensation. (2) can be expressed as (6), sin cos tan In (6), give the unknown quantity β a small increment Δβ in turn, the initial unknown quantity β is represented by β0, and H changes with the increment Δβ, so we can get (7) Where l is a known quantity, α and β0 are unknown quantities, and h changes with the increment Δβ. Therefore, Δβi(1≤i≤n) can be regarded as the independent variable and h i(1≤i≤n) as the dependent variable, i.e.

IV. PARAMETER ANALYSIS OF LENS ARRAY
In order to obtain more model data of hexagonal aperture lens, during the fabrication of array lens, array elements with different types of distance are assembled on the same substrate and arranged at different distance within the range of 3.5mm× 3.5mm, as shown in Fig 4. The distances between the two adjacent lens elements are 1.25mm, 1mm, 0.875mm and 0.5mm, respectively. It can be seen that the smaller the distance between two adjacent lens elements is, the more information will be obtained, which is also more conducive to improving the experimental accuracy. Therefore, this paper selected the distance of lens array as 0.5mm, the refractive index of lens material as 1.49, the focal length of each lens element as 6mm and the radius of curvature as 2.94mm [16][17][18][19][20].
Digital image processing technology is used to identify and calculate the spot images collected by CCD. In order to ensure that the diffraction ring has no effect on the measurement results, the spots cannot overlap. The light source is diffracted by imaging lens unit, and the first-order diffraction angle is Where D is the diameter of the lens unit aperture, λ is the wavelength of the light source. In this paper, D=0.5mm, the wavelength of the He-Ne laser is 632.8nm, thus the firstorder diffraction angle is The diameter of the first-order diffraction ring on the CCD Where b is the maximum distance from the array lens to the CCD, then we can get d=0.00154× 6.25≈0.0096mm.
For the digital imaging, the distance between two adjacent spots on the CCD is about 0.5mm, and the diameter of the first-order diffraction ring is much smaller than the distance between adjacent spots. Therefore, the influence of diffraction on the measurement results can be ignored.
In addition, we can ensure that the spot cannot overlap on the CCD by controlling the distance between CCD and array lens, lens focal length, array distance and other parameters.

V. PROCESSING METHOD OF MULTI-SPOT IMAGE CENTROID
In this paper, the measurement of beam incidence angle is mainly divided into two steps: Firstly, according to the spots array image detected by CCD, the spot centroid position of each sub-aperture is calculated, and then the distance between adjacent spots can be obtained. Secondly, according to the distance between adjacent spots, the corresponding data are processed in the beam incidence angle measurement formula.

A. FOR THE PROCESSING OF THE SPOTS ARRAY IMAGE
In order to improve the accuracy of spot distance detection, the spots array image is preprocessed by filtering to eliminate stray light and random noise, while the feature of spot signal is kept as far as possible, and the image is processed by binarization.
Then, the detection window is segmented by the iterative threshold method: The minimum grayscale value Gmin and the maximum grayscale value Gmax after denoising are calculated. Setting the initial threshold as Tk=(Gmin+Gmax)/2, dividing the image into foreground image and background image according to the threshold Tk, calculating the average gray value G0 and G1 of these two parts of the image, then the new threshold is Tk+1=(G0+G1)/2.
If Tk = Tk+1, the iteration ends. Otherwise, Setting the Tk+1 replaces Tk and iterating again until Tk = Tk+1. At this time, Tk is the global threshold T, and the detection window of the spot array image is obtained through global threshold segmentation.
After the detection window is obtained, the pixel is subdivided by interpolation method in image processing. It is equivalent to increasing the available points per unit area, reducing the pixel size, improving the image resolution of CCD and reducing the image dispersion, so that the detected image is closer to the original image. Linear interpolation method can achieve satisfactory results for low power interpolation and consumes less time, so linear interpolation method is selected to process spot image. In a certain detection window, the image is firstly interpolated linearly, and then the centroid of the spot is calculated, and the distance between adjacent spots is obtained. Fig. 5 is the spot image before and after interpolation in one of the detection windows. The size of the original image is 17 pixel × 18 pixel, and the size of the interpolated image is 34 pixel × 37 pixel.

B. FOR THE OPTIMAL ESTIMATE OF THE DISTANCE BETWEEN MULITIPLE SPOTS
After preprocessing the spot image, the exact location of the spot centroid can be determined by the first moment spot centroid detection method [21]. The equation for calculating the centroid of the first sub-aperture spot is given as (12). Where i x and i y are the centroid coordinates of the spot in the ith sub-aperture, Inm is the pixel intensity value at the location (n,m), xnm and ynm are the pixel coordinates at the location (n,m) respectively, and the size of the sub-aperture is N pixel × M pixel. According to the centroid coordinates, the distance between the ith and (i-1)th spot can be obtained by (13) ii v h h  (15) According to the algebra of residual errors and the test rules, and using the symmetry of random errors, if (16) is correct, the above calculation can be judged to be correct.
Otherwise, the above calculations and tests should be carried out again.
The number of positive and negative residual errors can be observed through the residual error observation method. If the number of positive and negative errors are almost equal, and distribution of the errors is obviously random, it can be judged that there is no systematic error in this group of measurement data. Then the standard deviation of the distance between adjacent light spots can be obtained by the Bessel function 2 1 / ( 1) According to the 3 criterion: It is considered that the measurement value contains gross errors which should be eliminated. The spot distance values will be iterated until the gross error is completely eliminated. The other values are the optimal spot distance measurement values without any gross errors.

A. EXPERIMENTAL PLATFORM
As shown in Fig. 6, the whole system is composed of two parts, one is the measurement unit including laser source, lens array arranged by pyramidtaper and the CCD camera. The other part is the verify unit composed by two autocollimators and a turntable. The lens arrays and CCD are integrated in a frame, and fixed on the turntable. Different angles of the frame relative to the coordinate axes of X, Y and Z can be obtained respectively. If we adjust the turntable or the adjusting screw, the spots array can be got from the CCD. When the values of the spots distance and coordinates are substituted into the (2), and (5), the spatial angle of the laser source relative to the frame can be obtained.

FIGURE6. Measurement experiment platform
In the experiment, the resolution ratio and the pixel size of CCD are 2048 pixel × 2048 pixel and 6.5μm× 6.5μm, the size of aperture of the sub-lens is 1mm× 1mm and the focal length is 30mm. There are two autocollimators arranged orthomorphic in the experimental system, the measurement accuracy is less than 0.1″ for each of them. Autocollimator 1 gets the angles of the frame around the X axes and Y axes depend on the laser beam 1 reflected by mirror 1 attached on the frame, and autocollimator 2 gets the angle of the frame around Z axes by the same theory.

B. CALIBRATION OF THE ANGLE α
The motion controller controlled the turntable to rotate an angle clockwise, and the exact value of the angle increment Δβ was read on the autocollimator. At the same time, the spot image was intercepted, and the distance h between adjacent spots in the X direction was obtained through image processing.
Through cyclic measurement, 23 groups of data were collected accumulatively, and angle increment Δβi(1≤i≤23) were obtained. Under the influence of errors such as rotary table accuracy, CCD pixel size, image processing, etc., the angle increment was set relatively large in the experiment in this paper to reflect the changing trend of spot distance. And the corresponding 23 groups of adjacent spots distance values hi (1≤i≤23) were obtained, as shown in Table I, of which the 7th group spots array is shown in Fig. 7. Because the distance between adjacent lens elements of the lens array is 0.5mm, that is, l=0.5mm.
In this paper, the Matlab software was used to perform data fitting for the 23 groups of data. In order to complete the estimation and solution of the nonlinear complex model in (8), the least square method was used for fitting and the optimal solution was found. As shown in Fig. 8, it is the data fitting diagram of the distance between adjacent spots. The deviation of angle α between the lens array and the CCD is a systematic error. The system error compensation is carried out by the angle calibration of α, that is, the compensation information of α value is obtained by the increment of incident angle with relative truth value characteristics. The least square fitting with the first order function was used to get the best adjustment compensation. The relation between the distance h between adjacent spots and the incident angle β is  (20) Where, the unit of incident angle β is second, and the unit of distance h between adjacent spots is millimeter.

C. ANLYSIS OF EXPERIMENTAL RESULT
The experimental results showed that the angle βy of the incident beam in the Y direction can be calculated from the spot distance of the lens array 2 and 4 along the Y direction. When the incident beam had a tilt Angle only in the Y direction, the result was shown in Fig. 9, where the distance of hx or hy was the mean of the distance of adjacent points in each row or column respectively. As shown in Fig. 9, the distance of adjacent spot arrays in the X direction was consistent with that expected, while the distance in the Y direction decreased with the increase of the distance between the angle βy and the equilibrium position βy=0. The error RMS between the autocollimator and the measured angle was 0.085". Similarly, when the incident beam had a slant angle only in the X direction, the relationship between the average distance of the spots array obtained by lens 1 and 3 and the slant angle value βx was obtained, as shown in Fig. 10. The distance of the spots array in the Y direction, hy, remained constant, while the distance in the X direction, hx, decreased as the deviation from the equilibrium position βx=0 increased. RMS of the angle error is 0.094 ". As shown in Fig. 1(a), the similar phenomenon occurred when the angle of the incident beam was slanted and tilted either in the X or Y directions due to the symmetry of the measured structure. When the incident beam was twisted along the Z axis, several groups of the feature points were selected on the spot formed by lens array 1 to 4 to calculate the change of the centroid (Δx,Δy). The average torsion angle γ was obtained from (5), as shown in Fig. 11. In the X and Y directions, the distance between the points array remained unchanged, and the RMS of the torsion angle γ was 0.092 ".
The relationship of the centroid variations Δx and Δy with the torsion angle γ were shown in Fig. 12. With the change of the spots centroid variation Δx in the X direction, if the variation was positive, the beam rotated clockwise, otherwise counter-clockwise. The small variation in the Y direction Δy increased with the increase of the torsion angle. Therefore, when rotating clockwise, the measurement result was negative, on the contrary, it was positive. In addition, the trajectory of feature points approximated to a circle.

VII. CONCLUSION
In summary, this paper argues that the inclination angle β of the incident beam in the X and Y directions and the torsion angle γ in the Z direction can be calculated from the spot distance of the pyramid lens array. The inclination component βx of the incident beam in the X direction can be obtained by the spot distance of the spots array formed by lens array 1 and 3, the inclination component βy in the Y direction can be obtained by the spot distance of the spots array formed by lens array 2 and 4, and the torsion angle γ in the Z direction can be obtained by four feature points of the lens array, and RMS≤0.1". Compared with the autocollimator angle measuring method, which has the highest accuracy in measuring small angle current, this method has the advantage of small volume and easy to carry. Therefore, after structural transformation and optimization, the measurement principle can also be applied to the detection of smile acceleration. With the miniaturization of the measurement angle, the influence of the measurement error on the results is also increasing, future research should be devoted to the improvement of the measurement accuracy based on this measurement method. The accuracy of this method can be improved from the following two aspects: spot centroid extraction and lens array model optimization.