# Application of Mathematical Morphology in Solving the Profile of Forming Grinding Wheel

Authors: Minglin You; Bin Yao
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

In the development of modern tools, the flute (or profiling flute) after design optimization is often obtained by grooving with a forming grinding wheel. At present, the main method of reverse forming wheel profile is the analytical method, which needs to solve the contact line equation according to the contact conditions. It is difficult to solve the equation. The solution value is unstable, which leads to the design error of the grinding wheel profile. In order to solve this problem, this paper proposes a new algorithm, called the pixel matrix method for short. This method is based on the spiral motion envelope method and mathematical morphology. First, the cross-section of the flute is discretized into a point cloud, and then, the envelope motion is carried out in the grinding wheel coordinate system. Second, the point cloud of the grinding wheel radial section is collected and converted into a binary image of pixel points. Finally, the profile of the binary image is extracted by erosion and dilation. The optimized profile of the formed grinding wheel reaches the accuracy requirements of the design and processing in the actual machining verification. This method can accurately reverse the profile of the forming grinding wheel. The calculation process is intuitive, avoiding the solution of the contact line equation, and the solution value is stable. It provides a new way to reverse the profile of the machining tool for cylindrical spiral products.


---

## Body

## 1. Introduction

As the “teeth” of industrial manufacturing, cutting tools play an important role in the processing quality and effectiveness of products. The performance of a tool depends mainly on the design of the spiral groove and grinding process. To obtain a good cutting effect and tool life, the flute needs to meet the specific structural requirements related to the rake angle, core radius, spiral angle, chip breaking, and chip removal [1]. A forming grinding wheel is often used to perform grooving in the design and optimization of a spiral groove. Therefore, it becomes particularly important to apply the reverse method of calculating the section of the forming grinding wheel based on the designed flute. It is also the key to realize high-precision grinding of the flute.Based on the meshing relationship between the grinding wheel and the spiral groove, Litvin and Fuentes [2] proposed an analytical solution, which focused on the meshing principle and considered the common normal direction at the contact point between the grinding wheel and flute as perpendicular to the direction of speed of relative motion; the solution determined the contact point between the rotating surface of the grinding wheel and helical surface processed by the grinding wheel. According to the condition that the contact point lies on both the rotating surface and spiral surface of the grinding wheel, the contact point is rotated around the axis of the grinding wheel, and the grinding wheel contour equation is obtained after fitting. Uhlman et al. [3] optimized the grinding wheel design for flute grinding processes by using the numerical analysis of complex contact conditions. Wasif et al. [4] used a five-axis NC grinding process combined with contact conditions to generate a simplified grinding wheel geometry for grinding end mills. Jianmin et al. [5] based on the principle of form grinding, combined with the meshing principle and the numerical method of piecewise accumulative chord length parameters, gave the basic calculation process of the profile of the form grinding wheel. Ren et al. [6], combined with contact conditions, gave a general and effective method for grinding cylindrical milling cutter with five-axis NC tools. Wei et al. [7] established a mathematical model for the cross-section profile design of a precision-grinding helical grinding wheel based on the gear meshing theory. By using the profile design method of forming tools based on the meshing principle and spline interpolation method, Tang et al. [8] combined the contact line shape generated by the coordinated movement of the machine tool, screw, and tool with the spatial position parameters and proposed the form position geometry method (FPGM), which avoids the task of solving the first derivative of each discrete point in the traditional contact line method. Shen et al. [9] introduced the parametric design method of grinding wheel with an arbitrary groove on the spiral rake face of the tool. Li [10] introduced a grinding wheel contour calculation algorithm based on the envelope and analytic geometry theory.The above methods are all based on complex mathematical equations, and their constraints are also described by mathematical models, which are called analytical methods. It has high accuracy and does not need too many iterative operations. During the process of solving, the analytical method established according to the surface conjugate theory often suffers from problems such as complex numerical solution, nonlinearity, and instability due to the complexity of the contact line equation. Especially, a solution cannot be obtained when there is no normal at a point on the contour of the grinding wheel. In addition, if the grinding wheel contour has a conic curve such as a circular arc, the transcendental equation needs to be solved, and the exact analytical solution cannot be obtained.With the rapid development of computer speed, researchers have proposed a new method, called the graphical method, which can obtain an accurate profile by using the envelope boundary. It avoids the use of the traditional complex surface meshing equation by simulating the envelope motion process of the helical surface and replacing the traditional conjugate principle. Chong and Ibrahim [11] developed computer vision measurement for end mill and realized cutter parameter measurement by image recognition. Karasawa et al. [12] used image processing technology to analyze the wear condition of the grinding wheel. Wu et al. [13] proposed the radial ray shooting method to segment the envelope curve cluster. They used the radial ray method to scan the approximate arc center position to extract the grinding wheel section profile. Chen et al. [14] introduced an image processing method for checking the accuracy of the grinding wheel profile in microdrill groove processing. Yang et al. [15–17] solved the formed grinding wheel of the screw compressor rotor based on the graphical edge detection method, avoiding the difficulty of solving the complex nonlinear contact line equation when using the analytical method. It can effectively obtain point cloud data to remove singular points, with high accuracy, and can extract relatively ideal edges. This method has reference value in the design of the grinding wheel profile for forming a grinding screw rotor. Shen et al. [18] proposed the digital graphic scanning method (DSG) to obtain the contour data of the rotor by scanning the pixels of the envelope surface in the tool cutting path on the screen.The above graphical methods need to scan point by point to obtain the boundary of the envelope profile and judge the validity of the boundary points point by point, which makes it difficult to remove the singular points of the point cloud data in the process of extracting the boundary, and the processing efficiency is relatively low. Because the accuracy of the image boundary depends on the trajectory planning, the number of pixels, and the fitting accuracy of the curve, there is still a large error between the boundary extraction and the theoretical curve. Therefore, the identification or extraction of the profile boundary of the formed grinding wheel has become a new difficulty and research topic. Many scholars have developed a variety of graphical methods, which enable the algorithm more efficient and accurate in identifying or extracting the theoretical profile boundary of the grinding wheel.Similarly, in order to avoid the analytic solution, this paper proposes a binary image processing algorithm, which combines the meshing motion envelope method and mathematical morphology, called the pixel matrix method for short. This method tries to use the idea of mathematical morphology to view the point cloud pixels as a set to extract the point cloud boundary, which eliminates the process of scanning and one-by-one boundary judgment. At the same time, the pixel matrix method, like other graphical methods, avoids the solution of the contact line equation. The calculation process is intuitive, and the solution value is stable. The pixel matrix method is another innovative research and application of the graphic method to obtain the profile of the shaped grinding wheel. This method is also suitable for the reverse calculation of forming tools. It provides a new way to obtain the section profile of spiral groove forming tools that meet the requirements of design and machining accuracy in theory.The remainder of this paper is organized as follows: in Section2, the basis of point cloud generation is derived by using the envelope principle of the flute. Section 3 presents the method and steps of extracting the profile of the formed grinding wheel based on mathematical morphology; in Section 4, simulation examples and actual machining are provided. Finally, Section 5 summarizes the study.


## 2. Envelope  Principle of Known Flute End Cross-Section for Determining Grinding Wheel Section Profile

In this paper, according to the envelope model proposed by Kang et al. [19, 20], Figure 1 shows the tool end cross-section curve Γ. Its vector equation can be expressed as follows:(1)r0=r0u,where u is a parameter variable. Furthermore, r0 can also be expressed as follows:(2)r0=x0ui+y0uj.Figure 1
Tool section profile.Equation (3) for the spiral surface of the flute can be obtained using the spiral motion of the profile curve Γ around the tool axis.(3)x=x0ucosθ−y0usinθ,y=x0usinθ+y0ucosθ,z=pθ,where θ is a parameter variable, which indicates the angle at which the section curve at the tool end rotates around the z-axis from the beginning; p is a helix parameter, which indicates the distance covered along the axial direction when the section curve at the tool end turns around the z-axis by a unit angle.The relative positions of the tool workpieces machined with the forming grinding wheels are shown in Figure2. The tool workpiece coordinate system o;x,y,z was fixed on the tool workpiece such that the z-axis coincided with the workpiece axis. The grinding wheel coordinate system o′;X,Y,Z was fixed on the grinding wheel, and its origin o′ was located at the center of the front face of the grinding wheel. The angle between the tool axis and workpiece axis was Σ, and the distance between the origins of the two coordinate systems along the y-axis direction was denoted as a (called the center distance); the distance along the x-axis direction was e (called the eccentricity), and the distance along the z-axis direction was d (distance before the end).Figure 2
Schematic of installation position of forming grinding wheel.According to the principle of coordinate transformation, the transformation matrix between the workpiece coordinate systemo;x,y,z and grinding wheel coordinate system o′;X,Y,Z can be expressed as follows:(4)M=−cosΣ0−sinΣ−e010a−sinΣ0cosΣd0001.The coordinates of the helical surface in the grinding wheel coordinate systemo′;X,Y,Z can be expressed as follows:(5)X=−xcosΣ−zsinΣ−e,Y=y+a,Z=−xsinΣ+zcosΣ+d.Then, the point cloud of the spiral surface is rotated around the axis of the grinding wheel, and the rotating surface of the sand wheel in its axial plane is expressed as shown in equation (6). The profile of the grinding wheel is shown in Figure 3.(6)Rg=X2+Y2,Zg=Z,where Zg is the thickness direction, and Rg is the radial direction of the grinding wheel.Figure 3
Section profile of forming grinding wheel.


## 3. Algorithm  for Extracting the Profile of Shaped Grinding Wheel Based on Mathematical Morphology

The proposed algorithm for extracting the profile of the shaped grinding wheel based on mathematical morphology is called the pixel matrix method. It is intended to quickly obtain the boundary of the point cloud after converting a large number of point cloud data into pixels based on the principle of combining computer image processing with the mathematical morphology. The specific algorithm for obtaining the profile of the shaped grinding wheel can be divided into the following steps:(1)
The discrete data points of the cross-section profile of the flute are interpolated and densified.(2)
The dense data points are used to generate the helicoid, and then, the data points of the grinding wheel section are enveloped to generate the data points. The boundary conditions are set to obtain the coordinates of the target point cloud of the grinding wheel section.(3)
The target point cloud is binarized, and the boundary of the binary image is extracted using mathematical morphology.(4)
The extracted wheel cross-section profile is optimized using the slope method to obtain the pixel points that are closer to the theoretical profile, and the actual wheel cross-section profile is obtained by restoring the wheel coordinates through the coordinate mapping relationship.


### 3.1. Densification of the Cross-Section Profile Point of the Flute

The cross-section profile point of the flute, indicated by the discrete points of the flute under the workpiece coordinates, isxi,yi, as shown in Figure 4, in which r is the radius of the tool.Figure 4
The cross-section profile of the flute.Two types of mathematical models are used for the end cross-section of the flute: the first is the vector model, which is given in the form of equation (1). The profile of the end cross-section of the flute can be obtained by discretizing the parameter u. The other model describes the section shape of the flute in the form of discrete points according to the following equation:(7)fx=x1,y1,x2,y2,……,xn,yn.In this case, because the number of points is limited, the profile of the end cross section of the flute can be interpolated and densified by the cubic spline curve.According to the definition of the spline curve, letsx be the cubic spline interpolation function of fx. Then, we can know that each segment of sxxi,xi+1 is a cubic polynomial function curve, which can pass through n+1 fixed points xi,yi, i=0,1,…,n. The specific expression for each curve can be obtained by calculating the coefficients in each spline curve equation. Each segment expression can be set as follows:(8)six=ai+bix−xi+cix−xi2+dix−xi3,where ai, bi, ci, di are undetermined coefficients.Obviously, the differential equation of the spline curve can be expressed as follows:(9)si′x=bi+2cix−xi+3dix−xi2,(10)si″x=2ci+6dix−xi.According to the definition, a units of sx, i.e., six, needs to meet two conditions.(1)
Interpolation and continuity conditions are as follows:(11)sixi=yi,sixi+1=yi+1,where i=0,1,…,n−1.(2)
Differential continuity condition is as follows:(12)si′xi+1=si+1′xi+1,si″xi+1=si+1″xi+1,where i=0,1,…,n−2.Then, the data nodes and the specified first endpoint conditions are brought into the matrix equation, and the pursuit method is used to solve the tridiagonal matrix equation to obtain the coefficients of each section of the spline curve, as shown in the following equation:(13)ai=yi,bi=yi+1−yihi−hi2mi−hi6mi+1−mi,ci=mi2,di=mi+1−mi6hi,where mi=si″xi=ci, i=0,1,…,n−1, and hi is the step size.Finally, the interpolatedxm is examined in the subinterval of [xi,xi+1], through which the six function is used to calculate the corresponding interpolation ym. The cubic spline interpolation points of each interval are drawn to obtain the densification point cloud of the flute, as shown in Figure 5.Figure 5
Densification point cloud of the flute.


### 3.2. Acquisition of Target Point Cloud under Point Cloud Envelope and Boundary Conditions

In the workpiece coordinate systemo;x,y,z, the point cloud of the end face profile of the tool flute after densification is spirally moved according to the screw parameter p; the point cloud on the cross-section of the grinding wheel is generated after enveloping the point cloud of the spiral surface formed according to the envelope principle, as shown in Figure 6. The cloud equation for generating the discrete space point set of the tool flute surface is as follows:(14)xiT=xicosθj−yisinθj,yiT=xisinθj+yicosθj,ziT=pθj,where i∈1,n, j∈1,m.Figure 6
Spiral surface of flute.According to the transformation matrixM of the workpiece coordinates and grinding wheel coordinates in equation (4), the calculation formula for calculating the conversion of the helicoid point cloud to the grinding wheel coordinates is as follows:(15)XiYiZi=MxiTyiTziT,where i∈1,n.The helicoid point cloudXi,Yi,Zi is converted to the grinding wheel coordinate around the grinding wheel axis. Then, all the point clouds Zgi,Rgi on the grinding wheel section are obtained according to equation (16), as shown in Figure 7.(16)Rgi=Xi2+Yi2,Zgi=Zi,where i∈1,n.Figure 7
Plane point cloud diagram of grinding wheel section profile.According to the envelope principle and processing conditions, the target point cloud can be determined through the following boundary conditions:(1)
Rg of the target point cloud is less than the set center distance a.(2)
The target point clouds are between the pointsP1Zg1,Rg1 and P2Zg2,Rg2. The target point cloud is in the Zg direction, and the coordinates are in the interval Zg1,Zg2, as shown in Figure 8.Figure 8
Schematic diagram of point cloud boundary of grinding wheel section profile.According to the above boundary conditions, the matrix form of the point cloud of the target grinding wheel section is expressed as equation (17), and the target point cloud satisfying the boundary conditions is shown in Figure 9.(17)Zg1Rg1Zg2Rg2⋮⋮ZgnRgn⟶findRg≤afindZg1≤Zg≤Zg2Zg1Rg1Zg2Rg2⋮⋮ZgdRgd.Figure 9
Cloud diagram of target points on the profile plane of grinding wheel section.


### 3.3. Boundary Extraction Algorithm of Mathematical Morphology

Mathematical morphology is a widely used technology in image processing. It is mainly used to extract meaningful image components to express or describe the shape of a region from an image. Based on the geometry, it focuses on the collection structure of the images [19].The research object of this paper is the grinding wheel. The key feature of the point cloud binary image of its cross-section is that each pixel in the binary image is 8-connected; that is, the connected features form the internal composition as shown in Figure10.Figure 10
Connectivity of grinding wheel section area.Finally, the binary image boundary is extracted through the dilation and erosion operations of mathematical morphology [20], and the final image boundary is marked as shown in Figure 11.Figure 11
Illustration of image boundary marking.LetA be the original image, and B be the “structural element.” Mathematical morphology erosion is expressed as equation (18), and the schematic is shown in Figure 12.(18)E=A⊝B.Figure 12
Schematic of morphological erosion.Similarly, the dilation operation process is shown in Figure13, and the operation is expressed as follows:(19)D=A⊕B.Figure 13
Schematic of morphological dilation.The operation on the boundary is shown in Figure14 and is expressed as follows:(20)βA=A−A⊝B=A−E.Figure 14
Schematic of extracting the boundary of the binary image.To realize the conversion between the data points and pixels, the point cloud data should be prepared for binary processing such as scaling, translation, and rounding operations to ensure that the pixel coordinates are positive integers. The point cloud is converted from the point cloud coordinatesZgi,Rgi of the grinding wheel section profile plane, shown in equation (21), into the pixel coordinates Zgip,Rgip. The converted image is shown in Figure 15.(21)Zg1pRg1pZg2pRg2p⋮⋮ZgnpRgnp=x1y1x2y2⋮⋮xnyn100010−xmin−ymin1,where xi=intN∗Zgi, yi=intN∗Rgi; int indicates a rounding operation, and N is the zoom factor.Figure 15
Image after point cloud zoom rounding translation.Here,xmin=minxi, ymin=minyi, i=1,2,…,n.Then, binarization is performed to generate a binarized image.The maximum valuesxpmax, ypmax and minimum values xpmin, ypmin are extracted to construct a matrix. The matrix element at the position Zgip,Rgip is “1” in equation (22). The other element in the matrix is “0.” The point cloud of the flute is established using the binary matrix, which binarizes the coordinates of the point clouds, and then, the binary image is generated according to the binarization matrix.(22)00000⋯001100001⋯111100111⋯1100⋮⋮⋮⋮⋮⋯⋮⋮⋮⋮11111⋯000011000⋯0000ypmaxypminxpminxpmaxThe binary point cloud image can be processed using the dilation and erosion algorithm of the mathematical morphology, and the profile curve of the forming wheel can be extracted. The resulting image after the dilation operation is shown in Figure16. The image obtained after the edge erosion operation using the erosion algorithm is shown in Figure 17.Figure 16
Result of mathematical morphology dilation operation.Figure 17
Result of mathematical morphology boundary extraction.


### 3.4. Boundary Extraction and Optimization Processing of Binary Image of Grinding Wheel Section Profile

The basic morphological operations of the binary images in the mathematical morphology include dilation, erosion, opening, and closing. As some nonexistent pixels are added or filled in the filling process of the dilation operation, as shown in Figure18, a stepped contour pixel boundary appears.Figure 18
Actual pixel points.In this study, the slope method was used to optimize the boundary extracted through mathematical morphology. The slope method can reduce the deviation caused by the dilation operation.The algorithm of the slope method calculates the slope between the characteristic pixels. To extract the pixels closer to the real contour, it calculates the interpolated pixels when the pixels change in thex or y direction (the pixels are called the characteristic pixels), instead of the pixels between the two characteristic pixels.As shown in Figure19, according to the change in the profile curvature, the computation begins at the starting pixel point (the pixel point with the smallest coordinate value Y) in a pixel unit (composed of a column of pixel points) and proceeds point-by-point with the comparison of the calculation results.Figure 19
Distribution of pixel points on contour boundary.Set the starting pixel point of the first-pixel unit as the starting point, and the given starting point coordinate isP11x11,y11. The starting pixel coordinate of the nth pixel unit is Pnixni,yni, where n=1,2,…; i denotes the pixel point, where i=1,2,…, and i = 1 is the starting point of the nth pixel unit. Then, the slope between any pixel point P11 and the nth pixel unit can be defined as equation (23). kni=arctanyni−y11/x11−xni(23)kni=tanyni−y11x11−xni.The position is taken with the minimum slope in each pixel unit, as follows:(24)minkni=k21,k31,…,kn1.Thus, only the pixel point with the smallest slope is reserved for extracting the pixel unit on the same vertical axis. On the contrary, after the curvature of the pixel points is reversed, the position pixel with the largest slope can be reserved, and the filtered pixel points can be regarded as the characteristic pixel points.Assume that the coordinates of the starting pixel of the nth pixel unit arePn1xn1,yn1, and the coordinates of the starting pixel of the n+1-th pixel unit are Pn+11xn+11,yn+11. The spline interpolation function is established through the interpolation method. Taking the y value of the pixel points as the independent variable, various pixel coordinate values x are obtained as the compensated pixel points to increase the number of pixel points. Thus, an approximate contour line is obtained, as shown in Figure 20. The interpolated pixel points can be expressed as follows:(25)y=x−xn1×yn+11−yn1xn1−xn+11+yn1.Figure 20
Interpolated pixel points and approximate contour lines.Finally, the grinding wheel profile coordinates are restored, and the theoretical contour is mapped to the pixel coordinatesxp,yp through the zoom and translation operations to obtain the corresponding grinding wheel profile coordinates Zgp,Rgp. The transformation is expressed as follows:(26)Zgp1Rgp1Zgp2Rgp2⋮⋮ZgpnRpn=xp1Nyp1Nxp2Nyp2N⋮⋮xpnNypnN100010xminymin1.


## 3.1. Densification of the Cross-Section Profile Point of the Flute

The cross-section profile point of the flute, indicated by the discrete points of the flute under the workpiece coordinates, isxi,yi, as shown in Figure 4, in which r is the radius of the tool.Figure 4
The cross-section profile of the flute.Two types of mathematical models are used for the end cross-section of the flute: the first is the vector model, which is given in the form of equation (1). The profile of the end cross-section of the flute can be obtained by discretizing the parameter u. The other model describes the section shape of the flute in the form of discrete points according to the following equation:(7)fx=x1,y1,x2,y2,……,xn,yn.In this case, because the number of points is limited, the profile of the end cross section of the flute can be interpolated and densified by the cubic spline curve.According to the definition of the spline curve, letsx be the cubic spline interpolation function of fx. Then, we can know that each segment of sxxi,xi+1 is a cubic polynomial function curve, which can pass through n+1 fixed points xi,yi, i=0,1,…,n. The specific expression for each curve can be obtained by calculating the coefficients in each spline curve equation. Each segment expression can be set as follows:(8)six=ai+bix−xi+cix−xi2+dix−xi3,where ai, bi, ci, di are undetermined coefficients.Obviously, the differential equation of the spline curve can be expressed as follows:(9)si′x=bi+2cix−xi+3dix−xi2,(10)si″x=2ci+6dix−xi.According to the definition, a units of sx, i.e., six, needs to meet two conditions.(1)
Interpolation and continuity conditions are as follows:(11)sixi=yi,sixi+1=yi+1,where i=0,1,…,n−1.(2)
Differential continuity condition is as follows:(12)si′xi+1=si+1′xi+1,si″xi+1=si+1″xi+1,where i=0,1,…,n−2.Then, the data nodes and the specified first endpoint conditions are brought into the matrix equation, and the pursuit method is used to solve the tridiagonal matrix equation to obtain the coefficients of each section of the spline curve, as shown in the following equation:(13)ai=yi,bi=yi+1−yihi−hi2mi−hi6mi+1−mi,ci=mi2,di=mi+1−mi6hi,where mi=si″xi=ci, i=0,1,…,n−1, and hi is the step size.Finally, the interpolatedxm is examined in the subinterval of [xi,xi+1], through which the six function is used to calculate the corresponding interpolation ym. The cubic spline interpolation points of each interval are drawn to obtain the densification point cloud of the flute, as shown in Figure 5.Figure 5
Densification point cloud of the flute.


## 3.2. Acquisition of Target Point Cloud under Point Cloud Envelope and Boundary Conditions

In the workpiece coordinate systemo;x,y,z, the point cloud of the end face profile of the tool flute after densification is spirally moved according to the screw parameter p; the point cloud on the cross-section of the grinding wheel is generated after enveloping the point cloud of the spiral surface formed according to the envelope principle, as shown in Figure 6. The cloud equation for generating the discrete space point set of the tool flute surface is as follows:(14)xiT=xicosθj−yisinθj,yiT=xisinθj+yicosθj,ziT=pθj,where i∈1,n, j∈1,m.Figure 6
Spiral surface of flute.According to the transformation matrixM of the workpiece coordinates and grinding wheel coordinates in equation (4), the calculation formula for calculating the conversion of the helicoid point cloud to the grinding wheel coordinates is as follows:(15)XiYiZi=MxiTyiTziT,where i∈1,n.The helicoid point cloudXi,Yi,Zi is converted to the grinding wheel coordinate around the grinding wheel axis. Then, all the point clouds Zgi,Rgi on the grinding wheel section are obtained according to equation (16), as shown in Figure 7.(16)Rgi=Xi2+Yi2,Zgi=Zi,where i∈1,n.Figure 7
Plane point cloud diagram of grinding wheel section profile.According to the envelope principle and processing conditions, the target point cloud can be determined through the following boundary conditions:(1)
Rg of the target point cloud is less than the set center distance a.(2)
The target point clouds are between the pointsP1Zg1,Rg1 and P2Zg2,Rg2. The target point cloud is in the Zg direction, and the coordinates are in the interval Zg1,Zg2, as shown in Figure 8.Figure 8
Schematic diagram of point cloud boundary of grinding wheel section profile.According to the above boundary conditions, the matrix form of the point cloud of the target grinding wheel section is expressed as equation (17), and the target point cloud satisfying the boundary conditions is shown in Figure 9.(17)Zg1Rg1Zg2Rg2⋮⋮ZgnRgn⟶findRg≤afindZg1≤Zg≤Zg2Zg1Rg1Zg2Rg2⋮⋮ZgdRgd.Figure 9
Cloud diagram of target points on the profile plane of grinding wheel section.


## 3.3. Boundary Extraction Algorithm of Mathematical Morphology

Mathematical morphology is a widely used technology in image processing. It is mainly used to extract meaningful image components to express or describe the shape of a region from an image. Based on the geometry, it focuses on the collection structure of the images [19].The research object of this paper is the grinding wheel. The key feature of the point cloud binary image of its cross-section is that each pixel in the binary image is 8-connected; that is, the connected features form the internal composition as shown in Figure10.Figure 10
Connectivity of grinding wheel section area.Finally, the binary image boundary is extracted through the dilation and erosion operations of mathematical morphology [20], and the final image boundary is marked as shown in Figure 11.Figure 11
Illustration of image boundary marking.LetA be the original image, and B be the “structural element.” Mathematical morphology erosion is expressed as equation (18), and the schematic is shown in Figure 12.(18)E=A⊝B.Figure 12
Schematic of morphological erosion.Similarly, the dilation operation process is shown in Figure13, and the operation is expressed as follows:(19)D=A⊕B.Figure 13
Schematic of morphological dilation.The operation on the boundary is shown in Figure14 and is expressed as follows:(20)βA=A−A⊝B=A−E.Figure 14
Schematic of extracting the boundary of the binary image.To realize the conversion between the data points and pixels, the point cloud data should be prepared for binary processing such as scaling, translation, and rounding operations to ensure that the pixel coordinates are positive integers. The point cloud is converted from the point cloud coordinatesZgi,Rgi of the grinding wheel section profile plane, shown in equation (21), into the pixel coordinates Zgip,Rgip. The converted image is shown in Figure 15.(21)Zg1pRg1pZg2pRg2p⋮⋮ZgnpRgnp=x1y1x2y2⋮⋮xnyn100010−xmin−ymin1,where xi=intN∗Zgi, yi=intN∗Rgi; int indicates a rounding operation, and N is the zoom factor.Figure 15
Image after point cloud zoom rounding translation.Here,xmin=minxi, ymin=minyi, i=1,2,…,n.Then, binarization is performed to generate a binarized image.The maximum valuesxpmax, ypmax and minimum values xpmin, ypmin are extracted to construct a matrix. The matrix element at the position Zgip,Rgip is “1” in equation (22). The other element in the matrix is “0.” The point cloud of the flute is established using the binary matrix, which binarizes the coordinates of the point clouds, and then, the binary image is generated according to the binarization matrix.(22)00000⋯001100001⋯111100111⋯1100⋮⋮⋮⋮⋮⋯⋮⋮⋮⋮11111⋯000011000⋯0000ypmaxypminxpminxpmaxThe binary point cloud image can be processed using the dilation and erosion algorithm of the mathematical morphology, and the profile curve of the forming wheel can be extracted. The resulting image after the dilation operation is shown in Figure16. The image obtained after the edge erosion operation using the erosion algorithm is shown in Figure 17.Figure 16
Result of mathematical morphology dilation operation.Figure 17
Result of mathematical morphology boundary extraction.


## 3.4. Boundary Extraction and Optimization Processing of Binary Image of Grinding Wheel Section Profile

The basic morphological operations of the binary images in the mathematical morphology include dilation, erosion, opening, and closing. As some nonexistent pixels are added or filled in the filling process of the dilation operation, as shown in Figure18, a stepped contour pixel boundary appears.Figure 18
Actual pixel points.In this study, the slope method was used to optimize the boundary extracted through mathematical morphology. The slope method can reduce the deviation caused by the dilation operation.The algorithm of the slope method calculates the slope between the characteristic pixels. To extract the pixels closer to the real contour, it calculates the interpolated pixels when the pixels change in thex or y direction (the pixels are called the characteristic pixels), instead of the pixels between the two characteristic pixels.As shown in Figure19, according to the change in the profile curvature, the computation begins at the starting pixel point (the pixel point with the smallest coordinate value Y) in a pixel unit (composed of a column of pixel points) and proceeds point-by-point with the comparison of the calculation results.Figure 19
Distribution of pixel points on contour boundary.Set the starting pixel point of the first-pixel unit as the starting point, and the given starting point coordinate isP11x11,y11. The starting pixel coordinate of the nth pixel unit is Pnixni,yni, where n=1,2,…; i denotes the pixel point, where i=1,2,…, and i = 1 is the starting point of the nth pixel unit. Then, the slope between any pixel point P11 and the nth pixel unit can be defined as equation (23). kni=arctanyni−y11/x11−xni(23)kni=tanyni−y11x11−xni.The position is taken with the minimum slope in each pixel unit, as follows:(24)minkni=k21,k31,…,kn1.Thus, only the pixel point with the smallest slope is reserved for extracting the pixel unit on the same vertical axis. On the contrary, after the curvature of the pixel points is reversed, the position pixel with the largest slope can be reserved, and the filtered pixel points can be regarded as the characteristic pixel points.Assume that the coordinates of the starting pixel of the nth pixel unit arePn1xn1,yn1, and the coordinates of the starting pixel of the n+1-th pixel unit are Pn+11xn+11,yn+11. The spline interpolation function is established through the interpolation method. Taking the y value of the pixel points as the independent variable, various pixel coordinate values x are obtained as the compensated pixel points to increase the number of pixel points. Thus, an approximate contour line is obtained, as shown in Figure 20. The interpolated pixel points can be expressed as follows:(25)y=x−xn1×yn+11−yn1xn1−xn+11+yn1.Figure 20
Interpolated pixel points and approximate contour lines.Finally, the grinding wheel profile coordinates are restored, and the theoretical contour is mapped to the pixel coordinatesxp,yp through the zoom and translation operations to obtain the corresponding grinding wheel profile coordinates Zgp,Rgp. The transformation is expressed as follows:(26)Zgp1Rgp1Zgp2Rgp2⋮⋮ZgpnRpn=xp1Nyp1Nxp2Nyp2N⋮⋮xpnNypnN100010xminymin1.


## 4. Example Analysis

### 4.1. Theoretical Calculation and Analysis

The 4-edge end mill (tool radius:r = 6 mm; helix angle: β = 30°) was selected for replication and manufacturing. The end mill was cut vertically along the axis, and the end cross-section profile of the tool was obtained. The measurement data were obtained by placing it on the projector (Table 1). The measurement error was within the range of 0.001 mm.Table 1
Discrete profile points of end cross-section of flute.
ix (mm)y (mm)1−3.0025.1952−2.8515.1863−2.7015.1744−2.5515.1595−2.4015.1396−2.2525.1167−2.1045.0898−1.9565.0599−1.8095.02410−1.6634.98511−1.5194.94212−1.3764.89513−1.2344.84314−1.0944.78715−0.9554.72816−0.8184.66417−0.6844.59718−0.5514.52519−0.4204.45020−0.2924.37021−0.1664.28622−0.0444.199230.0754.106240.1914.009250.3033.908260.4123.804270.5203.699280.6403.608290.7723.534300.9123.480311.0593.444321.2093.429331.3603.433341.5093.455351.6543.494361.7953.548371.9303.615382.0593.694392.1813.782402.2973.879412.4053.984422.5074.095432.6024.212442.6904.335452.7714.462462.8464.593472.9154.727482.9774.864493.0345.004503.0855.146The cross-section profile of the end mill was obtained after copying and rotating the profile points measured in Table1, as shown in Figure 21.Figure 21
The cross-section profile of flute.The grinding wheel installation parameters are shown in Table2. The zoom factor N selected in the pixel matrix method operation is 1000 times. The pixel matrix method can be used to reverse the profile of the formed grinding wheel by equation (26), as shown in Figure 22.Table 2
The grinding wheel installation parameters.
ParametersValuesCenter distance (a/mm)62.5Eccentricity (e/mm)0End face distance (d/mm)0Installation angle (Σ/°)58Figure 22
Section profile of grinding wheel extracted using pixel matrix method (N = 1000).Analytical method is the most commonly used and traditional method to reverse the profile of forming the grinding wheel in actual production activities. Therefore, this paper chooses the pixel matrix method to reverse the profile curve of the grinding wheel and the analytical method to reverse the profile curve of the grinding wheel for comparative analysis.Under the same parameters as in the above example of the pixel matrix method (Table2), the analytical method was used to solve the grinding wheel cross-section profile. The obtained cross-section profile point coordinate data are shown in Table 3, and the data points of the grinding wheel cross-section profile drawn from the table data are shown in Figure 23.Table 3
Extracted data points of grinding wheel section profile using analytical method.
iZg (mm)Rg (mm)15.22158.05925.20158.09635.19758.10445.08858.30355.04458.37564.97058.49074.90758.57884.83758.66794.76958.748104.69858.824114.62558.893124.55258.956134.47859.013144.40359.062154.33059.103164.25959.136174.18959.161184.12159.177194.05759.186203.99559.186213.93559.180223.87959.166233.83059.148243.80159.133253.70359.066263.51658.936273.33958.813283.16158.688292.98658.567302.81658.448312.65058.334322.48958.222332.33158.113342.17658.005352.02457.899361.87557.795371.72857.693381.58457.592391.44157.492401.30157.395411.16357.299421.02857.205430.89457.113440.76357.022450.63456.933460.50656.846470.38056.759480.25756.673490.13556.588500.01356.504Figure 23
Section profile of grinding wheel extracted using analytical method.The error evaluation method for the profile of the forming grinding wheel measures the distance between the corresponding points of the sand profile obtained with the pixel matrix method and analytical method in the normal direction of the profile points as the comparison error.(1)
The section profile curve of the grinding wheel reverse calculated by the pixel matrix method with the zoom factorN of 1000 times is compared with the section profile curve of the grinding wheel reverse calculated by the analytical method. The error of the two profiles is ≤1.2695 μm, as shown in Figure 24.It can be seen from the comparison results that the profile error is within the range of (−3μm, 3 μm), which can meet the accuracy requirements of actual machining.(2)
When the zoom factorN is 500 times, the pixel matrix method is used to reverse the profile of the forming wheel. The error distance of the profile point solved by the analytical method is less than 3.0044 μm. The comparison result is shown in Figure 25. It is found that the reverse profile cannot meet the accuracy requirements of actual processing.It can be seen from the comparison results that the profile error is beyond the range of (−3μm, 3 μm), and the reverse grinding wheel profile cannot meet the accuracy requirements of actual machining. It can be seen from this that with the increase of scaling factor N, the profile error of the grinding wheel inversely obtained by the pixel matrix method is smaller than that obtained by the analytical method, which indicates that the prediction model of the grinding wheel profile inversely obtained by pixel matrix method is more accurate.Figure 24
The grinding wheel profile error between analytical method and pixel matrix method (N = 1000).Figure 25
The grinding wheel profile error between analytical method and pixel matrix method (N = 500).


### 4.2. Actual Processing Verification

In order to verify the effectiveness of the algorithm in the actual tool grinding, the grinding wheel was shaped based on the grinding wheel section profile inversely solved by the pixel matrix, and the slotting was processed by a C818 five-axis CNC tool grinder manufactured by the Narita Intelligent Technology (Zhejiang) Co., Ltd., shown in Figure26.Figure 26
Slotting process of CNC tool grinder.Step 1.
Select the shaped grinding wheel with the profile of the grinding wheel section as shown in Figure22 for slotting. The installation parameters of the grinding wheel are shown in Table 2. Processing parameters are shown in Table 4. The 4-edge cutting tool (only slotting) obtained by slotting is shown in Figure 27.Table 4
Process parameters of actual grooving of grinding wheel.
Wheel speedApproach speedProcessing speedRetract speed3500.0 r/min600.0 mm/min250.0 mm/min600.0 mm/minFigure 27
Actual slotting tool.Step 2.
Extract the section profile of the actually processed flute, and the VMS-2010 image measuring instrument was selected as the detection equipment. The detection process is shown in Figure28.
The cross-section of the tool end after machining was extracted by the detection equipment, as shown in Figure29.
Figure30 shows the result after gray processing, and the extraction boundary is shown in Figure 31.Figure 28
Inspection process of machining tool.Figure 29
Picture of flute after actual machining of forming grinding wheel.Figure 30
Gray scale diagram of the cross-section of flute after actual processing.Figure 31
Boundary extraction of flute cross-section after actual machining.Step 3.
Compare the section profile of the flute. First, 200 discrete points of the single-edge flute profile are extracted from Figure31 and then compare it with the original given flute end face profile points in Table 1. The distances between the corresponding points of the two profiles along the normal direction were calculated as comparison errors. The error is ≤2.9733 μm, and the error distribution is shown in Figure 32. These errors were within the range of (−3 μm, 3 μm). Therefore, the pixel matrix method can meet the accuracy requirements of design or processing in actual production.
The results of theoretical calculation and actual machining show that the grinding wheel based on the inverse solution of mathematical morphology can meet the accuracy requirements of grooving, and the prediction model is stable, accurate, and reliable.Figure 32
Error comparison between the actual flute section and given section.


## 4.1. Theoretical Calculation and Analysis

The 4-edge end mill (tool radius:r = 6 mm; helix angle: β = 30°) was selected for replication and manufacturing. The end mill was cut vertically along the axis, and the end cross-section profile of the tool was obtained. The measurement data were obtained by placing it on the projector (Table 1). The measurement error was within the range of 0.001 mm.Table 1
Discrete profile points of end cross-section of flute.
ix (mm)y (mm)1−3.0025.1952−2.8515.1863−2.7015.1744−2.5515.1595−2.4015.1396−2.2525.1167−2.1045.0898−1.9565.0599−1.8095.02410−1.6634.98511−1.5194.94212−1.3764.89513−1.2344.84314−1.0944.78715−0.9554.72816−0.8184.66417−0.6844.59718−0.5514.52519−0.4204.45020−0.2924.37021−0.1664.28622−0.0444.199230.0754.106240.1914.009250.3033.908260.4123.804270.5203.699280.6403.608290.7723.534300.9123.480311.0593.444321.2093.429331.3603.433341.5093.455351.6543.494361.7953.548371.9303.615382.0593.694392.1813.782402.2973.879412.4053.984422.5074.095432.6024.212442.6904.335452.7714.462462.8464.593472.9154.727482.9774.864493.0345.004503.0855.146The cross-section profile of the end mill was obtained after copying and rotating the profile points measured in Table1, as shown in Figure 21.Figure 21
The cross-section profile of flute.The grinding wheel installation parameters are shown in Table2. The zoom factor N selected in the pixel matrix method operation is 1000 times. The pixel matrix method can be used to reverse the profile of the formed grinding wheel by equation (26), as shown in Figure 22.Table 2
The grinding wheel installation parameters.
ParametersValuesCenter distance (a/mm)62.5Eccentricity (e/mm)0End face distance (d/mm)0Installation angle (Σ/°)58Figure 22
Section profile of grinding wheel extracted using pixel matrix method (N = 1000).Analytical method is the most commonly used and traditional method to reverse the profile of forming the grinding wheel in actual production activities. Therefore, this paper chooses the pixel matrix method to reverse the profile curve of the grinding wheel and the analytical method to reverse the profile curve of the grinding wheel for comparative analysis.Under the same parameters as in the above example of the pixel matrix method (Table2), the analytical method was used to solve the grinding wheel cross-section profile. The obtained cross-section profile point coordinate data are shown in Table 3, and the data points of the grinding wheel cross-section profile drawn from the table data are shown in Figure 23.Table 3
Extracted data points of grinding wheel section profile using analytical method.
iZg (mm)Rg (mm)15.22158.05925.20158.09635.19758.10445.08858.30355.04458.37564.97058.49074.90758.57884.83758.66794.76958.748104.69858.824114.62558.893124.55258.956134.47859.013144.40359.062154.33059.103164.25959.136174.18959.161184.12159.177194.05759.186203.99559.186213.93559.180223.87959.166233.83059.148243.80159.133253.70359.066263.51658.936273.33958.813283.16158.688292.98658.567302.81658.448312.65058.334322.48958.222332.33158.113342.17658.005352.02457.899361.87557.795371.72857.693381.58457.592391.44157.492401.30157.395411.16357.299421.02857.205430.89457.113440.76357.022450.63456.933460.50656.846470.38056.759480.25756.673490.13556.588500.01356.504Figure 23
Section profile of grinding wheel extracted using analytical method.The error evaluation method for the profile of the forming grinding wheel measures the distance between the corresponding points of the sand profile obtained with the pixel matrix method and analytical method in the normal direction of the profile points as the comparison error.(1)
The section profile curve of the grinding wheel reverse calculated by the pixel matrix method with the zoom factorN of 1000 times is compared with the section profile curve of the grinding wheel reverse calculated by the analytical method. The error of the two profiles is ≤1.2695 μm, as shown in Figure 24.It can be seen from the comparison results that the profile error is within the range of (−3μm, 3 μm), which can meet the accuracy requirements of actual machining.(2)
When the zoom factorN is 500 times, the pixel matrix method is used to reverse the profile of the forming wheel. The error distance of the profile point solved by the analytical method is less than 3.0044 μm. The comparison result is shown in Figure 25. It is found that the reverse profile cannot meet the accuracy requirements of actual processing.It can be seen from the comparison results that the profile error is beyond the range of (−3μm, 3 μm), and the reverse grinding wheel profile cannot meet the accuracy requirements of actual machining. It can be seen from this that with the increase of scaling factor N, the profile error of the grinding wheel inversely obtained by the pixel matrix method is smaller than that obtained by the analytical method, which indicates that the prediction model of the grinding wheel profile inversely obtained by pixel matrix method is more accurate.Figure 24
The grinding wheel profile error between analytical method and pixel matrix method (N = 1000).Figure 25
The grinding wheel profile error between analytical method and pixel matrix method (N = 500).


## 4.2. Actual Processing Verification

In order to verify the effectiveness of the algorithm in the actual tool grinding, the grinding wheel was shaped based on the grinding wheel section profile inversely solved by the pixel matrix, and the slotting was processed by a C818 five-axis CNC tool grinder manufactured by the Narita Intelligent Technology (Zhejiang) Co., Ltd., shown in Figure26.Figure 26
Slotting process of CNC tool grinder.Step 1.
Select the shaped grinding wheel with the profile of the grinding wheel section as shown in Figure22 for slotting. The installation parameters of the grinding wheel are shown in Table 2. Processing parameters are shown in Table 4. The 4-edge cutting tool (only slotting) obtained by slotting is shown in Figure 27.Table 4
Process parameters of actual grooving of grinding wheel.
Wheel speedApproach speedProcessing speedRetract speed3500.0 r/min600.0 mm/min250.0 mm/min600.0 mm/minFigure 27
Actual slotting tool.Step 2.
Extract the section profile of the actually processed flute, and the VMS-2010 image measuring instrument was selected as the detection equipment. The detection process is shown in Figure28.
The cross-section of the tool end after machining was extracted by the detection equipment, as shown in Figure29.
Figure30 shows the result after gray processing, and the extraction boundary is shown in Figure 31.Figure 28
Inspection process of machining tool.Figure 29
Picture of flute after actual machining of forming grinding wheel.Figure 30
Gray scale diagram of the cross-section of flute after actual processing.Figure 31
Boundary extraction of flute cross-section after actual machining.Step 3.
Compare the section profile of the flute. First, 200 discrete points of the single-edge flute profile are extracted from Figure31 and then compare it with the original given flute end face profile points in Table 1. The distances between the corresponding points of the two profiles along the normal direction were calculated as comparison errors. The error is ≤2.9733 μm, and the error distribution is shown in Figure 32. These errors were within the range of (−3 μm, 3 μm). Therefore, the pixel matrix method can meet the accuracy requirements of design or processing in actual production.
The results of theoretical calculation and actual machining show that the grinding wheel based on the inverse solution of mathematical morphology can meet the accuracy requirements of grooving, and the prediction model is stable, accurate, and reliable.Figure 32
Error comparison between the actual flute section and given section.


## 5. Conclusions

In order to accurately and stably obtain the section profile of the grooved forming grinding wheel, a new digital graphic solution algorithm is proposed. It only needs to make a rotary motion around thez-axis of the grinding wheel through the discrete point cloud of the spiral surface of the cutting groove of the tool, collect the envelope point cloud, intercept the target point cloud of the condition boundary on the grinding wheel section, and extract the boundary profile curve of the grinding wheel section by using the concept of morphological binary image operation. The main conclusions about this new method are as follows:(1)
This algorithm is based on the principle of spiral motion, and it is not only applicable to reverse grinding wheel engineering of flute in end mill but also applicable to reverse engineering of machining tool profile in all cylindrical spiral products.(2)
This algorithm does not need to solve contact line and nonlinear equation, so the solution value of this method is stable and has no singular solution problem.(3)
The algorithm is intuitive in the calculation process and has the ability to simulate and calculate the profile of the formed grinding wheel section. It could be used as a theoretical inspection tool before grooving and be directly used to develop CAD/CAM computer software and automatically generate the profile of the grinding wheel section.(4)
This algorithm is a powerful calculation of actual tool slotting processing. It can guide the profiling production of formed grinding wheels, and its calculating accuracy can also meet the requirements of processing and design. However, the compensation problem after wear of formed grinding wheels needs to be further studied in combination with wheel position and attitude.(5)
This method is based on the mathematical morphology of pixel images. The numerical solution accuracy of the calculation is directly related to the number of point clouds. The more point clouds, the higher the calculation accuracy, and the greater amount of calculation, which often affects the efficiency of calculation. With the improvement of computer performance and optimization of calculating methods, this problem should be solved better.



---

*Source: 5735199-2022-12-29.xml*