## 3 Machine Tool Compensation Assessment
### Compensation Process  
The second step is the compensation process. This operation is carried out with a Visual Basic Application macro. It consists in correcting the nominal trajectory (set of P points) with the error vector \(\mathbf{d_{p}}\) to obtain the compensated trajectory (set of C points, with \(\mathbf{OC}=\mathbf{OP}+\mathbf{d_{p}}\)). This vector is derived from B-spline interpolations of the 18 kinematic errors and the three squareness errors of the compensation matrix, and the nominal coordinates of the trajectory point P. For that purpose, the kinematic model of the bridge-type machine tool, as shown in Figure 6, is required. S and P respectively refer to the reference point of the spindle and to the cutting edge location.  
Figure 5: Residual error maps estimation.  
In general, a homogenous transformation matrix is used to define the kinematic errors of a given translation axis. The machine tool structure is considered as rigid, which implies that the kinematic errors are proper to the node and independent from the other axes. Two types of errors exist: linear and angular. The linear drifts are characterized by a positioning error and two straightness errors. The angular errors are roll, pitch, and yaw motion errors. For an \(x\)-axis motion for example, the matrix terms are respectively noted \(\delta_{xx}\), \(\delta_{xy}\), \(\delta_{zz}\), \(\epsilon_{xx}\), \(\epsilon_{xy}\) and \(\epsilon_{zz}\). The homogenous transformation matrix, used to compute the kinematic error for a \(x\)-axis motion, is given in Equation (1). The squareness errors of the axis system (\(x\), \(y\), \(z\)) of the machine are written \(\alpha_{s}\), \(\beta_{s}\) and \(\gamma_{s}\).  
\[\left[\begin{array}{cccc}1&-\epsilon_{xz}&\epsilon_{xy}&\delta_{xx}\\ \epsilon_{xz}&1&-\epsilon_{xx}&\delta_{xy}\\ -\epsilon_{xy}&\epsilon_{xx}&1&\delta_{xz}\\ 0&0&0&1\end{array}\right]. \tag{1}\]  
A global transformation matrix that describes the machine tool locating error is determined. It accounts for the kinematic chain of the mechanical links and the 21 parameters of the machine kinematical error: six concerning each axis (\(x\), \(y\) and \(z\)) and the three squareness errors of the reference frame. Then, the error vector \(\mathbf{d_{p}}\) can be written at any point S that belongs to the spindle. Spindle rotation is not taken into account. Equation (2) defines the error vector at the cutting edge point P. The two homogeneous transformation matrices \(\mathbf{A}\) and \(\mathbf{A_{p}}\) respectively define the effects of the 21 error components on the locating error of the machine structure and the angular errors of the spindle.  
\[\mathbf{d_{P}}=\mathbf{A.OS}+\mathbf{A_{P}.SP} \tag{2}\]  
\[\mathbf{A}=\left(\begin{array}{cccc}0&-\gamma_{s}&\epsilon_{yy}+\epsilon_{ xy}+\beta_{s}&\delta_{xx}+\delta_{yx}+\delta_{zx}\\ \epsilon_{yz}&0&-(\epsilon_{yx}+\epsilon_{xx}+\alpha_{s})&\delta_{xy}+\delta_ {yy}+\delta_{zy}\\ -\epsilon_{yy}&0&0&\delta_{xz}+\delta_{yz}+\delta_{zz}\\ 0&0&0&1\end{array}\right);\]  
\[\mathbf{A_{P}}=\left(\begin{array}{cccc}0&-(\epsilon_{xz}+\epsilon_{yz}+ \epsilon_{zz})&\epsilon_{xy}+\epsilon_{yy}+\epsilon_{zy}&0\\ \epsilon_{xz}+\epsilon_{yz}+\epsilon_{zz}&0&-(\epsilon_{xx}+\epsilon_{yx}+ \epsilon_{xx})&0\\ -(\epsilon_{xy}+\epsilon_{yy}+\epsilon_{zy})&\epsilon_{xx}+\epsilon_{yx}+ \epsilon_{zx}&0&0\\ 0&0&0&1\end{array}\right).\]