A Study on Autotuning Controller for Servo System

This paper introduces a PID Autotuning controller using intelligent neural network control based on relay feedback approach. The proposed controller takes advantage of offline learning, in which the initial knowledge of control system is recognized by the relay feedback approach, and the on-line learning capability of neural network controller helps the control system respond quickly to the dynamics changes. The robustness and motion tracking performance are validated through simulation results.


Introduction
Several control design approaches have been developed as independent sub-fields of motion control domain, such as adaptive control, robust control, model predictive control, lead-lag compensation.However, controller of PID type is the most commonly used in motion control [1].Numbers of tuning methods for PID controller have been introduced since Ziegler and Nichols published their PID tuning rule in 1942.And until now it is still one of the most popular schemes.In this method, the control rules are defined by the ultimate gain and period, which are obtained by observing the oscillation of proportional closed-loop controller.This proposed scheme is difficult to carry out in motion control application since the amplitude of the oscillation is hard to keep under control.
A method for automatic determination of ultimate gain and period called relay feedback is used to overcome such drawbacks [2]- [5].The ultimate gain and period of the system are determined by observing the ultimate frequency where the phase angle is -PI under a closed-loop relay feedback control.Although it is straightforward to find the PID control parameters from the calculated ultimate gain and period based on desired amplitude margin, the result is not optimum.
Conventional PID controller is well-suited for the linear control system which behaves in a predictable way.However, the parameters of PID controller are difficult to adapt to a wide range of uncertainty.Therefore, the robustness and performance of PID deteriorate in some industrial control applications, where the systems are normally subjected to rapid and unpredictable ways.Consequently, it is mandatory to incorporate the intelligent control function to the PID controller to adapt with the dynamics change of the control system.There are several researches and commercial products which apply such advance functions [6]- [12].
In [13], a phase locked loop identifier is designed to solve different open-loop frequency domain non-parametric identification problems by giving exact estimation of the gain crossover point.In [14], the author presents a new strategy of PID autotuning based on the combination of relay feedback methodology and operational optimization.For the operational optimization, data base of the control system is generated to develop the radial basis function network model.This model is applied to a nonlinear program to obtain the optimized control output.The relay feedback is applied to obtain the ultimate gain and frequency of control system.Then, the operating regions are separated, and the process data generated in the previous step are used to identify the frequency response model for each operating region.
In this research, we introduce an autotuning of PID controller based on radial basis function neural network (RBFNN) and relay feedback approach.The controller is designed as follows: firstly, the relay feedback control is carried out to analyze the system dynamic and calculate the ultimate gain and ultimate frequency of the control system by measuring the output amplitude and period; then a RBFNN with gradient descent algorithm is designed to approximate the system dynamic.Finally, the ultimate gain and ultimate frequency are incorporated in the neural network to adjust the coefficients related to the PID control parameters.

Architecture of PID Autotuning Controller
The proposed PID AutoTuning controller using radial basis neural network based on relay feedback approach (ATNNRF) control structure is shown in Figure 1.At the first phase of control, the relay feedback control mode is activated.The ultimate frequency and ultimate gain are obtained by the peak detection and calculation of the times between zero crossings of the control input level.
At the second phase of control, a neural network with back propagation algorithm is used to adjust the PID gains continuously.

Relay Feedback Control
The ultimate gain and period of the system are determined by observing the ultimate frequency where the phase angle is -PI under a closed-loop relay feedback control.
Relay feedback control signal are shown in Figure 2.  The relay feedback control is carried out as following: where ( ) U t is the control input of the system at current time; h is the hysterical level at which the control input switch to the opposite position; ( ) e t is the position error of the control system at current time.Applying relay feedback control (1) to the motion system, we obtain a periodic signal with amplitude c A and period c P .In order to identify the ultimate gain from the relay feedback control, the describing function analysis is used.
Because the amplitude c A and period c P of the oscillation are measured from the relay feedback control, the ultimate gain c K and ultimate frequency c ω can be obtained as following:

Radial Basis Function Neural Network
Since neural networks can approximate any continuous function over a compact set with high accuracy and fast learning capability, they have been recognized as a powerful tool for the applications of control system.It is proven that the standard 2-layer neural network consists of two layers of weights, threshold, a hidden layer and an output layer has sufficient generality for closed-loop control purpose.
In particular, the radial basis function neural network (RBFNN) is a feed-forward 2-layer neural network and demonstrates good control performance in the presence of unmodeled dynamics.The RBFNN can be considered as a local approximation model of control system.Moreover, the capability of online learning and rapid convergence of RBFNN makes it feasible in the application of control system.
The general RBFNN shown in Figure 3 can be presented in matrix form: where is the output vector, and , , , N σ σ σ σ =  denotes the activation function vector.
We know that the main disadvantage of the multi-layer neural network is highly nonlinear in parameter.Hence, we consider hereafter the neural network of fixed V , which makes the neural network linearly parame- , we have: ( where is the generalized basis function vector.In this paper, we use the radial basis function with Gaussian form as following: (6) where is the node center of the i-th radial basis function, and is the width coefficient.

The Incorporation of Relay Feedback to the Autotuning Controller Using Neural Network
The proposed PID autotuning controller based on neural network and relay feedback (ATNNRF) is designed by the following procedures: -Firstly, the relay feedback control is carried out to analyze the system dynamic and calculate the ultimate gain and ultimate frequency of the control system by measuring the output amplitude and period.
-Secondly, a RBFNN with gradient descent algorithm is designed to approximate the system dynamic.In this step, the Jacobian matrix, denotes the sensitivity of control system output to the control input is obtained.
-Lastly, the ultimate gain and ultimate frequency calculated in the first step are incorporated with the Jacobian matrix to adjust the coefficients related to the PID control parameters.
Consequently, the PID gains are tuned automatically by the self-learning capability of neural network.It is proved from the simulations results that the proposed controller has the strong robustness, high adaptibility and high performance compared with other current researches and commercial products.
The design of proposed ATNNRF is described as below.
The conventional PID controller can be represented with the discrete form as followings: (7) It is assumed that the closed-loop characteristics are invariant to the time constant.
Since the PID tuning parameters are uniform functions of ultimate gain and ultimate period as described in (2) and (3), they can be scaled for control system that has different time constant as followings: The output of PID controller in ( 7) can be rewritten as the following discrete form: ( ) ( ) ( ) ( ) ( ) ( ) where ( ) e k is the error of closed-loop control system.Applying the tuning rule from ( 8), (9), and (10), we obtain the update control output as follow: Consider a RBFNN as in Figure 3.The input vector is presented as: And the output of RBFNN is given by: Define the performance cost function of RBFNN as: where ( ) R e k is denoted as the approximation error.Apply the gradient descent method, we can obtain the updating parameters of weight vector, node centers and width coefficients of RBFNN as followings: where R η is the learning rate of RBFNN, and R γ is the momentum gene.
The Jacobian matrix for the model identification is obtained as follows: ( ) ( ) ( ) Gradient descent is an iterative method that is given an initial point, and follows the negative of the gradient in order to move the point toward a desired local minimum.
In this paper, we assume that the approximation error in (21) converges to zero by gradient descent algorithm, then (27) can be rewrite as follows: The PID control parameters can be obtained through the calculation of scale factor as described as followings: Define the cost function of system as following: According to the gradient descent method, the scale factors can be updated by the following rules: From ( 17) and ( 27), we can obtain: Consequently, the PID control parameters can be obtained and the system is automatically tuned.

Simulation Results
The simulation is carried out by Matlab/Simulink with required inputs to achieve desired level of control and results.
The simulation of relay feedback control is shown in  The fast convergence of the simulated cost function R E of ATNNRF has proven the effectiveness of the pro- posed controller scheme.

Conclusion
This paper successfully demonstrates the application of an autotuning of PID controller based on neural network and relay feedback approach.First, the principle of relay feedback control is introduced to find the ultimate gain and ultimate frequency for the initial conditions of the neural network controller.Then, the results of relay feedback control are incorporated with the neural network to adjust the PID gains online through the gradient descent algorithm.An embedded motion control board with high performance DSP has been developed to implement the proposed control algorithms.The simulation results have proven the robustness and high tracking ability of the proposed controller.
are the scale factors that define the tuning rule.

Figure 4 .
The results of ultimate gain and ultimate frequency are figured out by measuring the output amplitude and period as follows: 0and momentum gene of neural network are selected as followings: neural is set as 2 10 N = .Sine wave with frequency of 0.25 Hz is used as reference profile for motion control system.The disturbance is a random noise signal.The simulation results including position tracking, position tracking error, and control input of proposed ATNNRF are shown in Figure 5.The position tracking of in Figure 5(a) shows that the actual position of the control system has tracked the desired sine wave position, and the position tracking error in Figure 5(b) proves the robustness and high tracking ability of the proposed controller.The simulated PID autotuning parameters and cost function of ATNNRF at 0.25 Hz are shown in Figure 6.