Tuning of PID Controllers – Approximate Methods

Apart from the object, a controller constitutes of the fundamental elements of control systems. However, such controllers, even in SISO (Single Input, Single Output) systems where a single output is controlled by a single input, may not be the most appropriate choice. Moreover, a PID controller may not be easily tuned to any setup. The paper outlines three elementary methods for tuning the controller. The results of the process conducted by means of Ziegler-Nichols, Cohen-Coon, and Lambda methods were compared in Matlab.


PID CONTROLLER
A PID controller is a mechanism applied in control systems.It is comprised of three terms: proportional, integral, and derivative.The mechanism is used in order to maintain output, i.e. a setpoint, at a predefined level.PID controllers are applied in both analogue and digital techniques.They are used in temperature control, engine's rotational speed control, as well as in PLC controllers.In analogue applications, the PID controller constitutes a hardware element.In case of digital applications, e.g. in PLC controllers, it is designed in a form of a collection of instructions in a particular tab in the controller's software.Individual controllers may be of universal or dedicated character.They meet universal installation standards (a control panel, DIN rail).They are equipped with inputs for determining setpoint or signals, and outputs for tuning control signals, or outputs determining the controller's state.In most cases, the configuration of an individual controller is conducted by selecting desired values on the control panel of the device, or by means of dedicated software provided by the producer.Increasingly, controllers are equipped with autotuning function.In case of controllers integrated with a controlling device, the configuration is much more complex.Obviously, simple solutions are available.However, frequently, this type of controllers has broad, complex collections of parameters, thus tuning to proper settings is timeconsuming and involves complex algorithms.

QUALITY OF CONTROL
A PID controller is a mechanism which must satisfy all requirements defined by the system's designer.Frequently, this is impossible.Therefore, the objective of the control is seen in reaching the setpoint swiftly with only a slight overshoot, which may be achieved by sending a highamplitude control signal to the object of the control.Such an approach entails a danger that the increasing control signal will not stop at the setpoint but at an undesired value (i.e. it will overshoot).
Such a contradiction is apparent and results directly from physical and technical properties of actuators and the control object itself.
In order to facilitate the supervision of the control process, several criteria of the control's quality were developed.They are formulated on the following basis: a) the course of step response, setpoint, and external disturbances.b) error signal (the difference between output and setpoint).c) requirements formulated for external disturbances.d) sensitivity of the system to external disturbances and to the system's variability.
It seems that the simplest criterion is based on evaluating the system's response to a step change.The quality of control is manifested in: • offset (e u ), • settling time, • where the time is determined by the following values: • settling time (t τ ) and • rise time (t T ).
The offset denotes the error value once transient processes have been determined.Settling time denotes the time between the step change and lasting reduction of the offset below a specified small value-usually a few percent.Rise time is the time between reaching 10 and 90% of setpoint.Next, the overshoot M p emerges when setpoint is overshot in the initial phase of the control process.It is defined as a ratio of maximum response value to setpoint value.Naturally, the greater the overshoot, the more adverse the process.In order to evaluate the system's oscillation, decay ratio (k) is applied.It is the ratio of absolute values of two neighboring overshoots.
A further group of factors determining the quality of control encompasses integral indicators.They describe the whole course of error signal instead of its fragment or selected characteristic values.The main indicators include: Optimization with the application of these criteria revolves around the minimization of their value.However, the indicators have limited applicability due to certain problems associated with the integration of the offset's course of the actual system.On the other hand, they constitute a vital tool for simulations.It is also a result of their physical interpretation: the ultimate objective of control processes pertains to achieving the smallest error value possible in the shortest time.Therefore, calculating the sum of the whole offset is a swift and effective measure of the system's quality.As a consequence, the smaller the sum, the more accurate the reflection of the setpoint.There exists one exception to this general rule, namely oscillating systems.The integral of the offset becomes less reliable because the oscillations may be of negative value, thus such values will be subtracted from error's positive values.In this way, results will be minimized and process variable may vary significantly.
As a consequence, integral criteria feature a certain miscalculation leading to the emergence of an error and a weight for large or long-term values.To sum up the section on integral criteria, the following may be said: 1. IAE, i.e.Integral of Absolute value Error, expressed by: is always positive.2. ISE, i.e.Integral Squared Error, expressed by: is always positive, and large values have greater weight than small ones.
3. ITAE is similar to IAE, and expressed by: is always positive, and its multiplication by time leads to long-term offset's values gaining weight.4. ITSE is similar to ISE, and expressed by: is always positive and its multiplication by time leads to long-term offset's values gaining weight.
This theoretical summary makes a premise that the integration runs from zero to infinity.However, in practice, the integration runs in a limited range.It is limited by time in which transient processes fade.i.e. the offset must equal zero.It results in the integrals' finite character.

METHODS FOR CONTROLLERS' TUNING
There exist several methods for tuning controllers [1].They all aim at shortening and optimization of PID controllers' tuning.However, in industrial applications, they are difficult to apply.The subsequent sections of the paper outline methods for tuning PID controllers by means of four approaches: Simulations were conducted in Matlab in the course of the analysis of a control system with the transfer function equivalent to the inertial element of the first order.

ZIGLER-NICHOLS METHODS
The method, in fact, consists of two independent methods.They were developed for cases where full knowledge of the object's model is not available, but full experimental knowledge or one emerging from simulations of the system's response, is.The first method applies approximation of parameters of the system's response.Figure 2 features an example response to a step change for an inertial object of the first order with a transportation lag.
Having determined the step response, the tangent to the course of the response in the inflection point was drawn.Subsequently, time constant T and lag τ were obtained.These two are required in order for optimal tuning of the controller to be obtained based on formulas in Table 1.It is worth mentioning that both T and τ may be calculated algebraically, based on geometrical relationships outlined in Fig. 2. Such calculations are more accurate.However, the result emerging from the constructive approach is accurate enough.
Table 1 outlines sets of parameters for P, PI, and PID controllers determined in order to meet three separate requirements with regards to the course of step response.
The first case concerns a situation when we intend to achieve an aperiodic response (k = 0%) in the shortest tuning time (tr → min).The second case involves a similar task.It also requires a minimum tuning time (tr → min), however, in this case oscillations are acceptable (k = 20%).In the third case the purpose of control is to select the settings that minimize the ISE integral criterion.The method of calculating the settings is described in literature [2,3,4].It is important that these settings were selected using the Zigler-Nichols method and have a different purpose, so a comparison of their control results is inappropriate.On the other hand, it is possible to indicate certain expected control objectives.Thus: the shortest tuning time tr → min should be obtained in the first case (k = 0%, tr → min).However, in the case of using a P-type regulator, this entails a consent for the greatest offset.On the other hand, the advantage in this case is the complete lack of oscillation.If the control target allows oscillations, the second set of parameters for the P regulator is preferable since the steady-state value is lower.In contrast, the fixing time is longer than the first.If the purpose of the control is to choose the controller settings to achieve the most accurate reflection of the setpoint, one should use the settings defined for parameters that minimize the ISE indicator.In this case, the longest settling time should be expected.
The second method, modified Zigler-Nichols method is easier to use.It is also a way of experimental setting of a PID controller.A practical advantage of this method is that there is no need for a geometric design (tangent to a transient response).This method assumes the following behavior: first, the system should be brought to the limit of stability, i.e. to the point at which non-fading oscillations begin to appear.Practically, this is achieved by increasing the settings of the P controller (in-crease of gain K p ). Limit K p corresponds to a critical gain (K kr ).The next step is to determine the period of critical vibrations (K kr ).-Fig. 3.
Coefficients K kr and T kr are inserted into formulae in Tab. 2 in order to obtain the values of PID controller tunings.
In this case, overshoot should not exceed 30%.

COHENA-COON METHOD
The Cohen-Coon method is very similar to the Zigler-Nichols method.However, it produces   3).
Coefficients k m , τ m , d m are calculated from the following formulae:

LAMBDA METHOD
Unlike the above-described methods, the Lambda method is dedicated to a PI controller and allows the controller to be adjusted according to the required response time (λ).The purpose of the control is to obtain an aperiodic response.In order to determine the parameters of the controller, a response to the unit step must be determined (Fig. 5).
Then, alike in Cohen-Coon method, selected parameters are read and controller tuning is calculated (Tab.4).
In this method, a step response is determined for an open feedback loop.
In this method, a time constant λ, is used, which is a measure of the rate of system reaction to change.For an inertial parameter, λ is determined as the time of response reaching 63% of the setpoint.

PRACTICAL APPLICATION
Practical application of the approximate method of tuning PID regulators is burdened with numerous requirements resulting from transferring theory into practice.An example may be determining a step characteristic, which is a response to a step change in a form of a unit step.While the definition of a unit step is obvious, its practical implementation is neither obvious nor easy.Eventually, even with particular accuracy and maintaining all the requirements, the resulting course is approximate.This happens in the application of the theory, as the actual change must grow along a certain slope, and the steepness of that slope determines the accuracy of the response.The ordinary practice is also difficult, for example, an electric motor with a significant power cannot be started instantly, regardless of whether the motor works with the inverter or not.Boot conditions impose the requirement for additional implementation elements on the designer.This situation occurs not only in the case of electrical systems, but also hydraulic devices have similar character- In order to conduct the analyses and simulations a controller system structured according to a scheme in Fig. 6 was used.
The following assumptions were made: • controller has a PI structure with a transfer function: () =   + • the actuator has a structure with a transfer function: • the plant has a structure with a transfer function: Using the above-given rules, the tunings were calculated for the PI controller (Table 5), which was chosen because of its practical common use.In addition, the PI controller was chosen because it allows for a steady offset of zero.
After the simulation with the controller, whose tunings are given in Table 5 (Ziegler-Nichols Method and minimization of tuning time and zero decay factor), the following waveforms were obtained (Fig. 7).
The response and adjustment error were then determined for a Ziegler-Nichols controller with an experimentally determined critical gain (Fig. 8).The response and offset for the controller tuned according to Cohen-Coon method (Fig. 9).
Unfortunately, Cohen-Coon method did not produce expected results.The response is provided in a very short time, however, the oscillations are suppressed weakly.The last method was the Lambda method (Fig. 10).

CONCLUSIONS
The analysis shows that the goal was not achieved in each case.The Cohen-Coon method gave the worst results.It required reduction of the gain factor K p In order to quantify the obtained results, the basic parameters (K p , T i ) rise time, tuning time and overshoot) were collected in Table 6.
The Lambda method seems to be the most optimal.In this case, a short rise time and the shortest stability time were obtained.Also overshoot was very beneficial.It is worth to note that the control flow corresponds to the control strategy, in which we assume a mild course of response in the absence of oscillation in the transient state.
It seems that the optimum method is the Zigler-Nichols method.Very short rise times and relatively favorable tuning time were obtained.Overshoot is not a strong side of this method.
Minimum rise time values were obtained for Zigler-Nichols method and Cohen Coon method.These methods are based on the pitch response of the open system.
To conclude, all methods are reasonably effective and lead to the goal.However, in practice, the nature of the adopted control strategy is essential.The decisive factor in selecting the tuning method of the controller is the control object's properties and regulatory quality requirements.
None of these methods is a simple, obvious and universal way of optimizing the operation of the controller.This is because they are implemented for different purposes.Neither method is a solution also if the object has e.g.slow variable transfer function.
During the simulation, numerous practical problems were encountered.It was necessary to determine the step characteristics of an open system, or the method required obtaining non-zero oscillation.Such tasks are very difficult to implement.Also, in practice, the problem of the accuracy of the designation of T and τ from the graph, which can also be calculated, has appeared.For the first Zigler-Nichols method, the values of T and τ were determined analytically and constructively in both cases, resulting in irrelevant differences in the selected settings of PI controller.

Fig. 2 .
Fig. 2. Response (green) to a step function (red) for an inertial system of the first order with a lag

Fig. 10 .
Fig. 10.System response for controller tuning according to the Lambda method for λ=3

Table 1 .
Formulas for tuning PID controllers

Table 4 .
Formulas for PID controller tunings.Modified Lambda method.

Table 6 .
Parameters for different methods of controller tuning