An algorithm for controlling of cutting speed based on soft calculations

The algorithm for controlling of cutting speed during machining of parts on equipment CNC is presented in the article. A program code has been developed for controlling of cutting speed on a three-axis milling machine CNC. The fuzzy-logical MISO system in which cutting speed depends on the rotation frequency of the cutting tool and the feed is presented.


Introduction
Machining cutting of products is a universal method of manufacturing of parts.Formation of high requirements to the final product requires an increase of the level of automation and intellectualization of production processes.If the automation of processes has now reached a high level through with use of various mechatronic complexes, then the applied intellectual systems are not sufficiently able to control complex systems [1,2].In this connection, the problem of increasing the level of intellectualization of control systems for equipment CNC arises.

Control system of a machine-tool with CNC
The experimental model of a 3-axis milling machine CNC is shown in Fig. 1.The machine-tool includes: microcontroller Arduino Mega 2560, a control board of motors SH Ramps v.1.4,power supply 12 V, three drivers of stepper motor MP4988, three bipolar stepper motors, mini-drill with cutting tools.
The process of forming control signals to the actuating mechanisms of a machine-tool with CNC includes five steps: Step 1. Software development in Arduino IDE for controlling the movement of a cutting tool along the axes of the machine-tool with CNC.
Step 2. Download of program code via serial COMport from PC to microcontroller Arduino Mega 2560.
Step 3. Data transfer from the microcontroller Arduino Mega 2560 to the control board of motors SH Ramps.
Step 4. Data transfer from the SH Ramps to drivers of stepper motors MP4988.
Step 5. Data transfer from the drivers of stepper motors MP4988 with the subsequent transfer of impulses to bipolar stepper motors.
After that, the transfer of rotary motion from stepper motors using the shaft to the axes supports of machinetool with CNC is carried out.The motion of supports of a machine-tool leads to the movement of the cutting tool along axes of the machine-tool.The graphic model of the cutting process is shown in Fig. 2. To connect MP4988 driver to the Arduino Mega microcontroller is used Table 1.Movement of the machine-tool supports is carried out along the shafts having thread of 2 mm.That is, in order the support of the machine-tool with CNC moved 2 mm, it is necessary to transfer 360 ° / 1.8 ° = 200 pulses through the STR channel.
The MP4988 driver works in several step modes: 1/2, 1/4, 1/8 and 1/16.Reducing the step size increases the accuracy of positioning machine-tool CNC supports.For example, in the 1/4 step mode, to move the support for 2 mm, it is necessary to transmit 800 pulses along the STR channel.The stepper motor is connected to the A1, A2, B1, B2 pins of the MP4988 driver.
To move supports along the axes of a three positioning machine-tool with CNC, the program code stored in the microcontroller is used.The program code for moving a support along the X-axis is shown need:

Fuzzy MISO-system control of cutting speed
During the experiments it was found that depending on the change in the number of pulses (i), the amount of displacement of the supports along each axis changes.The time delay between transmission of pulses (t) affects the speed of passage of the cutting tool along the axis (v).Also, the speed of passage of the cutting tool along the axis depends from frequency of rotation of the spindle drill (n).The fuzzy MISO-system for control of cutting speed was created on the basis of this data [3,4] (Fig. 3).

Fig.3. Fuzzy MISO-system control of cutting speed
The fuzzy system has two input variables: and one output variable: where n1,…,n3 are terms of the input variable of fuzzy set n; s1,…,s3 are terms of the input variable of fuzzy set s; t1,…,t5 -terms of the output variable of fuzzy set t [5,6].
Input and output variables are described by triangular membership functions (MF), the graphs of which are shown in Fig. 4, where μ (n), μ (s) and μ (t) are membership functions of the fuzzy sets n, s and t, respectively.[7,8].The MF is given by the following formula: The graphical view of the membership function is shown in Fig. 5.For fuzzification of the input variables were used the following data: the frequency of rotation of the drill spindle is 0 ÷ 8000 rpm.Feed of cutting tool is 0 ÷ 0.8 mm / rev.The delay time is limit of 70 ÷ 300 μs.If the time delay is less than 70 μs, the bipolar stepper motors do not rotate.The fuzzy knowledge base is given by nine fuzzy rules and is presented in Table 2 [9].

Fuzzy MISO-system
Cutting speed (V), the adjustable delay (t) Rotational speed of the drill (n) Feed (s) The defuzzification was carried out on the base of the method center of gravity [8,9,10] ( ) where min, max -limits of integration of fuzzy set; ( ) -degree of membership function truncated terms of output variable.
The structure of fuzzy inference with usage of soft arithmetic operations is presented in articles [11, 12 13].The structure of algorithm for control of cutting speed is shown in Fig. 6.Analysis of the graphs presented in Fig. 7 showed that during using in fuzzy inference of soft arithmetic operations and control of the cutting speed is performed more smoothly than with using of hard operations.Therefore, using soft arithmetic operations in fuzzy inference improves quality of the processed details.At the same time, the developed fuzzy MISO-system allows to extend the life of the cutting tools, since during the cutting, there is no overheating of the parts.

Conclusion
In this work the program code for controlling process of cutting on a three-axis milling machine with CNC is presented.The problem of deleting previous commands from the memory of the microcontroller, when loading the next command, was solved.Fuzzy MISO-system for controlling cutting speed, which depends on the rotation frequency of the spindle drill and the feed, is presented in the article.On the basis of the analysis of the resulting surfaces, it was concluded that, when using soft arithmetic operations, the accuracy in the machining of parts improves.

Fig. 4 .
Fig.4.Graphics of triangular membership functions: (а, b) are input variables n and s, respectively; (c) is output variable t.

BeginFig. 6 .Fig. 7 .
Fig.6.Fuzzy inference algorithm based on soft arithmetic operationsThe resultant surfaces received during modeling of fuzzy inference with usage of soft and hard arithmetic operations are shown in Fig.7.

Table 1 .
Connecting the MP4988 driver pins to the Arduino Mega microcontroller.
When using the program code, it was noticed that when changing the control parameters and then loading them into the Arduino Mega microcontroller, the program code written earlier in the Arduino Mega microcontroller is executed before using this code.As a consequence, the cutting tool does not move along the specified trajectory.To solve this problem, the program code need: