# A stepwise method for tuning PI controllers using ITAE criteria

Applications based on control theory have gone through major developments in the past decades. However 95% of the industrial controllers are of PID type even though most loops are actually PI control **[3]** . The main reasons for the choice are the simplicity of the control law and the fewer tuning parameters. Many theories and tools are available for this purpose.

But still, finding the optimum parameters for the PI controller is a daunting task and in practice control engineers often use trial and error method for the tuning process [4]. System nonlinearities, design method based on specific problem in hand, continuous parameter variations make tuning a “Difficult task”.

This article provides a brief over view of the ITAE [Integral of the time weighted absolute error],and then describes a stepwise method which can be followed to simplify the process of PI tuning for field oriented motor control.

**Overview of PID control**

Most processes are non-linear in some aspects. The process gain can vary with load or with time. Feedback control loops are designed so that the controller variable (process output) is maintained at a set point even if disturbances occur or the dynamics of the process changes.

In general the process nonlinearities are compensated by PI controller functions. Finding optimum values for the PI controller functions is a daunting task. There has been vast amount of literature, tools on the subject of PI controller tuning.

However many control system engineers still use the trial and error method for tuning the system. This paper describes the systematic approach to be followed to get the optimum tuning values based on ITAE criterion.

**Minimum Optimization Criterion **

Many methods are presented in literature that minimizes a certain error criterion [8]. One of the methods called, Minimum ITAE approximate model for controller tuning rules is described here. Integral of the time weighted absolute error [ITAE] is defined as,

The time weighting **‘t’** is used, because the initial error for a step response is always large, and for most set point cases it is reasonable to weigh this error less. Based on the below FOLPD model it is possible to mathematically determine the controller settings:

Where K is the gain, DT is the dead time, **τ ** is the time constant.

A distinction is made between responding to a disturbance and responding to a set point. The controller settings that give a minimum ITAE is given in **Table 1 below** [1].

**Table 1. Constants A and B for P, PI, PID control [8][9]**Terminology. Before tuning it is good to understand the terminologies used in this article.

**Figure 1 below**shows the generic control loop.

**Click on image to enlarge.**

*Figure 1. PI control loop*__Process__: It is the physical process that we want to control. The manipulation of the physical properties affects the output of the process.

__Process variable (PV):__ It is the output of the process. PV has to be controlled so that it gets close enough to the set point.

__Controller variable (CV)__ : It is the output of the PI controller and this value is manipulated by the PI controller to obtain the desired set point.

__Load:__ Disturbances which can move the PV from its setpoint. Control system has the job of counteracting the load.

__Set point (SP):__ SP is the desired value for the control system.

__Error:__ It subtracts the PV from the SP inside the controller. The difference between the SP and the PV is called the control error E. This is the input to the PID Algorithm.

**Mapping ITAE into an FOC **

The generic control loop as depicted in Figure 1 is translated to FOC control loop as shown in **Figure 2 below** .

**Clickon image to enlarge.**

**Figure 2. Field Oriented control**

Process + sensor: It includes motor, inverter board and the FOC algorithms other than the PI controller.

Process variable: The speed at which the motor rotates is defined as the process variable

Set Point 1(SP1), Controller variable 3(CV3): SP1 is the desired value of Iq. From Speed PI controller perspective this value is called as controller variable 3.

Set Point 2(SP2): SP2 is the desired value of Id

Set Point 3(SP3) : SP3 is the desired speed at which the motor rotates

Controller variable 1(CV1): It is the output of Current q PI controller

Controller variable 2(CV2): It is the output of Current d PI controller

**A stepwise approach to ITAE PI tuning** * Open Loop Step #1 . * If the system has more than one PI loop, decide on the tuning sequence.

**1 –** Tune the fastest acting loop first (i.e. the fastest loops are the ones where the PV changes fastest in response to a SP change)

**2 –** With cascade loops: tune the inner loop first, then the outer loop.

In FOC, tune the Current PI controllers (Id, Iq) first and then the speed PI controller.

* Open Loop Step #2 * . Identify the type of PI algorithm used in the system. This document explains the tuning method for standard or Non Interacting PI algorithm.

Classical Notation:

Laplace Notation:

(*Note : For other types of PI algorithms and tuning methods refer to Reference[2]* )

** Open Loop Step #3. ** Determine the speed of the loop. For every 50 microseconds (Sample time) the controller updates the PI algorithm in the experimental FOC setup.

* Open Loop Step #4 * . This test gives the tuning constants Kp and KI. We will be manipulating the open loop set point and measure selected few open-loop characteristics of the loop. We will then use these characteristics to mathematically calculate the best tuning constants.

To complete this test we need to continue recording both the CV (controller variable) and the PV (process variable).

Procedure to get open loop response is briefly summarized as follows:

**1) ** Wait until the process reaches steady state (i.e. PV is relatively horizontal)

**2)** Step the SP as much as feasible in a positive direction.

**3)** Wait for the process to stabilize

**4) ** Step the process again, the same magnitude as step 2, but this time in a reverse direction.

**5)** Wait for the process to stabilize.

Figure 3 below shows the CV trace and also explains how the process should respond.

**Clickon image to enlarge.**

**Figure 3. Open Loop Test****How to get open loop step response in FOC**

The previous steps in the process I am describing are related to field oriented control as follows:

**1) ** Set point1(SP1) is made equal to the controller variable (CV1) (i.e.) SP1 = CV1

**2)** Id and Iq (Output of FwPark transform) is left open.

**3)** Setpoint1 is given a step value of 0.1 and the process variable (PV) [Speed] is monitored until a steady state is reached

**4)** Step the SP1 value to 0.4 and wait for the process to stabilize

**5) ** Step the process again, the same magnitude as step 2 (0.1), but this time in a reverse direction.

**6)** Repeat the above steps for Setpoint2 also.

**7) ** Open loop response to step input 0.4 (Step 4) is shown in** Figure 4 below.**

**Clickon image to enlarge.**

**Figure 4. Open loop step response***Open loop analysis of the obtained step response is summarized as follows:*

**Open Loop Step #5.****1) ** Measure Δ PV as per Figure 3. This is the amount that the PV changed when we stepped the CV for the second time.

**2) ** Measure ΔCV from the CV trace as per Figure 3. This is the size of the second step of the controller output.

**3) ** Calculate the process gain (PG). This is calculated as PG = ΔPV/ΔCV

**4)** Look at the CV trace and determine the “time of step”. We'll label this T0. This is the time value on the x axis where your step input to the controller begins as per **Figure 5 below.**

**Clickon image to enlarge.**

**Figure 5. Tracing the curve to a noisy response****5)**Determine the time at which the PV is at 25% of its max value. It is denoted as Td25.

**6) ** Determine the time at which the PV is at 75% of its max value. It is denoted as Td75.

**7) ** Calculate the process time constant, TC where TC = 0.9*(T75 – T25)

**8)** Calculate the dead time, DT where DT = (TC75 – T0) – (1.4 * TC) + Controller’s Update time

**9)** Real time signal might look like the blue color response as in **Figure 5 above** . Draw a curve of best fit as shown in red color.

10) Stop the analysis if negative dead time is observed. It may be due to the unusual step response obtained through experiments as seen in **Figure 6 below[9]. **

**Clickon image to enlarge.**

**Figure 6. Unusual Step Response****Analysis for unusual step response**

1) To find Process time constant (TC): Draw a line parallel to the initial gradient and the TC is where that crosses the steady state value of the response

**Clickon image to enlarge.**

**Figure 7. Analysis of unusual step response****Calculation of tuning constants**

The tuning constants are calculated differently depending on whether P, PI or PID is used in the control.

The values of the constants A and B are different (**Table 1 below** ) depending on whether P only, PI or PID control is used, and also whether it is desired to respond better to set point changes or load changes.

**Table 1. Constants A and B for P, PI, PID control [8][9]****Open loop analysis in an FOC**

**1)**Steps mentioned in Open Loop Step #5 are followed to get the open loop response

**2) ** Controller Sample time : 50 Micro seconds

**3)** Figure 7 is the zoomed in plot of open loop response [experimental setup]

**4)** Process gain = ΔPV /ΔCV = 2711/ (0.4 – 0.1) = 9036

**5)** Measure the time of 25% Max value [ Td25 = 0.25 * 169 = 42.25] = 42.25 * 50 microseconds = 2.11 ms

**6)** Measure the time of 75% Max value [ Td75 = 0.75 * 169 = 126.75] = 126.75 * 50 microseconds = 6.33 ms

**7)** Calculate the time constant, TC where TC = 0.9*(6.33 – 2.11) = 3.798

**8) ** Calculate the dead time, DT = (6.33 ms – 50 microseconds) – (1.4 * 3.798) + 50 microseconds = -5.31087

**9)** Dead time is a negative value. Stop the analysis and proceed as per earlier in analysis for unusual step response.

**10)** TC = 130 * 50 microseconds (*Shown in Figure 8 below * ) = 6.5 ms,

**11)** DT = 6.5 * 0.1 = 0.65 ms

**12) ** Now we are ready to calculate the tuning constants as per section 4.5.4

**13)** P = 0.000527 and I = 0.004315, after substituting the tuning constants, TC and DC values (Set Point change).

**Clickon image to enlarge.**

**Figure 8. Calculate TC as per time constraints calculation**The ITAE empirical method described here can be applied to any field oriented control application. Optimal controller gains are obtained through this method even for a high inductive BLDC motor.

**Christober Venoth Raj** works as a lead research engineer in automation and control solutions business unit at Honeywell, Bangalore . His current activity involves designing condition monitoring for machines and conveyor belts. Prior to joining Honeywell, worked at Infineon Technologies as an embedded software engineer.

**References ** **[1] ** F.Y.Thomasson, Tuning Guide for basic control loops, 1997 Process control, Electrical & Info. Conf. Proceedings. **[2] ** Bela G.Leptak, Process control and optimization, Volume 2, 4th edition. **[3] ** Karl J.Astrom and Tore Hagglund, PID Controllers, 2nd edition. **[4]** http://www.automationworld.com/operations-management/pid-tuning; accessed as on 21/12/2011 **[5] ** Cecil L.Smith, Practical Process Control: Tuning and Troubleshooting. **[6]** Dale E.Seborb, Thomas F.Edgar, Duncan A.Meelichamp; Process dynamics and control. **[7] ** Aidan O’Dwyer, PI and PID controller tuning rules for time delay processes: A summary

[**8]** P.W.Murril, Automatic control of processes, International Textbook Co., 1967.**[9]** Rovlra, A.A., Murril P.W and smith, C.L., Tuning controllers for setpoint changes; Instruments and control systems, pp 67-69, 1969