1 Introduction

A continuous development of modern manufacturing technology and the improvement of product quality requirements has led the mechanical manufacturing industry rapidly proceed to the direction of high precision, high speed, and high efficiency. An important and crucial performance factor being geometric accuracy for machine products, especially under circumstances where relatively high precision is one of the basic requirements. Afterwards, an error compensation plays a significant role in ensuring the overall product quality [1]. Error diagnosis and compensation has three engineering steps: kinematic modeling, error diagnosis, and error compensation which is based on certain dominating error factors. Error diagnosis plays a vital role for grinding machines, as the final accuracy of any part is directly related to the grinding machine processing accuracy. Its improvement is critical for machine tool design research. The authors in this paper tried to shed some light in analyzing the different depending components for the grinding error and also provide a definitive compensation method for each.

The kinematics of the machine have been modeled by applying the homogeneous transformation matrix. The contour profile relating to the grinding wheel motion trajectory and also the grinding wheel motion relating to the contour profile has been extensively derived initially. To improve the precision of machined products, geometrical error diagnosis is generally employed by different researchers which further paves the way for several compensation techniques. Wang et al. developed a simulation software depicting the influence of X-axis feed error, the C-axis feed error, and the wheel radius error on the grinding process [2], which ultimately provides the basis for error compensation. In order to increase grinding accuracy, Tao and Tao revealed a coupling relationship between the thermal and geometrical error [3] which laid a foundation for subsequent error compensation. An On-Line Asynchronous Compensation Method (OACM) is proposed by Shen et al. for static/quasi-static error caused by thermal deformation and machine geometry [4]. The method reduces the complexity of compensation system while an offset compensation method (OCM) adopts Bayesian network to predict error. Tian et al. presents a general and systematic approach for geometric error modeling of machine tools which provides a direct linear mapping from each source error to pose accuracy of machine tool and also has clear physical meanings [5]. However, motion or structural errors of spindle, cutting tools, and worktable are not taken into consideration. Okafor and Ertekin [6] developed mathematical model to calculate and predict the resultant error vector at the tool workpiece interface for a three-axis vertical machining center. Xiang and Altintas proposed a method [7] to measure, model, and compensate both geometrically dependent and independent volumetric errors of 5-axis, serial CNC machine tools, where a total a 41 errors of all five axes are represented by error motion twists. Several authors have proposed an integrated geometric error prediction and compensation method [8, 9]. Zuo et al. presents the model [10] which is modeled by the propagation and the accumulation of errors based on Jacobian-Torsor theory. Intelligent AI techniques has also been introduced for the improvement of geometrical errors in grinding process [11, 12].

This research article deals with an example of a non-circular grinding to validate its results. A non-circular grinding is very different from conventional grinding methods. Onishi et al. analyzes the elastic deformation for a long workpiece in a cylindrical grinding process [13]. A non-circular grinding suffers a disparity between the differential geometry and computational geometry. An undercut is a problem that is very related to computational geometry. A non-circular grinding geometric error is also a major cause of the undercut. Jang and Choi [14] studied the grinding force, considering the characteristics of non-circular grinding. A compensation model was thus established that can estimate the set depth of cut to further obtain the real depth of cut. A major variable considered for geometrical error also adheres to an extensive tool condition monitoring. Arun et al. provides a tool condition monitoring approach using an acoustic emission sensor [15]. Various compensation methods are also established in terms of CNC machines regarding dominant errors [16]. Liu et al. had concluded a problem in the grinding wheel which needed to be frequently dressed due to inevitable grinding wear. A novel method has thus been proposed and employed to compensate the profile error caused by grinding wheel wear and improve grinding efficiency [17]. A recent article by Fa and Ye [18] proposed a modeling method in contrast to the multi-body system, which can simplify the calculation process and reflect the influence of each error components on the tool. A comprehensive error was determined by combining 24 fitting functions, the known error, the differential matrix of each part, and the Jacobian matrix.

In this article, the authors attempt to develop a diagnosis method for classifying the machining error sources on the external/internal contour surfaces which are fabricated using a two-axis cylindrical grinding machine. Differential geometry is used for a thorough derivation between the grinding wheel position to contour and vice-versa. A disparity between the concepts of computational geometry and differential geometry which can produce an undercut and ways to reduce it has been explained. A diagnosis of geometric error, linear and non-linear motion error components is shown according to the control system for both axes in the CNC system that is required to control the workpiece rotation and movement of the grinding wheel. A compensation method has thus been established.

This paper is organized as follows. Section 2 describes the cylindrical grinding machine and its machining process. Section 3 describes the differential geometry required for the surface profile in terms of the grinding wheel and vice-versa. Section 4 studies the disparity in the concepts of differential geometry to computational geometry leading to undercut and establish the grinding wheel constraints. Section 5 provides a detailed description for the diagnosis of the machining error and its error shape function. A least square curve fitting has been established. Section 6 describes the error compensation method based on the diagnosis. Section 7 substantiates the practicality of the diagnosis through experiments involving internal and external grinding of a workpiece. Section 8 concludes the research.

2 Cylindrical grinding and its machining process

The concept of cylindrical grinding [19,20,21] refers to the grinding of bores and holes. Internal/External grinders are internal/external grinding tools or machine tools used for cylindrical profiles, which uses grinding wheels as cutting tools. One possible arrangement for the two-axis cylindrical grinding machine may be arrangement as shown in Fig. 1, that the workpiece is fixed to a rotary axis with rotation index and the grinding wheel is fixed to a spindle. The grinding wheel spindle is horizontally movable with the grinding wheel into the grinding position.

Fig. 1
figure 1

Two-axis cylindrical grinding machine

Despite the actual grinding machine with two axes independently controlled from the ground table. We express the grinding process in a kinematic inversion way that makes the grinding wheel to move in a plane which representing a specific cross-section of the workpiece. The planar motion of the grinding wheel is specified in the polar coordinate using the radius \(r\) and radian \(\theta\) respectively. The grinding wheel remove the material from the workpiece to form the inner surface profile. It is also assumed that the slurry and fluid used in grinding process do not affect the profile contour.

3 Geometry and measurement of internal non-circular surface profile

3.1 Parametric contour of non-circular surface cross-section profile

The cavity of the workpiece is generally circular shape with variation described by two concentric circles centered at the origin O. One is the circumcircle of the cavity with diameter \({D}_{a}\) and the other is the inscribed circle of the cavity with diameter \({D}_{i}\). A nominal circle with diameter \({D}_{m}\) which takes the mean of the two circles as follows.

$${D}_{m}=\frac{{D}_{a}+{D}_{i}}{2}$$
(1)

A 2D parametric curve \({\varvec{Q}}(\gamma )\) bounded by the circumcircle and inscribed circle is used to describe the inner surface of the cavity. The Euclidean distance between \({\varvec{Q}}(\gamma )\) and the origin O denoted by \(\Vert Q(\gamma )\Vert\) is confined by the relation as follows.

$$\begin{array}{c}{\varvec{Q}}(\gamma )=\left[\begin{array}{c}{q}_{x}(\gamma )\\ {q}_{y}(\gamma )\end{array}\right]\\ {D}_{i}\le \Vert {\varvec{Q}}(\gamma )\Vert =\sqrt{{{q}_{x}}^{2}+{{q}_{y}}^{2}}\le {D}_{a}\\ \beta (\gamma )={tan}^{-1}\frac{{q}_{y}(\gamma )}{{q}_{x}(\gamma )}\end{array}$$
(2)

There is at least one point on \({\varvec{Q}}(\gamma )\) touches the circumcircle and the other point on \({\varvec{Q}}(\gamma )\) touches the inscribed circle. The peak-to-peak amplitude of \({\varvec{Q}}(\gamma )\) is denoted by \(2e= {D}_{a}-{D}_{i}\). The properties of the 2D, \({C}^{\infty }\), sinusoidal parametric curve \({\varvec{Q}}(\gamma )\) where \({\gamma }_{\mathrm{min}}\le \gamma \le {\gamma }_{\mathrm{max}}\) include.

  1. 1.

    G∞ continuity: The joint points \({\varvec{Q}}({\gamma }_{\mathrm{min}})\) and \({\varvec{Q}}({\gamma }_{\mathrm{max}})\) satisfy \({\varvec{Q}}({\gamma }_{\mathrm{min}}) ={\varvec{Q}}({\gamma }_{\mathrm{max}})\), \(\frac{d}{d\gamma }{\varvec{Q}}({\gamma }_{\mathrm{min}})=\frac{d}{d\gamma }{\varvec{Q}}({\gamma }_{\mathrm{max}})\), … to the infinite order \(\frac{{d}^{\infty }}{d{\gamma }^{\infty }}{\varvec{Q}}({\gamma }_{\mathrm{min}})=\frac{{d}^{\infty }}{d{\gamma }^{\infty }}{\varvec{Q}}({\gamma }_{\mathrm{max}})\).

  2. 2.

    N-period condition: \(\Vert {\varvec{Q}}(\gamma )\Vert =\Vert {\varvec{Q}}(\gamma +\frac{{\gamma }_{\mathrm{max}}-{\gamma }_{\mathrm{min}}}{N})\Vert\)

A specific parametric curve \({\varvec{Q}}(\gamma )\) with \({\gamma }_{\mathrm{min}}=0\), \({\gamma }_{\mathrm{max}}=2\pi\), and N = 3, expanded using the product-to-sum formula is proposed as follows.

$${\varvec{Q}}({\varvec{\gamma}})=a\left[\begin{array}{c}c\gamma \\ s\gamma \end{array}\right]+\left(\frac{b}{2}+e\right)\left[\begin{array}{c}-cos\left(2\gamma \right)\\ sin\left(2\gamma \right)\end{array}\right]+\frac{b}{2}\left[\begin{array}{c}cos(4\gamma )\\ sin(4\gamma )\end{array}\right]$$
(3)

Five properties are obtained from the proposed parametric curve (Fig. 2).

  1. 1.

    Since all terms are sinusoidal functions, the curve is \({C}^{\infty }\) continuous.

  2. 2.

    Since all terms are harmonics function of integer multiples of a fundamental frequency \(\gamma\), \({{\varvec{Q}}}^{(n)}(0)={{\varvec{Q}}}^{(n)}(2\pi )\) for n = 0, 1, 2, …\(\infty\).

  3. 3.

    Since

    $$\Vert {\varvec{Q}}({\varvec{\gamma}})\Vert =\sqrt{{\left(a-ecos(3\gamma )\right)}^{2}+{\left(b+e\right)}^{2}{sin}^{2}(3\gamma )}$$
    (4)

    it is verified that \(\Vert {\varvec{Q}}({\varvec{\gamma}})\Vert =\Vert {\varvec{Q}}({\varvec{\gamma}}+\frac{2\pi }{3})\Vert\) i.e. N = 3.

  4. 4.

    The diameters of nominal circle, circumcircle, and inscribed circle are derived as follows.

    $$\begin{array}{c}{D}_{m}=2a\\ {D}_{a}=2\left(a+e\right)\;\mathrm{at}\,\gamma =\frac{(2n+1)\pi }{3}\\ {D}_{i}=2\left(a-e\right) \;\mathrm{at}\,\gamma =\frac{2n\pi }{3}\end{array}$$
    (5)
  5. 5.

    The extreme radii of the parametric contour from the stationary condition as follows.

    $$\frac{d}{d\gamma }r\left(\gamma \right)=\frac{3sin(3\gamma )}{r \, }\left(ae+b\left(b+2e\right)cos(3\gamma )\right)$$
    (6)
Fig. 2
figure 2

The contour definition

To satisfy Eq. (2) for the contour design, the above equation imposes a constraint for coefficient \(b\) to avoid the extreme radii contour point is larger than\(a\), i.e. \(\frac{a}{e}>\frac{b}{e}\left(\frac{b}{e}+2\right)\). The maximum a/e ratio is then a function of the b/e ratio, i.e., \({\frac{a}{e}>(\frac{b}{e}+1)}^{2}-1\)

When b/e = 0, the third term of left hand side of Eq. (3) vanishes. Figure 3 shows different parametric contours generated from different b/e ratio according to Eq. (3). The result shows that the larger the b/e ratio the sharper the corner is. Due to the a/e must be no less than 1 according to Eq. (5), it is then derived that when b/e ratio is no less than 0.414 the result in Eq. (5) is guaranteed. On the other when we set b/e ratio to be 2, then the lowest a/e is 8.

Fig. 3
figure 3

The proposed parametric curve with a = 22 and e = 2.4

3.2 Contour profile measurement

An articulated coordinate measuring machine (CMM) can be used to measure the geometry of physical objects by sensing discrete points on the surface of the cavity with a probe. CMM specifies a probe’s position in terms of its displacement from a reference position in a two-dimensional Cartesian coordinate system with XY axes. The sensed discrete points \({{\varvec{M}}}_{i}=\left[\begin{array}{c}{M}_{x,i}\\ {M}_{y,i}\end{array}\right]\) taken from the probe written as follows are used to compare with the desired profile. The planar angle of measurement is defined as \({\beta }_{i}\). The corresponding parameter \(\gamma ({\beta }_{i})\) is obtained from solving the desired profile such as stated in Eq. (4) iteratively as follows.

$${\left(a-ecos(3\gamma )\right)}^{2}+{\left(b+e\right)}^{2}{sin}^{2}(3\gamma )={{M}_{x,i}}^{2}+{{M}_{y,i}}^{2}$$
(7)

After \(\gamma ({\beta }_{i})\) is obtained from a specific sensed discrete points \({{\varvec{M}}}_{i}\), the error between the desired inner surface profile \({\varvec{Q}}(\gamma ({\beta }_{i}))\) can then by compared with the specific sensed discrete points \({{\varvec{M}}}_{i}\) as follows.

$${{\varvec{\varepsilon}}}_{{\varvec{i}}}=\Vert {\varvec{Q}}(\gamma ({\beta }_{i}))-{{\varvec{M}}}_{{\varvec{i}}}\Vert \left[\begin{array}{c}c{\beta }_{i}\\ s{\beta }_{i}\end{array}\right]$$
(8)

The magnified plot, as shown in Fig. 4, of a specific measurement may be drawn to magnify the error at the specific polar location is performed using \({{\varvec{E}}}_{{\varvec{i}}}=\Theta {{\varvec{\varepsilon}}}_{{\varvec{i}}}+{\varvec{Q}}\left(\gamma \left({\beta }_{i}\right)\right)\), where \(\Theta\) denotes the magnification factor. An error plot example from the CMM measurement is shown in Fig. 4.

Fig. 4
figure 4

Error plot example

4 Cylindrical grinding

4.1 Grinding wheel motion to contour disregarding undercut

For the convenience of analysis, the grinding process with the grinding wheel position control is easier to be shown in the kinematic equivalence scheme as shown in Fig. 5a. The point \({\varvec{P}}\) on the grinding wheel is derived as follows.

$${\varvec{P}}={\varvec{C}}+{R}_{w}\left[\begin{array}{c}c\phi \\ s\phi \end{array}\right]$$
(9)

where

Fig. 5
figure 5

Kinematic equivalence of internal grinding process

$${\varvec{C}}(\theta )=r\left[\begin{array}{c}c\theta \\ s\theta \end{array}\right]$$

The differential geometry equation for P being the profile point is derived as follows.

$$\frac{\partial {\varvec{P}}}{\partial \theta }\times \frac{\partial {\varvec{P}}}{\partial \phi }=0$$
(10)

The above equation can be subsequently derived by substituting the vector derivatives. The contact point of the grinding wheel is derived as follows.

$$\begin{array}{c}\frac{\partial r}{\partial \theta }cos\left(\theta -\phi \right)=rsin(\theta -\phi )\\ \phi =\theta -\alpha \end{array}$$
(11)

where,

$$\alpha ={tan}^{-1}(\frac{\pm \partial r/\partial \theta }{\pm r})$$

The angle \(\alpha\) is the pressure angle with respect to the line \(\overleftrightarrow{OC}\) which connects the grinding wheel center and workpiece center. The positive sign on both the numerator and denominator of \(\alpha\) is applicable to the internal grinding and the negative sign is used in the external grinding. Using \(\alpha\), it can be seen in the internal grinding case as shown in Fig. 5b that the contour point \({\varvec{P}}\) of the grinding wheel determined by \(\phi\) is the same as the grinding wheel center orientation angle \(\theta\) at the position \(\partial r/\partial \theta\) = 0. The angle \(\phi <\theta\) when \(\partial r/\partial \theta\) is positive and vice versa. The pressure angle of the grinding machining is defined differently from the gear meshing definition. In mechanical gear pair, the pressure angle at a pitch point between the line of pressure (which is normal to the tooth surface) and the plane tangent to the pitch surface. The pressure angle in the grinding process is a complementary angle of the pressure angle defined in power transmission using gears. High pressure angles are not preferable in both definitions due to different purposes that one is power transmission which want to reduce the abrasive force and the other one is material removal which want to increase the abrasive force between two rigid bodies.

It may be given with an arbitrary trajectory as follow.

$${\varvec{C}}\left(\gamma \right)=\left[\begin{array}{c}{c}_{x}\left(\gamma \right)\\ {c}_{y}\left(\gamma \right)\end{array}\right]$$
(12)

The polar coordinate for the curve is defined using \(r\) and \(\theta\). The derivative of \(r\) with respect to \(\theta\) is defined using the derivative chain rule as follows. Thus

$$\frac{dr}{d\theta }=\left({\varvec{C}}\bullet \frac{d{\varvec{C}}}{d\gamma }\right)/\left|{\varvec{C}}\times \frac{d{\varvec{C}}}{d\gamma }\right|$$
(13)

The profile generated by the wheel to form the profile Q at a specific grinding wheel position \({\varvec{C}}(\theta )\) ignoring the undercut is derived as follows.

$${\varvec{P}}(\theta )=\left[\begin{array}{c}{p}_{x}(\theta )\\ {p}_{y}(\theta )\end{array}\right]={\varvec{Q}}(\gamma (\theta ))={\varvec{C}}(\theta )+{R}_{w}\left[\begin{array}{c}cos\left(\theta -\alpha \right)\\ sin\left(\theta -\alpha \right)\end{array}\right]$$
(14)

We obtain \(\gamma (\theta )\) from the procedures similar to in Sect. 3.1 as follows.

$${\left(a-ecos(3\gamma )\right)}^{2}+{\left(b+e\right)}^{2}{sin}^{2}(3\gamma )={{p}_{x}}^{2}+{{p}_{y}}^{2}$$
(15)

Subsequently, the one-on-one mapping of function \(\gamma (\theta )\) is obtained comparing \(\beta (\theta )\) from Eqs. (2) and (12).

4.2 Contour to grinding wheel position

For a given parametric contour \({\varvec{Q}}(\gamma )\) for the internal surface profile, the grinding wheel position can be derived from offsetting the contour with the grinding wheel radius.

$${\varvec{C}}(\gamma )={\varvec{Q}}(\gamma )+{R}_{w}{\varvec{N}}(\gamma )$$
(16)

\({\varvec{N}}(\gamma )\) is the unit vector normal to the unit tangential vector \({\varvec{T}}\) of contour at contour position \({\varvec{Q}}(\gamma )\), which can be obtained from the first derivative of \({\varvec{T}}\), while the unit tangential vector can be obtained from the first derivative of \({\varvec{Q}}\). The first derivative of \({\varvec{Q}}\) is derived from Eq. (3). The curvature \(\kappa (\gamma )\) of the parametric contour \({\varvec{Q}}(\gamma )\) is derived as follows.

$$\kappa (\gamma )=\frac{\Vert {\varvec{Q}}\mathrm{^{\prime}}(\gamma )\times {\varvec{Q}}"(\gamma )\Vert }{{\Vert {\varvec{Q}}\mathrm{^{\prime}}(\gamma )\Vert }^{3}}$$
(17)

The degeneracy of the curvature \(\kappa (\gamma )\) occurs when \({\varvec{Q}}\mathrm{^{\prime}}(\gamma )\) becomes a null vector having zero length. By re-examining Eq. (3) for the proposed contour, we find the degeneracy will start with the positions having largest curvature locations at \(\gamma =\frac{(2n+1)\pi }{3}, n = 0, 1, 2\).

$${\Vert {\varvec{Q}}\mathrm{^{\prime}}(\gamma )\Vert }_{{\varvec{m}}{\varvec{i}}{\varvec{n}}}=\Vert {\varvec{Q}}\mathrm{^{\prime}}(\frac{(2n+1)\pi }{3})\Vert =a-(3b+2e)$$
(18)

Therefore, the design constraint for the parametric contour must follow the constraint equation to avoid the curvature degeneracy, i.e., \(\frac{a}{e}>2+3\frac{b}{e}\). It is then observed that the a/e ratio must be larger than 2. The upper bound of b/e ratio in Sect. 3.1 yields a dominant bound when a/e ratio is less than 8, while the recent upper bound of b/e ratio becomes dominant when a/e ratio is higher than 8 (Fig. 6).

Fig. 6
figure 6

The upper bound chart for b/e ratio vs. a/e ratio to avoid parametric contour failure

4.3 Grinding wheel radius constraint to avoid the undercut in internal grinding

The center of curvature \({\varvec{\rho}}(\gamma )\) of the contour \({\varvec{Q}}(\gamma )\), known as the fixed centrode of the grinding wheel motion, can be written as follows.

$${\varvec{\rho}}(\gamma )={\varvec{Q}}(\gamma )+\frac{1}{\kappa (\gamma )}{\varvec{N}}(\gamma )$$
(19)

As shown in Fig. 7, the minimum distance between \({\varvec{\rho}}(\gamma )\) and the corresponding \({\varvec{Q}}(\gamma )\) of our propose contour is located at \(\gamma =\frac{(2n+1)\pi }{3}\).

Fig. 7
figure 7

Schematic interpretation of undercut during internal grinding

$${\left(\frac{1}{\kappa (\gamma )}\right)}_{min}=\frac{{\Vert {\varvec{Q}}\mathrm{^{\prime}}(\gamma )\Vert }^{3}}{\Vert {\varvec{Q}}\mathrm{^{\prime}}(\gamma )\times {\varvec{Q}}^{\prime \prime}(\gamma )\Vert }=\frac{{\left(a-3b-2e\right)}^{2}}{(a-6b+4e)}$$
(20)

The above equation yields an upper limit for the radius of the grinding wheel chosen to be \(a>\mathrm{min}(3b+2e, 6b-4e)\). That is if the radius of the grinding wheel is greater than the minimum radius of curvature then there is an undercut problem.

$$\frac{{R}_{w}}{e}<\frac{1}{e}{\left(\frac{1}{\kappa (\gamma )}\right)}_{min}=\frac{{\left(\frac{a}{e}-3\frac{b}{e}-2\right)}^{2}}{(\frac{a}{e}-6\frac{b}{e}+4)}$$
(21)

When the undercut problem occurs the profile of the inner surface undergoes an interference between the contour and the grinding wheel movement. The position control of the grinding wheel is subjected to a non-monotonic increasing function to rotate the workpiece as shown in Fig. 7. The interference suffers an invalidity of the differential geometry relation in Eq. (10) to form an actual profile.

4.4 Case study

For a particular arrangement, we have b/e ratio set to be 2, where \(a>\mathrm{min}(3b+2e, 6b-4e)\) can be reduced into an expression as follows.

$$\frac{{R}_{w}}{e}<\frac{a}{e}-8$$
(22)

The above equation can then be written subsequently in terms of a/e ratio as follows.

$$\frac{R_{w,max}}a=1-\frac8{\displaystyle\frac ae}$$
(23)

According to the above equation, the maximum grinding wheel diameter to the internal profile nominal diameter ratio \({R}_{w}/a\) can be determined. Depending on the choice of a/e ratio, the maximum grinding wheel diameter can be selected to minimize the rest time when the diameter of the grinding wheel is known keeping reduced during abrasive grinding process. As shown in Fig. 8, when the a/e ratio is above 16 then the maximum grinding wheel diameter can be higher than half of the internal profile nominal diameter.

Fig. 8
figure 8

The maximum grinding wheel diameter to the internal profile nominal diameter ratio

5 Diagnosis of machining error

Grinding machining is the process of removing metal from a workpiece in the form of tiny chips by the action of irregularly shaped abrasive particles. Grinding wheels are composed of thousands of small abrasive grains [22] held together by a bonding material. Each abrasive grain is a cutting edge. As the grain passes over the workpiece, it cuts a small chip, leaving a smooth surface. As each abrasive grain becomes dull, it breaks away from the bonding material. Diameter of the grinding wheel will keep on reducing during the machining process, therefore the NC codes must be updated to compensate the diameter change in order to maintain a higher accuracy on the workpiece dimension. Measurement of these grinding wheels often relies on tactile devices in a closed-loop process, which alternates between grinding and measuring in iterative stages to achieve diameter tolerances of ± 1.5 µm.

The servo system for both axes in the CNC system to control the workpiece rotation and the movement of the grinding wheel can involve the servo error according to the servo control system as shown in Fig. 9. The servo system consists of the position error gain \({K}_{p}\), the velocity error gain \({K}_{v},\) the velocity feedforward gain \({K}_{FF}\), the velocity error integral gain \({K}_{v}\), the speed limit, and the torque limit. The coordination between two axes are assumed to be managed during the path planning process before the position command \({\theta }_{cmd}\) is generated. There are other factors such as the anti-wind up, the torque disturbance due to \({G}_{D}\), the back EMF from the velocity \({G}_{BEMF}\) are assumed to be managed in the electronics system such as power amplifier and current sensor feedback.

Fig. 9
figure 9

Servo model for DC motor

5.1 Error sources modeling

We employed several error sources that cause the grinding machining error into the analysis. These error sources are encoded into either the grinding wheel radius or the motion error of \({\varvec{C}}(\gamma )\). The error contours are enumerated based on Eq. (14), which are then compared with the desired contour to obtain the error shape functions. It is first required to obtain a template for the desired contour \({\varvec{Q}}(\gamma )\) from Eq. (3). The discrete contour points in terms of \(\beta (\gamma )\) are obtained from Eq. (2). The error shape function is the individual error function due to a very small amount of error source, which is obtained as follows.

$$\boldsymbol g(\beta)=\overset{\boldsymbol\sim}{\boldsymbol Q}(\widetilde\gamma(\beta))-\boldsymbol Q(\gamma)$$
(24)

\(\widetilde{\gamma }(\beta )\) is obtained from comparing the contour point angle \(\beta (\gamma )\) obtained from \(\gamma\) with the contour point on \(\widetilde{{\varvec{Q}}}(\widetilde{\gamma })\) to reach the same contour point angle \(\beta (\gamma )\). The error shape function \(g(\beta )\) is then in terms of the parameter \(\beta\) (Fig. 10).

  • Grinding Wheel Outer Diameter Error \(\Delta {R}_{w}\): The grinding wheel is made of abrasive grains and the outer diameter of which is reducing during the work of grinding. Variation of the outer diameter of the grinding wheel can affect the profile contour derived in Eq. (14) (Fig. 11).

    $${\varvec{g}}(\beta )=\Delta {R}_{w}\left[\begin{array}{c}cos\left(\theta -\alpha \right)\\ sin\left(\theta -\alpha \right)\end{array}\right]$$
    (25)

    According to Eqs. (11) and (13), as the angle \(\alpha\) is also a function of \({\varvec{C}}(\theta )\), the machining error due to the grinding wheel outer diameter error is not a perfect circle. The corresponding error shape function is as shown in Fig. 12a.

  • r-axis Servo Position Gain Adjustment \(\Delta {K}_{p,r}\): Variation of the servo position gain of the \(r\)-axis control of the grinding machine can affect the profile contour.

    $$\Delta r=\Delta {K}_{p,r}\left|{\varvec{C}}\left(\gamma \left(\theta \right)\right)\right|=\Delta {K}_{p,r}\left|{\varvec{Q}}(\gamma )+{R}_{w}{\varvec{N}}(\gamma )\right|$$
    (26)

    Due to \({\varvec{Q}}(\gamma )\) is changing with respect to \(\gamma (\theta )\), the corresponding error shape function shown as in Fig. 12b approaches the original shape of \({\varvec{Q}}(\gamma )\).

    $$g(\beta )=\left|{\varvec{g}}(\beta )\right|\approx \Delta {K}_{p,r}(\left|{\varvec{Q}}(\gamma )\right|-{R}_{w})$$
    (27)
  • r-axis Servo Velocity Gain Adjustment \(\Delta {K}_{v,r}\): Variation of the servo velocity gain of the \(r\)-axis control affects the position control response of grinding wheel radial motion in the simplified expression as follows.

    $$\Delta r=\Delta {K}_{v,r}\frac{d}{d\gamma }\left|{\varvec{C}}(\gamma )\right|$$
    (28)

    The term \(\frac{d}{{\varvec{d}}\gamma }\left|{\varvec{C}}(\gamma )\right|\) can also affect the profile contour derived in Eq. (13). The dot term in the numerator of Eq. (13) does not change much due to this small deviation but the cross-product term on the denominator does. As a result, the \(\partial r/\partial \theta\) term in Eq. (13) affects to the angle \(\alpha\) in Eq. (11). Hence for those \(\partial r/\partial \theta =0\) regions, the servo velocity gain cannot affect the contour error much when it affect the contour accuracies on the significant rate of grinding wheel radial position change \(\partial r/\partial \theta\) zones. The corresponding error shape function shown as in Fig. 12c is compared to a zero value circle since it has both positive and negative signs due to the sign change of \(\partial r/\partial \theta\) in different zones.

  • r-axis Speed Limit \(\Delta {K}_{v\_\mathrm{limit},r}\): The speed limit of the \(r\)-axis control affects the position control of grinding wheel radial motion in the simplified expression as follows.

    $$\Delta r=\Delta {K}_{v\_limit,r}{\left(\frac{d}{d\gamma }\left|{\varvec{C}}(\gamma )\right|\right)}^{Z}$$
    (29)

    The power z is used to represent the nonlinearity of the velocity, which is 3 in our study. The corresponding error shape function is calculated as shown in Fig. 12d.

  • r-axis Servo Acceleration Gain Adjustment \(\Delta {K}_{a,r}\): Variation of the servo torque gain of the \(r\)-axis control affects the position control response of grinding wheel radial motion in the simplified expression as follows. The corresponding error shape function is calculated as shown in Fig. 12e.

    $$\Delta r=\Delta {K}_{a,r}\frac{{d}^{2}}{d{\gamma }^{2}}\left|{\varvec{C}}(\gamma )\right|$$
    (30)
  • r-axis Torque Limit \(\Delta {K}_{a\_\mathrm{limit},r}\): The torque limit of the r-axis control affects the position control of grinding wheel radial motion in the simplified expression as follows. The corresponding error shape function is calculated as shown in Fig. 12f.

    $$\Delta r=\Delta {K}_{a\_\mathrm{limit},r}{\left(\frac{{d}^{2}}{d{\gamma }^{2}}\left|{\varvec{C}}(\gamma )\right|\right)}^{Z}$$
    (31)
  • θ-axis Servo Velocity Gain Adjustment \(\Delta {K}_{v,\theta }\): Variation of the servo velocity gain of the \(\theta\)-axis control affects the rotation control response of workpiece rotational motion in the simplified expression as follows. The corresponding error shape function is calculated as shown in Fig. 12g.

    $$\Delta \theta =\Delta {K}_{v,\theta }\frac{d}{d\gamma }\theta (\gamma )$$
    (32)
  • θ-axis Speed Limit \(\Delta {K}_{v\_\mathrm{limit},\theta }\): The speed limit of the \(\theta\)-axis control affects the rotation control response of workpiece rotational motion in the simplified expression as follows. The corresponding error shape function is calculated as shown in Fig. 12h.

    $$\Delta \theta =\Delta {K}_{v\_\mathrm{limit},\theta }{\left(\frac{d}{d\gamma }\theta (\gamma )\right)}^{Z}$$
    (33)
  • θ-axis Servo Acceleration Gain Adjustment \(\Delta {K}_{a,\theta }\): Variation of the servo torque gain of the \(\theta\)-axis control affects the rotation control response of workpiece rotational motion in the simplified expression as follows. The corresponding error shape function is calculated as shown in Fig. 12i.

    $$\Delta \theta =\Delta {K}_{a,\theta }\frac{{d}^{2}}{d{\gamma }^{2}}\theta (\gamma )$$
    (34)
  • θ-axis Torque Limit \(\Delta {K}_{a\_\mathrm{limit},\theta }\): The torque limit of the \(\theta\)-axis control affects the rotation control response of workpiece rotational motion in the simplified expression as follows. The corresponding error shape function is calculated as shown in Fig. 12j.

    $$\Delta \theta =\Delta {K}_{a\_\mathrm{limit},\theta }{\left(\frac{{d}^{2}}{d{\gamma }^{2}}\theta (\gamma )\right)}^{Z}$$
    (35)
Fig. 10
figure 10

Flow chart of grinding error diagnosis

Fig. 11
figure 11

Formation of error shape function

Fig. 12
figure 12

Error shape functions

5.2 Least square fitting

The error shape functions \({g}_{i}\left(\beta \right)\), I = 1, 2, …, n, can be considered as the Fourier expansion [23] to the first order of the error source \({\epsilon }_{i}\) effect as follow.

$${g}_{i}\left(\beta \right)={\frac{d}{{d\epsilon }_{i}}g}_{i}\left({\epsilon }_{i}, \beta \right){\Delta \epsilon }_{i}$$
(36)

The matrix spanning the error space for m different contour point polar angles \({\beta }_{j}^{^{\prime}}s\) can be presented in form as follows.

$${\varvec{J}}={\left[\begin{array}{ccc}\frac{\partial {g}_{1}({\beta }_{1})}{\partial {\epsilon }_{1}}& \cdots & \frac{\partial {{\varvec{g}}}_{n}({\beta }_{1})}{\partial {\epsilon }_{n}}\\ \vdots & \ddots & \vdots \\ \frac{\partial {g}_{1}({\beta }_{m})}{\partial {\epsilon }_{1}}& \cdots & \frac{\partial {g}_{n}({\beta }_{m})}{\partial {\epsilon }_{n}}\end{array}\right] \, }_{m\times n}$$
(37)

The small error quantities used to construct the error shape functions is expressed in a diagonal matrix as follows.

$$\boldsymbol{\Delta }{\varvec{E}}={\left[\begin{array}{ccc}{\Delta \epsilon }_{1}& \cdots & 0\\ \vdots & \ddots & \vdots \\ 0& \cdots & {\Delta \epsilon }_{n}\end{array}\right]}_{n\times n}$$
(38)

The actual shape function matrix is \({\varvec{J}}\boldsymbol{\Delta }\boldsymbol{\rm E}\). The contour error vector \({\varvec{e}}\) can be formed from the CMM measurements which are then interpolated into the discrete points \(e({\beta }_{j})\), using \(\left({\varvec{J}}\boldsymbol{\Delta }\boldsymbol{\rm E}\right)\boldsymbol{\vartheta }={\varvec{e}}\), where \(\boldsymbol{\vartheta }\) is the scaled error quantity. The least square method is applicable to obtain the estimated quantity \({\varvec{E}}\) of each individual error sources using the equation as follows.

$${\varvec{E}}={\boldsymbol{\Delta }\boldsymbol{\rm E}}^{-1}{{\varvec{J}}}^{+}{\varvec{e}}$$

where

$${\varvec{E}}=\left[\begin{array}{c}{\epsilon }_{1}\\ {\epsilon }_{2}\\ \vdots \\ {\epsilon }_{n}\end{array}\right]$$
(39)

The total error is then calculated as a linear combination of all errors as follows.

$$\Delta Q\left(\beta \right)={\sum }_{i=1}^{n}{\epsilon }_{i}{g}_{i}\left({\epsilon }_{i}, \beta \right)$$
(40)

The above equation is actually the linear combination of all error shapes which can cause linear approximation error for the nonlinear system.

6 Compensation

Three categories of machining error sources have been included in this paper, which are the geometric error, the linear servo motion error, and the nonlinear servo motion error. The geometric error category includes the grinding wheel radius error. The linear motion error category includes the position gain error, the velocity gain errors of two axes, and the torque gain errors of two axes. The nonlinear motion error category includes the speed limit and torque limit of two axes. The compensation of each individual machine error sources are.

  1. 1.

    Grinding wheel radius error: The measurement of grinding wheel radius must be performed constantly to maintain the accuracy of the machining result. The grinding wheel radius error detected in the diagnosis process can be used to calculate the grinding wheel path \({\varvec{C}}(\gamma )\) according to Eqs. (16) and (17).

  2. 2.

    The position gain of grinding wheel position control error: The position gain may be either adjusted the servo control system or compensated in the pre-filtering compensation which offsets the contour \({\varvec{Q}}(\gamma )\) inward or outward toward the center of the workpiece according to the position gain compensation required.

  3. 3.

    The velocity gain of grinding wheel control error: To reduce the machining error of this kind may be achieved by either adjusting the servo control system or reducing the speed of the grinding motion commands.

  4. 4.

    The torque gain of grinding wheel control error: To reduce the machining error of this kind may be achieved by either adjusting the servo control system or reducing the speed override as well as the feed rate of the grinding motion commands.

  5. 5.

    The nonlinear motion error: Both the speed and torque limits affect the machining accuracy in a more unpredictable way. The closed loop control system with higher gain can result the nonlinearities happening. However, reducing the control gains may suffer the reduction of trajectory following accuracy simultaneously. Hence the high level motion planning including the NURB interpolation of the motion path with better speed and acceleration planning is necessary.

The motion planning to minimize the velocity variation as well as the acceleration is achieved by performing the NC code re-interpolation. There are two types of velocity minimization which can be done; minimize the \(\theta\)-axis (may also referred to as the C-axis on the CNC machine) velocity while the other is to minimize the contact point velocity. The original \(\gamma\) was interpolated at the beginning using a linear function. Let \(v\left(\gamma (u)\right)\) represent the velocity of concern, which is obtained from \(\gamma (u)\) interpolation. The velocity minimization algorithm can be stated in the following four iteration steps.

  • Step 1. Set \(\gamma \left(u\right)=u; u=[0, 2\pi ]\)

  • Step 2. Calculate \(v\left(\gamma (u)\right)\).

  • Step 3. Evaluate \(\Lambda (s)={\int }_{0}^{s}\frac{1}{{v}_{c}\left(\gamma (u)\right)-{V}_{\mathrm{offset}}}du\) \(; s=[0, 2\pi ]\) and calculate \(\widetilde{\gamma } (u)=\frac{2\pi \bullet \Lambda (u)}{\Lambda \left(2\pi \right)}\).

  • Step 4. If \(\widetilde{\gamma } (u)=\) \(\gamma (u)\) stop, else \(\gamma \left(u\right)\leftarrow \widetilde{\gamma } (u)\) and go to step 2.

The original linear \(\gamma (u)\) yields the velocity and acceleration of individual axes, shown in Fig. 13. It can be seen in Fig. 13b that, both the velocity of C and X (or r-axis) axes are minimized due to minimizing C-axis velocity based on the algorithm stated above, which shows a 25% reduction in both maximum velocities and accelerations. When minimization of the grinding contact point velocity is concerned, the result shown in Fig. 13c demonstrates a smoother C-axis acceleration (or \(\theta\)-axis). The smoother acceleration implies a smaller jerk which is obtained from the corresponding optimization. The differences of \(\gamma \left(u\right)\) for different interpolations is shown in Fig. 13d.

Fig. 13
figure 13

Velocity/Acceleration minimization under a the original linear mapping, b the minimization of C-axis velocity, c the minimization of grinding contact point velocity, and d the corresponding \(\gamma \left(u\right)\) mapping

7 Simulation and experiment

To characterize the whole experimental process, the quantitative parameters are hereby mentioned: The workpiece material is a SUJ2 with tempered hardness 58/62 (hardness Rockwell C). The grinding wheel was an 80-grit aluminum oxide grinding wheel. For the internal grinding with the workpiece radius 44 mm with a grinding wheel radius around 20 mm, the workpiece spindle rotated on around 30 rpm, the grinding wheel speed is around 3000 rpm, and the axial depth cut is usually 0.3 mm/min during fine grinding. The dressing tool is a single-point diamond dresser. The cooling lubricant is water-soluble cutting fluid.

Table 1 shows the design parameters for both external and internal grinding. The software for the machining error diagnosis is implemented using VC +  + . In the simulation session, we provided error to the servo system as stated in Eqs. (26) to (35) as well as the grinding wheel radius error. In this study, we ignored the asymmetric machining errors and only include the symmetric ones including the grinding wheel radius error, the servo position gains, the servo acceleration gains, and the torque limits in the analysis due to the fact that the asymmetric error sources are insignificant in our experiments. In the verification stage, it was found that the position gain error of grinding wheel position control may be linearly dependent with the diameter error of the grinding wheel when the position gain error is very small, therefore the position gain effect shall also be ignored from the diagnosis. Table 2 shows the assigned value to the individual error sources and corresponding result obtained from the diagnosis. The diagnosis result shows an overall within 10% error. Figure 14 depicts the simulation result. The red line contour is the desired contour. The purple line contour is the magnified contour error between the contour subjected to the error sources and the desired contour. The contour error is in the order of 100um error. The blue line contour is the least square fitting result. The least square fitting error in blue line closely matches the purple line contour. The remaining difference between the least square fitting error and the contour error is again magnified using green line, which is referred to as sum of the unclassified error and the linear fitting error. The unclassified error shall be zero since all error sources are predetermined from the assigned values of error source. Therefore, the remaining difference is simply the linear interpolation error due to the error shape function which is derived from the linearization stated in Eq. (36). The linear interpolation error in 1-µm scale shows a maximum of 5 µm which is about 3% of the maximum contour error which is 150 µm. The linear approximation error shows five-times frequency compared to the frequency of the design contour, which is an important feature to distinguish the linear approximation error from the unclassified error, if any found in the experiment.

Table 1 The design example (unit: mm)
Table 2 Internal grinding simulation and diagnosis verification
Fig. 14
figure 14

Simulation example

The experiment uses a Studer® cylindrical grinding machine fabricated by Fritz Studer AG. The probe system is VAST® Stylus system equipment from Carl Zeiss Co. Ltd.. The same contour stated in Table 1 is fabricated on Studer cylindrical grinding machine for both the internal grinding to make a holder of the tool as well as the external grinding to make the CNC tool. The experiments are conducted in the Mechanical and Mechatronics Research Laboratory of Industry Technology Research Institute (ITRI), Taiwan. There are two external grinding results and one internal grinding result submitted to the diagnosis software.

The internal grinding uses the grinding wheel in blue color as shown in Fig. 15a. The measurement of grinding wheel is done by caliper. We feed the diameter data of grinding wheel 17 mm taken from the catalog to the controller. The tool holder is fabricated by feeding the profile data according to Table 1 and contour Eq. (3) by having \(a={D}_{M}/2\). The internal profile of the machining part was measured using the probe system as shown in Fig. 15b. The CMM data was fed into the diagnosis software and the diagnosis result is shown in Fig. 16. A grinding wheel being nearly 100 µm smaller than the new grinding wheel was purposely chosen. The diagnosis result shows that not only large servo acceleration gains but also the speed and torque limits were presented. The caliper was used before the internal grinding process and the measurement shows the diameter was 100 µm shorter than the specification which is inconsistent with the diagnosis result. The remaining error of diagnosis is 20 µm, which is once again in the form of linear approximation error. The error shape function of the speed limit and torque limit was formed from \(\Delta {K}_{a\_\mathrm{limit},r}\) = 1E-11 and \(\Delta {K}_{a\_\mathrm{limit},\theta }\) = 1E-12 respectively. The results are actually 50 to 100 times of the source of the error shape function. The error sources were converted into the actual resulting machining error in um scale as shown in Table 3.

Fig. 15
figure 15

Experiment a internal grinding of CNC tool and b measurement of holder made by internal grinding

Fig. 16
figure 16

Experiment 1: tool holder with internal grinding diagnosis result

Table 3 Diagnosis result for experiment 1

In experiment 2, we changed to a new grinding wheel and tuned the motion trajectory into the version with a smoother workpiece speed. The second tool holder was fabricated using the new grinding wheel. The profile was again measured using the probe system as shown in Fig. 15b. The CMM data was fed into the diagnosis software and the diagnosis result is shown in Fig. 17. The diameter of the grinding wheel is new. The diagnosis result shows that the servo acceleration gain was smaller due to the said motion planning. The remaining error of diagnosis is 10 µm which is better than experiment 1; however, not acceptable as a final product whose specification is 2 µm (Table 4).

Fig. 17
figure 17

Experiment 2: tool holder with internal grinding

Table 4 Diagnosis result for experiment 2

A large amount of error was still present (6.56 and 8.84 µm) due to the motion planning shown in experiment 2. We thus apply the \(\gamma \left(u\right)\) mapping from the velocity minimization on the contact point as shown in Fig. 13 c and d to the following experiment. In the third experiment, the contour of the fabricated tool holder was measured using the same probe system as stated before. The CMM data was fed into the diagnosis software and the diagnosis result is shown in Fig. 18. The diameter of the grinding wheel is 1.48 µm larger than the nominal value of the catalog. The remaining error of diagnosis is 1 µm which is in the form of white noise. Therefore, it concludes that the new grinding wheel is of a larger diameter. From Fig. 18, we observed that there is 1 µm stick motion error on r-axis axis which results into six peaks marked in circular red. The backlash or other mechanical errors including stick motion, axis alignment and many others [24] may need to be examined for higher precision (Table 5).

Fig. 18
figure 18

Experiment 3: tool holder with internal grinding

Table 5 Diagnosis Result for experiment 3

As a result, the tool holder is made, which satisfies the specification 2um as the final product. Following the similar line of reasoning the tool axis is also made to satisfy the same specification in order to mate with the tool holder. The two individual test parts are shown in Fig. 19.

Fig. 19
figure 19

Photo of the machining workpiece a tool holder and b tool axis

8 Conclusion

The inaccuracy of the grinding machining can cause the contour of the male and female workpieces to not match each other. The precision measurement of the diameter of the grinding wheel is the key factor for the precision machining. However, the grinding wheel is abrasive and the diameter of which is constantly reducing. The in-situ measurement of the workpiece and the diagnosis software together can help the precision machining during the light–duty grinding. The diagnosis software is used to guide the operator to adjust the control input such as the diameter of grinding wheel information and speed override as well. The compensation means are machining tool and precision dependent. Due to a high cost of the grinding wheel, the diagnosis software can help the manufacturer to regenerate the new motion NC codes by monitoring radius change of the grinding wheel. The errors due to the servo gain and the motor torque limits can also be detected through the same diagnosis process, which can yield certain advices to the machine operators to make high quality products when the production throughput is not reduced. The asymmetric error sources are important when the precision requirement is higher. The extension work of this study including the motion error of the machine and the compensation of the profile grinding error using the pre-filtering techniques will be addressed in the future.