# Stability Analysis of Milling Process with Multiple Delays
## 4 AVSNIM with Spindle Speed-Dependent Discretization Algorithm  
The AVSNIM can provide accurate stability limits, the accuracy of which depends on the pre-set discretization parameter \(m_{p}\). A large discretization parameter usually brings a small time step and high calculation accuracy, and at the same time, increases the calculation time. In most of the research work, the SLD is obtained under constant discretization parameter. A constant discretization parameter will lead to different time steps and calculation accuracies under different spindle speeds. Generally, the accuracy of the stability limits in the region with low spindle speed is not as high as that in the region with a high spindle speed in the SLD. This implies that if the discretization parameter can be properly selected at each different spindle speed (usually, a large discretization parameter is used in the low-speed region and a small discretization parameter is used in the high-speed region), it is possible to improve the calculation accuracy of stability limit at a low speed and save the calculation time. Inspired by this, a spindle speed-dependent discretization algorithm is proposed to obtain the appropriate discretization parameters, and used in conjunction with the AVSNIM. The process of the algorithm is listed as follows:  
1. Sample the spindle speed range to get a series of discrete speed nodes \(\Omega_{k_{s}}(\Omega_{k_{s}}=\Omega_{start}:\Delta\Omega:\Omega_{end})\), where \(\Delta\Omega\) is the sampling interval;
2. For each discrete speed nodes \(\Omega_{k_{s}}\), the stability limit \(w_{ref,k_{s}}\) is obtained under a large reference discretization parameter \(m_{p}\) through the dichotomy search algorithm adopted in [24] and used as the reference stability limit;
3. Starting from a small discretization parameter \(m_{d}\), the approximate stability limit \(w_{a,k_{s}}(m_{d})\) is obtained through the dichotomy search algorithm. The relative error between \(w_{a,k_{s}}(m_{d})\) and \(w_{ref,k_{s}}\) is calculated by the following formula \[er_{k_{s}}(m_{d})=\left|\frac{w_{a,k_{s}}(m_{d})-w_{ref,k_{s}}}{w_{ref,k_{s}}}\right|\] (25)
4. Compare \(er_{k_{s}}(m_{d})\) with the pre-set relative error limit \(\varepsilon\), if \(er_{k_{s}}(m_{d})>\varepsilon\), set \(m_{d}=m_{d}+\Delta m\) and return to step 3, until \(er_{k_{s}}(m_{d})\leq\varepsilon\) is satisfied. Then, record the current \(m_{d}\) and let \(m(k_{s})=m_{d}\);
5. Repeat steps 2 to 4 for all the spindle speed sampling nodes to get the discretization parameter \(m(k_{s})\) at each speed node \(\Omega_{k_{s}}\);
6. Interpolate the discretization parameter \(m(k_{s})\) at the spindle speed sampling points \(\Omega_{k_{s}}\) to obtain the approximate discretization parameter \(m_{a}(k)\) at all the spindle speed nodes on the SLD. Finally, \(m_{a}(k)\) are rounded to obtain the final discretization parameter \(m_{f}(k)\) using the following formula \[m_{f}(k)=ceil(m_{a}(k))\] (26) where \"ceil (*)\" means rounds \"*\" towards the nearest integer greater than or equal to \"*\";
7. The stability limit is calculated using the AVSNIM and the corresponding discretization parameter \(m_{f}(k)\) on all the spindle speed nodes, then the SLD is obtained. In the above algorithm, parameters \(\Delta\Omega\), \(\varepsilon\) and \(\Delta m\) are variable input parameters. The value of \(\Delta\Omega\) determines the density of spindle speed sampling points. The smaller the value of \(\Delta\Omega\), the denser the sampling nodes, and the higher the interpolation accuracy of discretization parameters. The value of \(\varepsilon\) sets a relative error. The smaller the relative error is, the closer the stability limit is to the reference value. \(\Delta m\) is the increment step of the discretization parameter, the value of which determines the speed of the discretization parameter approaching the reference discretization parameter. If \(\Delta m\) is too small, the number of iterations will increase.