**6.3.1 The PGM algorithm**

64 Introduction to PID Controllers – Theory, Tuning and Application to Frontier Areas

*dw at w at w at w at w*

max max max max max an( ) an( ) an( ) an( ) <sup>2</sup> *new old old old old w d at w at w at w at w ID S*

These two algorithms always converge to the correct values of *wmin* and *wmax*, if for given *d*, *τS*, *τD* and *τ<sup>I</sup>* there exists a solution of (8), with respect to *wC*, when the *atan* function takes values in the range *(-π/2,π/2)*. We are now able to present the main steps of proposed GM

*Step 1.* Given the system parameters *d*, *τS*, the controller derivative term *τD* and the desired

*Step 4.* Calculate the values of *wmin* and *wmax* using the wmin Algorithm and the wmax

*Step 8.* The controller gain is evaluated from either *KC=KC,max/Ginc,des* or *KC=KC,minGdec,des*. This

The above algorithm converges to the correct solution, if such a solution exists, i.e. if for

If the derivative term is a priori selected, then it is not possible, in general, to simultaneously satisfy the specifications on *GMdec*, *GMinc*, and *PM* exactly, with the remaining two free controller parameters. This is due to the fact that, it is not possible to assign three independent specifications with only two independent controller parameters, namely *KC* and *τI*. Indeed, with the controller parameters *KC* and *τI* obtained from the GM Algorithm, in order to satisfy *GMdec* and *GMinc*, then a specific value of the phase margin *PM(d,KC,τI,τD)* is obtained, and, hence, in this case the phase margin cannot be selected independently. Keeping these in mind, we propose here a tuning method, in order to achieve simultaneous, although not exact, satisfaction of all three specifications *PM*, *GMdec* and *GMinc*. This method is based on the tuning methods presented in the previous two subsections. The basic steps, for the selection of the parameters of a PID-like controller that satisfy all three specifications,

gain matrix product *GMprod,des*, solve *max(PM(d,τI,τD,τS))=0* to obtain *τI,min*.

*0* or *wmax*

**6.3 The Phase and Gain Margin (PGM) tuning method** 

*Step 3.* Take the new value of *τΙ* as the average of *τI,1* and *τI,2*, i.e. *τΙ=( τI,1+ τI,2)/2*.

given *d*, *τS*, *τD* there exists a value of *τI* for which *GMprod(d,τS,τD,τI)=GMprod,des*.

Algorithm, respectively, for the obtained *τI*, and obtain *KC,min* and *KC,max* from (9).

(30)

*0*, then *τI,1=τI* or else *τI,2=τI*.

*<sup>r</sup> I DS e*

**6.2.2 The wmax algorithm** 

tuning method.

**6.2.3 The GM algorithm** 

*Step 3.* Take the new value of *wmin* as min min <sup>1</sup> *new old ww e <sup>r</sup> .*

*Step 1.* Start with a very large initial estimate of *wmax*, say max

*Step 4.* Repeat Steps 2 and 3 until a convergence.

*Step 2.* Using (8), calculate the new value of *wmax* as

*Step 3.* Repeat Steps 2 and 3 until convergence.

1

*Step 2*. Set *τI,1= τI,min* and *τI,2= 103τI,min*.

*Step 6.* If *GMprod<GMprod,des* or *wmin*

completes the algorithm.

are the following:

*Step 5.* Calculate the value of *GMprod* from (11).

*Step 7.* Repeat Steps 3 to 6 until convergence.

/ 2 min min min min min an( ) an( ) an( ) an( ) *init init init init init*

*init w* =104.

 

  (30)

*Step 1.* For the selected value of *τD*, check if there exists a value of *KC* that is able satisfy all three specifications, when *τI→ ∞*.

*Step 2.* Calculate the two controllers obtained by the PM and the GM methods. If the controller with the largest value of *τI* satisfies all three specifications, then this is the controller sought. In the opposite case continue with *Step 3*.

*Step 3.* Assume that *KC,PM* and *τI,PM* are the controller parameters obtained form the application of the PM tuning method and *KC,GM* and *τI,GM* are the controller parameters obtained from the GM tuning method. Then, if none of these two controllers satisfy all specifications, check which controller gives the largest gain *KC*, and distinguish the following two cases:


Although there are several ways to select the controller parameters in order to satisfy all three specifications (although not exactly), the method presented here is preferred, because it requires the smallest computational effort, since for a given *τI*, the phase margin can be calculated exactly without the use of iterative algorithms (using (12) and *PM=φL(wG)+π*). It is noted here that, in all PID tuning methods presented above, if the response obtained is too oscillatory (due to the small value of *τI*), then, by increasing the value of *τI*, the damping of the closed-loop system increases. From the analysis presented in Section 3, it becomes clear that, when *τI* is increased, the resulting closed-loop system is more robust, and hence all the stability robustness specifications are still satisfied (although not exactly).
