Remote Servo Tuning System for Multi-Axis CNC Machine Tools Using a Virtual Machine Tool Approach

Servo systems affect the performances of machining in accuracy and surface quality for high speed and precision machine tools. This study introduces an efficient servo tuning technique for Computer Numerical Control (CNC) feed drive systems using particle swarm optimization (PSO) algorithm by virtual machine tool approach. The proposed approach contained a system identification phase and a servo tuning phase based on the same bandwidth for all axes feed drive systems. The PSO algorithm was adopted to obtain the system parameters and maximize the corresponding bandwidth. An efficient two-step servo tuning method based on gain and phase margins was proposed for high speed and precision requirements. All feed drive systems controller gains were optimized simultaneously for synchronization. A remote system called Machine Dr. was established for servo tuning and monitoring. Simulation and experimental results were introduced to illustrate the effectiveness of the proposed approach.


Introduction
Computer numerical control (CNC) machine tools have been widely used in high speed and precision machining, such as curved surface, gears, aerospace materials, integrated circuit (IC) parts, and precision components, etc.This is why machine tool has been focused on how to accomplish high-speed and high-precision machining.Accurate control is required for machine tools to follow the desired contours.With increasing requirements for precision operations, many control strategies have been proposed [1][2][3][4][5][6][7][8][9][10][11].For industrial applications, the proportional-integral-derivative (PID) controllers of each axis are used for feed drive systems, therefore the tuning method for multi-axis synchronization for precision results are required.However, system dynamic parameters may be uncertain or vary with time.Thus, the system identification of feed drive systems should be done before tuning parameters.Some literature introduce virtual machine tools, including virtual CNC, servo models, and mechanical dynamics of feed drive systems, for treating the problem [11][12][13][14][15][16][17][18][19].
Feed drive systems may have unstable results or poor performance when servo parameters are not designed properly [20,21].Conventionally, the control gains of position and velocity controller are set as high as possible, under the condition that the stability and robustness of the closed loop system is secured with some stability margins [21,22].In general, each commercial CNC machine tool guides the user for tuning parameters step-by-step according to expert experience.In this study, we propose an intelligent and efficient method for the servo tuning problem to improve synchronization.
In order to employ the intelligent efficient method, this study developed a virtual CNC feed drive system via system identification technology using Heidenhain TNCopt software.This can obtain the characteristics of the system and the mathematical models which we can use in numerical simulations; therefore, we were able to implement this intelligent and efficient method by an optimization algorithm, e.g., a genetic algorithm, particle swarm optimization (PSO), evolutionary algorithm, electromagnetism-like algorithm, etc. [23][24][25][26][27][28][29][30].In this study, the PSO was adopted for solving optimization problems.As a result, combined with feed system signals processing and spectrum analysis, the servo system with mechanical dynamics was established.The intelligent algorithm was used to automatically generate a set of suitable servo parameters for the current machine tool.After optimization, performance and processing quality would be better than the original.The proposed approach contained a system identification phase and a servo tuning phase based on the same bandwidth for all axes feed drive systems.The particle swarm optimization algorithm was adopted to obtain the system parameters and maximize the corresponding bandwidth.An efficient two-step servo tuning method based on gain and phase margins was proposed for high speed and precision requirements.All feed drive systems controller gains were optimized simultaneously for synchronization.Finally, the cloud computing system, called Machine Dr., was established for system identification, servo tuning, and monitoring.This organization of this paper is introduced as follows.Section 2 introduces the preliminaries, including the modeling of feed drive systems, specification of machine tools, and the particle swarm optimization algorithm.The proposed system identification based on PSO is introduced in Section 3. Section 4 introduces the intelligent servo tuning technique by two-step PSO.The corresponding simulation, experimental results, and the Machine Dr. system are shown in Sections 3 and 4. Finally, the conclusion is given.

Preliminaries
This section introduces the preliminaries including feed drive system modeling, specifications of five-axis machine tools, and the particle swarm optimization algorithm.

Feed Drive Systems
Machine tool feed drive servo control systems are designed to accomplish a task, that is, to control the positions and velocities of machine tool axes in follow the commons generated by CNC controller.In general, the feed drive system contains two major parts.The first one is the electronic control system or servo control system.The second one is the mechanical system such as the lead screw, bearing, motor, and worktable, etc.The servo system consists of plant, actuator, controller, and sensor.The control system with feedback is a closed-loop system, and without feedback is an open-loop system.The most common structure of servo control is closed loop, which belonging to passive control, and it has multiple loop characteristics and each loop has close relationships.
Many feed drive models have been proposed for system identification and controller design [2,3,6,16,31,32].Literature [31] proposes a virtual simulation model, the model contains the influence of the cutting force, friction and backlash nonlinear phenomenon.However, it assumes that the lead-screw is a rigid body, and the table mass and damping ratio were not considered.These reduce the accuracy and response of feed drive system.Figure 1 shows the dynamic model of the single-axis feed drive system with mechanical vibration, where J m : rotary inertia (kg•m 2 ), B m : damping coefficient of the rotary motion (Ns/m), M t : table mass (kg), C t : damping coefficient of the lead-screw (Ns/m), T: motor torque(Nm), K: stiffness coefficient of the lead-screw (N/m), θ m : motor rotation angle (rad), x t : table position (m), R: transform ratio from motor rotation angle to table position (mm/rad) (R = p/2π), p is the lead-screw pitch (mm).The dynamic equation of this model can be expressed as: The schematic diagram for a motor is shown on Figure 1b, where v a is separate input voltage (V), i t is the circuit current (A) generated by the motor equivalent circuit impedance, R a is motor equivalent Appl.Sci.2017, 7, 776 3 of 21 resistance (Ω), L a is motor inductance (H), e b is total voltage (V) induced in the armature, and ω is motor velocity (rad/s).Therefore, we have The corresponding block diagram of the feed drive system is shown in Figure 2; Figure 2a-c show the servo motor system, feed mechanical dynamic systems, and the overall closed-loop systems, respectively.The proportional (P) or proportional-integral (PI) or proportional-integral-derivative (PID) controller are typically used to control the servo systems of machine tools.In general, current and velocity loops are usually part of the PI controller and the position loop is in the P controller [13,22,31].
The corresponding block diagram of the feed drive system is shown in Figure 2; Figure 2a-c show the servo motor system, feed mechanical dynamic systems, and the overall closed-loop systems, respectively.The proportional (P) or proportional-integral (PI) or proportional-integral-derivative (PID) controller are typically used to control the servo systems of machine tools.In general, current and velocity loops are usually part of the PI controller and the position loop is in the P controller [13,22,31].
The corresponding block diagram of the feed drive system is shown in Figure 2; Figure 2a-c show the servo motor system, feed mechanical dynamic systems, and the overall closed-loop systems, respectively.The proportional (P) or proportional-integral (PI) or proportional-integral-derivative (PID) controller are typically used to control the servo systems of machine tools.In general, current and velocity loops are usually part of the PI controller and the position loop is in the P controller [13,22,31].From Figure 2c, the closed-loop consists of a current loop, velocity loop and position loop.The current loop has a high-frequency response and the bandwidth is higher than processing.The typical values of bandwidths of the current, velocity, and position loops are 100-3000 Hz, 10-100 Hz, and 1-50 Hz, respectively.Since the control target of the milling application is the position control and the current loop gain is at unity in the low frequency band, therefore, the current loop can be bypassed in the applications of milling.Thus, the transfer function is: x s a s a s a s a s a as a where a5 = JmMt, a4 = CtJm + BmMt + KtKvpMt, a3 = JmK + BmCt + CtKtKvp + KtKviMt, a2 = BmK + CtKtKvi, a1 = KpKtKvpK, and a0 = KpKtKviK.

Specifications of the Machine Tool System
In this study, the proposed approach was applied in the Microcut-MCU-5X five-axis machine tool (shown in Figure 3) at National Chung Hsing University, Taiwan.Its major specifications are shown in Table 1.The CNC controller of the machine tool is TNC640, published by Heidenhain Co. (Schaumburg, IL, USA) [22].By using TNC640, we could obtain table position by linear scales, spindle speed, speed or acceleration of each axis, etc.  From Figure 2c, the closed-loop consists of a current loop, velocity loop and position loop.The current loop has a high-frequency response and the bandwidth is higher than processing.The typical values of bandwidths of the current, velocity, and position loops are 100-3000 Hz, 10-100 Hz, and 1-50 Hz, respectively.Since the control target of the milling application is the position control and the current loop gain is at unity in the low frequency band, therefore, the current loop can be bypassed in the applications of milling.Thus, the transfer function is: where , and a 0 = K p K t K vi K.

Specifications of the Machine Tool System
In this study, the proposed approach was applied in the Microcut-MCU-5X five-axis machine tool (shown in Figure 3) at National Chung Hsing University, Taiwan.Its major specifications are shown in Table 1.The CNC controller of the machine tool is TNC640, published by Heidenhain Co. (Schaumburg, IL, USA) [22].By using TNC640, we could obtain table position by linear scales, spindle speed, speed or acceleration of each axis, etc.

Particle Swarm Optimization
Within optimization problems, the objective is to find extreme values of objective function.In this section we introduce the particle swarm optimization (PSO) algorithm, an evolutionary computation technique proposed by Kennedy & Eberhart [23].It was developed by research on the social behavior of animals, e.g., bird flocking.Like Genetic Algorithms, PSO is initialized with a population of random solutions.It has been applied on optimization problems such as neural network learning, fuzzy control, and evolutionary algorithms [24][25][26][27][28][29][30].Compared with other

Particle Swarm Optimization
Within optimization problems, the objective is to find extreme values of objective function.In this section we introduce the particle swarm optimization (PSO) algorithm, an evolutionary computation technique proposed by Kennedy & Eberhart [23].It was developed by research on the social behavior of animals, e.g., bird flocking.Like Genetic Algorithms, PSO is initialized with a population of random solutions.It has been applied on optimization problems such as neural network learning, fuzzy control, and evolutionary algorithms [24][25][26][27][28][29][30].Compared with other evolutionary algorithms [24][25][26][27][28][29][30], PSO has less selected parameters to provide efficiency.At first, the optimization problem is formulated as minimize where f (X) is the objective function, X are the tuning parameters, U B and L B are the corresponding upper and lower bound vectors, respectively, D is the problem dimension, and constraint denotes the optimization constraints.Herein, each individual (or particle) X represents a solution agent.Thus, we have: where V denotes the velocity (update) for the particle X, w is the inertia weight, c 1 , c 2 > 0, and φ 1 , φ 2 are random number in [0, 1], p best is the best solution of this particle in current iteration and g best is the best solution for the overall particle.Based on (5), the population of particles tended to cluster together with others after optimization.The flow chart of the PSO algorithm is introduced in Figure 4.In this study, the PSO was adopted for system identification and servo tuning.Other heuristic evolutionary algorithms can be used for optimization.

Frequency Domain System Identification by PSO
In this paper, the system identification results were based on sine chirp approach.The outputs (red line) of velocity and position loops corresponds to chirp sine signals were obtained from the linear scale shown in Figure 5, and input (blue line) was generated by TNCopt.To enhance the efficiency of identification, a two-stage approach for frequency domain was proposed; at first the velocity loop was considered to obtain motor parameters (Jm, Bm), and then the position loop identification was done for lead-screw and table parameters (K, Mt, Ct).The procedure can be summarized as follows. (a)

Frequency Domain System Identification by PSO
In this paper, the system identification results were based on sine chirp approach.The outputs (red line) of velocity and position loops corresponds to chirp sine signals were obtained from the linear scale shown in Figure 5, and input (blue line) was generated by TNCopt.To enhance the efficiency of identification, a two-stage approach for frequency domain was proposed; at first the velocity loop was considered to obtain motor parameters (J m , B m ), and then the position loop identification was done for lead-screw and table parameters (K, M t , C t ).The procedure can be summarized as follows.

Frequency Domain System Identification by PSO
In this paper, the system identification results were based on sine chirp approach.The outputs (red line) of velocity and position loops corresponds to chirp sine signals were obtained from the linear scale shown in Figure 5, and input (blue line) was generated by TNCopt.To enhance the efficiency of identification, a two-stage approach for frequency domain was proposed; at first the velocity loop was considered to obtain motor parameters (Jm, Bm), and then the position loop identification was done for lead-screw and table parameters (K, Mt, Ct).The procedure can be summarized as follows. (a) where Ĝv (jω i ) denotes the corresponding estimation of velocity gain at ω i .(Step 4) Estimation of K, M t , and C t : where Ĝp (jω i ) denotes the corresponding estimation of position gain at ω i .
As above, Steps 3 and 4 used the PSO technique for finding system parameters (J m , B m ) and (M t , C t , K).The PSO was adopted to minimize the square error of estimated frequency response function (FRF).Subsequently, application of the velocity loop resulted in a position loop with unknown parameters (M t , C t , K).The same optimization process by PSO could find the parameters (M t , C t , K).In order to improve the efficiency of the calculation, the stop criterion was an iteration with a number greater than 4000 and with a particle number of 35, according our experience.Small values of the iteration number and population size resulted in worse optimization results, large values had the problem of complexity and computation effort.The overall identification process is shown in the Figure 6., 0 G j denotes the corresponding estimation of velocity gain at ωi.
Step 4) Estimation of K, Mt, and Ct: G j denotes the corresponding estimation of position gain at ωi.
As above, Steps 3 and 4 used the PSO technique for finding system parameters (Jm, Bm) and (Mt, Ct, K).The PSO was adopted to minimize the square error of estimated frequency response function (FRF).Subsequently, application of the velocity loop resulted in a position loop with unknown parameters (Mt, Ct, K).The same optimization process by PSO could find the parameters (Mt, Ct, K).In order to improve the efficiency of the calculation, the stop criterion was an iteration with a number greater than 4000 and with a particle number of 35, according our experience.Small values of the iteration number and population size resulted in worse optimization results, large values had the problem of complexity and computation effort.The overall identification process is shown in the Figure 6.

Identification Results
Herein, the identification results of MCU-5X are introduced by our approach.We obtained system parameters (Jm, Bm, Mt, Ct, K) of axes feed drive systems and the corresponding transfer function in form of (3).For the velocity loop, the corresponding frequency responses of the actual system and estimation system are shown in Figure 7 (solid-line: experimental results; dotted-line:

Identification Results
Herein, the identification results of MCU-5X are introduced by our approach.We obtained system parameters (J m , B m , M t , C t , K) of axes feed drive systems and the corresponding transfer function in form of (3).For the velocity loop, the corresponding frequency responses of the actual system and estimation system are shown in Figure 7 (solid-line: experimental results; dotted-line: identification model).From Figure 7a,c,e, we observed that there existed an identification error in the high frequency region due to the identified results in the form of an ideal model which showed as Figure 7b.For servo tuning, we focused on the bandwidth; therefore, it was adopted to obtain the equivalent inertia and viscosity coefficient of the motor, respectively.This identification results were valid as long as they fit low-frequency characteristics and maintained the actual velocity loop system characteristics.
Subsequently, the results of the velocity loop coefficients J m and B m were set (as obtained from the above process) for identifying the position loop.The FRF of the actual system and estimation results are shown in Figure 7. Obviously, the estimation results were suitable, and the corresponding frequency response and dynamic properties were almost the same.In summary, the parameters for velocity and position loop were identified and listed in Table 2. Herein, a time domain test where the input signal was generated by TNCOPT, was performed to demonstrate the identification results.The root mean square error (RMSE) of outputs corresponding to sine chirp signals are introduced in Table 3.  7a,c,e, we observed that there existed an identification error in the high frequency region due to the identified results in the form of an ideal model which showed as Figure 7b.For servo tuning, we focused on the bandwidth; therefore, it was adopted to obtain the equivalent inertia and viscosity coefficient of the motor, respectively.This identification results were valid as long as they fit low-frequency characteristics and maintained the actual velocity loop system characteristics.
Subsequently, the results of the velocity loop coefficients Jm and Bm were set (as obtained from the above process) for identifying the position loop.The FRF of the actual system and estimation results are shown in Figure 7. Obviously, the estimation results were suitable, and the corresponding frequency response and dynamic properties were almost the same.In summary, the parameters for velocity and position loop were identified and listed in Table 2. Herein, a time domain test where the input signal was generated by TNCOPT, was performed to demonstrate the identification results.The root mean square error (RMSE) of outputs corresponding to sine chirp signals are introduced in Table 3.    (e) (f) To verify the model obtained from system identification, another illustration example was introduced.We changed the servo parameters Kpp, Kvi, and Kvp to have the FRF of the actual experimental results (machine tool results) and the identified results.Figure 8 shows the identification results of the X-axis, Y-axis, Z-axis, A-axis, and C-axis, respectively.The blue line in Figure 8a-e are the FRF of default servo parameters, which we employed in system identification.The black line in Figure 8a-e are the FRF of changed servo parameters which were obtained by MCU-5X.Both dotted red lines represent the simulation FRF of the default and change servo parameters.It was confirmed that the system identification process was reliable.

X-axis Y-axis Z-axis A-axis C-axis
(a) To verify the model obtained from system identification, another illustration example was introduced.We changed the servo parameters K pp , K vi , and K vp to have the FRF of the actual experimental results (machine tool results) and the identified results.Figure 8 shows the identification results of the X-axis, Y-axis, Z-axis, A-axis, and C-axis, respectively.The blue line in Figure 8a-e are the FRF of default servo parameters, which we employed in system identification.The black line in Figure 8a-e are the FRF of changed servo parameters which were obtained by MCU-5X.Both dotted red lines represent the simulation FRF of the default and change servo parameters.It was confirmed that the system identification process was reliable.To verify the model obtained from system identification, another illustration example was introduced.We changed the servo parameters Kpp, Kvi, and Kvp to have the FRF of the actual experimental results (machine tool results) and the identified results.Figure 8 shows the identification results of the X-axis, Y-axis, Z-axis, A-axis, and C-axis, respectively.The blue line in Figure 8a-e are the FRF of default servo parameters, which we employed in system identification.The black line in Figure 8a-e are the FRF of changed servo parameters which were obtained by MCU-5X.Both dotted red lines represent the simulation FRF of the default and change servo parameters.It was confirmed that the system identification process was reliable. (a)

Servo Tuning Method by PSO
In this study, an intelligent servo tuning method was proposed to adjust the servo parameters of each axis for synchronization.This approach was a two-step adjustment method; the velocity loop control parameters (Kvp, Kvi) were first designed, and then the position loop Kpp was chosen to enhance the bandwidth at several constraints.Figure 8 shows the flow chart of the proposed method, it contains data acquisition, system identification, virtual servo system setup, parameters optimization of velocity loop, and parameters optimization of the position loop.After data analysis and system

Servo Tuning Method by PSO
In this study, an intelligent servo tuning method was proposed to adjust the servo parameters of each axis for synchronization.This approach was a two-step adjustment method; the velocity loop control parameters (K vp , K vi ) were first designed, and then the position loop K pp was chosen to enhance the bandwidth at several constraints.Figure 8 shows the flow chart of the proposed method, it contains data acquisition, system identification, virtual servo system setup, parameters optimization of velocity loop, and parameters optimization of the position loop.After data analysis and system identification, we established the virtual system of the feed drive.By using the virtual model, the PSO was adopted to optimize velocity controllers of five axes in the same bandwidth for synchronization.In this procedure, velocity loop servo parameters (K vp , K vi ) of each axis were obtained by PSO with constraints.where BW vel.denotes the bandwidth of velocity loop.According our experience, excessive gain of FRF may result unstable and vibrations.We used this Constraint 1 to ensure that the system was stable and vibration was low.Constraints 2 and 3 related to gain margin (GM) and phase margin (PM).GM and PM are widely used to confirm system stability and robustness.Herein, for the initialization of PSO, the default values were assigned to be for initial particles; thus, the tuning method would ensure that bandwidth would not decrease.By this method, we obtained velocity controller parameters with better bandwidth.After updating the velocity servo parameters, we then optimized the position controller (K pp ).Similar to velocity loop, we have: Gain margin (GM) > 15 dB Phase margin (PM) > 45 • BW pos.< BW vel.

3
where BW pos.denotes the bandwidth of the position loop.

3
, ensured system stability and only a small overshoot of the time response [33].

Comparison Results-One and Two Steps Optimization
Herein, we had a comparison of results of illustration for our approach.The tuning parameters (K vp , K vi , K pp ) were optimized simultaneously and by two-step optimization.Our approach was a two-step method, where the velocity loop control parameter (K vp , K vi ) were first designed, and then the position loop K pp was chosen to enhance the bandwidth, shown in Figure 9. Table 4 shows the comparison results of tuning results between one-step and two-steps.We found that the computation effort was reduced by our approach.An almost 50% improvement in computation time was saved.In summary, the two-step was better than the one-step in various aspects.

Machine Dr. System Development
We developed a platform to implement remote connection with machine tools, where the user could connect the machine tools and obtain the status of machines via the internet, called Machine Dr.; the functions illustration is shown in Figure 10.It is based on system identification, intelligent tuning servo systems, database processing, and cloud computing.Figure 10b illustrates the communication between machine tools and users.After receiving system identification data, Machine Dr. calculates the associated information of the machine and establishes corresponding data in the cloud, and then Machine Dr. also provides identification results and suggested P-PI controller

Machine Dr. System Development
We developed a platform to implement remote connection with machine tools, where the user could connect the machine tools and obtain the status of machines via the internet, called Machine Dr.; the functions illustration is shown in Figure 10.It is based on system identification, intelligent tuning servo systems, database processing, and cloud computing.Figure 10b illustrates the communication between machine tools and users.After receiving system identification data, Machine Dr. calculates the associated information of the machine and establishes corresponding data in the cloud, and then Machine Dr. also provides identification results and suggested P-PI controller parameters with the corresponding bandwidth.The Vendor can also get these information and supply services when needed.Thus, the vendor and users can reduce the maintenance duration and increase the efficiency of the machine tools.
the user and vendor can monitor the machine operation status, servo parameters, tuning history, etc. by their personal computer (PC) remotely.
In summary, Machine Dr. combines cloud computing with knowledge of CNC machine tools to develop additional features for CNC machine tools.Machine Dr. provides customers and vendors a more easy method of controlling and obtaining information on machine tools.The vendor can also receive these data from the platform.As the result, the vendor can keep track the condition of CNC machine tools which are sold, and then services can be easily offered.In addition to this, if problems occur with the machine tools, the vendor may obtain the causes of the problems from the data stored in the cloud.Consequently, downtime and customers' service time can be reduced.In addition, when the machine tools have already been in use for some time, and the stiffness of the structure may have changed, Machine Dr. recommends suitable parameters to enhance the bandwidth.Figure 11a shows the results of using the Machine Dr.The current system parameters obtained by system identification are shown in the right column and the suggested controller parameters are listed as below.Furthermore, Machine Dr. also provides the function of remote monitoring, since communication has already been established between the user and the CNC machine tools though the platform.When a user operates the software to survey the machine, the information of the machine is stored in the cloud, which is shown in Figure 11b.As the result, both the user and vendor can monitor the machine operation status, servo parameters, tuning history, etc. by their personal computer (PC) remotely.
In summary, Machine Dr. combines cloud computing with knowledge of CNC machine tools to develop additional features for CNC machine tools.Machine Dr. provides customers and vendors a more easy method of controlling and obtaining information on machine tools.The vendor can also receive these data from the platform.As the result, the vendor can keep track the condition of CNC machine tools which are sold, and then services can be easily offered.In addition to this, if problems occur with the machine tools, the vendor may obtain the causes of the problems from the data stored in the cloud.Consequently, downtime and customers' service time can be reduced.

Intelligent Servo Tuning Results
Table 5 shows the PI controller parameters and bandwidth of before and after optimization.A large and almost the same bandwidth of five axes feeding the drive systems, were obtained for synchronization.To verify the effectiveness of the intelligent servo tuning approach for MCU-5X CNC machine tools, there are some tests which are conducted with different parameter settings.The virtual feed drive system of the CNC machine tools is able to estimate the performance, and the tendency of simulation results are representative.The simulation and experimental results are introduced to illustrate our approach.

Intelligent Servo Tuning Results
Table 5 shows the PI controller parameters and bandwidth of before and after optimization.A large and almost the same bandwidth of five axes feeding the drive systems, were obtained for synchronization.To verify the effectiveness of the intelligent servo tuning approach for MCU-5X CNC machine tools, there are some tests which are conducted with different parameter settings.The virtual feed drive system of the CNC machine tools is able to estimate the performance, and the tendency of simulation results are representative.The simulation and experimental results are introduced to illustrate our approach.

Simulation Results
We established the model with the optimized servo parameters with values shown in Table 5, and a spiral trajectory, shown in Figure 12, with high feed rate generated to evaluate the efficacy of intelligent servo tuning.From Table 6, we observed that both tracking error and contouring error were decreased.

Simulation Results
We established the model with the optimized servo parameters with values shown in Table 5, and a spiral trajectory, shown in Figure 12, with high feed rate generated to evaluate the efficacy of intelligent servo tuning.From Table 6, we observed that both tracking error and contouring error were decreased.
There is another simulation for rotation axes, which is the harmonic movement of the A-axis and C-axis.We generated a sine wave with a particular frequency, which was treated as the desired reference.As shown in Table 7, the tracking error was lower than both the A-axis and C-axis.It was explicated that the servo parameters obtained from intelligent servo tuning took effect on the rotation axes.The next simulation was the circular test, with a reference command consisting of 8 Hz angular frequency and a 1 mm radius circular path.Any two of the three axes would follow the command and the simulation results are shown in Figure 13, where Figure 13a,c,e are results of before optimization and Figure 13b,d,f are results of after optimization.The circular motion test illustrated that the performance of machine tool would be improved by an intelligent tuning servo approach.The reason why we selected 8 Hz as the reference command was that this frequency was near the bandwidth, and if the bandwidth increased, the system performance would be obviously improved.Compared to the frequency within the bandwidth, the optimized FRF showed that 8 Hz had an  There is another simulation for rotation axes, which is the harmonic movement of the A-axis and C-axis.We generated a sine wave with a particular frequency, which was treated as the desired reference.As shown in Table 7, the tracking error was lower than both the A-axis and C-axis.It was explicated that the servo parameters obtained from intelligent servo tuning took effect on the rotation axes.The next simulation was the circular test, with a reference command consisting of 8 Hz angular frequency and a 1 mm radius circular path.Any two of the three axes would follow the command and the simulation results are shown in Figure 13, where Figure 13a,c,e are results of before optimization and Figure 13b,d,f are results of after optimization.The circular motion test illustrated that the performance of machine tool would be improved by an intelligent tuning servo approach.The reason why we selected 8 Hz as the reference command was that this frequency was near the bandwidth, and if the bandwidth increased, the system performance would be obviously improved.Compared to the frequency within the bandwidth, the optimized FRF showed that 8 Hz had an obvious rise.As shown in Table 8, there was a significant improvement in both contouring errors and tracking errors.obvious rise.As shown in Table 8, there was a significant improvement in both contouring errors and tracking errors.

Experiment Results
The corresponding experimental results are introduced in Figure 14, Figure 14a,c,e are results before optimization and Figure 14b,d,f are results after optimization.Due to the limitations of the mechanism, the maximum value of angular frequency was about 3-4Hz.Here, the reference command was 3 Hz.As shown in the Table 9, we observed our approach results had smaller contour errors, especially since the reference 3 Hz was within the bandwidth, and the reference frequency was at a distance from the bandwidth.In other words, the reference was located at a flat interval, which meant that the frequency had slight variations in the range.As Figure 14 shows, the experimental results still showed that our intelligent servo tuning method was effective.

Conclusions
This study has introduced an intelligent tuning technique for CNC servo systems using a PSO algorithm with constraints.The proposed approach contained a system identification phase and a servo tuning phase based on the same bandwidth for all axes feed drive systems.The PSO algorithm was adopted to obtain the controller parameters and maximize the corresponding bandwidth.An efficient two-step servo tuning method based on gain/phase margins was proposed for high speed and precision requirements.All feed drive systems controller gains were optimized simultaneously for synchronization.Eventually, these techniques and our research results were integrated into an intelligent cloud computing software, Machine Dr.In this paper, the machine tool MCU-5X was used to demonstrate the effectiveness and performance of intelligent tuning.Simulation and experimental results were introduced to illustrate the effectiveness of the proposed approach.Furthermore, Machine Dr. combined the cloud computing with the knowledge of CNC machine tools to develop additional features for CNC machine tools.Machine Dr. provides customers and vendor with greater ease of controlling and obtaining information on machine tools.

Conclusions
This study has introduced an intelligent tuning technique for CNC servo systems using a PSO algorithm with constraints.The proposed approach contained a system identification phase and a servo tuning phase based on the same bandwidth for all axes feed drive systems.The PSO algorithm was adopted to obtain the controller parameters and maximize the corresponding bandwidth.An efficient two-step servo tuning method based on gain/phase margins was proposed for high speed and precision requirements.All feed drive systems controller gains were optimized simultaneously for synchronization.Eventually, these techniques and our research results were integrated into an intelligent cloud computing software, Machine Dr.In this paper, the machine tool MCU-5X was used to demonstrate the effectiveness and performance of intelligent tuning.Simulation and experimental results were introduced to illustrate the effectiveness of the proposed approach.Furthermore, Machine Dr. combined the cloud computing with the knowledge of CNC machine tools to develop additional features for CNC machine tools.Machine Dr. provides customers and vendor with greater ease of controlling and obtaining information on machine tools.

Figure 1 .
Figure 1.Dynamic model of single-axis feed drive system; (a) mechanical dynamics, (b) motor dynamics.

Figure 2 .
Figure 2. Block diagram of feed drive system; (a) Servo motor system; (b) Mechanical system; and (c) Closed-loop systems.

Figure 2 .
Figure 2. Block diagram of feed drive system; (a) Servo motor system; (b) Mechanical system; and (c) Closed-loop systems.

Figure 4 .
Figure 4.The flow chart of the particle swarm optimization (PSO) algorithm.

Figure 4 .
Figure 4.The flow chart of the particle swarm optimization (PSO) algorithm.

Figure 4 .
Figure 4.The flow chart of the particle swarm optimization (PSO) algorithm.

Figure 5 .
Figure 5. Sine chirp input signals and the corresponding outputs for system identification.(a) X-axis (b) Y-axis (c) Z-axis (d) A-axis (e) C-axis.

(Step 1 )
Data Acquisition: Obtain corresponding data (velocity and positon results) from chirp sine response.(Step 2) Data Transformation: Convert data to get the corresponding frequency responses [gain versus frequency, (Ai, ωi)] (Step 3) Estimation of Jm and Bm: Velocity Loop Identification via PSO:

Figure 6 .
Figure 6.Two-stage approach for system identification.

Figure 6 .
Figure 6.Two-stage approach for system identification.

Figure 10 .
Figure 10.Illustration of the cloud platform-Machine Dr. system; (a) functions illustration; (b) communication between the user and the cloud servo system.

Figure 10 .
Figure 10.Illustration of the cloud platform-Machine Dr. system; (a) functions illustration; (b) communication between the user and the cloud servo system.

Figure 11 .
Figure 11.Operation illustration of the Machine Dr. (a) Auto-tuning screen; (b) Operation history data screen.

Figure 11 .
Figure 11.Operation illustration of the Machine Dr. (a) Auto-tuning screen; (b) Operation history data screen.

Table 2 .
The results of identification for each axis.

Table 3 .
Root mean square error (RMSE) of each axis for time responses.

Table 2 .
The results of identification for each axis.

Table 3 .
Root mean square error (RMSE) of each axis for time responses.

Table 4 .
Comparison results of tuning results between one-step and two-steps.

Table 4 .
Comparison results of tuning results between one-step and two-steps.

Table 6 .
Simulation result of spiral trajectory.

Table 7 .
Simulation result of rotation axes.

Table 6 .
Simulation result of spiral trajectory.

Table 7 .
Simulation result of rotation axes.

Table 8 .
Contour error and tracking error RMSE of circular motion.

Table 9 .
Contour error and tracking error RMSE of circular test.