Research on Improved Auto-Tuning of a PID Controller Based on Phase Angle Margin

In order to realize fast and efficient tuning of the proportional-integral-derivative (PID) controller parameters in thermal power plants, this paper thoroughly analyzes the problems existing in the relay characteristic method based on the phase angle margin auto-tuning method (PM method), and proposes an improved PM auto-tuning method for the most common first order plus dead time (FOPDT) model in practical engineering applications. The improved algorithm proposes the design of the target phase angle margin and the method of plant identification. Then, the optimization algorithm is used to calculate the correction coefficient of the setting formula to obtain the PID controller parameters that minimize the integrated time absolute error (ITAE) index of the control system. Finally, through the auto-tuning experiment on the generalized control model of the main steam temperature system in thermal power plants, it is verified that the improved algorithm is superior to the traditional PM method and Ziegler–Nichols method (Z-N method), and can obtain a fast and stable control performance.


Introduction
The proportional-integral-derivative (PID) controller is widely used in industry with the characteristics of a simple structure and strong robustness [1].In thermodynamic systems, the characteristic parameters of each thermal plant often change in different operation conditions, so the fixed controller parameters cannot always meet the control requirements [2].The fast self-tuning PID algorithm can adjust parameters of controllers online according to the characteristics of the controlled plant, maintaining the stability, rapidity and robustness of the control system.In thermal power plants, process plants usually exhibit first order plus dead time (FOPDT) characteristics, while larger delay times increase the difficulty of self-tuning control.
Ziegler and Nichols first proposed the critical proportional band method [3] for the industrial PID controller tuning, which was recognized and applied by the majority of engineers.The robustness and stability of the controllers after tuning meet certain engineering requirements.However, the method requires engineers to set the parameters online according to the experimental results.In this case, the controlled plant needs to be excited to generate a critical oscillation, which seriously affects the safety and stability of the system.In response to this shortcoming, Karl Aström and Hägglund et al. proposed the relay characteristic method [4] in 1984, using a relay to limit the amplitude of the modulated oscillation, and realizing the online self-tuning of PID parameters, thus reducing the Energies 2019, 12, 1704 2 of 16 workload of engineers.It is necessary to analyze the relay characteristics by using the description function method in nonlinear analysis, but there is a certain error in determining the critical point information.Moreover, the control effect has deviation by using information of only one critical point to calculate the controller parameters.
There are three main kinds of tuning methods for relay characteristics, namely the Ziegler-Nichols (Z-N) formula tuning, amplitude margin tuning and phase angle margin tuning [4,5].Several studies have implemented Z-N formula tuning for actual plants.For example, in [6,7] the authors applied the tuning algorithm based on the ideal relay and Z-N formula to the control of the Buck-Boost circuit and the resistance box temperature, respectively, and put the basic relay characteristic method into practice.However, they did not consider the impact of noise on the actual environment.In [8], the hysteresis relay was used to remove the influence of a certain amplitude noise in the system.The software platform was developed to operate and supervise the parameter tuning process, and was then successfully applied into the network control system, however, there was no comparison of the algorithm effectiveness.Gu Dake et al. [9] proposed a relay feedback self-tuning method based on model parameters.The simulation experiment verified the proposed method and proved that the relay feedback method based on model parameters has a better control effect than the Z-N method in cascade control.In terms of the amplitude margin and phase angle margin settings, Chen Fuxiang et al. [10] proposed a PID parameter tuning method based on phase margin (PM).The researchers combined the system oscillation information, which was obtained under the hysteresis relay control loop, and the target phase angle margin to design the controller parameters.Chai Tianyou et al. [11] proposed a self-tuning method based on amplitude margin and phase margin (SPAM), combining oscillation information with amplitude margin and phase margin to obtain PID controller parameters.In [12], a pure delay link and a filter were added to the loop of the target phase angle margin tuning, and the delay time was changed repeatedly to obtain multiple critical point information, thereby improving the accuracy of the PM method.However, multiple operations of the tuning loop would reduce the setting efficiency and even affect the working state of the controlled plant, which was not conducive to engineering applications.
On the basis of the PID self-tuning principle, the researchers also combined the relay characteristic method with intelligent algorithms such as the neural network [13], fuzzy control [14] and Gauss algorithm [15], and proposed various modified schemes to improve the control effect of the controller.However, they increased the complexity of the algorithm and reduced the setting speed, which was inconsistent with the original intention of the simple PID controller.Another study [15] combined the Gauss algorithm with self-tuning to improve the control effect during the actual operation of the electric motor, but the implementation of the Gauss algorithm in the field would increase the economic cost and technical cost.In the thermal field, PID self-tuning is only a coarse adjustment method; the tuning process only needs to meet the operational safety and stability, and the control effect of the set controller is not strictly required.Therefore, the simple and direct PID self-tuning method based on relay characteristics can meet engineering requirements.
In the basic relay characteristic tuning methods, when compared with the Z-N formula setting, the PM method has a higher stability and also overshoot and oscillation times of the control curve are lower.Compared with the SPAM method, the PM method does not need to set a target amplitude margin and has no requirement for the amplitude margin of the controlled plant.However, the PM method cannot fix the thermal plant that does not meet the conditions of the relay characteristic method, such as the first-order inertia link.In addition, for the controlled plant with large delay characteristics, the control effect obtained by the PM method self-tuning is not satisfactory.Therefore, based on the traditional PM self-tuning method, this paper proposes an improved algorithm.It optimizes the selection range of the target phase angle margin by frequency characteristic analysis, then obtains a solution to estimate the target phase angle margin.The parameters of the oscillation curve output of the relay loop are used for model identification to obtain the transfer function of the control object.Then, the optimum algorithm is used to work out the correction coefficient of the PM method auto-tuning formula, and satisfactory controller parameters are obtained.
Hereinafter, Section 2 briefly introduces the basic principles of the traditional PM method and its shortcomings in the FOPDT plant.Section 3 analyzes the function of the target phase angle margin in the tuning process, and designs the correction factor from the tuning formula by the optimum algorithm.Section 4 simulates the superiority of the improved algorithm.Finally, the last section summarizes the characteristics of the improved PM self-tuning algorithm.The improved algorithm of the PID auto-tuning controller based on phase angle margin is shown in Figure 1.
Energies 2018, 11, x FOR PEER REVIEW 3 of 17 curve output of the relay loop are used for model identification to obtain the transfer function of the control object.Then, the optimum algorithm is used to work out the correction coefficient of the PM method auto-tuning formula, and satisfactory controller parameters are obtained.
Hereinafter, Section 2 briefly introduces the basic principles of the traditional PM method and its shortcomings in the FOPDT plant.Section 3 analyzes the function of the target phase angle margin in the tuning process, and designs the correction factor from the tuning formula by the optimum algorithm.Section 4 simulates the superiority of the improved algorithm.Finally, the last section summarizes the characteristics of the improved PM self-tuning algorithm.The improved algorithm of the PID auto-tuning controller based on phase angle margin is shown in Figure 1.

Figure 1.
The diagrammatic sketch of the improved phase margin (PM) method.

Basic Principles and Disadvantages of the Traditional PM Method
Figure 2 shows the auto-tuning principle of PID parameters based on the PM method.The process of calculating the controller auto-tuning parameters by the PM method is as follows: When the switch is thrown at terminal a, the hysteresis relay and the controlled plant form a unit negative feedback control loop.Select a set of relay thresholds and dead zones that can allow the system to output an oscillation curve under the action of the relay, and use the amplitude and period of the oscillation curve to estimate the coordinates of the critical point in the complex plane.There is a set of PID controller parameters that cause the critical point to move to the unit circle under the PID control and to meet the target phase angle margin.This set of controller parameters can be determined by the critical point coordinates and the target phase angle margin.In Figure 2, r is the input, e is the deviation of the system and y is the output of the controller.The description function of the hysteresis relay is:

Basic Principles and Disadvantages of the Traditional PM Method
Figure 2 shows the auto-tuning principle of PID parameters based on the PM method.The process of calculating the controller auto-tuning parameters by the PM method is as follows: When the switch is thrown at terminal a, the hysteresis relay and the controlled plant form a unit negative feedback control loop.Select a set of relay thresholds and dead zones that can allow the system to output an oscillation curve under the action of the relay, and use the amplitude and period of the oscillation curve to estimate the coordinates of the critical point in the complex plane.There is a set of PID controller parameters that cause the critical point to move to the unit circle under the PID control and to meet the target phase angle margin.This set of controller parameters can be determined by the critical point coordinates and the target phase angle margin.
Energies 2018, 11, x FOR PEER REVIEW 3 of 17 curve output of the relay loop are used for model identification to obtain the transfer function of the control object.Then, the optimum algorithm is used to work out the correction coefficient of the PM method auto-tuning formula, and satisfactory controller parameters are obtained.
Hereinafter, Section 2 briefly introduces the basic principles of the traditional PM method and its shortcomings in the FOPDT plant.Section 3 analyzes the function of the target phase angle margin in the tuning process, and designs the correction factor from the tuning formula by the optimum algorithm.Section 4 simulates the superiority of the improved algorithm.Finally, the last section summarizes the characteristics of the improved PM self-tuning algorithm.The improved algorithm of the PID auto-tuning controller based on phase angle margin is shown in Figure 1.

Basic Principles and Disadvantages of the Traditional PM Method
Figure 2 shows the auto-tuning principle of PID parameters based on the PM method.The process of calculating the controller auto-tuning parameters by the PM method is as follows: When the switch is thrown at terminal a, the hysteresis relay and the controlled plant form a unit negative feedback control loop.Select a set of relay thresholds and dead zones that can allow the system to output an oscillation curve under the action of the relay, and use the amplitude and period of the oscillation curve to estimate the coordinates of the critical point in the complex plane.There is a set of PID controller parameters that cause the critical point to move to the unit circle under the PID control and to meet the target phase angle margin.This set of controller parameters can be determined by the critical point coordinates and the target phase angle margin.In Figure 2, r is the input, e is the deviation of the system and y is the output of the controller.The description function of the hysteresis relay is:  In Figure 2, r is the input, e is the deviation of the system and y is the output of the controller.The description function of the hysteresis relay is: where d is the output threshold value of the relay, d > 0. ε is the dead zone of relay, ε > 0. N(A) is the complex ratio of the first harmonic component and the input signal in the steady-state output of the relay under the action of sinusoidal signals.A is the amplitude of sine signal, A > ε.
Set the transfer function of the controlled plant as G(jω).When the switch is at terminal a, the closed-loop characteristic equation of the system is shown in Equation ( 2).The necessary condition for the limit oscillation of the system is that the equation below has a positive solution.
Figure 3 shows the Nyquist curve of the plant G(jω) on the complex plane and the negative reciprocal description function −1/N(A) curve of the hysteresis relay.The angular frequency where their intersection point B is located is the solution of Equation ( 2).Point B is the self-excited oscillation point of the closed-loop system, also known as the critical point.The negative reciprocal description function of the relay comes as Equation ( 3), then the coordinates of point B (−x, −jy) can be expressed by Equation (4).
Energies 2018, 11, x FOR PEER REVIEW 4 of 17 where d is the output threshold value of the relay, d > 0. ε is the dead zone of relay, ε > 0. N(A) is the complex ratio of the first harmonic component and the input signal in the steady-state output of the relay under the action of sinusoidal signals.A is the amplitude of sine signal, A > ε.
Set the transfer function of the controlled plant as G(jω).When the switch is at terminal a, the closed-loop characteristic equation of the system is shown in Equation ( 2).The necessary condition for the limit oscillation of the system is that the equation below has a positive solution.
Figure 3 shows the Nyquist curve of the plant G(jω) on the complex plane and the negative reciprocal description function −1/N(A) curve of the hysteresis relay.The angular frequency where their intersection point B is located is the solution of Equation ( 2).Point B is the self-excited oscillation point of the closed-loop system, also known as the critical point.The negative reciprocal description function of the relay comes as Equation ( 3), then the coordinates of point B (−x, −jy) can be expressed by Equation ( 4).

, 44
x A y dd The form of the PID controller is shown in Equation (5).When the switch is thrown at terminal b (see Figure 2), the forward channel transfer function of the system is shown in Equation (6).The controller makes the Nyquist curve of the controlled plant move along these directions: (j )  G  , (j ) / Gj  and jG  , through proportional, derivative and integral actions, respectively.At a certain set of PID parameters, the critical point B can be moved to point C which meets the target phase angle margin requirement.The form of the PID controller is shown in Equation (5).When the switch is thrown at terminal b (see Figure 2), the forward channel transfer function of the system is shown in Equation ( 6).
The controller makes the Nyquist curve of the controlled plant move along these directions: → G( jω), → G( jω)/ jω and → jωG( jω), through proportional, derivative and integral actions, respectively.At a certain set of PID parameters, the critical point B can be moved to point C which meets the target phase angle margin requirement.
Assuming that the target phase angle margin is ϕ m , the coordinate of point C is (− cos ϕ m , −j sin ϕ m ), so: Energies 2019, 12, 1704 5 of 16 According to the coordinates of the B and C points in the complex plane and the vector relationship of the controller, the traditional PM method proposes the controller parameter tuning formula as follows: where d is the output threshold of the relay, d > 0. ε is the dead zone of the relay, ε > 0. A is the amplitude of sine curve when the controlled plant oscillates, A > ε.T is an intermediate parameter.α is the empirical coefficient, which is between 2 and 4. β is the correction coefficient, and the traditional PM method takes the correction coefficient as 0.5.In this paper, the PM method is applied to the auto-tuning of controlled plants in thermal power plants.It is found that because the controlled plants of thermal power plants generally have first-order inertia plus pure delay characteristics, the traditional PM method cannot guarantee good control effects.There are two main problems as follows. 1.
The characteristics of the limit cycle object have not been studied in depth.To determine whether an object has a limit oscillation, the transfer function of the object is needed to be known.The oscillation condition is that the Nyquist curve of the plant intersects the negative inverse description function curve of the hysteresis relay in the third quadrant on the complex plane, and the limit cycle at the intersection is stable.However, during the actual engineering application process, the characteristics of the controlled plants are not fixed, the specific parameters are unknown, and the accurate Nyquist curve cannot be obtained.

2.
The PM method cannot obtain a stable PID control system when the plant delay is large.
The amplitude margin of a system is related to the open-loop amplitude-frequency characteristic at the phase-crossing frequency.For a system with a large delay plant, the open-loop amplitude-frequency characteristic is the Nyquist curve of the large delay plant without a controller, with this curve having poor attenuation.The method by only moving the critical point on the curve cannot change the amplitude-frequency characteristic of the frequency band near the phase angle crossing frequency.Reflected on the complex plane, the PM method cannot guarantee the system amplitude margin with the PID controller to meet the stability requirements.
For the large delay plant, the PID control system obtained by the simple PM method will have a step response with oscillation and even divergence, and the control effect is not good.

Basic Principle of the Improved PM Method
In order to solve these two problems, an improved PM method is proposed in this paper.For plants with first-order inertia and pure delay, the main contents include selecting a target phase angle margin according to the estimated characteristics of the controlled plant to obtain an oscillation curve under the control of a relay loop.The mathematical model of the controlled plant is identified through the oscillation curve of the relay control loop.Then, an algorithm is used to optimize the coefficients in the auto-tuning formula to tune the controller parameters with the smallest integrated time absolute error (ITAE) index.

Selection of Target Phase Angle Margin
In Figure 3, the coordinate of point C is (− cos ϕ m , −j sin ϕ m ), indicating that the distance is sin(ϕ m ) from the origin to the intersection point of the negative reciprocal description function curve −1/N(A) with the negative imaginary axis.The value of sin(ϕ m ) is related to the Nyquist curve of the controlled plant.The frequency characteristic curve of the FOPDT plant is in the shape of a spiral attenuation toward the origin, as shown in Figure 4.The coordinate of the first intersection Q between the curve and the negative imaginary axis is (0, −Ksin(τω q )), where ω q is the angular frequency at point Q.Therefore, the target phase angel margin should satisfy.sin(ϕ m ) < K sin(τω q ) Set the controlled plant as G(s) = K Ts+1 e −τs , its frequency characteristic is G( jω) = K jTω+1 e −jτω , in which the real part is: The frequency characteristic curve needs to be satisfied that the real part of G(jω) equals to 0, i.e., Re[G( jω)] = 0, at the intersection point with the imaginary axis, so is simplified by Equation (10) to: Equation ( 11) is a transcendental equation with no analytic solution and infinite positive real number solutions.As the frequency ω changes from zero to positive infinity, the frequency characteristic curve approaches the origin in a spiral shape and has infinite intersections with the negative imaginary axis.Each intersection point corresponds with a solution, wherein the first intersection point Q far from the origin point corresponds with the smallest solution ω q .Draw curves f (ω) = tan(τω) and g(ω) = 1/Tω in a plane rectangular coordinate system, as shown in Figure 5.The tangent curve is a periodic curve that is symmetric about the axis of symmetry ω = kπ + π/2(k ∈ Z), so: Suppose τ/T = 1/M, M > 0, then there is T = τM, and Equation ( 11) is converted to: Equivalent to: Let the solution of Equation ( 11) be ω 0 ∈ Ω, then the solution ω 1 of Equation ( 13) will satisfy: So: That is to say, in Equation ( 11), when τ/T is known, the product of the solution of the equation and the inertia time T is constant, in other words: where the constant c is uniquely determined by Equation (14).
Energies 2019, 12, 1704 7 of 16 and the inertia time T is constant, in other words: where the constant c is uniquely determined by Equation (14).The frequency ω q of point Q satisfies Equation (11), so the absolute value of the imaginary axis coordinate of point Q is also constant, that is: Im[G(j )] sin( ) 1  and the inertia time T is constant, in other words: where the constant c is uniquely determined by Equation (14).The frequency ωq of point Q satisfies Equation (11), so the absolute value of the imaginary axis coordinate of point Q is also constant, that is:  The frequency ω q of point Q satisfies Equation (11), so the absolute value of the imaginary axis coordinate of point Q is also constant, that is: To sum up, when the ratio of the delay time and inertia time of the controlled plant G(s) is determined, the upper limit of the target phase angle margin of the system is: In this paper, 18 points are taken in the range of τ/T ∈ (0, 1.5), and the tangent function and inverse proportional function curves shown in Figure 5 are drawn.The angular frequency at point Q is obtained, and a list of coordinates of the imaginary axis of point Q on the complex plane is obtained (see Table 1).The phase angle margin represents the stability performance of the closed-loop system.The larger the value of ϕ m , the more stable the step response curve of the system under PID control, the less oscillation, but the slower the adjustment speed.The smaller the value of ϕ m , the more the step response curve oscillates and the faster the adjustment.When ϕ m is between 10% and 50% of the maximum value, both the rapidity and stability of the system can be considered.At the same time, the larger the inertia time constant of the controlled plant itself or the larger the delay time relative to the inertia time, the smaller the value ϕ m can take in the above range.When the amplitude and frequency of the critical oscillation and the target phase angle margin of the controlled plant are determined, the traditional PM method can tune a group of PID controller parameters according to Equation ( 8).However, it has been proven by experiments that when the correction factor β in Equation ( 8) is equal to 0.5, it may not meet the control requirements.Therefore, a new auto-tuning strategy is proposed here to improve the control effect of the controller.According to Equation ( 5), if the K p value decreases, the proportional action, integral action and derivative action of the controller are weakened, thus reducing the oscillation times and improving the stability of the system.Therefore, the selection of the correction coefficient can directly affect the control effect obtained by the PM method.
In this paper, 0.05, 0.5 and 2.75 for β are respectively applied to the tuning formula of the controlled plant G 1 (s) = 5 50s+1 e −s , and determined the PID controller parameters and the step response curve, as shown in Figure 6 by Equation (8).The overshoot of the control curve when β = 0.5 is about 21%, and the adjustment time is longer than that of the curve with β = 2.75.When β = 2.75, the control effect of the controller is optimal, the curve overshoot is the smallest and the adjustment time is the shortest.Take 0.5, 2.75 and 8.45 for β and apply them to the tuning formula of controlled plant G 2 (s) = 1 100s+1 e −s , respectively, and find the PID controller parameters and the step response curve according to Equation (8) also.The result is shown in Figure 7.With β = 0.5, the overshoot of the control curve is about 25%, and the adjustment time is the longest.With β = 8.45, the controller has the best control effect-the overshoot of the curve is the smallest and the adjustment time is the shortest.It can be seen that a single correction coefficient for different control systems cannot guarantee that the control effect of the auto-tuning controller is satisfactory.Those PID controllers below are shown in Table 2.
Energies 2018, 11, x FOR PEER REVIEW 9 of 17 guarantee that the control effect of the auto-tuning controller is satisfactory.Those PID controllers below are shown in Table 2.

Optimization of the Correction Coefficient
According to the previous analysis, the PM method can be applied to first-order inertial plants with different characteristics by modifying the correction coefficient in the setting formula.Since the thermal engineering plant characteristics of the actual power plant are not fixed and often change, this paper proposes the idea of changing the correction coefficient according to the characteristics of the controlled plant to ensure the control effect meets the requirements of stability and rapidity.The specific idea is shown in Figure 8, and the optimization method is shown below.
In Figure 8, N max1 equals 100, representing the maximum number of iterations of the genetic algorithm, and f min equals 10 -4 , showing the maximum acceptable deviation to meet model accuracy requirements.N max2 means the maximum number of iterations of the optimization algorithm and equals 100 as well.The termination conditions of genetic algorithm running are that the fitness function has been less than f min , or the number of iterations has been larger than N max1 .During the running of the optimization algorithm, the termination condition is that the number of iterations has been larger than N max2 , and the minimum ITAE index can be located during the iterative process.
After the target phase angle margin is selected, the ratio of the dead zone and the threshold value of the relay can be designed according to Equation ( 7), wherein the dead zone is larger than the amplitude of noise, so that the system output of the relay control loop presents a critical oscillation curve.Then, the fast Fourier algorithm is used to analyze the frequency spectrum of the system output data to obtain the amplitude A 0 and angular frequency ω c0 of the oscillation curve.The method of identifying the controlled plant using the amplitude A 0 and the angular frequency ω c0 is described below.
Assuming that the controlled plant is G(s) = K Ts+1 e −τs , connect the actual controlled plant to the relay controlled loop, and the output of the system generates critical oscillation.The oscillation waveform and the output waveform of the relay are shown in Figure 9.
According to the previous analysis, the PM method can be applied to first-order inertial plants with different characteristics by modifying the correction coefficient in the setting formula.Since the thermal engineering plant characteristics of the actual power plant are not fixed and often change, this paper proposes the idea of changing the correction coefficient according to the characteristics of the controlled plant to ensure the control effect meets the requirements of stability and rapidity.The specific idea is shown in Figure 8, and the optimization method is shown below.In Figure 8, Nmax1 equals 100, representing the maximum number of iterations of the genetic algorithm, and fmin equals 10 -4 , showing the maximum acceptable deviation to meet model accuracy requirements.Nmax2 means the maximum number of iterations of the optimization algorithm and equals 100 as well.The termination conditions of genetic algorithm running are that the fitness function has been less than fmin, or the number of iterations has been larger than Nmax1.During the running of the optimization algorithm, the termination condition is that the number of iterations has been larger than Nmax2, and the minimum ITAE index can be located during the iterative process.
After the target phase angle margin is selected, the ratio of the dead zone and the threshold value of the relay can be designed according to Equation ( 7), wherein the dead zone is larger than the amplitude of noise, so that the system output of the relay control loop presents a critical oscillation curve.Then, the fast Fourier algorithm is used to analyze the frequency spectrum of the system output data to obtain the amplitude A0 and angular frequency ωc0 of the oscillation curve.The method of identifying the controlled plant using the amplitude A0 and the angular frequency ωc0 is described below.
Assuming that the controlled plant is () , connect the actual controlled plant to the relay controlled loop, and the output of the system generates critical oscillation.The oscillation waveform and the output waveform of the relay are shown in Figure 9. First, identify the gain K of the plant.The average output value y of the oscillation curve is obtained by multiplying the output of the relay and the gain of the plant [16], that is: So the gain of the controlled plant is: The modulus of the frequency characteristic of the controlled plant is . The angular frequency of the critical point B is ωc.According to Equation ( 4): First, identify the gain K of the plant.The average output value y of the oscillation curve is obtained by multiplying the output of the relay and the gain of the plant [16], that is: So the gain of the controlled plant is: Energies 2019, 12, 1704 11 of 16 The modulus of the frequency characteristic of the controlled plant is . The angular frequency of the critical point B is ω c .According to Equation (4): So the inertia time constant of the plant is: After calculating the gain K and inertia time constant T of the control object from Equation (21) and Equation ( 23), the delay time τ is optimized by a genetic algorithm.The specific process is as follows: It is known that each set of parameters K, T and τ can obtain a unique amplitude A and angular frequency ω c of the critical oscillation curve through relay loop control and the selection of an appropriate target phase angle margin.Therefore, when K and T are determined, a unique τ can be found in a given range, so that the obtained A and ω c are equal to the known amplitude A 0 and angular frequency ω c0 .A genetic algorithm is used here to find the variable τ that minimizes the objective function.The objective function is as follows: Take the transfer function G 3 (s) = 5 50s+1 e −50s as an example.Connect G 3 (s) with the relay control loop to obtain the oscillation curve (see Figure 10).As can be seen from Figure 10, y = 1, d 1 = −0.8,d = 1, t 1 = 19 and T c = 37, so the gain is K = 4.41.In Figure 10, the amplitude of the oscillation curve is A = 0.5125, and the angular frequency is ω c = 0.1745, so the inertia time constant is T = 62.5221.Finally, the delay time τ = 56.8957 is obtained by a genetic algorithm.The identification results are shown in Table 3. Obviously, the error of the identification results is acceptable in engineering application.as an example.Connect G3(s) with the relay control loop to obtain the oscillation curve (see Figure 10).As can be seen from Figure 10, y = 1, d1 = −0.8,d = 1, t1 = 19 and Tc = 37, so the gain is K = 4.41.In Figure 10, the amplitude of the oscillation curve is A = 0.5125, and the angular frequency is ωc = 0.1745, so the inertia time constant is T = 62.5221.Finally, the delay time τ = 56.8957 is obtained by a genetic algorithm.The identification results are shown in Table 3. Obviously, the error of the identification results is acceptable in engineering application.After obtaining the mathematical model of the controlled plant, the correction coefficient is adjusted online by an optimization algorithm.The specific process is as follows: According to the  After obtaining the mathematical model of the controlled plant, the correction coefficient is adjusted online by an optimization algorithm.The specific process is as follows: According to the amplitude, angular frequency and target phase margin of the oscillation curve output of the relay circuit, the PID controller parameters are calculated online by Equation ( 8), in which the correction coefficient β traverses a certain range, generally taking (0,10).The PID controller and the identified plant transfer function constitute a closed loop system.Give the set point of the closed-loop system a step signal, then the ITAE index can be calculated from the output curve.By optimization algorithm the minimum ITAE index can be located and also the optimal correction coefficient β, whose corresponding controller is the tuning result.Finally, the controller is used for the control of actual plants.The ITAE index is shown in Equation ( 25):

Simulation Example
The main steam temperature is one of the most important controlled parameters in large boiler units of thermal power plants.Only when the main steam temperature is controlled within a reasonable and stable range can the efficient operation of the units be ensured.The commonly used main steam temperature control strategy is the cascade PID control.When adjusting the controller parameters of the outer loop, the inner loop system and outer loop controlled plant need to be fitted to a generalized plant first.According to [17], the generalized controlled plant function of the main steam temperature to the disturbance of the feed water of a 600 MW supercritical once-through boiler at 100% load is shown in Equation ( 25).An improved PM auto-tuning algorithm is applied to the model to obtain PID controller parameters.
Here, the characteristics of the controlled plant have been determined, so the identification process is omitted.The ratio of the delay time of the plant to the inertia time constant is 0.6429.In the case of τ/T = 0.6 in Table 1, the sine of the target phase angle margin satisfies sin(ϕ m ) < 0.6481, so sin(ϕ m ) = 0.4 is available.According to Equation (7), the relay parameter should be designed as ε/d = 0.5357, where the relay threshold value is taken as d = 1.Connect the plant and the relay into a closed loop, and the oscillation curve can be obtained, as shown in Figure 11.reasonable and stable range can the efficient operation of the units be ensured.The commonly used main steam temperature control strategy is the cascade PID control.When adjusting the controller parameters of the outer loop, the inner loop system and outer loop controlled plant need to be fitted to a generalized plant first.According to [17], the generalized controlled plant function of the main steam temperature to the disturbance of the feed water of a 600 MW supercritical once-through boiler at 100% load is shown in Equation ( 25).An improved PM auto-tuning algorithm is applied to the model to obtain PID controller parameters.
Here, the characteristics of the controlled plant have been determined, so the identification process is omitted.The ratio of the delay time of the plant to the inertia time constant is 0.6429.In the case of τ/T = 0.6 in Table 1, the sine of the target phase angle margin satisfies sin( ) 0.6481 m   , so sin( ) 0.4 m  = is available.According to Equation (7), the relay parameter should be designed as ε/d = 0.5357, where the relay threshold value is taken as d = 1.Connect the plant and the relay into a closed loop, and the oscillation curve can be obtained, as shown in Figure 11.

Figure 11. Limit oscillation curve of G4(s).
The controller parameters with the smallest ITAE index are calculated by an optimization algorithm for the correction coefficient within the range of (0,10), and algorithm results are shown in  The controller parameters with the smallest ITAE index are calculated by an optimization algorithm for the correction coefficient within the range of (0,10), and algorithm results are shown in Table 4  The controller obtained through auto-tuning by the traditional PM method comes as: In addition, the controller of the same plant is tuned by the Z-N method, and the obtained controller comes as: When the input of the set value of the plant is disturbed, the control effect of the controlled plant under the three PID controllers is shown in Figure 12, and the ITAE indexes of the three control performances is shown in Table 5.The ITAE index of the improved PM method is much smaller than that of the Z-N method and the traditional PM method, and the control curve does not fluctuate frequently.The overshoot is only about 1%, and the adjustment time is about 100 s, which are both less than those of the other two control curves.In summary, the PID tuning improvement algorithm based on the phase angle margin obtains the best controller effect.
In addition, the controller of the same plant is tuned by the Z-N method, and the obtained controller comes as: When the input of the set value of the plant is disturbed, the control effect of the controlled plant under the three PID controllers is shown in Figure 12, and the ITAE indexes of the three control performances is shown in Table 5.The ITAE index of the improved PM method is much smaller than that of the Z-N method and the traditional PM method, and the control curve does not fluctuate frequently.The overshoot is only about 1%, and the adjustment time is about 100 s, which are both less than those of the other two control curves.In summary, the PID tuning improvement algorithm based on the phase angle margin obtains the best controller effect.In order to more directly verify the results of the improved PM tuning algorithm applied in thermal power plants, this paper carried out a test on a 1000 MW ultra-supercritical unit.Under the steady-state condition of the 1000 MW unit, the PID controller of the secondary spray desuperheating  In order to more directly verify the results of the improved PM tuning algorithm applied in thermal power plants, this paper carried out a test on a 1000 MW ultra-supercritical unit.Under the steady-state condition of the 1000 MW unit, the PID controller of the secondary spray desuperheating system of the unit's main steam temperature control is tuned.From the operating experience of the power plant, it can be seen that the secondary water spray desuperheating system is a large inertial element with delay, and the system characteristics will change according to the operating conditions.Therefore, it is difficult to manually adjust PID parameters.
The experimental results with the main parameters during the tuning process are shown in Figure 13.The controlled system begins to enter the tuning mode at 100 s, and the controlled object forms a closed loop with the relay.The output curve of the relay is a square wave, and the system exhibits limit oscillation under the excitation of the square wave.The oscillation of the main steam temperature is shown by the blue dotted line, and the fluctuation of the main steam temperature is less than 2 • C. When it reaches 610 s, the tuning algorithm gives the PID control parameters, the controlled object switches from the relay loop to the PID control loop and the tuning mode ends.At 620 s, the system set point is reduced from 605 • C to 600 • C, and the main steam temperature gradually stabilizes to 600 • C under the PID control.Then, the set value is increased from 600 • C to 603 • C at 1170 s, and the main steam temperature is gradually increased to 603 • C. The experimental results show that the improved PM tuning algorithm can be applied to the control of thermal objects in thermal power plants.The tuning controller is calculated in Equation (30).The experimental results with the main parameters during the tuning process are shown in Figure 13.The controlled system begins to enter the tuning mode at 100 s, and the controlled object forms a closed loop with the relay.The output curve of the relay is a square wave, and the system exhibits limit oscillation under the excitation of the square wave.The oscillation of the main steam temperature is shown by the blue dotted line, and the fluctuation of the main steam temperature is less than 2 ℃.When it reaches 610 s, the tuning algorithm gives the PID control parameters, the controlled object switches from the relay loop to the PID control loop and the tuning mode ends.At 620 s, the system set point is reduced from 605 ℃ to 600 ℃, and the main steam temperature gradually stabilizes to 600 ℃ under the PID control.Then, the set value is increased from 600 ℃ to 603 ℃ at 1170 s, and the main steam temperature is gradually increased to 603 ℃.The experimental results show that the improved PM tuning algorithm can be applied to the control of thermal objects in thermal power plants.The tuning controller is calculated in Equation (30).

Conclusions
In this paper, the application of the PID controller auto-tuning parameter algorithm based on the phase angle margin is studied in the objected with first-order inertia and pure delay of a thermal power plant.The study found that the traditional PM method cannot always meet the control requirements for PID controller auto-tuning for different plants.In this paper, an improved tuning algorithm based on phase margin is proposed.By obtaining the maximum value of the target phase angle margin of critical oscillation by the frequency characteristics of the plant, it can ensure the critical oscillation of the controlled plant under the control of the relay, reduce the online auto-tuning time and ensure the safe operation of the controlled plant when oscillating.Furthermore, the amplitude and angular frequency of the limit oscillation waveform are obtained by combining the oscillation waveform.Based on this, the PID controller parameters are optimized online by

Conclusions
In this paper, the application of the PID controller auto-tuning parameter algorithm based on the phase angle margin is studied in the objected with first-order inertia and pure delay of a thermal power plant.The study found that the traditional PM method cannot always meet the control requirements PID controller auto-tuning for different plants.In this paper, an improved tuning algorithm based on phase margin is proposed.By obtaining the maximum value of the target phase angle margin of critical oscillation by the frequency characteristics of the plant, it can ensure the critical oscillation of the controlled plant under the control of the relay, reduce the online auto-tuning time and ensure the safe operation of the controlled plant when oscillating.Furthermore, the amplitude and angular frequency of the limit oscillation waveform are obtained by combining the oscillation waveform.Based on this, the PID controller parameters are optimized online by combining the plant model identification.

Figure 2 .
Figure 2. Principle diagram of proportional-integral-derivative (PID) parameter auto-tuning based on PM method.

Figure 1 .
Figure 1.The diagrammatic sketch of the improved phase margin (PM) method.

Figure 1 .
Figure 1.The diagrammatic sketch of the improved phase margin (PM) method.

Figure 2 .
Figure 2. Principle diagram of proportional-integral-derivative (PID) parameter auto-tuning based on PM method.

Figure 2 .
Figure 2. Principle diagram of proportional-integral-derivative (PID) parameter auto-tuning based on PM method.

Figure 4 .
Figure 4. Nyquist curve of first order plus dead time (FOPDT) plant.

Figure 5 .
Figure 5. Tangent function and inverse proportional function curve.

Figure 4 .
Figure 4. Nyquist curve of first order plus dead time (FOPDT) plant.

Figure 4 .
Figure 4. Nyquist curve of first order plus dead time (FOPDT) plant.

Figure 5 .
Figure 5. Tangent function and inverse proportional function curve.

Figure 5 .
Figure 5. Tangent function and inverse proportional function curve.

Figure 6 .
Figure 6.Comparison of control effect by different correction factors of G1(s).Figure 6.Comparison of control effect by different correction factors of G 1 (s).

Figure 6 .
Figure 6.Comparison of control effect by different correction factors of G1(s).Figure 6.Comparison of control effect by different correction factors of G 1 (s).

Figure 6 .
Figure 6.Comparison of control effect by different correction factors of G1(s).

Figure 7 .
Figure 7.Comparison of control effect by different correction factors of G2(s).

Figure 7 .
Figure 7.Comparison of control effect by different correction factors of G 2 (s).

Figure 8 .
Figure 8. Flow chart of algorithm for controller optimization.

Figure 8 .
Figure 8. Flow chart of algorithm for controller optimization.

Figure 9 .
Figure 9. Schematic diagram of oscillation curve and relay output waveform.

Figure 9 .
Figure 9. Schematic diagram of oscillation curve and relay output waveform.

Figure 12 .
Figure 12.Control curves of different PID controllers.

Figure 12 .
Figure 12.Control curves of different PID controllers.

Figure 13 .
Figure 13.Curves of setting process about main parameters.

Figure 13 .
Figure 13.Curves of setting process about main parameters.

Table 1 .
The imaginary axis coordinate of point Q under each ratio τ/T.

Table 2 .
PID controllers by different correction factors of G1(s) and G2(s).

Table 2 .
PID controllers by different correction factors of G 1 (s) and G 2 (s).

Table 3 .
Comparison of identification results with actual values of the plant G3(s).

Table 3 .
Comparison of identification results with actual values of the plant G 3 (s).

Table 4 .
The controller is:

Table 4 .
Results of relevant variables.

Table 5 .
Comparison of integrated time absolute error (ITAE) indexes by different PID controllers.

Table 5 .
Comparison of integrated time absolute error (ITAE) indexes by different PID controllers.