1 Introduction

The term free-form surfaces refers to surfaces that, unlike typical surfaces, have no translational symmetry or axes of rotation [1]. This kind of surfaces is widely used in industry nowadays, in automobile, aerospace, consumer products and die/mould manufacturing [2]. The free-form surfaces can be produced by forming methods, cutting methods and additive manufacturing. In the case of mass production, different kinds of forming methods can be used, which require moulds and dies. The mould and die manufacturing uses cutting methods primarily, like milling, or electric discharge machining, but the machining of EDM electrodes also needs milling method. Despite the development of science and technology, milling of free-form surfaces still faces challenges with the constant change in contact between the cutting tool and the workpiece resulting in a change in the tool’s working diameter along with the cutting speed, which in turn affects the surface quality [3] [4].

Most studies addressing the issue are focused on cutting condition optimization based on the correct selection of the milling strategy. Simple strategies can work effectively when machining many parts. However, when it comes to machining complex surfaces, limitations appear to such strategies in providing good surface quality. Varga et al. [5] compared the effect of four milling strategies on the surface roughness when milling using the ball-end tool. They found out that minimal shape deviations can be achieved using the constant Z strategy and a freeform surface was obtained using this strategy. Vu et al. [6] succeeded in optimizing the tool path planning for machining sculpture surfaces using three-axis end milling. By applying this new method, they were able to reduce the length of the tool path by 20% compared with the traditional approaches. Huo et al. [7] presented a method to generate a tool path for milling free-form surfaces using the three-axis machine. This approach ensures creating a tool path that follows most of the desired feed directions over the entire free-form surface. Mali et al. [8] studied the effect of the cutting parameters and tool path strategies on the tool wear, cutting forces and surface quality when milling curved surfaces. Their findings emphasize the importance of the working diameter of the milling cutter and the cutting speed on the milling process.

Other studies focused on tool orientation and cutting forces to improve the milling process of free-form surfaces. Yao et al. [9] investigated the impact of the tool orientation and the surface inclination on the surface quality. They found out that the tool orientation has a significant effect on the surface roughness. Habibi et al. [10] introduced a new algorithm to reduce the form error based on adjusting the tool orientation. Baburaj et al. [11] presented a model to predict the cutting forces in machining free-form surfaces using a three-axis end ball milling machine. The model was effective and the error in predicting cutting forces is in an acceptable range.

The cutting speed of the milling tool was the focus of other researchers, who tried to maintain a constant cutting speed throughout the milling process. The next examples show several advantages. Zhang et al. [12] studied the effect of the speed of the ball-end tool on the milling process. Their results emphasize the importance of the cutting speed on the cutting force and the chip formation and the relationship between the cutting speed with each of feed direction and the inclination angle during the milling of free-form surfaces. Vavruska et al. [13] suggested a method to control the cutting speed and the feed rate. By using this approach, they were able to ensure a constant cutting speed, which improves the milling process by decreasing the machining time. Käsemodel et al. [14] were able to reduce the roughness of the surface and the machining time by controlling the spindle speed. In their approach, the spindle speed is controlled using an algorithm that depends on the Grasshopper application at Rhino3D software to get the normal vector of the surface.

Although the five-axis milling method can solve the problem of variable working diameter and cutting speed, a similar result can be achieved with three-axis milling by controlling the spindle speed.

The aim of the current research is to investigate the effect of the changing working diameter and the cutting speed of the ball-end milling cutter on the surface roughness of a free-form surface and to develop a method in order to adapt control of the spindle speed. The proposed method uses only standard file formats in the case of CNC program and the description of the surface geometry, instead of special formats and software tools.

This article presents the results of milling tests. A free-form surface was machined by ball-end milling with five different feed directions. The two test series were machined with constant and controlled spindle speed and the surface roughness of these parts is compared.

2 Materials and methods

The workpiece material used for the present work was C45 (1.0503) medium-carbon unalloyed steel. The C45 steel is used to manufacture parts with high strength requirements, such as gears, shafts and piston pins, and parts that are not very stressed, such as machined parts, forgings, stampings, bolts, nuts and pipe joints. The tensile strength is Rm = 650–800 MPa; the chemical composition of C45 is as follows: C = 0.42–0.50%; Si < 0.4%, Mn = 0.50–0.80%, P < 0.045%; S < 0.045%; Cr < 0.40%; Mo < 0.10%; Ni < 0.40%.

During the design of the test surface geometry, several aspects were considered. The aim was to design a surface with both flat and curved sections, limited height for better machining, low curvature variation for roughness measurement and a size that would allow rapid production of several test pieces with minimal tool wear. The size of the test part was 50 × 50 mm; it contains a sphere (R = 106.25 mm), a toroid (R = 25 mm) section and a horizontal plane surface (Fig. 1). The height of the 3D surface is 10 mm.

Fig. 1
figure 1

The test part

After the milling, the surface roughness was measured by a Mahr-Perten GD130 instrument. Rz parameters were measured in 25 zones, three times on the surface, in a perpendicular direction to the feed, and the presented values were calculated with the averages of three measures. The value of the cut-off was 0.8 mm, and the speed was 0.5 mm/s.

The test parts were machined by a Mazak 410-AII CNC machining centre with a YG NC-Mill G9F44100N ball-end milling cutter with 10 mm diameter (Dc) and 2 teeth (z). The cutting parameters were the next: nominal cutting speed was vc = 63 m/min, and the feed per tooth was fz = 0.125 mm. In the case of determining the cutting parameters, the recommendation of the tool catalogue, the properties of the machine tool and the possible changing and the maximum value of the spindle speed were considered. The depth of the cut was ap = 0.3 mm and the width of the cut was ae = 0.25 mm. In order to maintain the constant depth of the cut, the pre-finishing 3D ball-end milling was performed.

The test surfaces were machined by zig-zag 3D surface milling method with five different feed directions compared to the x-axis. The feed directions were Af = 0°, 22°, 45°, 67.5° and 90°.

In the case of the first test set, the constant spindle speed was applied, the spindle speed was n = 2000 1/min, and the feed rate was vf = 500 mm/min. In the case of the second test set, the spindle speed and the feed rate were modified along the tool path considering the actual cutting diameter.

To control the spindle speed, an algorithm was developed to calculate the required change in spindle speed to compensate for the change in the cutting speed. This requires a description of the path of the cutting tool, the cutting parameter and the surface.

The developed algorithm (Fig. 2) uses the APT file to determine the tool position coordinates at each point of the surface and STL file format in order to describe the surface geometry.

Fig. 2
figure 2

The processing workflow

Automated Programming Tool or APT is a programming language used mostly to give instruction to the numerically controlled machines [15]. APT file format is a widely used format in CAM systems. It contains the tool path and includes information about the tool position and the cutting parameter [16]. The developed algorithm reads the tool positions and the initial cutting parameters from the APT file.

The surface geometry can be described in several ways. The STL file format includes data that describe the surface geometry. STL file represents the surface as a list of triangles and the corresponding normal vector in a three-dimensional coordinate system. The STL file does not include any other surface information such as the colour or the texture [17, 18].

The algorithm will match each position of the tool with the corresponding normal vector to make the calculation of the working diameter possible using a mathematical model presented by Mikó and Zentay [19]. The detailed description and the analysis of the spindle speed control algorithm are presented in [20, 21].

During the pre-processing of the STL file of the surface, the normal vectors and the centre point of the triangles are listed. The next step is to find the normal vector at each position of the tool. This can be done by connecting the position of the tool to the corresponding triangle. Therefore, the algorithm calculates the distance between the tool location and all the centre points of the STL triangles and returns the centre point with the shortest distance to the tool position. That means, the tool is close to the triangle which has that centre point and it has the same normal vector as the triangle. Depending on the resolution of the STL file, one triangle can be assigned to more tool positions. It can be a source of the error in the calculation of the working diameter, but it has just a small effect, and the accuracy can be improved by the resolution of the surface description.

The method uses a simplified tool geometry, taking into account the spherical surface of the tool envelope. The free-form surface to be machined is replaced by a plane whose normal is the same as the normal of the surface at the actual machining point. The substitution plane is offset parallel to the depth of the cut. The substitution plane and the normal vector are provided by the STL description of the surface CAD model.

This offset plane and the enveloping surface of the tool sphere intersects a circle. This circle determines the working diameter. The working diameter is the distance between the feed-directed tangent point on the circle and the tool axis (Fig. 3). As the figure shows, the working diameter depends on the feed direction. The milling feed direction is determined from the APT description of the CNC program by the difference vector of two consecutive points. The working diameter has two values, and the current value depends on the direction of the width of the cut parameter.

Fig. 3
figure 3

Working diameter of a ball-end milling cutter

The APT file contains every data, which is necessary for the tool motion and the whole machining process. The algorithm reads the points of the tool path and the cutting parameters from the APT file. The tool path contains the nose point of the tool, which is not the contact point between the surface and the tool, but the difference has no effect on the result because of the resolution of the STL file.

Based on the actual working diameter, the required spindle speed can be calculated by using the formula (1). The feed rate is modified also, because of maintaining the constant feed per tooth value. The formula (2) is used to calculate the required feed rate at each point. The new parameters are added to the APT file.

$$n=\frac{1000\times {v}_{c}}{ {D}_{\mathrm{eff}}*\uppi }(1/\mathrm{min})$$
(1)
$${\nu }_{\mathrm{f}}={f}_{z}\times z\times n(\mathrm{mm}/\mathrm{min})$$
(2)

By applying the proposed method, the cutting speed is constant during the whole machining process to ensure that the spindle speed is controlled and adjusted at each point of the surface. The resolution of the surface tessellation can be controlled by the parameters of the STL file generation in the CAD systems.

The decreasing size of the triangles means higher resolution of the surface and the spindle speed, but in some cases, the CNC controller cannot follow the fast changes. If the size of the triangles is larger, the speed control is less frequent, and the milling length section with constant spindle speed is longer.

However, if the resolution of the STL model is reduced, changing the spindle rotation puts a more dynamic load on the machine tool. In our experience, a speed change of 500 1/min was still feasible on the applied machine without any error message.

 The developed algorithm changes only the values of the spindle speed and the feed rate; the points of the milling tool path are not changed, so the tool path of the CNC program is unchanged. Table 1 shows a part of the original and modified APT code.

Table 1 Original and modified APT file (a part)

3 Spindle speed changing

Figure 4 shows how the spindle speed changes during the milling process to keep the cutting speed constant. The diagrams show the spindle speed in the case of five different milling feed directions (0°, 22.5°, 45°, 67.5°, 90°). As can be seen in these figures, as the surface inclination changes, the effective diameter changes. To make up for the decrease in cutting speed, the spindle speed must be increased. It is evident that the effective diameter and cutting speed decrease to their lowest values at the points where the tool is perpendicular to the surface. In these points, the algorithm calculates the highest speed for the spindle. When the surface inclination changes fast (at the small radius), the spindle speed changes fast also.

Fig. 4
figure 4

The controlled spindle speed in the case of the five feed directions

The minimum and the maximum values of the spindle speed depend on the feed direction. The minimum values are 3002, 3066, 3251, 3062 and 3002 1/min and the maximum values are 5877, 6308, 8066, 6308 and 5877 1/min. Because of the symmetric surface (the diagonal plane is a symmetry plane too), the minimum and the maximum values of the spindle speed show symmetricity also.

The spindle speed changed point by point, and however, the diagrams look similar (Fig. 4); because of the different lengths and the different numbers of the points of the toolpaths, there are some differences. These differences can be presented by the integral value of the spindle speed by path (the area under the function of spindle speed). This integral characterizes the dynamic load of the spindle.

As Fig. 5 shows, in the case of constant spindle speed, the value of the integral is virtually the same. The maximum difference in tool path length is 100 mm (Af = 0°, 10,286 mm; and Af = 45°, 10,383 mm), so it has a little effect on it. In the case of the controlled spindle speed, the larger spindle speeds are because of the higher integral values, and the effect of the different ways of changing can be seen in the integral. The largest value there is at the feed direction 45°, and the smallest at 0° and 90°; the difference is 17%.

Fig. 5
figure 5

The integral of the spindle speed by the path

4 Results

The Rz parameter of the surface roughness was investigated and compared. The average value of all measured Rz data (5 feed directions × 25 sections × 3 repetitions) in the case of constant spindle speed is 4.1 µm, and the standard deviation is 1.3 µm. In the case of controlled (compensated) spindle speed, the average value is 1.7 µm and the standard deviation is 0.4 µm.

If the actual cutting speed has no effect on the surface roughness, the values of the Rz should be the same in the case of five different feed directions. The results show that the controlled spindle speed and the constant feed per tooth result in more homogenous surface roughness, the average value of the Rz is smaller and the standard deviation is smaller too.

Figure 6 and Fig. 7 show the surface roughness in the case of the milling process with a constant spindle speed and in the case of constant cutting speed (controlled spindle speed).

Fig. 6
figure 6

The maps of surface roughness Rz—constant spindle speed

Fig. 7
figure 7

The maps of surface roughness Rz—controlled spindle speed

Based on the diagrams, the values of the surface roughness in the case of controlled spindle speed are smaller, and the change along the surface is smaller in every case.

The higher surface roughness values for uncontrolled milling are found in the horizontal surface sections (Fig. 6), where the working diameter and thus the cutting speed are decreased. In the case of controlled parameters, the surface map is smoother (Fig. 7), and the differences are smaller.

The comparison of the statistical data of the surface roughness confirms the effect of the controlled spindle speed on the changing of the surface roughness.

Figure 8 compares the average values of the surface roughness Rz for each milling direction. The difference between the Rz surface roughness values after modification is small (2.0 µm in the case of milling direction 0° and 1.6 µm in the case of 45°) compared with milling under a constant spindle speed (between 4.5 µm in the case of feed direction 67.5° and 3.7 µm in the case of milling direction 0°). Keeping the cutting speed constant reduces the effect of the milling direction on the surface quality, which can ensure a similar surface roughness under different milling directions and a more homogeneous surface regardless of the surface inclination.

Fig. 8
figure 8

Average values of the surface roughness (Rz)

As can be seen in Fig. 9, the Rz parameter ranges (the difference of the maximum and the minimum values) 1 µm to about 2 µm in the case of a controlled surface, depending on feed direction. With the conventional milling method (constant spindle speed), the ranges are between 3.7 and 5.3 µm in each direction. The smaller range indicates the more homogenous surface quality.

Fig. 9
figure 9

The ranges of the surface roughness (Rz)

Figure 10 shows the standard deviation of the Rz surface roughness in each milling direction, in the case of constant and controlled spindle speed. The standard deviations of the workpieces machined with controlled spindle speed are smaller (less than 0.4 µm) than the standard deviations of those machined without optimization, which range from 1 to 1.5 µm. This small value of the standard deviation means that the surface has the same roughness after the machining process. This is the same result under different milling directions. On the other hand, having a similar value of the standard deviation emphasizes what is stated before that milling using the suggested method can eliminate the milling direction effect.

Fig. 10
figure 10

Standard deviation of Rz surface roughness

The visual comparison also confirms the differences, which can be seen in the data. The pictures show a 4.5 × 3.75 mm area.

Figure 11 presents the differences in different places on the surface. The figure shows four examples when the feed direction was 45°. Four pairs of pictures can be seen in the picture, the left side picture shows the surface, which was machined with constant spindle speed, and the right side picture presents the result of the proposed method.

Fig. 11
figure 11

Pictures of the surface zones in the case of constant (left) and controlled (right) spindle speed (Af = 45°)

The four surface sections are different in nature. The surface section marked 1.1 is located at the top of the test surface on the large radius section and is nearly horizontal. The surface parts 2.4 and 4.2 are located at the bottom of the high radius, with a greater surface slope in a mirrored position. The inclination of these sections is close to each other, but their positions are different, so the relative feed direction is also different, resulting in dissimilar machining conditions. Surface zone 4.4 is at the transition between the small radius and the horizontal surface section.

In the case of Sect. 1.1, the visible difference is small, even though the roughness value is significantly different. For zones 2.4 and 4.2, the visual difference is more noticeable. For the transition zone 4.4, the flat section looks similar (upper right), but the radial section (lower left) looks significantly different.

As the working diameter is significantly reduced in the horizontal sections, the increased speed cannot correct the unfavourable cutting conditions. On the steeper sections, where the working diameter is larger, however, the surface aesthetics are also improved along with the roughness values.

Figure 12 shows the images of the surface zone 3.4 for the five different feed directions. On the left side, there are the results of milling at constant spindle speed and on the right at controlled spindle speed. The presented surface zone is at the boundary of the plane surface and spherical section, where the surface inclination varies greatly.

Fig. 12
figure 12

3.4 surface zone in the case of different feed directions (left, constant spindle speed; right, controlled spindle speed)

The more advantageous chip removal conditions resulting from the controlled machining parameters lead to changes in the surface appearance. In the second case, the surface appears smoother and the scallops created by the milling edge are less pronounced.

The differences in the surface roughness values (Fig. 13) are also reflected in the visual properties of the surface. The value of the Rz surface roughness is much smaller in the case of the controlled spindle speed.

Fig. 13
figure 13

Rz surface roughness at the 3.4 surface zone

5 Conclusion

This study presents a new algorithm to improve the manufacturing of free-form surfaces when milling with a ball-end tool. The cutting speed is one of the most significant inputs from the viewpoint of the surface roughness, while the spindle speed will change during the entire machining process. The presented approach depends on keeping the cutting speed constant by calculating the working diameter and updating the spindle speed and the feed accordingly.

The algorithm, which recalculates the required spindle speed and feed based on the actual working diameter of the ball-end milling cutter, uses the STL model of the machined surface geometry and the APT form of the tool path.

The presented cutting experiments demonstrate the effectiveness of the method. A free-form surface was produced on C45 steel test pieces with a 10-mm-diameter ball-end milling cutter using different feed directions; constant and controlled spindle speed; and feed rate. The cutting parameters were the next: nominal cutting speed was vc = 63 m/min, and the feed per tooth was fz = 0.125 mm. The depth of the cut was ap = 0.3 mm and the width of the cut was ae = 0.25 mm. Subsequently, the surface roughness Rz was measured at several points on the surface having different characteristics.

The main focused points in this article can be summarized as follows:

  • •The milling tests show an improvement in the surface roughness when milling the parts under a constant cutting speed. The average value and the standard deviation of the surface roughness decreased. Depending on the milling direction, the Rz surface roughness decreases from 3.7–4.5 to 1.6–2.0 µm.

  • •In the case of milling with controlled spindle speed, the surface roughness is less dependent on the milling direction, as the smaller standard deviation is indicated, which decreases from 1.0–1.5 to 0.4 µm.

  • •The implementation of controlled spindle speed means greater dynamic stress on the machine tool. The integral value of the spindle speed by the path indicates the dynamic load of the spindle, which is suitable for selecting the most efficient milling direction.

The method presented is therefore suitable for post-processing a free-form surface finishing CNC milling program to compensate for the cutting speed, which improves the quality and visual appearance of the surface.

Further research is needed to study the integral value in detail, which may help to find the most favourable milling strategy taking into account the surface change and the dynamic loading of the spindle.