Comparison of Automatically Tuned Cascade Control Systems of Servo-Drives for Numerically Controlled Machine Tools

Servo-drives have a significant influence on the tracking accuracy of numerically controlled machine tools. It is important to properly choose the structure and gains of a servo-drive control system. This paper presents a tuning method for position and velocity controllers of digital servo-drives. The proposed method allows the controllers’ gain values regardless of controller types (P, PI, PD or PID) to be determined. It takes into account a number of parameters relevant to practical applications, such as the shape of the position error signal and the resolution of the transducer used to measure the angular position of the motor shaft. The controller gains are determined for a parabolic position command signal. A comparison of the influence of both controllers’ types and feed-forward control types on tracking error is also presented. DOI: http://dx.doi.org/10.5755/j01.eee.20.3.2788


I. INTRODUCTION
The displacement of a tool in relation to a workpiece along the desired trajectory is required in many manufacturing processes.In computer numerical control (CNC) of machine tools, the motion trajectory is generated based on the information contained in a technological program [1].The generated motion trajectory is commonly planned by using the constant, trapezoidal or cubic acceleration profiles [2].It reduces the influence of machine tool feed drive system dynamics on the tracking error and also does not allow for to a saturation of servo-drive control systems.Despite the development of modern control methods such as the state feedback controllers [3], model predictive controllers [4], fuzzy logic [5] and neural networks based controllers, etc. [6] commercial servo-drive control systems are still based on the cascade control system structure with feed-forward control [7].A position, velocity and current controllers of the cascade control system are commonly of the P, PI, PD or PID-type (Proportional-Integral-Derivative) [8].The position and velocity controllers are often of the P and PI type respectively (P-PI control) or vice versa (PI-P control).Other position and velocity controller types are rarely used.Feed-forward control added to the cascade control system usually occurs in Manuscript received January 7, 2013; accepted December 30, 2013.
two variants with a velocity signal [9] or with velocity and acceleration signals [7], [10]- [12].It allows tracking accuracy improvement.Cascade control system also has to ensure good disturbance rejection.The correct operation of both cascade control system and feed-forward controls of a servo-drives improves the accuracy of a machine tools operation.
The feed-forward control quality significantly depends on the accuracy of model parameters estimation of a machine tool feed drive system.The quality of cascade control system mainly depends on the choice of controller gains and controllers types.In order to obtain a small tracking error during the operation, the controller gain values have to be high and the internal signals of the servo-drive control system can not become saturated.Generation of motion trajectory with constant acceleration profile [11] is one of the easiest ways to prevent the internal signals in the control system from reaching their maximum values.During acceleration of a feed-drive system with this type of trajectory profile, servo-drive position command signals increase parabolically.Tuning methods of PID controllers are widely described in the literature [8], [13], [14] but these methods focus on obtaining good control properties for step or ramp position command signal.
The purpose of this paper is to present practical tuning method of cascade control system of servo-drive for CNC machine tools and present the impact of feed-forward control on the tracking error.The proposed tuning method allows position and velocity controller gains for different controller types (P, PI, PD, PID) to be determined.The parameters are determined for a control system with a velocity feed-forward signal for a parabolic position command signal.The tuning method takes into account, among others: shape of the position error signal, the resolution of the transducer used to measure the angular position of the motor shaft, friction non-linearity, discrete nature of the controllers.The simulation and experimental results are presented in Section V.

II. FEED DRIVE SYSTEM MODEL
Currently, feed drive systems of CNC machine tools are most often driven by servo-drives with Permanent Magnet Synchronous Motors (PMSM).In this application, control scheme of PMSM is based on Field Oriented Control method.A longitudinal component of the stator current (id) is maintained at a constant value equal to zero, then the electromagnetic torque (Te) produced by a PMSM is directly proportional to the transverse component of stator current (iq) [15] , where kt -electromagnetic torque constant.Feed drive systems performing linear displacement up to 2 meters usually contain backlash-free ball screw gear.The ball screw converts angular movement of a motor shaft to linear motion of a slide (Fig. 1).A slide is commonly placed on backlash-free linear ball guideways to reduce friction and non-linear effects associated with it.The values of static and Coulomb friction of rolling elements of the feed drive system are often approximately equal.The quality of machine tools depends, among others, on accuracy of each feed drive system.Feed drive systems and machine tools body are optimized for high stiffness, small backlash, small linear dimension changes with temperature and ability to dampen vibration.This allows a rigid model of the feed drive system for a synthesis of servo-drive position control systems to be used.A rigid model of the feed drive system with a ball screw gear is shown in Fig. 2, where: Jresultant moment of inertia, k -resultant friction coefficient, s -Laplace operator, θm -angular position of the motor shaft, ωm -angular velocity of the motor shaft, Tddisturbance torque (force applied to the slide reduced to motor shaft), Tf -resultant non-linear friction torque of the linear ball guideway and the ball screw gear.
1 s Non-linear friction torque (Tf) is expressed by the following equation sgn( ), where fc -Coulomb friction coefficient, sgn(ωm) -sign of the angular velocity of the motor shaft.In this model, the sum of the disturbance torque (Td) and the non-linear friction torque can be interpreted as resultant disturbance torque (TD).

III. CASCADE CONTROL SYSTEM STRUCTURE OF SERVO-DRIVE
The PID controllers are used in the majority of commercial servo-drives.Implemented PID algorithms are different for different servo-drive manufacturers.One example of implementation of the digital PID control algorithm is shown in Fig. 3, where: Kp, Ki, Kd are proportional, integral and derivative controller gains, respectively.The PID controller calculates the command signal u(n) according to the control error signal e(n) and the integral action hold signal h(n).The h(n) signal assumes two states: 0 or 1.When it is equal 0, the integral action is turned off to prevent the integral wind-up [8].The PID controller can be simplified to a P, PI, PD controller by zeroing the appropriate controller gains.
h n ( ) -integral action hold u n ( ) Fig. 3. Digital implementation of PID control algorithm.
Cascade control system structures are widely used in servo-drives because of their good control performance and ability to limit motor shaft angular velocity (ωm(n)) and motor current (iq(n)).Limitation of these signals is important in case of failure.In a correctly operating machine-tool control system, containing a trajectory generation system with acceleration profiling [2], [11], ωm(n) and iq(n) signals do not reach maximum values.The tested machine tool uses the trajectory generation algorithm with constant acceleration profiling.This means that, during acceleration and deceleration of the feed drive system, the position command signal has the shape of a parabola.
A cascade servo-drive control system includes three distinct control loops: position, velocity and current.The current control loop is an internal part of the velocity control loop.In turn, the velocity control loop is an internal part of the position control loop [7], [12].A current control system most often contains PI controllers.Its gains are often set by the manufacturers because they mainly depend on the parameters of the PMSM (servo-motor), servo-drive converter and current controller sampling time.The current control loops typically have much higher bandwidth than the velocity and position control loops due to the fact that electrical time constants are much smaller than mechanical time constants.Therefore, when designing the velocity and position control loops the dynamics of the current control loop is often omitted.In the test servo-drives, settling times of current control systems equal approximately 0.5 ms, while the position and the velocity controllers sampling times are 1 ms.
Figure 4 shows the cascade control system structure of a servo-drive with anti-wind-up system and feed-forward control.

Position controller
Velocity controller

Feed drive system
i n ff ( ) 1-z -1 T s K ff Fig. 4. Simplified model of discrete cascade control system of servo-drive with feed-forward, where: H, S -sample and hold system, Ts -sampling time.
The anti-wind-up system suspends the integral action of position and velocity controllers when the velocity command signal (ωm * (n)) and/or the current command signal (iq * (n)) are/is saturated.The structure of the position and velocity controllers was shown in Fig. 3.The closed-loop current transfer function is taken as one.A feed drive system model was shown in Fig. 2. The position (θgen(n)), velocity (ωgen(n)) and acceleration (εgen(n)) command signals are obtained from the trajectory generation system [11].The feed-forward command signal iff (n) is calculated from an inverse model of a feed drive system using ωgen(n), εgen(n) and estimated feed drive model parameters ( J ˆ, k ˆ, c f ˆ, t k ˆ) in order to improve the position control system response [7].
Some important information about the discrete non-linear cascade control system with feed-forward (Fig. 4) can be obtained by analysing the steady-state position error of its continuous linear equivalent shown in Fig. 5.The continuous linear transfer function of PI controller can be written as follows .
The derivative part of the PID controller is not considered because it has no effect on the steady-state error value.In CNC machine tools with constant acceleration profiling, control systems of servo-drives should make it possible to obtain zero steady-state position errors for parabolic position command signal.This allows achieving small tracking errors during acceleration/deceleration of feed-drive systems.Cascade control systems without feed-forward signals (Kff, Kfω and Kfε equal zero -Fig.5) are rarely used in CNC, as it is not possible to obtain a zero steady-state position error for a parabolic position command signal.This control structure allows obtaining zero steady-state position error for either step or ramp position command (the analysis is conducted for TD = 0).For the ramp position command a zero steadystate position error is obtained if the position controller is of the PI-type and the velocity controller is of the P-or PI-type (from now on referred to as PI-P or PI-PI).For P-P and P-PI controllers, a zero steady-state position error is achieved only for the step position command.
Let us consider a cascade control system (Fig. 5) with only ωff feed-forward signal (without iff feed-forward signal; Kff ≠ 0; Kfω and Kfε = 0).Its steady-state position errors values for step (gen(s) = A/s), ramp (gen(s) = A/s 2 ), and parabolic (gen(s) = A/s 3 ) position commands and TD = 0, depending on the position and velocity controller types are shown in Table 1.Kpp, Kip denote proportional and integral position controller gains, while Kpv, Kiv are proportional and integral velocity controller gains, respectively.Zero steadystate position error for the parabolic command is achieved only for PI-P and PI-PI controllers, and feed-forward gain Kff equals (k/kt+Kpv)/Kpv and 1, respectively.
Closed-loop transfer functions of a cascade control system with ωff and iff feed-forward signals (Fig. 5) for P-P, P-PI, PI-P, PI-PI controllers are shown in Table II.Zero steadystate position error for the parabolic command is achieved for all considered controller types (and TD = 0).Numerator and denominator of all transfer functions can be the same if feed-forward gains are properly chosen (Kff = 1, Kfω = k/kt, Kfε = J/kt).This allows for accurate tracking.

Position controller
Velocity controller . Simplified model of continuous cascade control system of servo-drive with feed-forward.

Steady-state position error (eθss) value
Step disturbance Ramp disturbance A cascade control system (Fig. 5) can also achieve zero steady-state position errors for parabolic position command without a ff feed-forward signal (Kff = 0) if the controllers are of the P-P or PI-P type and Kfω = k/kt + Kpv, Kfε = J/kt.In that case the corresponding coefficients of the numerator and denominator of the closed-loop transfer function are the same (see Table II).It is often proposed [7], [10], [13] to add two feed-forward signals (ff and iff) to the cascade control system in order to achieve accurate tracking.For cascade control system (Fig. 5) the iff feed-forward signal is necessary only for the P-PI and PI-PI controller types.
The derivative parts of the position and velocity controllers (Fig. 5 for Td = 0) are not required to obtain accurate tracking.This is also true for the discrete control system, which takes into account the Coulomb friction.This will be shown experimentally in Section V.
Steady-state position error values of the cascade control system (Fig. 5) for step (gen(s) = A/s), ramp (gen (s) = A/s 2 ), parabolic (gen (s) = A/s 3 ) disturbance torque TD and gen = 0 depending on the position and velocity controller types are shown in Table III.In CNC machine tools obtaining zero steady-state position error for step disturbance is one of the basic requirements.This condition is not fulfilled if a cascade control system contains P-P controllers.Therefore, in the following part of this paper, P-P, P-PD and PD-P controllers will not be considered.

IV. TUNING POSITION AND VELOCITY CONTROLLER GAINS
The quality of a cascade control system also depends on the position and velocity controller gain values.In order to compare the influence of position and velocity controller types on the quality of a cascade control system, controller gain values should be determined using the same method for different controller types.In CNC machine tools, controller gains have to be determined in such a way that:  the trajectory tracking error (position error eθ(n) -Fig.4) is as small as possible,  the position error signal is as smooth as possible, i.e.
without oscillation,  the feed-drive system is not noisy at standstill, where: noisetorque ripple causes vibrations of mechanical elements of feed-drive systems, characterized by high intensity sound.
One of the causes of the noise in feed-drive systems is related to the finite resolution of the converter measuring the motor shaft angle position and measurement noise.When the machine is at standstill, the measured motor shaft angle position changes between values: +R, 0, -R, where R is the converter resolution.These changes result in calculating new values of the position error and motor shaft angular velocity (Fig. 6).The changes of position error and motor shaft angular velocity amplified in the position and velocity controllers cause changes of the current command signal (iq*(n)) and, consequently, oscillation of the motor torque, which produces noise in the feed drive system.This noise is often so troublesome that, in order to reduce it, the controller gain values are decreased, at the expense of accuracy and rigidity of the feed drive system.Based on Fig. 6, the amplitude of the current command signal caused by change of the motor shaft position reading value of R when the machine is at a standstill and Td = 0 can be determined from the following equation 1, where Kpp, Kip, Kdp -position controller gains; Kpv, Kiv, Kdvvelocity controller gains; Ts -sampling time.
In order to determine the controller gains which meet the objectives set, a cost function, which calculates the sum of absolute value of position error or position command, depending on the lim parameter (limitations) value has been proposed  A = 1 if the number of local minima of the position error signal (eθ) is greater than zero.This component allows controllers gains for which the control system response is as smooth as possible, i.e. without oscillations to be determined;  B = 1 if the value of Iqn is greater than the one assumed by the machine tool operator.This component specifies the controller gains, for which the noise generated by the feed drive system at standstill will be at an acceptable level;  C = 1 when the minimum value of the position error signal is less than zero.For the position command signal increasing parabolically, the steady-state position error is larger or equal to 0, depending on the type of controllers and feed-forward command.Thus, a negative minimum value of the position error signal indicates that the controllers' gains values are incorrect. D = 1, when one or more controller gains take negative values.
In other cases the components A, B, C and D take the zero value.Values of the cost function are determined from the simulation of the discrete cascade servo-drive control system with the ωff feed-forward signal (Fig. 4).During tuning the iff feed-forward signal is disconnected because it allows for obtaining small position error also for controllers gain values equal zero.The parameters of the parabolic position command signal are selected so as to force the movement of the feed drive system with maximum acceleration (εmax) to nominal speed (mN).The value of maximum acceleration is determined from the following relationship where meN -nominal torque of the motor.The controller gain values for which SAE takes the minimum value are considered optimal.
The particle swarm optimization (PSO) method [16], [17] was used to find the minimum of the cost function (5), for all investigated types of controllers (P, PI, PD, PID) of a cascade servo-drive control system.The PSO algorithm was developed based on social behaviour of flocks of birds and schools of fish.The position of each individual particle is treated as a potential solution for the optimization problem.
In D-dimensional search space, the position of j-th particle can be described by D-dimensional vector xj = [xj1, ..., xjd, ..., xjD], while its velocity can be described by a vector vj = [vj1, ..., vjd, ..., vjD].The most commonly used variant of the PSO algorithm contains an inertia function to increase the ability of global search.For an m-th iteration, PSO algorithm with a linear inertia function can be written using the following equations: where w(m) -value of inertia function in the m-th iteration, wmax, wmax -maximum and minimum value of inertia function, respectively, mmax -number of iterations, c1, c2set accelerate constants, r1, r2 -random numbers within the range (0,1), pjd -component of vector pj = [pj1, ..., pjd, ..., pjD] which stores the best position of j-th particle (personal best), gd -component of vector g = [g1, ..., gd, ..., gD] which stores the best position found by swarm (global best, best of personal bests).The initial position vector and initial velocity vector of jth particles are drawn from a uniform distribution on the interval (0,1) [18].If the lim parameter of the cost function takes a value equal 1 for the initial position vector, the initial position vector is drawn again.

V. RESULTS
Investigation of the developed tuning method for position and speed controllers and quality comparison of cascade control systems with feed-forward was carried out on the Xaxis of MW1008 CNC Router (Fig. 7).Numerical control of this machine is based on a PC and Linux CNC software.Communication between all servo-drives of the MW1008 and the PC is realised with a MOXA CP-114 serial port card (Fig. 8).The kinematic diagram of the X-axis feed drive system is shown in Fig. 1.The X-axis travel range is 1000 mm, the ball screw lead is 20 mm.The estimated parameters of the dynamic model of X-axis feed drive system are as follows:   The MATLAB/Simulink software is used to carry out simulations of the discrete cascade servo-drive control system with feed-forward (Fig. 4) and implementation of the cost function (5) and the particle swarm optimization method (7).Using the presented tuning method, the position and velocity controller gains were determined (Table V).This was performed for different controller types of the cascade control system with ωff feed-forward signal (without iff feedforward signal).During the tuning, the position command signal (gen) increases parabolically with the acceleration εmax = 362.5 rad/s 2 (see (6)) to velocity ωmN (see Table IV).This signal was the same as gen(n) shown in Fig. 9 for n from 1 to 828.Iqn value (see ( 4)) was taken as 0.2 A. Following parameters of the PSO algorithm were used: ps = 200 (population size); wmax = 1; wmin = 0.4; c1 = c2 = 1.5; mmax = 200.Table V also contains: Kff value, cost function value (SAE) and maximum position error (emax) value.The smallest cost function value was obtained for the PI-P and PID-P controllers.Simulation results of a discrete cascade control system with P-PI, PI-P, PI-PI, PD-PI, PI-PD, PID-P, PID-PI controller types and ωff feed-forward signal for the X-axis of the CNC Router MW1008 are shown in Fig. 9.
The position command signal gen(n) and ωgen(n) signal used during simulation are shown in Fig. 9 Analysing the presented results it can be seen that controller gains have been determined correctly.In addition, studies indicate that the conclusions of the theoretical considerations presented in section 3 are also valid for the discrete cascade control system of servo-drive with feed drive system model which takes into account the Coulomb friction (Fig. 2).
As expected, the derivative part of the position controller has no significant influence on the quality of the control system.For this reason, position error signals overlap each other for P-PI, PD-PI and PI-P, PI-PD, PID-P as well as PI-PI, PID-PI controller types (Fig. 9(b).Therefore, the derivative part will not be considered further.In the control system with PI-PD controllers, the derivative part of the velocity controller was set to zero by the optimization algorithm (see Table V) because it significantly increases the value of Iqn.As previously noted, in a cascade servo-drive control system with P-PI controllers and ωff feed-forward signal a steady state position error occurs in response to the parabolic command.
For the determined P-PI, PI-P and PI-PI controller gains (Table V) experimental research was performed on a discrete cascade control system with ωff and iff feed-forward signals of SDMT-5A for X-axis CNC Router MW1008 (Fig. 10).Both the position command signal (gen(n)) and the feed-forward signals have the form shown in Fig. 10(a  An equally small tracking error can be obtained for a cascade control system with PI-P controllers and iff feedforward signal if Kfω = k/kt + Kpv and Kfε = J/kt (Kff = 0, see Section III).This is shown in Fig. 11(b).During the experiment, the position command signal had the form shown in Fig. 10(a).The iff feed-forward signal (Fig. 11(a)) takes high values because it has to compensate for the velocity feedback signal ωm (see Fig. 4).The values of the velocity command signal ωm * are low because position error signals eθ(n) take low values and ωff = 0.For P-PI and PI-PI controller types with this feed-forward signal the position error signal takes large values.The position error signal also takes high values for a cascade control system with P-PI, PI-P and PI-PI controllers and iff feed-forward signal if Kfω = k/kt and Kfε = J/kt (Kff = 0).
Figure 12 shows the position error signal (a) and the current command signal (b) of a cascade control system for step disturbance torque with the amplitude meN (see Table IV) at n = 500 (0.5 s).As can be seen in Fig. 12(a), a discrete cascade control system with P-PI and PI-P controllers provides faster disturbance rejection than the one with PI-PI controllers.Position error signals for P-PI and PI-P controllers overlap each other.Here it should be remembered that controller gains are tuned for a parabolic position command.

VI. CONCLUSIONS
This paper presents a servo-drive controller gains tuning method in a discrete cascade control system for different position and velocity controller types (P, PI, PD, PID).
A comparison of cascade control systems with different feed-forward control types was also presented.The described tuning method takes into account a number of parameters relevant to practical applications.It allows suitable controller gains for CNC machine tools to be determined.For the cascade control system and the adopted rigid model of a feed drive system, the derivative part of the position controller has no significant influence on control quality.The derivative part of the velocity controller significantly amplifies the quantization noise.In the cascade control system with ωff feed-forward signal zero steady-state position errors have been obtained for PI-P or PI-PI controller types.These control structures do not allow for accurate tracking.Accurate tracking can be obtained for a cascade control system with ωff and iff feed-forward signals and P-PI, PI-P, PI-PI controller types or for a cascade control system with iff feed-forward signal and PI-P controller types.An integral part of the position or the velocity controller is required in order to achieve the zero steady-state position error for step disturbance.

Fig. 1 .
Fig. 1.Kinematic model of a feed drive system with ball screw gear, where: m -angular position of a motor shaft, x -linear position of a slide, l -ball screw lead.

Fig. 2 .
Fig. 2. Dynamic model of a feed drive system.

Fig. 6 .
Fig. 6.Simplified block diagram of position and velocity controllers (q -1 -backward shift operator).SAE values are calculated for parabolic position command signals.The lim parameter takes two values -0 or 1, depending on the logical sum of components A, B, C and D, where:  A = 1 if the number of local minima of the position error . Feed drive systems of the MW1008 are driven by Permanent Magnet Synchronous Motors (SSD AC M2n0150-4/1-3) controlled by SDMT-5A servodrives[19].Selected parameters of the SDMT-5A servodrive are listed in TableIV.The angular position of the PMSM shaft is measured by a resolver.

Fig. 9 .
Fig. 9. Simulation results of discrete cascade control system with ωff feedforward signal for different controllers types (sampling time Ts = 1 ms).
(a), Fig. 9(b) and Fig. 9(c) show the position error signals eθ(n) and current command signals iq*(n).Current command signals for different controller types are similar.For this reason, these signals overlap each other.

Fig. 10 .
Fig. 10.Experimental results of discrete cascade control system with P-PI, PI-P, PI-PI controllers and ωff and iff feed-forward signals of SDMT-5A on X-axis CNC Router MW1008 (sampling time Ts = 1 ms).
) and Fig.10(b), respectively.Figure10(c) and Fig.10(d) show position error signals eθ(n) and current feedback signals iq(n) during the experiments.For different controller types signals eθ(n) and iq(n) are similar therefore overlap each other.This is due to the fact that for determined optimal controller gains for each considered control structures similar dynamics was obtained.The oscillatory nature of the position error signals and the current feedback signals in a quasi-steady state is associated, among others, with ball screw run-out, measurement inaccuracy of the motor shaft angular position made by resolver and torque ripple in the PMSM.In a transient state, oscillatory behaviour of the aforementioned signals is caused by flexibility of mechanical components of the feed drive system.The cascade control system with ωff and iff feed-forward signals allows, as expected, for accurate tracking.

Fig. 11 .
Fig. 11.Experimental results of discrete cascade control system with PI-P controllers and iff feed-forward signal of SDMT-5A on X-axis CNC Router MW1008.

TABLE . I
. STEADY-STATE POSITION ERRORS VALUES OF CASCADE CONTROL SYSTEM (FIG.5) WITH ONLY ΩFF FEED-FORWARD SIGNAL (WITHOUT IFF FEED-FORWARD SIGNAL) FOR STEP, RAMP AND PARABOLIC POSITION COMMAND.

TABLE III .
STEADY-STATE POSITION ERROR VALUES OF CASCADE CONTROL SYSTEM (FIG.5) FOR STEP, RAMP AND PARABOLIC DISTURBANCE TORQUE TD.

TABLE V .
CONTROLLER GAINS DETERMINED FOR X-AXIS CNC ROUTER MW1008.