CN115096261A - Method for measuring forging inclination based on improved ellipse fitting optimization algorithm - Google Patents

Method for measuring forging inclination based on improved ellipse fitting optimization algorithm Download PDF

Info

Publication number
CN115096261A
CN115096261A CN202210682961.XA CN202210682961A CN115096261A CN 115096261 A CN115096261 A CN 115096261A CN 202210682961 A CN202210682961 A CN 202210682961A CN 115096261 A CN115096261 A CN 115096261A
Authority
CN
China
Prior art keywords
ellipse
fitting
orthogonal
point
forging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210682961.XA
Other languages
Chinese (zh)
Other versions
CN115096261B (en
Inventor
张云刚
鲁政
张玉存
张凯越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yanshan University
Original Assignee
Yanshan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yanshan University filed Critical Yanshan University
Priority to CN202210682961.XA priority Critical patent/CN115096261B/en
Publication of CN115096261A publication Critical patent/CN115096261A/en
Application granted granted Critical
Publication of CN115096261B publication Critical patent/CN115096261B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C9/00Measuring inclination, e.g. by clinometers, by levels
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/26Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/11Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention relates to a method for measuring the gradient of a forged piece based on an improved ellipse fitting optimization algorithm, belonging to the technical field of detection of key geometric quantity of the forged piece. According to the method, the interference of an abnormal value cluster on a fitting result is eliminated and the calculation power is saved by randomly dividing a region to select sample points and screening a weighted quantile; the problem of high curvature deviation can be eliminated by constructing an orthogonal geometric distance residual error model, and a better approximation effect can be obtained; fitting the ellipse through an improved PSO algorithm to obtain a fitting ellipse with higher accuracy and stability; the measurement errors within the range of-3 degrees to 3 degrees are less than 0.05 degrees, and the measurement requirement of the forging inclination is met.

Description

Method for measuring forging inclination based on improved ellipse fitting optimization algorithm
Technical Field
The invention relates to a method for measuring the gradient of a forged piece based on an improved ellipse fitting optimization algorithm, and belongs to the technical field of detection of key geometric quantity of the forged piece.
Background
Parts produced by forging technology are widely applied to the fields of metallurgy, aerospace, weapon equipment, transportation and the like, wherein long-shaft forgings are commonly used for rotating shafts or connecting shafts of rotating mechanisms, such as marine propeller shafts, nuclear power half-speed rotors and the like, and circular-ring forgings are commonly used for rotating parts or fixed parts, such as vehicle and ship hubs, evaporating pot bases and the like. Upsetting and punching are important processes of a columnar or annular forging in the forging process, and the position posture between the upsetting rod or the perforating needle and the blank of the forging has great influence on the processing quality.
At present, the optical technology is widely applied to measuring the geometric quantity of a forged piece and can be divided into a machine vision method and a laser scanning method. For the machine vision method, on one hand, the side image of the forging can be directly acquired through the CCD, and the size of the forging is determined after image processing, however, the method is easily influenced by the measuring environmental noise; on the other hand, a line laser image projected on the surface of the forging can be obtained by using a CCD, and the section of the workpiece is obtained by using green strip laser projected on the surface of the workpiece in the document of Spectral selective and differential imaging laser measurement system for on line measurement of large hot workpieces in precision optical beam forming, so as to solve the diameter of the forging; the length and size measurement of the thermal state large forging based on green laser image recognition firstly obtains a green strip laser image, and then a circumferential curve of the thermal state cylindrical forging is obtained by fitting a plurality of sections of point cloud data. For the laser scanning method, the laser range finder can be driven by a rotating platform or a servo motor to complete the acquisition of point cloud data, and then the point cloud data can be used for reconstructing a three-dimensional image of a measured piece. Although the application of the above detection techniques has been studied with respect to the measurement of the dimensions of forgings, the study of the measurement of the inclination of forgings is still in the phase of launch.
Disclosure of Invention
The invention aims to provide a method for measuring the inclination of a forging based on an improved ellipse fitting optimization algorithm, which is characterized in that the visualization of the profile of a measured section is realized through coordinate transformation, a random method is combined to screen sample points, a PSO algorithm is used for solving a geometric parameter model of a fitting ellipse, a three-dimensional linear equation of a central shaft of the forging is obtained from the central point of the fitting ellipse, and the inclination angle of the forging is calculated from the linear equation. The influence of abnormal values on measurement is avoided, the calculation efficiency and precision are improved, and the inclination of the forge piece is measured more conveniently, quickly and accurately.
In order to achieve the purpose, the invention adopts the technical scheme that:
a method for measuring the inclination of a forging based on an improved ellipse fitting optimization algorithm comprises the following steps:
step 1: controlling a stepping motor to move to drive a spiral screw rod, aligning the rotating axis of the measured forge piece to the rotating shaft, and enabling a laser range finder to reach a measuring position;
step 2: the computer drives the laser range finder and the servo motor to be started simultaneously, and the dynamic distance di between the laser range finder and the surface of the forge piece to be measured is measured;
and step 3: the system device for controlling the computer performs coordinate transformation and sample point screening on the distance information, eliminates the influence of abnormal values, and performs ellipse fitting on the screened points, and the specific steps are as follows:
step 31: the angle of each rotation of the laser range finder is recorded as theta 0 Then the angle theta that the laser range finder rotates at a certain position is k theta 0 Where k denotes the kth point swept by the laser rangefinder, the position coordinate (x) of the kth point k ,y k ) Namely, the coordinates of the sample points of the profile of the measured forging are as follows:
x k =(L-d)·cosθ
y k =(L-d)·sinθ
in the formula: l represents the distance from the laser range finder to the rotation center, and d represents the distance from the laser range finder to the surface of the measured forging;
step 32: carrying out random area division on the sample points of the measured cross section profile of the measured forge piece obtained in the step 31, randomly and uniformly dividing the sample points into 6 areas each time, randomly selecting one sample point from each area, and carrying out direct algebraic fitting on the selected sample point, wherein an elliptic equation represented by the direct algebraic fitting is as follows:
Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0
traversing all sample points, constructing an orthogonal geometric distance residual error model, carrying out weighted quantile screening by taking the model as a basis, and storing the sample points corresponding to the orthogonal geometric residual errors meeting the conditions;
step 33: according to the definition of the orthogonal geometric distance residual error model in the step 32, the problem of the target ellipse parameters is converted into the problem of solving a nonlinear target function, the minimum orthogonal geometric distance residual error of the fitting ellipse and the sample point selected in the step 32 is set as the target function, the ellipse is characterized by a model vector u, and the method specifically comprises the following steps:
u=(x c y c a b α) t
in the formula: (x) c ,y c ) Is the center of an ellipse, a is a major axis, b is a minor axis, and alpha is the included angle between the major axis a and the positive X half axis; the constraint conditions are satisfied as follows:
C1:a,b∈R +
C2:b≤a
C3:θ c ∈[0,π)
C4:x c ,y c ∈R
solving an objective function by utilizing a particle swarm optimization algorithm, wherein a model vector u corresponding to the objective function is a fitting ellipse parameter;
and 4, step 4: the central axis of the measured forge piece is fitted by the center of each cross section, and finally, the tilt angle of the forge piece is solved by a central axis equation, which specifically comprises the following steps:
Figure BDA0003697017900000031
Figure BDA0003697017900000032
Figure BDA0003697017900000033
in the formula, (a, b, c) is the coordinate of a known point on a straight line, and (m, n, l) is the direction vector of a space straight line, and the direction vector is obtained by the slope of the projection equation of a three-dimensional straight line on an XOZ (YOZ) plane and corresponds to the inclination angle of X, Y.
The technical scheme of the invention is further improved as follows: the algebraic fitting method in step 32 is as follows: by the formula
Figure BDA0003697017900000041
To determine each coefficient, then according to the extreme principle, in order to minimize F (a, B, C, D, E, F), it is necessary to have
Figure BDA0003697017900000042
Wherein, let the vector lambda be [ A, B, C, D, E, F] t Representing the ellipse parameters.
The technical scheme of the invention is further improved as follows: the process of building the ellipse orthogonal geometric distance residual error model in the step 32 is as follows:
starting from the geometric equation of a general ellipse, the length of the semi-major axis of the ellipse is a, the length of the semi-minor axis is b, the direction angle alpha (the included angle between the major axis of the ellipse and the X axis), and the center (X) c ,y c ) The geometric representation of the elliptic equation is specifically:
Figure BDA0003697017900000043
in order to reduce the amount of computation required to find the orthogonal points, a new local coordinate system (O-XY) is established within the fitted coordinate system (O-XY), the transformation of the two coordinate systems being represented by a rotation matrix and a translation vector:
Figure BDA0003697017900000044
Figure BDA0003697017900000045
in the formula, X in the vector is translated c ,Y c Representing the center coordinates of the ellipse under a fitting coordinate system, wherein the parameters are provided by iterative initial values;
in the local coordinate system, the equation of the ellipse is expressed as:
Figure BDA0003697017900000046
the tangent equation at the orthogonal point is expressed as:
Figure BDA0003697017900000047
from this, the orthogonal geometric residual model can be written as:
Figure BDA0003697017900000051
the technical scheme of the invention is further improved as follows: the sample point screening method in step 32 is as follows:
screening the sample points in the step 32 by using a weighted quantile method, traversing the sample points, and recording the orthogonal geometric residual square sum g (u) corresponding to each group of sample points in an array num _ index, wherein the orthogonal geometric residual square sum g (u) is expressed as:
Figure BDA0003697017900000052
where X represents the coordinates of the data points in the fitted coordinate system and f represents a non-linear function of the orthogonal distance from the acquired data points to the ellipse.
These values are arranged from small to large, noting that the values after arrangement are:
G (1) ≤G (2) ≤...≤G (m)
in the formula, G (k) Represents the corresponding G value of the k group;
to pre-compute p, only k needs to be found, so that
Figure BDA0003697017900000053
X is then (m) <ξ p <x (k+1) When an abnormal value occurs, the p quantile of the selected point cannot be changed, so that the threshold value is inaccurate, and the quality of the selected point is poor. In order to extract the quality of the selected point and reduce the influence of abnormal values on poor fitting effects, a weight function is added on the basis of the highest percentile, and the weight function is expressed as:
ξ p =(mp-k)(w' k+1 ·x (k+1) -w' k ·x (k) )+w' k ·x (k)
in the formula, the sum of squares of weighted algebraic distances is expressed as:
Figure BDA0003697017900000054
in the formula, α represents a weight coefficient, and the determination formula is specifically:
Figure BDA0003697017900000055
Figure BDA0003697017900000056
storing G (u) corresponding to all the sample points in the step 32 in an array best _ epipse _ par, wherein G (u) < ξ p Sample point coordinates of the condition.
The technical scheme of the invention is further improved as follows: the method for establishing the objective function in step 33 is as follows:
according to the definition of the geometric fitting algorithm on the error distance, the problem of solving the target ellipse parameters by the sample points of the logarithm group best _ ellipse _ par is converted into the problem of solving the nonlinear objective function, and the method specifically comprises the following steps:
Figure BDA0003697017900000061
in the formula, X represents the coordinate of the data point in the fitting coordinate system, f represents a nonlinear function for obtaining the orthogonal distance from the data point to the ellipse, u represents the parameter of the ellipse equation to be solved, and min represents the target function, namely the minimum value of the solved g (u).
The technical scheme of the invention is further improved as follows: the elliptical objective function min can obtain an elliptical objective model vector u through the particle group optimization algorithm in the step 33; in the PSO algorithm, each particle can update its velocity and position:
Figure BDA0003697017900000062
Figure BDA0003697017900000063
wherein i is the particle index; j is a dimension index; p is a radical of best And g best The adaptive values of (a) are the inertia weight and acceleration coefficient of the variable; k is the current iteration number; c. C 1 And c 2 Is the acceleration constant; r is 1 And r 2 Is in accordance with [0,1]Random numbers distributed at even numbers within the range; w is an inertial weight coefficient that has the ability to trade-off global and local search capabilities, with values as follows:
Figure BDA0003697017900000064
Figure BDA0003697017900000065
updating the position x and velocity v of the particle continues until the required minimum mismatch is reached. The criterion for stopping updating the two values is based on the maximum number of iterations or the required computational accuracy.
Due to the adoption of the technical scheme, the invention has the following technical effects:
the invention provides a method for measuring the inclination of a forge piece based on an improved optimization algorithm fitting ellipse, which comprises the steps of building a measuring device consisting of a measured forge piece, a laser range finder, an inclination sensor and the like, performing multiple processing on measured distance data, converting the measured distance data into a forge piece central axis on a three-dimensional space, obtaining the inclination of the forge piece, and remarkably eliminating error interference of an abnormal value cluster; the established X, Y-direction measurement calibration curve can eliminate system errors, the forgings in different inclination states are measured, and after the measurement results are corrected by using a calibration equation, the measurement errors in the range of-3 degrees to 3 degrees are all less than 0.05 degrees, so that the measurement requirements of the inclination of the forgings can be met.
Drawings
FIG. 1 is a diagram of a laser ranging and detection drive experimental setup of the present invention;
FIG. 2 is a comparison graph of fitting results after outlier clusters exist and are eliminated;
FIG. 3 is a G (u) convergence curve of the PSO algorithm fitting ellipse;
FIG. 4 shows the data processing results when the Y direction is tilted by 3.0 degrees;
fig. 5 is a system error curve.
The device comprises a forge piece to be measured 1, a platform with adjustable inclination 2, an objective table 3, a stepping motor 4, a screw rod 5, a fixed support 6, a rotating shaft 7, a servo motor 8, a reduction gearbox 9, a base 10, a base 11, adjustable supporting legs 12, a laser range finder 13 and a computer.
Detailed Description
The invention is described in further detail below with reference to the following figures and specific embodiments:
a method for measuring the tilt of a forged piece based on an improved optimization algorithm fitting ellipse comprises the steps of performing surrounding measurement on the forged piece by using a laser displacement sensor to obtain distance information of the cross section of the forged piece, and performing abnormal value judgment and elimination on collected distance data based on a regression analysis method; and (3) carrying out coordinate transformation and direct least square fitting on the data without the abnormal values, fitting the central axis of the forge piece by each cross section center, and finally solving the tilt angle of the forge piece by the central axis equation.
The laser ranging and detection driving experimental device is shown in fig. 1 and is an experimental device of the method for measuring the inclination of the forge piece based on the improved ellipse fitting optimization algorithm.
Laser rangefinder and detection drive experimental apparatus include laser detection device and detection drive arrangement, laser detection device includes: the device comprises an inclination adjustable platform 2, an object stage 3, a base 10, an adjustable supporting foot 11, a laser range finder 12 and a computer 13. The detection drive device includes: the device comprises a stepping motor 4, a spiral screw rod 5, a rotating shaft 7, a servo motor 8, a reduction gearbox 9 and a fixed support 6.
The working process of the laser ranging and detection driving device is as follows:
the whole measuring system is kept horizontal by adjusting the adjustable supporting legs 11, the measured forge piece 1 is fixed on the inclination-adjustable platform 2, the stepping motor 4 drives the screw rod 5 to move the measuring pose and calibrate the experimental system, and the laser range finder 12 is aligned to the rotating axis of the rotating shaft 7; the servo motor 8 and the reduction gearbox 9 drive the rotating shaft 7 to rotate continuously for 360 degrees, the measured forging 1 rotates along with the rotating shaft, and the laser range finder 12 detects the distance between the laser range finder and the surface of the section of the measured forging 1 which rotates for one circle; and adjusting the inclination adjustable platform 2 to change the inclination angle state of the measured forging 1, recording the XY-direction inclination angle in the state, and measuring the distance of the surface of the section of the measured forging 1 rotating for one circle by the laser range finder 12 again. The measured distance data are transmitted to the computer 13, and a system device of the computer 13 adopts visual studio, industrial control software and Matlab for combined programming, wherein the Matlab is mainly used for processing the data.
The measured forging 1 is cylindrical, the diameter is 200mm, and the height is 240 mm; the inclination angle of the inclination adjustable platform 2 is adjusted by a fine adjustment screw rod positioned at the left side position, and the adjusting range is +/-3 degrees; the inclination angle is measured by an electronic inclinometer, the double-axis measurement resolution of the electronic inclinometer is 0.01 degrees, and the double-axis measurement precision is 0.05 degrees; the servo motor 8 is connected with the reduction gearbox 9, an output shaft of the reduction gearbox 9 drives the fixing support 6 connected through the rotating shaft 7, a pulse signal driven by the servo motor 8 is supplied by an S7-200PLC, the laser range finder 12 is fixed, and the measured forge piece 1 rotates to complete the surrounding measurement; the effective stroke and the positioning precision of the screw rod 5 are respectively 200mm and 0.03 mm; the spiral screw rods 5 are driven by 42 stepping motors 4, driving pulse signals are supplied by an STM32 single chip microcomputer, and data acquisition and processing are completed by software compiled by C #.
A method for measuring the inclination of a forge piece based on an improved ellipse fitting optimization algorithm comprises the following specific steps:
step 1: and controlling the stepping motor 4 to move to drive the screw rod 5, so that the rotating axis of the forge piece 1 to be measured is aligned with the rotating shaft 7, and the laser range finder 12 reaches a measuring position.
Step 2: the computer 13 drives the laser distance meter 12 and the servo motor 8 to start simultaneously, and the dynamic distance di between the laser distance meter 12 and the surface of the forge piece 1 to be measured is measured;
and step 3: the system device for controlling the computer performs coordinate transformation and sample point screening on the distance information, eliminates the influence of abnormal values, and performs ellipse fitting on the screened points, and the specific steps are as follows:
step 31: the principle of conversion from polar coordinates to rectangular coordinates is that the angle of each rotation of the laser range finder 12 is recorded as theta 0 Then the angle theta of the laser distance meter 12 at a certain position is k theta 0 Where k denotes the kth point swept by the laser range finder 12, and the position coordinate (x) of the kth point k ,y k ) Namely, the coordinates of the sample points of the profile of the measured forging are as follows:
Figure BDA0003697017900000091
in the formula: l represents the distance from the laser range finder to the rotation center, is related to the length of a rotation arm in the measurement system, and is a known quantity in the experiment, and d represents the distance from the laser range finder to the surface of the forged piece, and is a measured quantity in the experiment;
step 32: carrying out random region division on the sample points of the measured cross section profile of the measured forge piece obtained in the step 31, randomly and uniformly dividing the sample points into 6 regions each time, randomly selecting one sample point from each region, carrying out direct algebraic fitting on the selected sample point, constructing an orthogonal set distance residual error model, carrying out weighted quantile screening on the sample points according to the model, wherein an elliptic equation represented by the direct algebraic fitting is as follows:
Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0 (2)
determining an algebraic fit evaluation function as:
Figure BDA0003697017900000092
to determine each coefficient, then according to the extreme principle, in order to minimize F (a, B, C, D, E, F), it is necessary to have
Figure BDA0003697017900000093
Wherein, let the vector lambda be [ A, B, C, D, E, F] t Representing the ellipse parameters.
Ellipse orthogonal geometric distance residual model: starting from the geometric equation of a general ellipse, the length of the semi-major axis of the ellipse is a, the length of the semi-minor axis is b, the direction angle alpha (the included angle between the major axis of the ellipse and the X axis), and the center (X) c ,y c ) The geometric representation of the elliptic equation is specifically:
Figure BDA0003697017900000101
to reduce the amount of computation required to find the orthogonal points, a new local coordinate system (O-XY) is established within the fitted coordinate system (O-XY). The transformation relation of the two coordinate systems is represented by a rotation matrix and a translation vector:
Figure BDA0003697017900000102
in the formula, X in the vector is translated c ,Y c Representing the coordinates of the center of the ellipse under a fitting coordinate system, wherein all the parameters areThe initial value of the iteration is provided.
In the local coordinate system, the equation of the ellipse is expressed as:
Figure BDA0003697017900000103
the tangent equation at the orthogonal point is expressed as:
Figure BDA0003697017900000104
from this, in the local coordinate system, the orthogonal geometric residual model can be written as:
Figure BDA0003697017900000105
carrying out weighted quantile screening by taking the orthogonal geometric distance residual error model as a basis, traversing sample points, and recording the square sum G (u) of orthogonal geometric residual errors corresponding to each group of sample points in an array num _ index, wherein the square sum G (u) is expressed as follows:
Figure BDA0003697017900000106
where X represents the coordinates of the data points in the fitted coordinate system and f represents a non-linear function of the orthogonal distance from the acquired data points to the ellipse.
These values are arranged from small to large, noting that the values after arrangement are:
G (1) ≤G (2) ≤...≤G (m) (11)
in the formula, G (k) Representing the corresponding G value of the kth group.
To pre-compute p, only k needs to be found, so that
Figure BDA0003697017900000111
X is then (m) <ξ p <x (k+1) When an abnormal value occursIn time, the p quantile of the selected point does not change, resulting in inaccurate threshold and poor quality of the selected point. In order to extract the quality of the selected point and reduce the influence of abnormal values on poor fitting effects, a weight function is added on the basis of the highest percentile, and the weight function is expressed as:
ξ p =(mp-k)(w' k+1 ·x (k+1) -w' k ·x (k) )+w' k ·x (k) (12)
in the formula, the sum of squares of weighted algebraic distances is expressed as:
Figure BDA0003697017900000112
in the formula, α represents a weight coefficient, and the determination formula is specifically:
Figure BDA0003697017900000113
storing G (u) corresponding to the sample points in all the steps 32 in an array best _ epipse _ par, wherein G (u) < ξ p Sample point coordinates of the condition.
Step 33: and carrying out ellipse fitting based on a particle swarm optimization algorithm on the sample points of the array best _ epipse _ par.
According to the definition of the orthogonal geometric distance residual error model in step 32, the problem of the target ellipse parameters is converted into a problem of solving a nonlinear target function, specifically:
Figure BDA0003697017900000114
in the formula, X represents the coordinate of the data point in the fitting coordinate system, f represents a nonlinear function for obtaining the orthogonal distance from the data point to the ellipse, u represents the parameter of the ellipse equation to be solved, and min represents the target function, namely the minimum value of the solved g (u).
The ellipse is characterized by a model vector u, specifically:
u=(x c y c a b α) t (16)
in the formula: (x) c ,y c ) Is the center of the ellipse, a is the major axis, b is the minor axis, and alpha is the included angle between the major axis a and the positive X half axis. The constraint conditions are satisfied as follows:
Figure BDA0003697017900000121
and (4) solving an elliptic model vector u by the elliptic objective function min through the PSO algorithm. In the PSO algorithm, each particle can update its velocity and position:
Figure BDA0003697017900000122
wherein i is the particle index; j is a dimension index; p is a radical of formula best And g best The adaptive values of (a) are the inertial weight and acceleration coefficient of the variable; k is the current iteration number; c. C 1 And c 2 Is the acceleration constant; r is 1 And r 2 Is in accordance with [0,1]Random numbers are distributed at even numbers within the range. w is an inertial weight coefficient that has the ability to trade-off global and local search capabilities. The values are shown below:
Figure BDA0003697017900000123
updating the position x and velocity v of the particle continues until the required minimum mismatch is reached. The criterion for stopping updating the two values is based on the maximum number of iterations or the required computational accuracy.
And 4, step 4: the central axis of the forging to be measured 1 is fitted by the centers of the cross sections, and finally, the inclination angle of the forging is solved by a central axis equation, which specifically comprises the following steps:
Figure BDA0003697017900000124
Figure BDA0003697017900000131
in the formula, (a, b, c) is the coordinate of a known point on a straight line, and (m, n, l) is the direction vector of a space straight line, and the direction vector is obtained by the slope of the projection equation of a three-dimensional straight line on an XOZ (YOZ) plane and corresponds to the inclination angle of X, Y.
And adjusting the platform to enable the workpiece to generate an inclination angle in the XY direction at the same time, and performing system error compensation on the measurement result, wherein the measurement results of the workpiece at different inclination angles are shown in Table 1.
TABLE 1 results of inclination measurement
Figure BDA0003697017900000132
From the data analysis in table 1, it can be seen that, when 6 groups of measurement results of different inclination angles are analyzed, the maximum measurement error is 0.04 °, the average measurement error is less than 0.03 °, and the measurement results show that the measurement method provided herein can realize accurate measurement on the inclination angles within the range of 0-3 °.
According to the traditional least square ellipse fitting technology, all sample points and the like are considered, when the measured forge piece has an abnormal value cluster, a large error occurs, iteration optimization performance is not achieved, and a large deviation occurs in an ellipse fitting result, so that the inclination measurement is inaccurate. According to the method provided by the invention, the weighting quantile method is used for eliminating the abnormal value clusters, and the ellipse fitting result and the traditional method are shown in figure 2, so that the method is fully proved to effectively eliminate the influence of the abnormal value clusters and improve the fitting precision.
A forging inclination amount measuring method based on an improved optimization algorithm fitting ellipse is characterized in that an iteration curve of G (u) is shown in FIG. 3, and the values of G (u) reach convergence around 35 th generation. The workpiece is fixed on the inclination-adjustable platform, the measurement results of the workpiece when the workpiece is inclined by 0.00 degree in the X direction and is inclined by 3.00 degrees in the Y direction are shown in fig. 4, 8 cross section measurement conditions with different heights and the central positions of the cross sections are shown in the figure, the vertical distances between adjacent cross sections are 16mm, therefore, the space coordinates of the central points of a plurality of oval major axes in the vertical direction are obtained, and finally the central axis of the forging is obtained through fitting. Due to systematic errors in the measuring device, the workpiece at different tilt angles is first measured to determine the calibration equation. Adjusting the platform to different inclinations according to the readings of the electronic inclinometer, so that the workpiece generates different postures; the inclination of the workpiece in the X (Y) direction was set to 0.00 °, then the measurements were performed in the Y (X) direction at different inclinations, the measurement range was-3 ° to 3 °, the interval was 1 °, and the measurement results in the X direction and the Y direction are shown in fig. 5.
The above-mentioned embodiments are merely illustrative of the preferred embodiments of the present invention, and do not limit the scope of the present invention, and various modifications and improvements of the technical solution of the present invention can be made by those skilled in the art without departing from the spirit of the present invention, and the technical solution of the present invention shall fall within the protection scope defined by the claims.

Claims (6)

1. The method for measuring the gradient of the forged piece based on the improved ellipse fitting optimization algorithm is characterized by comprising the following steps of: the method comprises the following steps:
step 1: controlling a stepping motor to move to drive a spiral screw rod, aligning the rotating axis of the measured forge piece to the rotating shaft, and enabling a laser range finder to reach a measuring position;
step 2: the computer drives the laser range finder and the servo motor to be started simultaneously, and the dynamic distance di between the laser range finder and the surface of the forge piece to be measured is measured;
and step 3: the system device for controlling the computer performs coordinate transformation and sample point screening on the distance information, eliminates the influence of abnormal values, and performs ellipse fitting on the screened points, and the specific steps are as follows:
step 31: the angle of each rotation of the laser range finder is recorded as theta 0 Then the angle theta of the laser range finder rotated at a certain position is k theta 0 And k represents the k point swept by the laser range finder, and the position coordinate (x) of the k point k ,y k ) Namely, the coordinates of the sample points of the profile of the measured forging are as follows:
x k =(L-d)·cosθ
y k =(L-d)·sinθ
in the formula: l represents the distance from the laser range finder to the rotation center, and d represents the distance from the laser range finder to the surface of the measured forging;
step 32: carrying out random area division on the sample points of the measured cross section profile of the measured forge piece obtained in the step 31, randomly and uniformly dividing the sample points into 6 areas each time, randomly selecting one sample point from each area, and carrying out direct algebraic fitting on the selected sample point, wherein an elliptic equation represented by the direct algebraic fitting is as follows:
Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0
traversing all sample points, constructing an orthogonal geometric distance residual error model, carrying out weighted quantile screening by taking the model as a basis, and storing the sample points corresponding to the orthogonal geometric residual errors meeting the conditions;
step 33: according to the definition of the orthogonal geometric distance residual error model in the step 32, the problem of the target ellipse parameters is converted into the problem of solving a nonlinear target function, the minimum orthogonal geometric distance residual error of the fitting ellipse and the sample point selected in the step 32 is set as the target function, the ellipse is characterized by a model vector u, and the method specifically comprises the following steps:
u=(x c y c a b α) t
in the formula: (x) c ,y c ) Is the center of an ellipse, a is a major axis, b is a minor axis, and alpha is the included angle between the major axis a and the positive X half axis; the constraint conditions are satisfied as follows:
C1:a,b∈R +
C2:b≤a
C3:θ c ∈[0,π)
C4:x c ,y c ∈R
solving an objective function by utilizing a particle swarm optimization algorithm, wherein a model vector u corresponding to the objective function is a fitting ellipse parameter;
and 4, step 4: the central axis of the measured forge piece is fitted by the center of each cross section, and finally, the tilt angle of the forge piece is solved by a central axis equation, which specifically comprises the following steps:
Figure FDA0003697017890000021
Figure FDA0003697017890000022
Figure FDA0003697017890000023
in the formula, (a, b, c) is the coordinate of a known point on a straight line, and (m, n, l) is the direction vector of a space straight line, and the direction vector is obtained by the slope of the projection equation of a three-dimensional straight line on an XOZ (YOZ) plane and corresponds to the inclination angle of X, Y.
2. The method for measuring the inclination of a forging based on the improved ellipse fitting optimization algorithm of claim 1, wherein the algebraic fitting method in the step 32 is as follows: by the formula
Figure FDA0003697017890000024
To determine each coefficient, then according to the extreme principle, in order to minimize F (a, B, C, D, E, F), it is necessary to have
Figure FDA0003697017890000025
Wherein, let the vector lambda be [ A, B, C, D, E, F] t Representing the ellipse parameters.
3. The method for measuring the inclination of a forging based on the improved ellipse fitting optimization algorithm according to claim 1, wherein the ellipse orthogonal geometric distance residual error model building process in the step 32 is as follows:
starting from the geometric equation of a general ellipse, the length of the semi-major axis of the ellipse is a, and the length of the semi-minor axis isDegree b, direction angle alpha (included angle between the main axis of the ellipse and the X axis), center (X) c ,y c ) The geometric representation of the elliptic equation is specifically:
Figure FDA0003697017890000031
in order to reduce the amount of computation required when finding the orthogonal points, a new local coordinate system (O-XY) is established in the fitted coordinate system (O-XY), the transformation relationship of the two coordinate systems being represented by a rotation matrix and a translation vector:
Figure FDA0003697017890000032
Figure FDA0003697017890000033
in the formula, X in the vector is translated c ,Y c Representing the center coordinates of the ellipse under a fitting coordinate system, wherein the parameters are provided by iterative initial values;
in the local coordinate system, the equation of the ellipse is expressed as:
Figure FDA0003697017890000034
the tangent equation at the orthogonal point is expressed as:
Figure FDA0003697017890000035
from this, the orthogonal geometric residual model can be written as:
Figure FDA0003697017890000036
4. the method for measuring the inclination of a forging based on the improved ellipse fitting optimization algorithm according to claim 1, wherein the sample point screening method in the step 32 is as follows:
screening the sample points in the step 32 by using a weighted quantile method, traversing the sample points, and recording the orthogonal geometric residual square sum g (u) corresponding to each group of sample points in an array num _ index, wherein the orthogonal geometric residual square sum g (u) is expressed as:
Figure FDA0003697017890000041
wherein X represents the coordinate of the data point in the fitting coordinate system, and f represents a nonlinear function for obtaining the orthogonal distance from the data point to the ellipse;
these values are arranged from small to large, noting that the values after arrangement are:
G (1) ≤G (2) ≤...≤G (m)
in the formula, G (k) Represents the corresponding G value of the k group;
to pre-compute p, only k needs to be found, so that
Figure FDA0003697017890000042
X is then (m) <ξ p <x (k+1) When an abnormal numerical value occurs, the p quantile of the selected point cannot be changed, so that the threshold value is inaccurate, and the quality of the selected point is poor; in order to extract the quality of the selected points and reduce the influence of abnormal values on poor fitting effects, a weight function is added on the basis of the highest percentile, and is expressed as follows:
ξ p =(mp-k)(w' k+1 ·x (k+1) -w' k ·x (k) )+w' k ·x (k)
in the formula, the sum of squares of weighted algebraic distances is expressed as:
Figure FDA0003697017890000043
in the formula, α represents a weight coefficient, and the determination formula is specifically:
Figure FDA0003697017890000044
Figure FDA0003697017890000045
storing G (u) corresponding to the sample points in all the steps 32 in an array best _ epipse _ par, wherein G (u) < ξ p Sample point coordinates of the condition.
5. The method for measuring the inclination of a forging based on the improved ellipse fitting optimization algorithm according to claim 4, wherein the objective function establishing method in the step 33 is as follows:
according to the definition of the geometric fitting algorithm on the error distance, the problem of solving the target ellipse parameters by the sample points of the logarithm group best _ ellipse _ par is converted into the problem of solving the nonlinear objective function, and the method specifically comprises the following steps:
Figure FDA0003697017890000051
in the formula, X represents the coordinate of the data point in the fitting coordinate system, f represents a nonlinear function for obtaining the orthogonal distance from the data point to the ellipse, u represents the parameter of the ellipse equation to be solved, and min represents the target function, namely the minimum value of the solved g (u).
6. The method for measuring forging inclination based on improved ellipse fitting optimization algorithm of claim 5, wherein said ellipse objective function min is capable of calculating an ellipse from a model vector u by said particle group optimization algorithm in step 33; in the PSO algorithm, each particle can update its velocity and position:
Figure FDA0003697017890000052
Figure FDA0003697017890000053
wherein i is the particle index; j is a dimension index; p is a radical of best And g best The adaptive values of (a) are the inertial weight and acceleration coefficient of the variable; k is the current iteration number; c. C 1 And c 2 Is the acceleration constant; r is 1 And r 2 Is in accordance with [0,1]Random numbers distributed at even numbers within the range; w is an inertial weight coefficient that has the ability to trade-off global and local search capabilities, with values as follows:
Figure FDA0003697017890000054
Figure FDA0003697017890000055
updating the position x and velocity v of the particle continues until the required minimum mismatch is reached. The criterion for stopping updating the two values is based on the maximum number of iterations or the required computational accuracy.
CN202210682961.XA 2022-06-16 2022-06-16 Method for measuring inclination of forging based on improved elliptic fitting optimization algorithm Active CN115096261B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210682961.XA CN115096261B (en) 2022-06-16 2022-06-16 Method for measuring inclination of forging based on improved elliptic fitting optimization algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210682961.XA CN115096261B (en) 2022-06-16 2022-06-16 Method for measuring inclination of forging based on improved elliptic fitting optimization algorithm

Publications (2)

Publication Number Publication Date
CN115096261A true CN115096261A (en) 2022-09-23
CN115096261B CN115096261B (en) 2023-08-18

Family

ID=83291270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210682961.XA Active CN115096261B (en) 2022-06-16 2022-06-16 Method for measuring inclination of forging based on improved elliptic fitting optimization algorithm

Country Status (1)

Country Link
CN (1) CN115096261B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116205923A (en) * 2023-05-06 2023-06-02 威海锐鑫丰金属科技有限公司 Nondestructive testing method for internal defects of automobile hub based on X-RAY
CN117824487A (en) * 2024-03-04 2024-04-05 南京师范大学 High-precision intelligent detection method for differential mechanism tool of pipeline robot

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5208763A (en) * 1990-09-14 1993-05-04 New York University Method and apparatus for determining position and orientation of mechanical objects
CN102162728A (en) * 2010-12-17 2011-08-24 南京工程学院 Method for evaluating minimum area of line profile error of cross section of skirt part of variable-ellipse piston
CN106595593A (en) * 2016-11-10 2017-04-26 西安工程大学 Method for monitoring windage deviation of suspension insulator strings based on ellipse fitting
CN109916343A (en) * 2019-04-08 2019-06-21 西安交通大学 A kind of measurement method and system using single laser sensor detection concentricity
CN111780745A (en) * 2020-06-29 2020-10-16 南京航空航天大学 Short arc ellipse fitting optimization method for deep space exploration optical navigation
US20210095959A1 (en) * 2019-01-24 2021-04-01 Dalian University Of Technology 3D measurement model and spatial calibration method based on 1D displacement sensor
CN113419280A (en) * 2021-06-21 2021-09-21 大庆油田有限责任公司 Pre-stack crack density estimation method based on improved ellipse fitting
CN114353690A (en) * 2021-12-13 2022-04-15 燕山大学 On-line detection device and detection method for roundness of large aluminum alloy annular forging

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5208763A (en) * 1990-09-14 1993-05-04 New York University Method and apparatus for determining position and orientation of mechanical objects
CN102162728A (en) * 2010-12-17 2011-08-24 南京工程学院 Method for evaluating minimum area of line profile error of cross section of skirt part of variable-ellipse piston
CN106595593A (en) * 2016-11-10 2017-04-26 西安工程大学 Method for monitoring windage deviation of suspension insulator strings based on ellipse fitting
US20210095959A1 (en) * 2019-01-24 2021-04-01 Dalian University Of Technology 3D measurement model and spatial calibration method based on 1D displacement sensor
CN109916343A (en) * 2019-04-08 2019-06-21 西安交通大学 A kind of measurement method and system using single laser sensor detection concentricity
CN111780745A (en) * 2020-06-29 2020-10-16 南京航空航天大学 Short arc ellipse fitting optimization method for deep space exploration optical navigation
CN113419280A (en) * 2021-06-21 2021-09-21 大庆油田有限责任公司 Pre-stack crack density estimation method based on improved ellipse fitting
CN114353690A (en) * 2021-12-13 2022-04-15 燕山大学 On-line detection device and detection method for roundness of large aluminum alloy annular forging

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
代杰;赵现朝;刘仁强;: "基于激光扫描的大锻件三维尺寸测量" *
代杰;赵现朝;刘仁强;: "基于激光扫描的大锻件三维尺寸测量", 机械设计与研究, vol. 27, no. 03, pages 82 - 85 *
陈若珠;孙岳;: "基于最小二乘法的椭圆拟合改进算法研究" *
陈若珠;孙岳;: "基于最小二乘法的椭圆拟合改进算法研究", 工业仪表与自动化装置, no. 02, pages 35 - 39 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116205923A (en) * 2023-05-06 2023-06-02 威海锐鑫丰金属科技有限公司 Nondestructive testing method for internal defects of automobile hub based on X-RAY
CN117824487A (en) * 2024-03-04 2024-04-05 南京师范大学 High-precision intelligent detection method for differential mechanism tool of pipeline robot

Also Published As

Publication number Publication date
CN115096261B (en) 2023-08-18

Similar Documents

Publication Publication Date Title
CN115096261A (en) Method for measuring forging inclination based on improved ellipse fitting optimization algorithm
CN111536902B (en) Galvanometer scanning system calibration method based on double checkerboards
CN111486802B (en) Rotating shaft calibration method based on self-adaptive distance weighting
CN112396664B (en) Monocular camera and three-dimensional laser radar combined calibration and online optimization method
CN109029299B (en) Dual-camera measuring device and method for butt joint corner of cabin pin hole
CN108340211A (en) Numerically-controlled machine tool profile errors method for three-dimensional measurement based on monocular vision
CN111982019B (en) High-precision blade section contour detection method based on line-structured light sensor
CN111811395A (en) Monocular vision-based dynamic plane pose measurement method
CN113189568B (en) Laser radar calibration device and method
CN114353690B (en) On-line detection device and detection method for roundness of large aluminum alloy annular forging
CN113465543B (en) Three-dimensional measurement system and method based on multi-view vision and galvanometer laser scanning
CN113155047B (en) Long-distance hole distance measuring device and method, storage medium, equipment and rail vehicle
CN114770517B (en) Method for calibrating robot through point cloud acquisition device and calibration system
CN207456381U (en) Improve the device of laser tracker measurement accuracy
CN114770516A (en) Method for calibrating robot through point cloud obtaining device and calibration system
CN115077378A (en) Line scanning laser hand-eye calibration method applied to large workpiece measurement
CN112525106B (en) Three-phase machine cooperative laser-based 3D detection method and device
CN109773589A (en) Method and device, the equipment of on-line measurement and processing guiding are carried out to workpiece surface
Yang et al. A fast calibration of laser vision robotic welding systems using automatic path planning
CN110954022A (en) Rotary scanning structure and calibration method for circular object
CN110706292B (en) Two-dimensional workbench error self-calibration method based on machine vision
CN115482276A (en) High-precision calibration method based on phase shift deflection measurement system
CN107860309B (en) Method and device for improving measurement precision of laser tracker
CN115752293B (en) Calibration method of aero-engine sealing comb plate measuring system
CN117665780B (en) Laser scanner system error calibration target selection method, system and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant