Calibration method and system of optical on-machine measurement device
By installing a rotatable distance sensor and a standard ball on the machine tool spindle and combining it with the random forest algorithm to identify tiny inclination angles, the measurement accuracy problem caused by the installation error of the distance sensor is solved, an efficient and universal calibration method is implemented, and the measurement accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202510871296.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-09-12
AI Technical Summary
In existing optical on-machine measurement devices, installation errors of ranging sensors lead to reduced measurement accuracy. In addition, existing calibration methods are cumbersome and not applicable to different types of ranging sensors, lacking versatility.
By installing the ranging sensor on the machine tool spindle and making it rotatable, installing the standard ball on the workbench, and using the random forest algorithm to establish a small inclination angle recognition model, the deviation angle of the ranging sensor is adjusted according to the deviation change law, which is suitable for different laser ranging sensors.
It improves the accuracy and operational efficiency of ranging sensor calibration, is applicable to a variety of laser ranging sensors, improves measurement accuracy and efficiency, and simplifies the operating process.
Smart Images

Figure CN120627892A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of precision measurement technology, and in particular to a calibration method and system for an optical on-machine measurement device. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] On-machine measurement systems can be divided into non-contact and contact types. The contact method uses a distance sensor to directly contact the surface of the object to be measured for measurement, while the non-contact measurement method obtains surface data of the object to be measured through optical, acoustic and other technologies. Laser distance sensors are commonly used distance sensors in optical non-contact on-machine measurement systems. They include laser triangulation distance sensors and laser confocal distance sensors, which have the advantages of high precision and adaptability to different materials. The distance sensor is installed in the spindle of the CNC machine tool through a fixture, so that the light spot is illuminated on the surface of the part to be measured and distance information is collected. However, during the installation of the distance sensor, due to the installation operation or the design of the fixture, there will be an error between the measurement direction emitted by the distance sensor and the workpiece in the Z-axis direction, which will affect the distribution of sampling points on the workpiece and reduce the accuracy of the measurement results.
[0004] To reduce on-machine measurement errors, a ranging sensor is usually used to scan multiple reference points on a standard sphere, and then the sensor's position and posture are calculated using a calibration algorithm. However, this calibration method requires multiple measurements and the derivation of complex formulas, resulting in a cumbersome and inconvenient calculation process. Furthermore, it is difficult to identify and adjust the ranging sensor's slight tilt angle, which has a significant impact on the accuracy of the measurement results.
[0005] In addition, the measurement parameters and principles of laser ranging sensors are different, and the sizes of ranging sensors are also different. That is to say, the existing calibration method is not applicable to different optical ranging sensors and is not universal. Summary of the Invention
[0006] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide a calibration method for an optical on-machine measurement device, which effectively improves the accuracy and operating efficiency of the ranging sensor calibration and is applicable to different laser ranging sensors.
[0007] In order to achieve the above object, the present invention is implemented through the following technical solutions: A calibration method for an optical on-machine measurement device includes the following contents: The distance measuring sensor of the optical on-machine measuring device is installed on the main shaft of the machine tool, the distance measuring sensor is rotatable relative to the main shaft of the machine tool, and the standard ball is installed on the workbench; The ranging sensor emits a light beam to the surface of the standard sphere. The starting point of the light beam is used as the emission point, and the point where the light beam lands on the surface of the standard sphere is used as the sampling point. The measuring circle model is determined based on the coordinates of the sampling points on the surface of the standard sphere. The measuring circle model is fitted to obtain a fitting circle model. The deviation variation law is determined based on the deviation between the measuring circle model and the fitting circle model. According to the deviation change law, a small tilt angle recognition model is established based on the random forest algorithm to obtain the relationship between the deviation angle of the ranging sensor and the deviation change value; The distance between the light beam emission point and the sampling point collected by the ranging sensor during actual use is input into the coordinates of the sampling point on the surface of the standard sphere to obtain the deviation change value between the measurement circle model and the fitting model. The deviation angle of the ranging sensor is obtained based on the relationship between the deviation angle of the ranging sensor and the deviation change value. Adjust the installation angle of the optical axis according to the obtained deviation angle of the distance measuring sensor.
[0008] In the calibration method of the optical on-machine measurement device described above, the coordinates of the sampling points on the surface of the standard sphere are obtained according to the following contents: Get the theoretical coordinates of the launch point; The intersection of the light beam and the standard sphere is used as the sampling point, and the theoretical coordinates of the sampling point are obtained based on the mathematical model of the standard sphere surface in the workpiece coordinate system; The theoretical sampling distance between the emission point and the sampling point is obtained through the theoretical coordinates of the emission point and the sampling point; Discrete points of the trajectory calibrated by angle p i As the base point, the beam vector is the direction vector ( v x , v z ), the coordinates of the sampling points on the surface of the standard sphere can be determined based on the theoretical sampling distance.
[0009] In the calibration method of an optical on-machine measuring device as described above, after determining the coordinates of the sampling points on the surface of the standard sphere, if the vertical direction is used as the beam direction, the above formula satisfies v x = 0, v z = 1, get discrete points q i ', forming the measuring circle model; The measured circle model is fitted using the least squares method to obtain the fitted circle model.
[0010] In the calibration method of the optical on-machine measurement device described above, obtaining the theoretical coordinates of the emission point includes the following: When the ranging sensor moves horizontally in the positive direction of the X-axis, the moving trajectory of the light beam emission point of the ranging sensor is used as the scanning trajectory of the ranging sensor. A mathematical model of the actual scanning trajectory of the ranging sensor is established. The ranging sensor reading is L min When , its position is point p 0, its x The coordinates in the machine tool coordinate system are usually set to 0, while in the workpiece coordinate system, the point p 0 x The coordinates are x p0 , the starting and ending coordinates of the scanning trajectory are points p 1( x p1 , z p ) and dot p 2( x p2 , z p ), the actual scanning trajectory of the ranging sensor is a horizontal straight line in the plane XOZ, and the theoretical coordinates of the emission point can be determined.
[0011] In the calibration method of the optical on-machine measurement device described above, the acquisition of the theoretical coordinates of the sampling points includes the following: Know the surface of the standard sphere ( x w , z w ) mathematical model in the workpiece coordinate system; Convert the beam of the distance sensor into a straight line model, which is composed of the beam on the reference plane n x Inclination angle between center and Z axis θ and beam launch point p OK, the slope is k The straight line passes through the launch point p and with the circle O w Intersect or tangent, so as to solve the coordinates of the intersection or tangent point on the circle. If there are two intersection points, compare the two intersection points with the emission point. p The nearest point is selected as the sampling point q, Sampling point q Satisfy the standard sphere surface ( x w , z w ) Based on the mathematical model and straight line equation in the workpiece coordinate system, a sign function is introduced to select the intersection point closest to the emission point as the sampling point, thereby obtaining the theoretical coordinates of the sampling point.
[0012] As described above, a calibration method for an optical on-machine measuring device is used to calibrate the position of the distance measuring sensor. x The actual scanning trajectory of the coordinate and distance sensor is in the machine tool coordinate system x The minimum and maximum coordinates are used to determine the theoretical coordinates of the launch point. x coordinate; According to the distance sensor reading, the light beam is on the reference surface n x Inclination angle between center and Z axis θ and the radius of the standard sphere to determine the z coordinate in the theoretical coordinates of the emission point.
[0013] In the calibration method of an optical on-machine measuring device as described above, the distance measuring sensor is installed on the main shaft of the machine tool through a mounting component, the mounting component is provided with a recess to fix the distance measuring sensor, and the mounting component drives the distance measuring sensor to rotate.
[0014] The calibration method for an optical on-machine measurement device described above, wherein a small tilt angle recognition model is established based on a random forest algorithm according to the deviation variation law during the angle calibration process, includes the following contents: Extract data features: predefine different small deviation angles of the ranging sensor, summarize the information of the deviation deformation, and extract multi-dimensional features including basic statistical features, differential features, fluctuation features and peak features; RF model building: During model building, the tiny ranging sensor deviation angles and multidimensional data features are combined into an original dataset. This original data is sampled to generate multiple sub-datasets. A different decision tree is constructed for each sub-dataset based on the classification and regression tree algorithm. At each node, some features are randomly selected for node splitting to increase model diversity. The prediction results of each tree are averaged to obtain the final regression prediction. Optimize RF parameters: RF parameters include the number of decision trees, the maximum depth, and the branching conditions used to control the decision trees. A grid search is used to traverse predefined hyperparameter combinations. The performance of each combination is evaluated through cross-validation to select the optimal parameter configuration. This results in the relationship between the deviation angle of the ranging sensor and the deviation change value.
[0015] In a second aspect, the present invention further discloses a calibration system for an optical on-machine measuring device, comprising a distance measuring sensor, a standard sphere, and a calculation device, wherein the distance measuring sensor is mounted on a spindle of the machine tool via a mounting component, the mounting component being rotatable relative to the spindle of the machine tool, and the standard sphere is mounted on a workbench; The computing device is configured to: The ranging sensor emits a light beam to the surface of the standard sphere. The starting point of the light beam is used as the emission point, and the point where the light beam lands on the surface of the standard sphere is used as the sampling point. The measuring circle model is determined based on the coordinates of the sampling points on the surface of the standard sphere. The measuring circle model is fitted to obtain a fitting circle model. The deviation variation law is determined based on the deviation between the measuring circle model and the fitting circle model. According to the deviation change law, a small tilt angle recognition model is established based on the random forest algorithm to obtain the relationship between the deviation angle of the ranging sensor and the deviation change value; The distance between the light beam emission point and the sampling point collected by the ranging sensor during actual use is input into the coordinates of the sampling point on the surface of the standard sphere to obtain the deviation change value between the measured circle model and the fitting model. The deviation angle of the ranging sensor is obtained based on the relationship between the deviation angle of the ranging sensor and the deviation change value.
[0016] In the calibration system for an optical on-machine measurement device as described above, the computing device obtains the coordinates of the sampling points on the surface of the standard sphere according to the following contents: Get the theoretical coordinates of the launch point; The intersection of the light beam and the standard sphere is used as the sampling point, and the theoretical coordinates of the sampling point are obtained based on the mathematical model of the standard sphere surface in the workpiece coordinate system; The theoretical sampling distance between the emission point and the sampling point is obtained through the theoretical coordinates of the emission point and the sampling point; Discrete points of the trajectory calibrated by angle p i As the base point, the beam vector is the direction vector ( v x , v z ), the coordinates of the sampling points on the surface of the standard sphere can be determined based on the theoretical sampling distance.
[0017] The beneficial effects of the present invention are as follows: 1) The present invention determines a measuring circle model based on the coordinates of sampling points on the surface of a standard sphere, fits the measuring circle model to obtain a fitting circle model, determines a deviation variation law based on the deviation between the measuring circle model and the fitting circle model, and establishes a small tilt angle recognition model based on the random forest algorithm based on the deviation variation law, thereby obtaining a relationship between the deviation angle of the ranging sensor and the deviation variation value. In other words, the deviation angle and the deviation variation value of the ranging sensor are first theoretically established. Then, the distance between the light beam emission point and the sampling point collected by the ranging sensor during actual use is input into the coordinates of the sampling points on the surface of the standard sphere to obtain the deviation variation value between the measuring circle model and the fitting model. Then, the deviation angle of the ranging sensor is obtained based on the relationship between the deviation angle of the ranging sensor and the deviation variation value. This effectively ensures the accuracy and precision of the measurement results, and the overall operation is relatively reasonable, thereby improving the operational efficiency of ranging sensor calibration.
[0018] 2) The present invention has relatively low requirements on the ranging sensor as a whole, can be adapted to different laser ranging sensors, and has good applicability.
[0019] 3) The present invention quantifies the optical measurement model error at small tilt angles, extracts the error variation characteristics of the theoretical scanning process, and establishes a small tilt angle recognition model with the help of a random forest algorithm. This effectively identifies the installation angle deviation of the ranging sensor. This model can not only accurately determine the small tilt angle of the ranging sensor, but also has the advantages of simple operation and rapid recognition, thereby improving measurement accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0021] Figure 1 The present invention is a schematic diagram of the arrangement of a distance measuring sensor and a standard sphere in a calibration method of an optical on-machine measuring device according to one or more embodiments.
[0022] Figure 2 It is a schematic diagram of installing components and installing a distance measuring sensor in a calibration method of an optical on-machine measurement device according to one or more embodiments of the present invention.
[0023] Figure 3 The present invention provides a theoretical coordinate analysis for angle calibration of a distance sensor in a calibration method for an optical on-machine measurement device according to one or more embodiments of the present invention.
[0024] Figure 4 This is a flow chart of a small tilt angle recognition model in a calibration method of an optical on-machine measurement device according to one or more embodiments of the present invention.
[0025] FIG5( a ) shows the deformation of a standard sphere when light is deflected to the left in a calibration method for an optical on-machine measurement device according to one or more embodiments of the present invention.
[0026] FIG5( b ) shows the deformation of a standard sphere when light is deflected to the right in a calibration method for an optical on-machine measurement device according to one or more embodiments of the present invention.
[0027] Figure 6 (a) ~ Figure 6 (1) is a schematic diagram of a theoretical data model at different tilt angles in a calibration method for an optical on-machine measurement device according to one or more embodiments of the present invention.
[0028] FIG7( a ) is a schematic diagram of identifying an inclination angle in a calibration method of an optical on-machine measurement device according to one or more embodiments of the present invention.
[0029] FIG7( b ) is a schematic diagram of average deviation deformation in a calibration method for an optical on-machine measurement device according to one or more embodiments of the present invention.
[0030] FIG7( c ) is a schematic diagram of a maximum deviation deformation in a calibration method for an optical on-machine measurement device according to one or more embodiments of the present invention.
[0031] FIG7( d ) is a schematic diagram of a standard deviation of a deviation deformation in a calibration method for an optical on-machine measurement device according to one or more embodiments of the present invention.
[0032] In the figure: the distances or sizes between parts are exaggerated to show the positions of various parts, and the schematic diagram is for reference only.
[0033] Among them: 1. Distance sensor; 2. Standard ball; 3. Machine tool; 4. Mounting components; 5. Spindle; 6. Workbench; 7. Connecting rod; 8. Mounting block; 9. Clamping parts. DETAILED DESCRIPTION
[0034] It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0035] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless otherwise clearly indicated in the present invention, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "include" and / or "comprising" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or their combinations; As introduced in the background art, the prior art has the problem of low detection accuracy of distance measuring sensors. In order to solve the above technical problem, the present invention proposes a calibration method for an optical on-machine measurement device.
[0036] Example 1 In a typical embodiment of the present invention, referring to Figure 1 As shown, a calibration method for an optical on-machine measurement device includes the following contents: Step 1) Mount the distance sensor 1 of the optical on-machine measuring device on the main shaft 5 of the machine tool, so that the distance sensor can rotate relative to the main shaft 5 of the machine tool, and mount the standard ball 2 on the workbench 6; Step 2) The ranging sensor emits a light beam toward the surface of the standard sphere. The starting point of the light beam is used as the emission point, and the point where the light beam lands on the surface of the standard sphere is used as the sampling point. The measuring circle model is determined based on the coordinates of the sampling points on the surface of the standard sphere. The measuring circle model is fitted to obtain a fitting circle model. The deviation variation pattern is determined based on the deviation between the measuring circle model and the fitting circle model. Step 3) Based on the deviation change pattern, a small tilt angle recognition model is established based on the Random Forest (RF) algorithm to obtain the relationship between the ranging sensor deviation angle and the deviation change value; Step 4) Input the distance between the beam emission point and the sampling point, as collected by the ranging sensor during actual use, into the coordinates of the sampling point on the surface of the standard sphere to obtain the deviation change value between the measured circle model and the fitted model. The deviation angle of the ranging sensor is then obtained based on the relationship between the deviation angle of the ranging sensor and the deviation change value. Step 5) The staff adjusts the installation angle of the optical axis according to the deviation angle of the ranging sensor obtained.
[0037] refer to Figure 1 As shown, the distance sensor 1 adopts a laser distance sensor. The probe of the distance sensor 1 can emit laser. The probe of the distance sensor 1 is installed on the spindle 5 of the machine tool 3 through the installation component. The installation component 4 is provided with a notch to clamp the distance sensor. Figure 2 As shown, the mounting component 4 includes a connecting rod 7 detachably connected to the spindle 5 of the machine tool. The connecting rod 7 is specifically installed at the tool handle on the spindle 5. The connecting rod 7 is connected to the mounting block 8. The mounting block 8 is connected to the clamping member 9 through a pin shaft, so that the clamping member 9 can rotate relative to the mounting block 8. In this way, the probe of the distance measuring sensor can rotate relative to the spindle 5. The clamping member 9 is connected to the probe of the distance measuring sensor by a snap-fit manner, that is, the clamping member is provided with an opening, and the probe of the distance measuring sensor is snap-fitted and mounted at the opening of the clamping member.
[0038] It should be noted that the top of the standard sphere is relatively flat, which may cause continuous minimum values in the sampled data. Therefore, when determining the minimum value data sequence, try to select the middle position of the continuous data segment to accurately determine the highest point of the standard sphere.
[0039] Step 2) The ranging sensor emits a light beam toward the surface of the standard sphere. The starting point of the light beam is used as the emission point, and the point where the light beam lands on the surface of the standard sphere is used as the sampling point. The measuring circle model is determined based on the coordinates of the sampling points on the surface of the standard sphere. The measuring circle model is fitted to obtain a fitting circle model. The deviation between the measuring circle model and the fitting circle model is used to determine the deviation variation pattern, including the following: Based on the reference plane nxTaking the analysis of the reference plane (based on the XOZ plane of the machine tool coordinate system) as an example, the ranging sensor moves at a constant speed along the X axis of the workpiece coordinate system so that the sampling points all fall on the maximum diameter contour of the sphere, see Figure 3 As shown, the standard sphere is projected as a circle in this reference plane. Ow , the center of the circle coincides with the origin of the workpiece coordinate system, and the radius is r .
[0040] First, when the ranging sensor moves horizontally in the positive direction of the X axis, the moving trajectory of the light beam emission point is used as the ranging sensor scanning trajectory, and the ranging sensor reading is L min , L min is the distance between the ranging sensor and the sampling point, and the ranging sensor position is point p 0, its x The coordinates in the machine tool coordinate system are usually set to 0. In the workpiece coordinate system, the point p 0 x The coordinates are x p0 , the starting and ending coordinates of the scanning trajectory are points p 1( x p1 , z p ) and dot p 2( x p2 , z p ), the actual scanning trajectory of the ranging sensor is a horizontal straight line in the plane XOZ, and the theoretical coordinates of the emission point can be determined as
[0041] Where, θ The beam is on the reference plane nx The inclination angle with respect to the Z axis is defined as positive when the beam is deflected in the positive direction of the X axis, and negative when it is deflected in the negative direction of the X axis. r is the radius of the standard sphere. The starting and ending points of the scanning trajectory x The coordinate solution is
[0042] Where, Δ xq ,min and Δ xq ,max is the actual scanning trajectory of the ranging sensor in the machine tool coordinate system x Coordinate minimum and maximum values.
[0043] Secondly, the surface of the standard ball ( xw , zw ) in the workpiece coordinate system is
[0044] Then, the beam is transformed into a straight line model, which is composed of the beam on the reference plane. nx Inclination angle between center and Z axis θ and the beam starting point p OK. The slope is k The straight line passes through the point p and with the circle Ow Intersect or tangent, and then solve the coordinates of the intersection or tangent point on the circle. If there are two intersection points, compare the two intersection points with the point p The nearest point is selected as the sampling point q Sampling point q As the intersection point satisfies the equations of the line and circle, and the circle and line are expressed in standard form, then the initial condition satisfies
[0045]
[0046] Arrange the above formula to get a xq The equation is
[0047] Considering that the straight line and the circle have two intersection points, by introducing the sign function sgn( p − q )Select distance point p The nearest intersection point, then the sampling point q The theoretical coordinates are as follows:
[0048] Therefore, the sampling point coordinate value ( xq , zq ) with the coordinate value of the emission point ( xp , zp ) changes, the theoretical sampling distance of the corresponding point is obtained from the known scanning trajectory:
[0049] Based on the above analysis, the calculation from the inclination angle to the distance sensor reading is realized. The following is a further study on the calculation method from the distance sensor reading to the inclination angle. pi As the base point, the beam vector is the direction vector ( vx , vz ), the corresponding sampling point can be determined according to the theoretical sampling distance, that is,
[0050] If the vertical direction is used as the beam direction, the above formula satisfies vx = 0, vz = 1, get discrete points qi ', forming a measuring circle model Om , to obtain
[0051] Similarly, the direction vector is determined according to the small inclination angle to obtain the sampling point on the surface of the standard sphere qi , together forming the actual circle model Ow ,satisfy
[0052] The actual circle and the measured circle model are as follows Figure 3 As shown, we obtain
[0053] When the number of sampling points is constant, the X-axis point density is inversely proportional to the sampling distance. q 0' is the dividing point, and the point density on the left and right sides of the measurement circle model changes. d 0 is the minimum value. If the beam is on the reference plane nx Inclination angle between center and Z axis θ If it is a positive value, we get , the point density of the left arc decreases, and the point density of the right arc increases. On the contrary, if , the point density of the left arc increases, and the point density of the right arc decreases. nx Inclination angle between center and Z axis θ When it is 0, the two circle models overlap and the point density is the same.
[0054] Considering the point pi Arrive qi 'And point qi The measured circle model is not a regular arc. The above analysis shows that the larger the inclination angle, the greater the difference in point density between the actual circle and the measured circle model, and the more obvious the deformation of the measured circle model. Furthermore, the positive or negative inclination angle affects the point density variation at different locations, causing the direction of the measured circle deformation to change.
[0055] In theory, the inclination angle can be calculated using the deformation of the measuring circle model. Therefore, the least squares method is used to fit the measuring circle model to obtain the fitting circle model, such as Figure 3 Then, by calculating the deviation between the fitting circle and the measured circle, the deviation deformation is quantified, that is, the deviation change law during the angle calibration process is obtained.
[0056] Step 3) According to the deviation change law, a small tilt angle recognition model is established based on the random forest algorithm to obtain the relationship between the deviation angle of the ranging sensor and the deviation change value. Figure 4As shown, including the following: First, extract data features: predefine different small ranging sensor deviation angles, and then, based on the deviation deformation information obtained in the previous step (the deviation between the fitted circle and the measured circle), extract multidimensional features including basic statistical features (mean, standard deviation, maximum, median, interquartile range), differential features (first-order difference, second-order difference), fluctuation features (root mean square, coefficient of variation), and peak features (peak value, number of peaks, average peak height).
[0057] Next, a RF model is built: The original dataset is composed of small inclination values and multidimensional data features. This data is then resampled using the bootstrap method to generate multiple sub-datasets. A different decision tree is constructed for each sub-dataset using the classification and regression tree algorithm. At each node, some features are randomly selected for node splitting, increasing model diversity. Finally, the predictions from each tree are averaged to obtain the final regression prediction.
[0058] Finally, optimize RF parameters: When building the RF model, parameters that need to be adjusted include the number of decision trees, the maximum depth, and the branching conditions (minimum number of split samples and minimum number of leaf node samples) used to control the decision tree to improve the accuracy of the model's angle prediction. This example uses a grid search to traverse predefined hyperparameter combinations, evaluating the performance of each combination through cross-validation to select the optimal parameter configuration and thus determine the relationship between the ranging sensor deviation angle and the deviation change value.
[0059] Step 4) Input the distance between the beam emission point and the sampling point collected by the ranging sensor during actual use into the coordinates of the sampling point on the surface of the standard sphere to obtain the deviation change value between the measured circle model and the fitting model. Based on the relationship between the ranging sensor deviation angle and the deviation change value, the ranging sensor deviation angle is obtained: Processing of acquired data in the perpendicular direction of the beam di , (the data collected at this time is the indication of the distance sensor), that is, substitute into the following formula
[0060] The measured circle model and the fitted circle model are then obtained, and the deviation between them is calculated as the actual deformation. Finally, the multidimensional features of the actual deformation are extracted and used as input. The relationship between the deviation angle of the ranging sensor and the deviation change value can be used to determine the deviation angle of the ranging sensor under actual working conditions. The deviation angle of the sensor can be used to adjust the installation of the optical axis.
[0061] Example 1 According to the above steps, set Δ xq ,min and Δ xq,max is -5 mm and 5 mm, r The deviations for different inclination angles are 12.5 mm, as shown in Figure 5. As can be seen, the larger the inclination angle, the more pronounced and greater the deformation of the measured circle. The smaller the inclination angle, the closer the sizes of the measured circle, the fitted circle, and the actual circle. Furthermore, the deformation direction of the measured circle changes as the inclination angle changes.
[0062] The small inclination angle range is set to -5° to 5°, and 1000 uniformly distributed angle values are generated by discretization with equal spacing, and a certain amount of noise is added to the features. The theoretical data model at different angles is calculated based on coordinate analysis, and some results are shown in Figure 6 The center and radius of the fitted circle also reflect the degree of deformation and are clearly related to the change in inclination angle. When the inclination angle is negative, both the measured and fitted circles shift to the right of the actual circle, with the maximum deformation occurring at the rightmost sampling point. When the inclination angle is positive, both the measured and fitted circles shift to the left of the actual circle, with the maximum deformation occurring at the leftmost sampling point.
[0063] Feature values were then extracted from the deformations to form a dataset for training the RF model. The hyperparameter combinations are shown in Table 1. The optimal parameters were determined through a parameter optimization process: 300 decision trees, a maximum depth of 10, a minimum number of partition samples of 2, and a minimum number of leaf node samples of 4. Therefore, using the deviation between the theoretical measured circle and the fitted circle, a relationship model between the quantized value and the inclination angle was established.
[0064] Table 1 Parameter optimization information
[0065] Example 2 To verify the effectiveness and applicability of the recognition model, two laser ranging sensors (a laser triangulation sensor and a laser confocal ranging sensor) were mounted vertically. Position calibration was first performed using a bidirectional cross-positioning method. The maximum diameter of a standard sphere was then scanned at a constant speed of 160 mm / min and a sampling frequency of 1 kHz to provide a basis for angle calibration. The acquired data was then processed to obtain a measured circle model and a fitted circle model, and the deviation between the two was calculated as the deviation deformation. Finally, multidimensional features of the deviation deformation were extracted, and the angle recognition model was used to identify and correct small inclination angles.
[0066] Experiments were conducted, and the experimental results are shown in Figures 7(a), 7(b), 7(c), and 7(d). The first 8 groups of experiments were completed by the laser triangulation ranging sensor, and the last 8 groups of experiments were completed by the laser confocal ranging sensor. After the measurement circle model was corrected based on the identified small angles, the average deviation deformation was reduced by 19.80% to 40.93%, and finally stabilized at around 11 μm. The maximum deviation deformation was reduced by 8.50% to 16.07%, and the standard deviation of the deviation deformation was reduced by 0.17% to 5.10%. Comparing the changes in the fitting circle radius before and after correction, the deviation deformation indicators before and after correction are as follows: Figures 7(b) to 7(d) As shown in the figure, the theoretical radius of the standard sphere is 12.5 mm, and the corrected radius is closer to the theoretical radius.
[0067] Example 2 A calibration system for an optical on-machine measuring device includes a distance sensor, a standard sphere, and a calculation device. The distance sensor is mounted on a spindle of a machine tool via a mounting component, the mounting component being rotatable relative to the spindle of the machine tool, and the standard sphere is mounted on a workbench. The computing device is configured to: The ranging sensor emits a light beam to the surface of the standard sphere. The starting point of the light beam is used as the emission point, and the point where the light beam lands on the surface of the standard sphere is used as the sampling point. The measuring circle model is determined based on the coordinates of the sampling points on the surface of the standard sphere. The measuring circle model is fitted to obtain a fitting circle model. The deviation variation law is determined based on the deviation between the measuring circle model and the fitting circle model. According to the deviation change law, a small tilt angle recognition model is established based on the random forest algorithm to obtain the relationship between the deviation angle of the ranging sensor and the deviation change value; The distance between the light beam emission point and the sampling point collected by the ranging sensor during actual use is input into the coordinates of the sampling point on the surface of the standard sphere to obtain the deviation change value between the measured circle model and the fitting model. The deviation angle of the ranging sensor is obtained based on the relationship between the deviation angle of the ranging sensor and the deviation change value.
[0068] The computing device obtains the coordinates of the sampling points on the surface of the standard sphere according to the following content: Get the theoretical coordinates of the launch point; The intersection of the light beam and the standard sphere is used as the sampling point, and the theoretical coordinates of the sampling point are obtained based on the mathematical model of the standard sphere surface in the workpiece coordinate system; The theoretical sampling distance between the emission point and the sampling point is obtained through the theoretical coordinates of the emission point and the sampling point; Discrete points of the trajectory calibrated by angle p i As the base point, the beam vector is the direction vector ( v x , v z), the coordinates of the sampling points on the surface of the standard sphere can be determined based on the theoretical sampling distance.
[0069] For details on the above, please refer to Example 1.
[0070] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A calibration method for an optical on-machine measuring device, characterized in that: Includes the following: The distance measuring sensor of the optical on-machine measuring device is installed on the main shaft of the machine tool, the distance measuring sensor is rotatable relative to the main shaft of the machine tool, and the standard ball is installed on the workbench; The ranging sensor emits a light beam to the surface of the standard sphere. The starting point of the light beam is used as the emission point, and the point where the light beam lands on the surface of the standard sphere is used as the sampling point. The measuring circle model is determined based on the coordinates of the sampling points on the surface of the standard sphere. The measuring circle model is fitted to obtain a fitting circle model. The deviation variation law is determined based on the deviation between the measuring circle model and the fitting circle model. According to the deviation change law, a small tilt angle recognition model is established based on the random forest algorithm to obtain the relationship between the deviation angle of the ranging sensor and the deviation change value; The distance between the light beam emission point and the sampling point collected by the ranging sensor during actual use is input into the coordinates of the sampling point on the surface of the standard sphere to obtain the deviation change value between the measurement circle model and the fitting model. The deviation angle of the ranging sensor is obtained based on the relationship between the deviation angle of the ranging sensor and the deviation change value. Adjust the installation angle of the optical axis according to the obtained deviation angle of the distance measuring sensor.
2. The calibration method of an optical on-machine measurement device according to claim 1, characterized in that: The coordinates of the sampling points on the surface of the standard sphere are obtained according to the following: Get the theoretical coordinates of the launch point; The intersection of the light beam and the standard sphere is used as the sampling point, and the theoretical coordinates of the sampling point are obtained based on the mathematical model of the standard sphere surface in the workpiece coordinate system; The theoretical sampling distance between the emission point and the sampling point is obtained through the theoretical coordinates of the emission point and the sampling point; Discrete points of the trajectory calibrated by angle p i As the base point, the beam vector is the direction vector ( v x , v z ), the coordinates of the sampling points on the surface of the standard sphere can be determined based on the theoretical sampling distance.
3. The calibration method of an optical on-machine measuring device according to claim 2, characterized in that: After determining the coordinates of the sampling points on the surface of the standard sphere, if the vertical direction is used as the beam direction, the above formula satisfies v x = 0, v z = 1, get discrete points q i ', forming the measuring circle model; The measured circle model is fitted using the least squares method to obtain the fitted circle model.
4. The calibration method of an optical on-machine measurement device according to claim 2, characterized in that: The acquisition of the theoretical coordinates of the launch point includes the following: When the ranging sensor moves horizontally in the positive direction of the X-axis, the moving trajectory of the light beam emission point of the ranging sensor is used as the scanning trajectory of the ranging sensor. A mathematical model of the actual scanning trajectory of the ranging sensor is established. The ranging sensor reading is L min When , its position is point p 0, its x The coordinates in the machine tool coordinate system are usually set to 0, while in the workpiece coordinate system, the point p 0 x The coordinates are x p0 , the starting and ending coordinates of the scanning trajectory are points p 1( x p1 , z p ) and dot p 2( x p2 , z p ), the actual scanning trajectory of the ranging sensor is a horizontal straight line in the plane XOZ, and the theoretical coordinates of the emission point can be determined.
5. The calibration method of an optical on-machine measurement device according to claim 2, characterized in that: The acquisition of the theoretical coordinates of the sampling points includes the following: Know the surface of the standard sphere ( x w , z w ) mathematical model in the workpiece coordinate system; Convert the beam of the distance sensor into a straight line model, which is composed of the beam on the reference plane n x Inclination angle between center and Z axis θ and beam launch point p OK, the slope is k The straight line passes through the launch point p and with the circle O w Intersect or tangent, so as to solve the coordinates of the intersection or tangent point on the circle. If there are two intersection points, compare the two intersection points with the emission p The nearest point is selected as the sampling point q, Sampling point q Satisfy the standard sphere surface ( x w , z w ) Based on the mathematical model and straight line equation in the workpiece coordinate system, a sign function is introduced to select the intersection point closest to the emission point as the sampling point, thereby obtaining the theoretical coordinates of the sampling point.
6. The calibration method of an optical on-machine measuring device according to claim 4, characterized in that: According to the position of the ranging sensor x The actual scanning trajectory of the coordinate and distance sensor is in the machine tool coordinate system x The minimum and maximum coordinates are used to determine the theoretical coordinates of the launch point. x coordinate; According to the distance sensor reading, the light beam is on the reference surface n x Inclination angle between center and Z axis θ and the radius of the standard sphere to determine the z coordinate in the theoretical coordinates of the emission point.
7. The calibration method of an optical on-machine measurement device according to claim 1, characterized in that: The distance measuring sensor is installed on the main shaft of the machine tool through a mounting component. The mounting component is provided with a recess to fix the distance measuring sensor, and the mounting component drives the distance measuring sensor to rotate.
8. The calibration method of an optical on-machine measurement device according to claim 1, characterized in that: According to the deviation change law during the angle calibration process, a small tilt angle recognition model is established based on the random forest algorithm, including the following contents: Extract data features: predefine different small deviation angles of the ranging sensor, summarize the information of the deviation deformation, and extract multi-dimensional features including basic statistical features, differential features, fluctuation features and peak features; RF model building: During model building, the tiny ranging sensor deviation angles and multidimensional data features are combined into an original dataset. This original data is sampled to generate multiple sub-datasets. A different decision tree is constructed for each sub-dataset based on the classification and regression tree algorithm. At each node, some features are randomly selected for node splitting to increase model diversity. The prediction results of each tree are averaged to obtain the final regression prediction. Optimize RF parameters: RF parameters include the number of decision trees, the maximum depth, and the branching conditions used to control the decision trees. A grid search is used to traverse predefined hyperparameter combinations. The performance of each combination is evaluated through cross-validation to select the optimal parameter configuration. This results in the relationship between the deviation angle of the ranging sensor and the deviation change value.
9. A calibration system for an optical on-machine measuring device, characterized in that: The machine tool comprises a distance measuring sensor, a standard ball and a calculation device, wherein the distance measuring sensor is mounted on the main shaft of the machine tool through a mounting component, the mounting component is rotatable relative to the main shaft of the machine tool, and the standard ball is mounted on the workbench; The computing device is configured to: The ranging sensor emits a light beam to the surface of the standard sphere. The starting point of the light beam is used as the emission point, and the point where the light beam lands on the surface of the standard sphere is used as the sampling point. The measuring circle model is determined based on the coordinates of the sampling points on the surface of the standard sphere. The measuring circle model is fitted to obtain a fitting circle model. The deviation variation law is determined based on the deviation between the measuring circle model and the fitting circle model. According to the deviation change law, a small tilt angle recognition model is established based on the random forest algorithm to obtain the relationship between the deviation angle of the ranging sensor and the deviation change value; The distance between the light beam emission point and the sampling point collected by the ranging sensor during actual use is input into the coordinates of the sampling point on the surface of the standard sphere to obtain the deviation change value between the measured circle model and the fitting model. The deviation angle of the ranging sensor is obtained based on the relationship between the deviation angle of the ranging sensor and the deviation change value.
10. The calibration system of an optical on-machine measurement device according to claim 9, characterized in that: The computing device obtains the coordinates of the sampling points on the surface of the standard sphere according to the following content: Get the theoretical coordinates of the launch point; The intersection of the light beam and the standard sphere is used as the sampling point, and the theoretical coordinates of the sampling point are obtained based on the mathematical model of the standard sphere surface in the workpiece coordinate system; The theoretical sampling distance between the emission point and the sampling point is obtained through the theoretical coordinates of the emission point and the sampling point; Discrete points of the trajectory calibrated by angle p i As the base point, the beam vector is the direction vector ( v x , v z ), the coordinates of the sampling points on the surface of the standard sphere can be determined based on the theoretical sampling distance.