1 Introduction

In recent years, with the rapid development of computer technology, the design of solid end mills has changed from “a large number of experiments” to a model of “parametric design, cutting simulation, parameter optimization, and a small number of experiments.” This model can improve the efficiency of tool design, shorten the design cycle, and save development costs. For example, commercial CAD software such as NX, SolidWorks, and CATIA are widely used in the parametric design of solid end mills. At present, there are many researches to improve the design speed of cutting tools with commercial CAD software and the integration with CAE software. Li et al. [1] used UG Open API and C++ to redevelop the UG NX platform to realize the computer-aided rapid design of solid end mill. The milling process of Ti-6Al-4V alloy was simulated by DEFORM three-dimensional finite element method, and its geometric parameters were optimized. Tzotzis et al. [2, 3] used SolidWorks API and VBA to establish a tool design platform that can be used to generate standardized turning blade CAD models. The accuracy of the model was verified by DEFORM simulation and experimental results, and the influence of the tip radius on the cutting force was studied. Chen [4] proposed a parametric design method of solid end mills based on CATIA. Chang [5] and Zhu [6] developed parametric design systems of full radius and corner radius solid end mill respectively by combining VB and CATIA macro programming technologies. The solid end mill model is imported into Third Wave Advantage software for finite element simulation, and the simulation results are used to guide the optimization design of the cutter, although the above research has improved the design efficiency of cutting tools through the secondary development of commercial CAD software. However, due to the restriction of kernel and interface, the integration effect of CAD software and CAM/CAE software is limited, which can no longer meet the needs of rapid and accurate tool design. Therefore, it is necessary to develop an independent special software for parametric design of solid end mills.

The core of developing CAD software is the kernel. Commercial kernel Parasolid, ACIS, CGM, and Granite also need to be used for payment, which is not conducive to obtaining independent intellectual property rights. Open CASCADE (Open Computer Aided Software for Computer Aided Design and Engineering, OCC for short) is a CAD/CAE/CAM software platform developed by French Matra Datavision. The platform has open source geometric modeling API architecture. Using OCC to develop CAD software can reduce development costs and improve development flexibility. At present, there are many researches on industrial software and algorithm development using OCC. Bagherzadeh [7] introduced an offline robot programming system based on Python and OCC library, which is used to automatically generate the trajectory of the printer powder bed cleaning robot. Wang et al. [8] developed a fast model segmentation system for complex surfaces with local geometric features based on the Initial Graphics Exchange Specification (IGES) and OCC platform. Wang et al. [9] proposed a 3D casting process CAD system for steel castings based on neutral STEP files based on OCC. From these studies, it can be seen that the exploitability and integration of OCC are suitable for the development of parametric design software for solid end mills. In addition, the kernel can be used not only in the design of macro tools but also in the design of micro milling cutters [10,11,12]. ISO 13399 Cutting Tool Data Expression and Exchange (hereinafter referred to as ISO 13399) has been used as the tool model building standard by more and more international research [13,14,15,16,17]. The application of tool modeling standards is conducive to the transmission and interaction of tool data.

The free cutting vibration directly affects the machining surface quality of titanium alloy thin-walled structural parts during machining. Yue et al. [18] studied the milling process of Ti-6Al-4V frame parts with carbide tools and proposed a chatter prediction method for the chatter problem generated in the milling process. Zheng et al. [19] conducted dynamic modeling and analysis of thin-walled part cutting, extracted modal parameters of the tool workpiece contact area, predicted forced vibration, and avoided chatter. In terms of tool design, variable pitch and variable helix solid end mill has become a new scheme to suppress milling chatter [20]. However, because of its asymmetric structure, which leads to the characteristics of eccentricity, it has an impact on the stability and processing quality of high-speed milling. Therefore, based on ISO 13399 standard, this paper designs and builds a parametric design system for solid end mills based on OCC kernel. The system can quickly and accurately generate 3D models, 2D drawings, and data files of milling cutters for model transmission and exchange. In addition, the system can generate end milling cutter simulation model and workpiece model for finite element simulation of cutting process. Based on the system, the geometric parameters of variable pitch and variable helix solid end mill are optimized, and the residual unbalance is optimized by changing the position of the center of mass.

2 Establishment of mathematical model of solid end mill

The premise of tool parametric design is to accurately describe the dimensions of each spatial structure of the tool, which is particularly important for milling cutters. For the complex features of solid end mill, such as flute and gash surface, mathematical models should be used to describe them in order to achieve rapid parametric design.

2.1 Extraction of key features and agreement of coordinate system

The cutting part of solid end mill is mainly composed of periphery edges and end edges. The grinding process of a finished solid end mill mainly includes five stages: bar, flute, periphery, gash, and end face. Table 1 shows the key features of the solid end mill as shown in Fig. 1a. In order to facilitate and unify the mathematical description of each key feature of the opposite milling cutter, the right hand Cartesian coordinate system X-Y-Z shown in Fig. 1b is agreed in this paper. The axis of the solid end mill is Z-axis, the edge plane is XY plane, and the X-axis passes through one of the tool tip points. The establishment of the coordinate system complies with the provisions of ISO/TS 13399-303:2016 [21] (creation and exchange of 3D models—solid end mills) on the coordinate system for the creation of 3D model of solid end mill. This standard will be introduced in detail later.

Table 1 Key features of solid end mill
Fig. 1
figure 1

Coordinate system and key structure of solid end mill

2.2 Helix edge curve

The helix feature of solid end mill is composed of flute and land. In this section, continuous edge curve model is established by using equal lead spiral of rotary tool. In the solid end mill coordinate system in Fig. 2, expressing edge curve equation by rotation angle φ of any point P on the edge curve, the following is the analysis of the edge profile of the vertical milling cutter and the parameter equation about the parameter t.

Fig. 2
figure 2

Coordinate system of solid end mill

When the periphery edge curve rotates around the Z-axis, the equation of the rotating surface is Eq. (1).

$${r}_1=\left\{\begin{array}{c}{d}/{2\cos \varphi}\\ {d}/{2\sin \varphi}\\ {l}_1t\end{array}\right\}, \; \varphi \in \left[0,2\pi \right],t\in \left[0,1\right]$$
(1)

The tangential vector and longitude vector of the edge curve of point P are respectively dr1 and δr1, then we will get Eq. (2) [22].

$$\left\{\begin{array}{c}{d}_{r1}={r}_{1t} d t+{r}_{1\upvarphi} d\varphi \\ {}{\delta}_{r1}={r}_{1t}\updelta t\\ {}{r}_{1t}=\left\{0,0,{l}_1\right\}\\ {}{r}_{1\varphi }=\left\{-d/2\sin \varphi, d/2\cos \varphi, 0\right\}\end{array}\right.$$
(2)

Using the first basic form of surface, the helix angle β between dr1 and δr1 can be calculated by Eq. (3) [22]. Equation (4) can be obtained by transforming Eq. (3).

$${\cos}^2\beta =\frac{{l_1}^2d{t}^2}{{l_1}^2d{t}^2+{d}^2/4d{\varphi}^2}$$
(3)
$${d}\varphi =\frac{2{l}_1\tan \beta }{d}{d}t$$
(4)

So, when we integrate Eq. (4) at t = 0, φ = 0, we will get Eq. (5).

$$\varphi =\frac{2{l}_1\tan \beta }{d}t$$
(5)

Substituting Eq. (5) into Eq. (1), the parametric equation of the helix f(xt, yt, zt) of the periphery edge of the end mill with respect to t ∈ [0, 1] is Eq. (6).

$$\left\{\begin{array}{c}{x}_t=d/2\cos \left[360t{l}_1\tan \beta /\left(\pi d\right)\right]\\ {}{y}_t=d/2\sin \left[360t{l}_1\tan \beta /\left(\pi d\right)\right]\\ {}{z}_t={l}_1t\end{array}\right.$$
(6)

2.3 Periphery edge section

The simplified model of the periphery edge section of the solid end mill is shown in Fig. 3, where Fig. 3a is the flute feature and Fig. 3b is the periphery feature. The solid end mill shown in this example is an open spiral flute feature.

Fig. 3
figure 3

Periphery edge of solid end mill

(1) Flute

As shown in Fig. 3a, the flute curve is composed of a straight line ls and two arcs l1 and l2, and all curve segments are connected smoothly. The design parameters of flute are as follows. The included angle between ls and X-axis is the rake angle γ. The radius of l1 is R1 where the core diameter is guaranteed to be dc. The radius of l2 is R2, and the flute field angle δ shall be ensured here.

It is known that the coordinate of point A is (d/2, 0). According to the geometric relationship, the equation of line ls is Eq. (7).

$$y=\left(d/2-x\right)\tan \gamma$$
(7)

Let the coordinates of the center O1 of the arc l1 be (XO1, YO1). Since the arc l1 is tangent to the core diameter, we will get Eq. (8).

$${X_{O1}}^2+{Y_{O1}}^2={\left({d}_{\textrm{c}}/2+{R}_1\right)}^2$$
(8)

Since the arc l1 is tangent to the line ls, the shortest distance from the center O1 of the arc l1 to the line ls is R1 and can be expressed in Eq. (9).

$${R_1}^2=\frac{{\left[\left({X}_{O1}-d/2\right)\tan \gamma +{Y}_{O1}\right]}^2}{1+{\tan}^2\gamma }$$
(9)

Solving Eq. (8) and Eq. (9) simultaneously can calculate that the coordinates of the center O1 of arc l1 are (XO1, YO1). Then, the circular equation of arc l1 is Eq. (10).

$${\left(x-{X}_{O1}\right)}^2+{\left(y-{Y}_{O1}\right)}^2={R}_1^2$$
(10)

The coordinates of point B of the tangent point can be obtained by solving Eq. (10) and Eq. (7) simultaneously.

The known coordinate of point D is (d/2cosδ, − d/2sinδ). Let the coordinates of the center O2 of the arc l2 be (XO2, YO2). We will get Eq. (11) because the arc l2 passes through point D.

$${\left(d/2\cos \delta -{X}_{O2}\right)}^2+{\left(-d/2\sin \delta -{Y}_{O2}\right)}^2={R}_2^2$$
(11)

We will get Eq. (12) because the arc l1 is tangent to the arc l2.

$${\left({X}_{O1}-{X}_{O2}\right)}^2+{\left({Y}_{O1}-{Y}_{O2}\right)}^2={\left({R}_1+{R}_2\right)}^2$$
(12)

Solving Eq. (12) and Eq. (11) simultaneously can calculate that the coordinates of the center O2 of the circular arc l2 are (XO2, YO2). Then, the circular equation of the circular arc l2 is Eq. (13).

$${\left(x-{X}_{O2}\right)}^2+{\left(y-{Y}_{O2}\right)}^2={R}_2^2$$
(13)

The coordinate of point C of the tangent point can be obtained by solving Eq. (13) and Eq. (10) simultaneously.

(2) Periphery

As is shown in Fig. 3b, the section curve of periphery is composed of two straight lines l3 and l4, and the coordinates of point E can be obtained as (d/2−lα1sinα1, lα1cosα1). The line l4 can be expressed in Eq. (14).

$$y=\cot {\alpha}_2\left(d/2-{l}_{\alpha 1}\sin {\alpha}_1-x\right)+{l}_{\alpha 1}\cos {\alpha}_1$$
(14)

The coordinate of the intersection point F can be obtained by solving Eq. (14) and Eq. (13) simultaneously. So far, the key points A, B, C, D, E, F, O1, and O2 of the periphery edge section have been obtained.

2.4 Gash surface

In this section, the modeling process of this part is simplified into a process of LNMQ stretching of the grinding wheel section and Boolean difference with the base according to the grinding process of the gash surface. The solution model is established as shown in Fig. 4 where MN perpendicular to MQ and let MN be b4. The included angle between the plane MPQ and the coordinate plane XOZ is the rake angle γf. The included angle between the straight line MQ and the LQ is the included angle of the grinding wheel ω. The included angle between the straight line MQ and LN are the widening angle μ. The included angle between the straight line PQ and PM is the gash angle η. LQ is the widening b1. On the plane MPQ, make QQ' perpendicular to MP and intersect MP at point Q' and let QQ' be b2. On the plane LNMQ, make LL' perpendicular to MQ and intersect MQ at point L' and let ML' be b3. In order to ensure the complete removal of the tool model, make the X coordinate of Q point d/2, which is easy to get Eq. (15) and Eq. (16).

$$\left\{\begin{array}{c}{b}_2=\left(d/2+{a}_1\right)\tan \eta \\ {}{b}_3={b}_2/\cos \eta -{b}_1\cos \omega \\ {}{b}_4={b}_3\tan \mu +{b}_1\sin \omega \end{array}\right.$$
(15)
Fig. 4
figure 4

Mathematical model of solid end mill gash surface

Then, the coordinates of each point are shown in Eq. (16).

$$\left\{\begin{array}{c}\left({x}_L,{y}_L,{z}_L\right)=\left(d/2+{b}_1\cos \omega \sin \eta, -{a}_2+{b}_3\cos \eta \sin {\gamma}_f-{b}_1\sin \omega \cos {\gamma}_f,{b}_3\cos \eta \cos {\gamma}_f+{b}_1\sin \omega \sin {\gamma}_f\right)\\ {}\left({x}_M,{y}_M,{z}_M\right)=\left(d/2+{b}_2\tan \eta, -{a}_2,0\right)\\ {}\left({x}_N,{y}_N,{z}_N\right)=\left(d/2+{b}_2\tan \eta, -{a}_2-{b}_4\cos {\gamma}_f,{b}_4\sin {\gamma}_f\right)\\ {}\left({x}_P,{y}_P,{z}_P\right)=\left(-{a}_1,-{a}_2,0\right)\\ {}\left({x}_Q,{y}_Q,{z}_Q\right)=\left(d/2,{b}_2\sin {\gamma}_f-{a}_2,{b}_2\cos {\gamma}_f\right)\end{array}\right.$$
(16)

2.5 End face

This section establishes the solution model as shown in Fig. 5 according to the machining characteristics of the end face of the solid end mill. The straight line RU is the straight line where the edge line of the end edge is located and the included angle between it and the plane XOY is the inverted taper of the dish edge λ. The R point is the tool tip point, and the included angle between the straight line RS and the plane XOY is the first clearance angle of the end face αf1. The included angle between the straight line ST and the plane XOY is the second clearance angle of the end face αf2. The length of RS is the width of the first end face lαf1. The projection of W on plane XOY is point W', and the angle between the straight line RO and RW' is the tooth angle θ. To ensure the complete removal of the tool model, let the y coordinate of T point be d/2, then the coordinates of each point are shown in Eq. (17).

Fig. 5
figure 5

Mathematical model of solid end mill end face

$$\left\{\begin{array}{l}\left({x}_R,{y}_R,{z}_R\right)=\left(d/2,-{a}_2,0\right)\\ {}\left({x}_S,{y}_S,{z}_S\right)=\left(d/2,{l}_{\alpha f1}\cos {\alpha}_{f1}-{a}_2,{l}_{\alpha f1}\sin {\alpha}_{f1}\right)\\ {}\left({x}_T,{y}_T,{z}_T\right)=\left(d/2,d/2,{z}_S+\left(d/2-{y}_S\right)\tan {\alpha}_{f2}\right)\\ {}\left({x}_U,{y}_U,{z}_U\right)=\left(0,-{a}_2,d/2\tan \lambda \right)\\ {}\left({x}_V,{y}_V,{z}_V\right)=\left({l}_{\alpha f1}\cos {\alpha}_{f1}/\tan \theta, {y}_S,{z}_S+\left(d/2-{x}_V\right)\tan \lambda \right)\\ {}\left({x}_W,{y}_W,{z}_W\right)=\left(d/\left(2\tan \theta \right),d/2,{z}_T+\left(d/2-{x}_W\right)\tan \lambda \right)\end{array}\right.$$
(17)

3 Key technologies of parametric modeling of solid end mill

This section introduces the key technologies of parametric modeling of solid end mill. Firstly, the method of establishing tool data files, 2D drawings and 3D models based on ISO 13399 is introduced. Using the geometric modeling framework of Open CASCADE and the mathematical model of solid end mill established in Section 2, the 3D model of solid end mill is established, and the parametric modeling is realized. The parametric 2D drawing of solid end mill are established by ezdxf. Finally, the centroid optimization method of variable pitch and variable helix solid end mill is introduced.

3.1 Tool standardization modeling based on ISO 13399

In the process of tool information model building, the expression method of features and design details are paid much attention to, while the standard of model building is often ignored by designers. Due to the different ways of establishing the tool information model, there will be many inconveniences in the transmission and use. ISO 13399 provides a way to realize electronic representation of cutting tool data by providing the information structure required to describe various data of cutting tools and cutting tool components. The cutting tool data that can be described in ISO 13399 series includes but is not limited to all data between workpiece and machine tool. Information about blades, solid tools, assembly tools, accessories, components, and their relationships can be shown in this document [23]. Therefore, it is necessary to apply this standard in the process of building the tool design platform. In this paper, modeling rules are applied to establish tool data, including data files, 2D drawings, and 3D models.

(1) Data file

ISO/TS 13399-150:2008 [24] (cutting tool data representation and exchange—part 150: usage guidelines) provides guidance for the overall application of ISO 13399, including the instantiation guide of EXPRESS mode described in ISO 13399-1 and the reference data described in ISO/TS 13399-2, ISO/TS 13399-3, ISO/TS 13399-4, ISO/TS 13399-5, ISO/TS 13399-50, and ISO/TS 13399-60. This part proposes the general format of P21 data file, mainly including header and data.

(a) Header

The header contains the basic information of the tool data file, including file description, file name, and file architecture. Its basic form is shown in Fig. 6.

Fig. 6
figure 6

Header of P21 data file

(b) Data

The data contains the basic information of the tool design features. The common features include four types: item information features, file information features, numerical value features, and string value features.

The item information features mainly express the information features of the tool project, mainly including the tool name, base material, layer material, and supplier. The general form is shown in Fig. 7.

Fig. 7
figure 7

Item information characteristics of P21 data file

The file information feature mainly represents the tool data file information in the tool product data package, mainly including the data file type, name, and application standard. The general form is shown in Fig. 8.

Fig. 8
figure 8

File information characteristics of P21 data file

Numerical value features mainly express the design features of tools in numerical form, as shown in Fig. 9, which is the general form of numerical features. The information expressed is the following: the cutting diameter is 20 mm.

Fig. 9
figure 9

Numerical value characteristics of P21 data file

The string value feature mainly expresses the design feature of the tool in the form of character value, as shown in Fig. 10, which is the general form of the character value feature. The information expressed is the rotation direction is right.

Fig. 10
figure 10

String value characteristics of P21 data file

(2) 2D drawing

ISO/TS 13399-70:2016 [25] defines the terms, attributes and definitions of layers in computer aided design (CAD). The purpose of this part is to provide a reference layer setting to support the use of CAD design of tool graphics for simulation and documentation of tool components and components. Dimensions are limited to the number of dimensions filled in the manufacturer’s or dealer’s catalog. The manufacturer determines its level of detail and defines those that are specific to the tool. The design of the layer structure shall meet all requirements of the tool assembly and its assembly layout. This is mainly to use tool presetting as tool purchase and tool management information. According to the structure of the layer, this part of the standard defines seven main functions: tool graphics, NC machining geometry, extended tool graphics, multiple languages, tool repair, machine equipment layout, and drawing frame.

ISO/TS 13399-72:2016 [26] defines the terms, attributes, and definitions of drawing frame and drawing content in CAD. This part provides a general method for electronic data exchange of graphic product information. Drawing is one of the most important means of communication for manufacturing enterprises. In addition to the description of complex workpiece geometry, the corresponding documents are required in most cases. Most design orders are forced to use the user’s separate picture frame. Therefore, a large part of the design expenditure is used for document creation rather than for proper problem solving. This section separates the appropriate product description (2D drawings) from the user specific representation (drawing header). Therefore, because the product drawings of suppliers or manufacturers are automatically merged into each drawing frame of the end user, the maintenance of documents is reduced.

ISO/TS 13399-71:2016 [27] defines the elements used to create 2D drawings. The elements of a drawing include cutting tool graphic, manufacturer block, drawing frame (includes mapping list), and data table (XML file).

(3) 3D model

ISO/TS 13399-303:2016 specifies the establishment method of 3D basic model and 3D detail model of solid end mill. The standardized modeling of 3D models has been studied [28], and will not be repeated in this section.

3.2 Parametric modeling of 3D tool model based on Open CASCADE

OCC has opened a model establishment interface, which provides a kernel for the establishment of 3D modeling software. The source code of OCC is the C++ version. Although it can guarantee the running speed, the development efficiency and open source degree are limited. Python OCC is a Python encapsulated version of OCC, produced and distributed by tpaviot. The author combines the open source feature of Python and the operating efficiency of OCC to make Python OCC give consideration to both operating efficiency and development efficiency.

This paper uses the visualization module of OCC to realize the 3D model visualization function of the tool parametric modeling system. Use the open source geometric modeling API (Application Programming Interface) architecture to build the 3D model of the solid end mill. Common API functions and their applications are shown in Table 2.

Table 2 OCC common modeling functions and applications

By using OCC and combining the tool mathematical model in Section 2 and based on ISO 13399, the modeling process of solid end mill cutting part as shown in Fig. 11 is realized. The model establishment process is as follows.

  1. (1)

    Bar

Fig. 11
figure 11

Modeling of solid end mill cutting part based on OCC

Create a sketch of the cutter bar section, and obtain the cutter bar through rotation.

  1. (2)

    Flute

Establish the spiral groove section sketch, and obtain the spiral groove feature by sweeping and Boolean difference with the bar.

  1. (3)

    Periphery

Create a sketch of the section of the cutter face after the peripheral cutting, and obtain the feature of the cutter face after the peripheral cutting by sweeping and Boolean difference with the bar.

  1. (4)

    Gash

Create the section sketch of the gash face, and obtain the features of the gash face by stretching and Boolean difference with the bar.

  1. (5)

    End face

Create a sketch of the end face, and obtain the features of the end face by stretching and Boolean difference with the bar.

3.3 Parametric modeling of tool 2D drawings based on ezdxf

Ezdxf is Python’s CAD drawing toolkit, which provides a tool for the establishment of 2D drawings. The toolkit can be used to break away from the constraints of commercial software such as AutoCAD and realize the parametric modeling of 2D drawings by establishing drawing template graphics and changing function variables. Common drawing functions are shown in Table 3. Through the use of ezdxf based on ISO 13399, some solid end mill 2D drawings as shown in Fig. 12 are realized.

Table 3 Common modeling functions of ezdxf and their functions
Fig. 12
figure 12

Part of 2D drawings solid end mill based on ezdxf

3.4 Integration method with CAE software

Taking Abaqus CAE as an example, two methods of integration with CAE software are introduced based on the tool parametric modeling method introduced in this paper.

(1) Toolbar

The RSG dialog builder is a GUI plug-in development tool embedded in Abaqus CAE. It is located in the submenu “Abaqus” under the menu “Plug ins” in the main window of Abaqus CAE. This plug-in can be used to develop tool and workpiece design interfaces.

(2) Secondary development

Establish an independent software system and carry out secondary development on Abaqus CAE to realize the integration of tool design. First, use Python language to record the macro file of finite element simulation pre-processing and make the finite element simulation template model in CAE format. Set the parameters in the macro file through the established user interface. Secondly, prepare a batch file in BAT format. The driver in this file can enable Abaqus CAE to read macro files. Finally, the BAT file can be called through Python logic program to realize the rapid setting of finite element simulation tools and process parameters and the automatic submission of jobs.

4 Development and application of parametric design system for solid end mill

This section applies the mathematical model of solid end mill and OCC API to establish the parametric design system of solid end mill. Through the design of interactive interface, the establishment of solid end mill model is simpler, faster, and more accurate. In order to improve the interactivity of tool model data, the 3D model, 2D drawings, and data files generated by the system conform to ISO 13399 standard.

4.1 System development tools and structural

(1) Development tools

The system built in this paper uses Python 3.6 as the underlying language and MySQL 5.7.31 as the system database. The plug-ins used and their applications are shown in Table 4.

Table 4 Plug-in and its application

(2) System structure

The parametric design system of solid end mill adopts modular design structure, and the platform structure is shown in Fig. 13. The user can generate new tool model data by inputting design parameters through the parametric design interface and view the model data generated by the above design through the model browser in the model browsing module. The user can also manage the tool model database through the database management interface. Through the finite element simulation module, users can use the model generated by the system to simulate the cutting process.

Fig. 13
figure 13

Parametric design system structure of solid end mill

(3) Program structure

The program structure of the system built in this paper mainly includes interface program, logic program, and main program. The interface program is mainly used to represent the layout in the GUI. It is compiled from the UI file generated by PyQt5 design. Logic program is the core program of the whole design system, which plays the role of transmitting user input parameters and controlling interface actions. The function of the main program is to connect the interface program with the logic program. This paper uses the method of separating interface program from logic program to program. This method has the advantages of clear code structure and high programming efficiency, and the modification of a single program will not affect other programs. The logic structure of the system program is shown in Fig. 14.

Fig. 14
figure 14

Parametric design system structure of solid end mill

4.2 System function

(1) Parametric design module

The user can quickly generate the tool model by inputting the tool design parameters through the tool model parametric design interface as shown in Fig. 15 produced by PyQt5. With this system, square end, chamfer, corner radius, and full radius solid end mills can be established as shown in Fig. 16. In addition, the user can design the workpiece in the finite element simulation of the cutting process such as cube and C-section.

Fig. 15
figure 15

Parametric design interface of solid end mill

Fig. 16
figure 16

Solid end mill types based on OCC

(2) Model browsing module

The data file visualization function can realize the browsing function of P21 format data files, including data browsing, data extraction, and data export. The data extraction function can identify the contents of P21 data files and analyze and extract them in the form of tables and tool family diagrams.

The 2D drawing visualization function can realize the browsing function of 2D drawings in DXF format, including drawing browsing and printing.

The 3D model visualization function can realize the browsing function of 3D models in STP, STL, and IGS formats, including six view browsing and solid and wireframe functions.

4.3 Model database

The model database module can upload, view, download, and delete the tool information in the tool cloud model library. In order to facilitate the user to understand the tool information in the database, the module can display the tool product diagram, tool family diagram, and tool design data in the structured product data package online.

(1) Database structure

In order to facilitate users’ interaction and application of tool model data, this paper uses Linux system to build a cloud database based on MySQL database. The database has established model data tables (STP 3D model, DXF 2D drawing, P21 data file) according to the data category. Table 5 is the field of the data table. The user can manage the database through the model database management interface. At the same time, the logic program can upload the user’s operation record and IP address to the operation record sub table, which provides security for the database.

Table 5 Fields of model database table

(2) Data transmission mode

MySQL supports multiple types of data, which can be roughly divided into three types: numeric, date/time, and string (character) types. This system mainly uses numeric and string types. For numeric types, the system mainly uses the data type int to store the serial number (id) of items in the table. For string types, the system mainly uses the data type varchar to store shorter string contents. The long text generated by parsing the P21 file when uploading it is stored in the data type “longtest.” Model files in P21, DXF, and STP formats are stored in “longblob” data type. DXF and ASCII text files, P21 and STP are both text files based on EXPRESS. Therefore, in order to ensure the file integrity and transmission efficiency, the system will background process the model file before uploading it, convert it into a text file, and store it directly in the table. Similarly, after downloading, the system will restore it to the original format file.

4.4 Optimization design of solid end mill centroid

The design of variable pitch and variable helix angle of solid end mill can effectively restrain vibration, improve tool setting accuracy, and the quality of machined surface of workpiece. Because of the asymmetry of the solid end mill with this design, the structure of this kind of cutter has the disadvantage of eccentricity, which makes the solid end mill unable to meet the requirements of high-speed cutting. Therefore, it is necessary to optimize the eccentricity of the end mill without reducing the cutting performance to improve the machining accuracy of the workpiece.

(1) Centroid optimization method and results

In the past, the tool centroid was determined by calculating the centroid of the tool section. However, due to the characteristics of variable pitch and variable helix solid end mill, the cross section of the cutter is constantly changing, and the centroid cannot be calculated quickly. The centroid coordinate (xt, yt, zt) of the tool model can be quickly obtained by using the “CentreOfMass” function of OCC. The centroid of the tool can be obtained by calculating the eccentricity with Eq. (18).

$$e=\sqrt{x_t^2+{y}_t^2}$$
(18)

In this paper, the solid end mill shown in Fig. 17 is selected as the research object. The marks in the figure are shown in Table 6, and the design parameters of the cutter are shown in Table 7. In order to optimize the tool centroid accurately and efficiently, it is necessary to find the features that have a significant impact on the centroid. Therefore, the centroids of ten groups of cutters as shown in Table 8 are calculated in this paper. Among them, nos. 1–3 are of variable helix angle type, no. 4 is of standard type, nos. 5–7 are of variable pitch type, and nos. 8–10 are of variable pitch and variable helix type.

Fig. 17
figure 17

Optimization object of solid end mill centroid

Table 6 Key parameters of solid end mill
Table 7 Design parameters of three edge over center variable pitch and variable helix solid end mill
Table 8 Recognition experiment of features with significant influence on tool centroid

From nos. 1–4 groups in Fig. 18a, it can be seen that the feature of variable helix angle has a great influence on the tool centroid, and the influence increases with the decrease of helix angle. From nos. 4–7 groups in Fig. 18b, it can be seen that the feature of variable pitch has little influence on the tool centroid, and the influence increases with the increase of pitch angle. Nos. 8–10 groups of experiments were added to prevent the coupling effect of the characteristics of variable pitch and helix angle on the center of mass. Comparing nos. 1–4 groups and nos. 7–10 groups in Fig. 18a, it can be seen that the characteristics of variable pitch and variable helix feature is consistent with the influence trend of variable helix on the center of mass. It can be seen that the feature of variable helix has a greater impact on the tool centroid, and the design parameters related to the peripheral edge should be selected for optimization. In this paper, the design parameters of the first and second clearance angles of the periphery are selected to optimize the design of the tool centroid.

Fig. 18
figure 18

Influence of different features on the center of mass of the tool

Select α1, α2, α3, α4, α5, and α6 in Fig. 17b as an optimization feature; the first clearance angle is 5° to 15°, and the second clearance angle is 15° to 20°. Select no. 8 in Table 8 as the optimization object; compile the underlying program to use the exhaustion method to optimize the eccentricity. The optimization results are α1 = 7°, α2 = 15°, α3 = 15°, α4 = 20°, α5 = 15°, and α6 = 18°. The eccentricity of the optimized tool model is e = 0.0158 mm.

(2) Experimental verification

The 3D model of the tool built by the modeling software cannot be completely consistent with the tool grinded by the machine tool. In order to verify the effect of system optimization, the tool dynamic balance experiment was carried out. First, the tool grinding experiment was carried out. The general design parameters of the tool in the grinding experiment are shown in Table 7, and the special design parameters are shown in Table 9. In this experiment, five kinds of cutting tools were designed, including nos. 1 to 5. Use NUMROTO plus V4.0.0 software to design and simulate the grinding track, and the simulation results are shown in Fig. 19. The experimental grinding machine (SAACKE UW I F, Germany) is shown in Fig. 20a. The processing process is shown in Fig. 20b, and the obtained solid end mills are shown in Fig. 20c.

Table 9 Special design parameters of three edge over center variable pitch and variable helix solid end mill
Fig. 19
figure 19

Grinding simulation process of solid end mill

Fig. 20
figure 20

Grinding process and results of solid end mill

As is shown in Fig. 21, the dynamic balance experiment of the above five tools was carried out, which is a hard bearing balancing machine for the experiment (Shanghai Move Also Static Testing Machine Co., Ltd., DH16QF, China). The experiment process is shown in Fig. 21. The experimental results and model eccentricity are shown in Table 10. In this experiment, the tool rotation speed is 5000 r/min. Although this experiment will produce errors, the five tools adopt the same experimental conditions, and the resulting errors do not affect the change trend of this group of experimental data.

Fig. 21
figure 21

Tool dynamic balance experiment

Table 10 Tool dynamic balance test results

It can be seen from the analysis in Table 10 that the feature of variable helix has an impact on the dynamic balance of the tool. The optimized position of the center of mass and the unbalance of no. 3 tool are obviously better than that of no. 4 tool whose first and second clearance angles are equal, which proves that the system has certain effect on the optimization of the center of mass and residual unbalance quality of the tool.

5 Conclusions

This paper introduces a parametric modeling method of solid end mill based on Open CASCADE kernel. The parametric equation of the peripheral edge curve is established by using the equal lead helix of the rotary tool, and the simplified mathematical model of the key design features of the solid end mill is established. Through the established mathematical model of solid end mill and the Open CASCADE modeling interface, the parametric modeling of solid end mill is realized. Aiming at the problem that commercial CAD software cannot be fully integrated with CAD/CAE software due to its limited kernel and interface, this paper uses Python as the underlying language to establish an independent parametric design system for solid end mill using PythonOCC and ezdxf. The conclusions of this paper are as follows:

  1. (1)

    The parametric design system of solid end mills can quickly generate data files, 2D drawings, and 3D models of multiple types of tool and realize the cloud storage function of model data.

  2. (2)

    The tool model established by the system according to ISO 13399 standard has good tool information interaction. The system has simple operation and low requirements for hardware configuration.

  3. (3)

    The feature of variable helix angle has a great influence on the tool centroid, and the influence increases with the decrease of helix angle. Based on the system, the unbalance characteristic of the solid end mill with variable pitch and variable helix is optimized, and the unbalance of this kind of cutter is improved.