Adaptive PID Controller Using RLS for SISO Stable and Unstable Systems

1 Automatic Control Engineering, Egyptian Nuclear and Radiological Regulatory Authority (ENRRA), 3 Ahmed El-Zomor Street, El-Zohor District, Naser City, Cairo 11762, Egypt 2 Automatic Control Engineering, Department of Electronics and Communication, Faculty of Engineering, Cairo University, Giza 12316, Egypt 3 Nuclear Engineering, Egyptian Nuclear and Radiological Regulatory Authority (ENRRA), 3 Ahmed El-Zomor Street, El-Zohor District, Naser City, Cairo 11762, Egypt


Introduction
A challenging problem in designing a PID controller is to find its appropriate gain values (i.e., proportional gain , integral gain , and derivative gain ) [1]. Moreover, in case where some of the system parameters or operating conditions are uncertain, unknown, or varying during operation, a conventional PID controller would not change its gains to cope with the system changes. Therefore a tuning method is needed. Various PID controller tuning techniques have been reported in the literature. It is classified into two groups, offline tuning methods as Zeigler-Nichols method and online tuning methods or adaptive PID. APID can tune the PID gains to force the system to follow a desired performance even with the existence of some changes in system characteristics [2].
Adaptive control has been commonly used during the past decades specially the model reference adaptive control (MRAC). Its objective is to adapt the parameters of the control system to force the actual process to behave like some given ideal model which is demonstrated in [3,4]. There are two main categories of adaptive control. (1) Indirect. It starts with controlled system identification and then uses those estimated parameters to design the controller as presented in [5][6][7]. (2) Direct. This is more practical than indirect method. It uses a parameter estimation method to get the controller parameters directly the same as introduced in [8,9].
An adaptive PID controller is presented in [10] using least square method which is an offline parameter estimation method. On the other hand, an optimal self-tuning PID controller is introduced in [5] using RLS to estimate the model from its dynamic data. RLS is a recursive algorithm for online parameter estimation that is frequently used because it has a fast rate of convergence. In [11] an online type of controller parameter tuning method is presented by utilizing RLS algorithm. It develops the standard offline fictitious reference iterative tuning FRIT method to be used as a modified estimation error for RLS algorithm. Also the controllers in [11][12][13] present online tuning based on input and output data of the system. In the case of unstable systems, few researchers study the behaviour of the adaptive PID techniques on unstable systems and examine its ability to stabilize them as verified in [14][15][16][17].
In this paper, the direct method of adaptive control is considered. RLS algorithm is used as adaptation mechanism to tune the PID gains automatically online to force the actual process to behave like the reference model. The proposed approach has also the ability to stabilize the unstable system. Adding some parameters variations in actual process during its operation time confirms the proposed controller adaptation capability and robustness against process variation in both stable and unstable cases.
The structure of this paper is as follows. In Section 2, the problem statement is presented. In Section 3, an APID controller and its adaptation mechanism using RLS are introduced. The proposed technique is applied to numerical examples in Section 4 and its results show its ability in tracking the reference input signal using APID controller for both stable and unstable systems even when the considered system suffers from changes of its parameters. Finally, in Section 5, the conclusion and some suggestions for further work are presented.

Problem Formulation
Consider a system shown in Figure 1, where is a process that is modeled as a single-input and single-output linear system, ( ) is a PID controller, and denotes a parameter vector to be tuned in the controller. Also, , , , and = − denote the control input, output, reference signal, and error signal, respectively.
In conventional control, the PID controller can be expressed as Note that, approximately, the transfer function of integrator / can be expressed as /( + 1).
Simply, the controller transfer function [11] can be expressed as ] .
( ] . (3) So (2) can be rewritten in the form In most of practical applications, the actual structure of the controlled system is unknown or varying. Therefore, the adaptive mechanism is used for self-adjustment of the PID gains to achieve the best tracking performance. The proposed technique controls the motion of both stable and unstable systems to follow the ideal trajectory provided by a designer defined reference model ( ).

APID Controller Using RLS
The proposed controller objective is to find the coressponding controller parameters (PID gains) using RLS algorithum as adaptation mechanism such that the closed-loop transfer function is more or less equal to the reference model transfer function. In other words, the reference output ( ) tends to be equal to the plant output ( ) as follows: So it can be written as where ( ) is a given model reference transfer function which represents the ideal closed-loop dynamics. Hence, (6) can be written as Applying the controller transfer function ( ) to both sides of the above equation results in and becomes Now the modified estimation error of RLS can be defined as This means that Based on the RLS algorithms, we tune the parameters which are the PID gain values so that the following performance index is minimized: On the other hand, in order to apply the classical equations of the RLS estimation algorithm used to find the parameters , a modified estimation error can be expressed as where = 1 (1 − ( )) ( ).
To build the RLS algorithm using the 2nd-Level S-Function in Matlab, the first term in right hand side of (13) has to be rewritten as where RLS = [ ] and is a vector which contains all parameters of PID gains.
RLS is an algorithm which recursively finds the optimal estimatê( ) of the controller parameter by usinĝ( −1) [3]. Thus, considering (14), the proposed RLS update laws will be as follows: where is the adaptation gain and is the covariance matrix. According to the above RLS algorithm equations, the controller parameterŝ( ) are updated at each time. Thus, variation of the controller parameterŝ( ) may be large at the start of algorithm, at the time when plant characteristics change rapidly, and at the time when the set-point reference is changed. Due to this, the system may stop working steadily.
In order to avoid such a problem and reduce the variation of the controller parameterŝ( ) is filtered by a low-pass filter which can be defined as where is a sufficiently small positive constant. So is changed reasonably.

Numerical Examples
In order to illustrate the main features of the proposed APID using RLS, simulation examples are now presented.
The following examples cover stable and unstable systems cases and consider the changes in the system parameters during simulation time.
Let the sampling time be = 0.001 and let the reference model be The reference input signal is chosen to be a delayed square wave.
In order to evaluate the proposed control method to plant uncertainties, we consider the case where there exists a change in one of the system poles at 155 s (i.e., the pole = 1 changes to = 3); moreover the gain of the plant is doubled suddenly at 225 s.
The output by the proposed APID using RLS controller is shown in Figure 2 and it is compared with the controller presented in [11] and conventional PID. In the proposed controller the PID gains are tuned adaptively despite the variation of gain and poles of plant, and good tracking performance is maintained. It is clear from the figure that the proposed APID using RLS controller has superior performance as it has smaller overshoot at the beginning of the simulation than the controller in [11] and the conventional PID could not handle either the gain change or the pole change.

Unstable SISO System
. Now, consider that the unstable system stated in [18] is a simple SISO model of inverted pendulum And reference model can be expressed as where natural frequency = 2 and damping ration = 1. The reference input signal is chosen to be a delayed square wave.
It is shown in Figure 3 that the proposed APID using RLS controller can stabilize the system and achieve good tracking performance despite the fact that the gain of the plant is doubled suddenly at 155 s and the system's unstable pole is changed at 255 s. On the contrary the conventional PID and the controller presented in [11] with the same initial parameters failed to stabilize the system.

Conclusions
In this paper, adaptive PID (APID) controller is proposed using RLS algorithm which updates the PID gains automatically online to force the actual system to behave like a desired reference model. Numerical examples have been shown to confirm the tracking capability of the proposed controller when it is applied to both stable and unstable systems. It also proves the efficiency of the controller during the changes of system parameters during operation of system. Moreover comparisons are made between the proposed APID and the adaptive controller presented in [11] and the conventional PID. This work can be further extended to drive the stability analysis for the proposed APID controller for SISO systems. Also, as a further research, the APID controller technique demonstrated in this paper can be modified to be applicable for MIMO systems and then its behavior can be investigated in the presence of some variations in system parameters.