{'fraction_non_alphanumeric': 0.03174332571857206, 'fraction_numerical': 0.008217122984077193, 'mean_word_length': 4.711781888997079, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
From Basic to Advanced PI Controllers: A Complexity vs. Performance Comparison

The history of PIDs dates back to the beginning of the twentieth century when preliminary works of [Sperry (1922)] and [Minorski (1922)] provided mathematical results for the control of the ship motion and of automatically steered bodies in general. In particular, Minorski was the first to introduce three-term controllers with Proportional-Integral-Derivative (PID) actions. The success of PID was fast and solid, as nowadays they still represent the most popular choice in most industrial process control applications. The main reasons for their success are:

• Well-established tuning rules: There are predefined and well-known methods for deciding the values of the PID regulators. The most popular methods were given by [Ziegler and Nichols (1942)], [Astrom and Hagglund (1984)], and more recently [Zhuang and Atherton (1993)] and [Luyben and Eskinat (1994)]. Different tuning methods are due to different control objectives (e.g. reference following, disturbance rejection) and different plants (e.g. first-order model, second-order model).
• Good performances: The main reason for PID success is of course that good control performances are usually obtained; thus, the control engineer might not be interested in developing more complicated and less intuitive control schemes to improve something that is already working fine.
The ideal equation of a PID controller is where k p is the proportional gain, k p /T i is the integral gain (sometimes denoted as k i )andk p T d is the derivative gain (sometimes denoted as k d ). According to conventional notation r(t), y(t) and u(t) denote respectively the reference, output and input signals. The error signal r(t) − y(t) is sometimes denoted as e(t). The classic feedback structure involving a PID controller is shown in Figure 1. Equation (1) is sometimes considered an ideal equation for PIDs, as usually a few tricks are required to avoid some typical well-known problems associated with ideal PIDs. For instance, a more realistic equation for PIDs is where the two main differences with the ideal equation (1) are the introduction of a set-point weighting factor b [Rasmussen (2009)] and the absence of the reference in the derivative term. The term b is used to mitigate kicking phenomena, that usually occur when there is an abrupt change in the reference signal r(t). In the same circumstance, the derivative term of (1) is even larger, and a possible precaution is to relate the derivative only to the output signal. Assuming that only piecewise constant reference signals should be followed, the derivative term of (2) is equal to that of (1) after the transient stage.
Even the Equation (2) of a realistic PID is not always enough to obtain good control performances. One of the main drawbacks is that the PID's parameters are fixed, therefore if the plant's parameters vary in time then the fixed PID can not always represent the optimal solution. A simple way to deal with this problem is to use a relay auto-tuning procedure, i.e. the behaviour of the plant is continuously monitored, and the PID's parameters are automatically tuned in reaction to plant's changes. A second drawback of conventional PIDs is that usually they are tuned either to have good tracking performances or to have good disturbance rejection. Of course, in practice both properties are desirable at the same time, thus requiring the design of suitable filters that separate the high-frequency components of noise from the low-frequency components of the reference signal. Alternatively, it is possible to design two PIDs which are optimal with respect to reference tracking and disturbance rejection respectively, and a smart device that switches between the two PIDs according to the most important objective in the particular moment. A last problem of PIDs is that an anti-windup scheme must be adopted, especially in the common case that the inputs to the actuators are bounded by physical constraints, see for instance the tutorial [Peng et al. (1996)]. A consequence of the previous remarks is that some modifications to the basic structure of the PIDs might be required to achieve better control performances. A classic improvement is obtained by considering PID-like regulators whose parameters are not fixed, but are allowed to be time variant to maintain good control performances in different operating conditions. Moreover, it is clear that time varying parameters introduce more degrees of freedom in the control design, and in principle more flexibility in shaping the control response. Time variant PIDs can be designed according to several approaches well known in the literature: (a) fuzzy PIDs [Tang et al. (2001)]; in this case typically several fixed conventional PID controllers are designed for different operating conditions, and are then interpolated according to a set of fuzzy logic rules. Alternatively, fuzzy rules are used only to improve one component of the PID, for instance the set-point weighting term as in [Visioli (2004)]. (b) nonlinear PIDs; see for instance [Haj-Ali and Ying (2004)] for a comparison with fuzzy PIDs. (c) variable structure PIDs, see for instance [Scottedward Hodel and Hall (2001)] or [Visioli (1999)] where a classic PID is modified by adding a feedforward term. In this spirit, this work compares a traditional PI with three parameter varying PIs, characterised by an increasing level of complexity. As a support to the evalution of the control performance of each of the four regulators, conventional control indices, such as the integral of the absolute value or the square of the error signal, and the integral of the absolute value of the input and its derivative, have been used, as further detailed in Section 4. The final objective is to establish some thumb rules that quantify how much (or when) it is convenient to complicate the original conventional PI, in terms of improved control performances.
The discussion in this paper is restricted to PIs rather than PIDs for two main reasons: • Many industrial controllers are simple PIs.
• The design of the derivative action simply follows the design of the other components. Therefore the derivative component can be introduced without affecting the general results of this work. Simple rules to introduce the derivative component can be found in the recent reference [Leva and Maggio (2011)].
Furthermore, the discussion is here restricted to linear time invariant systems, as in practice most industrial plants can be represented in such a form, eventually after a linearisation step around the desired operating point. While PI are successful in most stabilization and control problems, from a theoretical perspective there is a class of linear systems which are not stabilizable via output PI feedback; however, such examples will not be trated in this chapter. This paper is organised as follows: next section introduces the 3 PIs that will be thoroughly compared with a conventional PI in benchmark examples. Section 3 illustrates the tuning procedures for all PIs. Section 4 compares the PI regulators in a challenging noisy reference tracking example, while Section 5 is dedicated to a realistic example. In the last section final conclusions are given and future work is outlined.

PI-like regulators
This sections presents the four regulators that will be later compared in challenging control problems.

Conventional PI controller
The conventional PI is described by Equation 1, without the derivative term, i.e.
where all parameters are constant.

Variable Integral PI
A simple modification of the standard PI was proposed in [Balestrino et al. (2009)] and is here reproposed as a term of comparison as it represents a good trade-off between performances and complexity. In particular, the Variable Integral PI (VIPI), provides a control action equal to where σ is a further tuning parameter. The main difference with Equation (3) is that the integral gain is not simply k p /T i ,b u tk p /T i · exp − e(τ) 2 2σ 2 , and thus it is not fixed anymore, but depends on the instant error. The motivation of Equation (4) is that the integral gain is required to obtain a zero steady-state error, and therefore a precise and accurate tracking of the reference signal. However, in the transient stage when the error is large, it might be useless or at least misleading to perform accurate and refined control actions using the integral component. Moreover, this use of the integral action might also lead to windup problems. Accordingly, Equation (4) encourages the use of the proportional action to get close to the reference signal (as in presence of large errors the integral gain is close to zero), while the integral action recovers the nominal value k p /T i when the error is close to zero. For this purpose, the tuning parameter σ 2 plays the role of choosing when the integral action has to play an important role, as it corresponds to the variance of the Gaussian distribution centered around zero error, as in Figure 2. A consequence of VIPI is that the control effort is always inferior to that of a conventional PI as the integral action can never be greater than the nominal one.

API controller
The acronym API denotes an Adaptive PI controller, whose parameters are not fixed but change, i.e. adapt, in reaction to different operating conditions (e.g. plant parameter changes, ageing phenomena, input uncertainties). Adaptive controllers have a long history, but their use in practical applications has been limited by their usually high demanding computational requirements; indeed, computations like matrix inversions can not be easily embedded in real-time applications, as they might cause runtime faults and consequently even lead to plant damages.
More recently, adaptive techniques have been applied to PI controllers, as their simple structure is very attractive, by including additional adaptive terms to extend and robustify such controllers. One example is given by [Fisher (2009)], where the authors compare three different controllers: a classic PI, an Adaptive PI and a P-FI which is a Proportional+Fuzzy Integral term controller. In this paper, we use the second controller (API) as a term of comparison in our examples, because it is characterised by accurate and robust tracking performances. The main property of adaptive controllers is that parameters are not fixed, but vary in time searching for an optimal configuration. In [Fisher (2009)] the controller parameters update law is described bẏ with positive constant parameters γ p , γ i , β p , β i ; the resulting control law is as usual The rationale of this adaptive PI control is that the updating law is composed by a and an anti-dissipative term β p e 2 β i e t 0 e(τ)dτ The dissipative term is used to decrease the value of the corresponding gain, once that the anti-dissipative terms becomes small. For instance, a large error will cause an increase of the proportional gain through the anti-dissipative term; thus the error will decrease, and when close to zero (e ≈ 0), the proportional gain decreases exponentially with decay rate γ p .

FAPI controller
Similarly to many other recent approaches, we also propose here a Fuzzy variant of the Adaptive PI (FAPI). Fuzzy approximation property has been widely and successfully used in robotics and control theory, to handle model uncertainties and external unpredictable disturbances. A large number of controllers use the Wang universal approximation theorem [Wang (1997)], to design nonlinear integral terms to improve performance indices and address robustness issues. However, in many cases, as shown in [Fisher (2009)], the involved additional computational efforts do not match significative performance improvements, thus not making fuzzy techniques particularly attractive. Here we present a different novel approach to fuzzy controllers, where the simplicity of the conventional PI regulator, the interesting idea of the VIPI integral action and the robustness properties of adaptive PI controllers, are all combined together into a single Fuzzy-Adaptive PI Control (FAPI). Next section is dedicated to recall the basic ideas of Fuzzy Logic Theory that, in the following section, will be used to implement the FAPI controller, which is one of the main contributions of this paper.

Fuzzy logic theory background
A fuzzy set A on a domain X is a set defined by the membership function μ A (x) which is a mapping from the domain X into the unit interval: There are several ways to define a fuzzy set, in particular we define it here using the analytic description of its membership function μ A (x)= f (x). For instance (see Fig. 3), the triangular membership function can be described as: where a,b and c are parameters that is related to the coordinates of the triangle's vertices, whereas a Gaussian membership function can be described as A static or dynamic system which makes use of fuzzy sets and the corresponding mathematical framework is called a fuzzy system. In order to derivate the FAPI controller Af u n c t i o nt can be qualified as an intersection function, if it satisfies at least the following four requirements: In the following analysis, the probabilistic connective AND will be used: The most common fuzzy systems are defined by means of if-then rules: rule-based fuzzy systems. In the rule-based fuzzy systems, the relationships between variables are represented in the following general form: if antecedent proposition then consequent proposition.
A fuzzy proposition is a statement like "x is big" where "big" is a linguistic label,d e fi n e db ya fuzzy set on the universe of discourse of variable x. In the linguistic fuzzy model developed by [Zadeh (1978)] and [Mamdani (1977)], both the antecedent and the consequent are fuzzy propositions: where L is the number of propositions (rules). Here x is the input (antecedent) linguistic variable,a n dA i are the antecedent linguistic terms (labels). Similarly, y is the output (consequent) linguistic variable and B i are the consequent linguistic terms. The linguistic terms A i ,B i are always fuzzy sets. After fuzzy theory gained popularity, many control problems have been recasted into control of Takagi-Sugeno-Kang (TSK) models: which is a particular case of the general fuzzy model (16), obtained when the consequent fuzzy sets B i are functions of the variable x. In systems and control theory, TSK models are frequently used to model nonlinear systems over a fuzzy space. The resulting TSK model can efficiently clone the nonlinear system or alternatively, approximate it over a defined domain. For such a nonlinear systems representation, stability and synthesis of controllers and observers can be expressed in terms of Linear Matrix Inequalities, which in turn can be solved adopting convex optimization techniques as shown in [Tanaka (2001)]. It is important to mention that the output of a fuzzy system can be obtained using different defuzzification methods. In the remainder of this chapter we will use the following TSK model: where we consider that each rule has an antecedent proposition obtained by intersecting n fuzzy sets. The output can be evaluated by considering the Center of Gravity defuzzification method where

FAPI parameters update law
According to the discussion on fuzzy sets and rules introduced in the previous section, we introduce now the controller parameters update laws: for the proportional gain k p , while for the integral action we have IF error is SMALL, The main difference with respect to the API regulator is the presence of the two terms k * p and k * i that are the gains of a reference model regulator K * . In order to compute the corresponding time-varying gain, we will consider a single Gaussian membership function μ S (e) defined over the error domain to identify the fuzzy set SMALL (S), and also the fuzzy sets MEDIUM (M) and LARGE (L) as follows: The philosophy of shaping the control effort on the basis of the error value is analogous to that of the previously introduced VIPI. The resulting k p gain law is obtained aṡ while the integral gain k i law iṡ Each updating law it is composed of three terms: used to decrease the (absolute) value of the gains, used to increase the gain values analogously to the API control philosophy, and used to force the adapting law to generate controller gains sufficiently close to the ideal controller K * . In the end, the control law is as usual In practice, when the error is large, the parameter update laws make the proportional gain increase due to its anti-dissipative term, while the integral action progressively disappears. This leads to a fast response (high proportional gain). On the other hand, when the error is small, the proportional gain is subject to the dissipative term and gets negligible values, while the integral component grows. This will result in a disturbance rejection behaviour. In any moment, good performances are guaranteed by the third term that makes the PI close to the model reference controller K * . Remark: Both the API controller developed in [Fisher (2009)] and the FAPI controller shown here are not symmetrical with respect to the error signal as their update rules are a function of the error, and thus depend on its sign. As a consequence, they can behave differently if the reference signal is larger or smaller than the actual output of the plant.

Tuning of the conventional PI
In this paper we tune the conventional PI using Zhuang-Atherton optimal parameters [Zhuang and Atherton (1993)].
In particular we use the values of Table 1 of [Zhuang and Atherton (1993)], which correspond to PI tuning formulae for set-point changes in the case of first-order plus dead time plant model, optimised in order to minimise the Integral of the Square Error (ISE) signal. The set-point weighting factor is usually not used (i.e. b = 1), as in the examples a time-varying reference signal is used.

Tuning of the VIPI
Tuning of the VIPI is a two-step procedure: 1. Conventional tuning is first performed, and values of k p and T i are found according to the procedure outlined in Section 3.1.
2. The further parameter σ is computed to decide at which point the integral action should come into action. Namely, the integral action must already be active when the error is equal to the steady-state error obtained using only the proportional action.

Example :
Let us consider a plant described by the transfer function and let us design a classic PI characterised by k p = 6.122, T i = 0.606 and b = 1. Then the step response of the VIPI for different values of σ = 0.1, 0.15, 0.25, 0.5, 1, 5 are shown in Figure 4. As can be appreciated in Figure 4, the step response is contained between the one obtained using a single proportional controller, which is recovered from Equation (4) when σ tends to zero, and that of the conventional PI, which is recovered from Equation (4) when σ has large values (in practice they coincide already for σ = 5).  = 0.1, 0.15, 0.25, 0.5, 1, 5 Fig. 4. Different step responses as a function of the free parameter σ of the VISI. The step response is contained between the one obtained using a single proportional controller (i.e. σ → 0) and high values of the parameter. In this case, the step response when σ = 5already coincides with the one obtained with the nominal PI.

Tuning of the API
Tuning of adaptive controllers is simpler than other PIs as the inner adaptive capacity allows the API to recover good performances against non optimal initial tunings. However, APIs are characterised by more degrees of freedom, e.g. parameters in the updating rules. For the purpose of the example shown in the following sections, the adaptive PI control parameters γ and β have been optimally tuned (using genetic algorithms) in order to get a good trade-off between tracking and disturbance rejection. Particular care is required to handle the anti-dissipative terms, which might yield to instability problems when a fault occurs. In fact, the anti-dissipative term should be neglected only when the error is close to zero.

Tuning of the FAPI
The FAPI controller parameters α, β, γ must be tuned, after a desired target controller K * is chosen. In this case, we use a conventional PI tuned according to Zhuang-Atherton rules (see Section 3.1) as a reference model. Then, the parameters can be tuned keeping in mind that each parameter directly affects a different controller property: • α:A d a p t i n g Therefore, parameters are chosen in function of whether the priority objective is fast response to variations, or no overshoots or adherence to the ideal model controller. Particular care should be used in tuning α, that should be small in presence of significative system delays.

Comparison of the four PIs
As a preliminary comparison the step-responses of the four controllers are compared. Then, in the following sections, a more challenging example and a realistic scenario are simulated to further establish the differences among the proposed PI regulators. The step response of the four controllers is shown in Figure 5, in the case of the system plant (34). The shown comparison is performed after a transient time given to the adaptive controllers to adapt their parameters, and after Zhuang-Atherton tuning procedure for the other two controllers [Zhuang and Atherton (1993)]. The control performances of the four regulators are also  Table 1. Comparison of the four controllers in terms of the Step Response. The best values of the indices have been highlighted in grey. The FAPI requires the least control effort, while the VIPI has the best overall control performances.

A more challenging example
The performances of the four controllers are again compared in a more challenging scenario where the plant transfer equation is the same (i.e. Equation (34)), but the reference signal is composed of a periodic sinusoidal component and of a pulse wave, plus a filtered Gaussian random signal n(t) added to simulate sensor noise (i.e. e(t)=r(t) − y(t) − n(t)). As a consequence, this simulation is tailored on purpose to compare the robustness and disturbance rejection performances of the four controllers. The ability of the four controllers to track the reference signal despite the sensor noise is shown in Figure 6. Again, the comparison has been performed after some time that was required by the adaptive controllers to reach a steady-state behaviour. As illustrated in Figure 6, the conventional PI and the modified VIPI apparently have the best performance in terms of tracking, however, as better shown in Figure  7, the adaptive controllers, and especially the FAPI, are characterised by a less demanding input signal. This is particularly important because the input signal is usually required to vary slowly in time, to avoid actuators' stress. Remark: In this example, the plant is required to follow small variations of the reference signal, therefore the error is usually small and the integral action of the VIPI is constantly set to the nominal value. As a consequence, the PI and the VIPI provide (almost) identical results.  Fig. 7. Comparison of the four PI controllers in presence of a varying reference signal and sensor noise. This simulation shows the control effort of the four controllers. Clearly the FAPI is the most convenient one, as actuators are less stressed. On the left a long time interval, while on the right a shorter time interval is shown.

A realistic example: Ship course control
Let us consider a 3DoF model of a low-speed marine vessel [Fossen (2002)]: where • M represents the generalized mass-inertia matrix, including the added-masses contribution • C(ν) contains the Coriolis-centripetal effects • D represent the linear approximation of hydrodynamic drag • τ is the generalized force-torque applied to the 3DoF model expressed in the body-fixed reference frame • τ d is an external disturbance expressed in the navigation referenceframe • ν =[u, v, r] T ∈ R 3 is the state variable related to the surge, sway and yaw rate speed • η =[p n , p e , ψ] ∈ R 3 represents the position and the orientation of the vessel with respect to the navigation frame • J(η) is the Jacobian matrix which relates body-fixed reference frame to navigation reference frame: Let us assume that the vessel is moving at constant speed u 0 ,a n d u 2 0 + v 2 ≈ u 0 ,t h e n the previous 3DoF model can be decoupled into longitudinal and manoeuvring subsystems. Here we will analyse the manoeuvring subsystem in order to obtain a course control for a vessel equipped with a single rudder. For low surge speed, in addition the Eq. (35) can be approximated by:M˙ν where the parameters Y δ , N δ are used to model the force and the torque generated by the rudder, Yv, Yṙ, Nṙ are parameters related to the added-masses, m, x g , I z are parameter of the rigid-body (mass, center of gravity and moment of inertia, respectively), Y v , Y r , N v , N r are coefficients related to the drag effects and δ is the rudder deflection. The equivalent state-space model of (38) can be found by observing that:ν Considering the the parameters of the CyberShip II experimentally estimated in Fossen (2004), choosing a constant speed of u 0 = 1.5m/s ≈ 3knots and defining the output y = r = C rν , C r =[ 0, 1] ∈ R 2 , the following second linear time invariant system, also referred as Nomoto 2nd order model is obtained: Since the course angle derivative is related to the yaw-rate asψ = r, we can finally derive the course model for the CyberShip II as: The controller parameters used in the course-control problem are summarised in Table 2.
ZA VIPI API FAPI K * p 7.7220 7.7220 -7.7220 Table 2. Course Control Problem: controller parameters used in the simulation.
Note that we are not handling actuator saturations and limitations of the input rate. However, in order to use efficiently those controllers with such limitations the adoption of anti-windup systems and reference filters is strongly recommended. In practice, the use of a frequency-shaped reference signal causes a smoother and less demanding control action which is expected to satisfy the actuator limitations. The four controllers are compared in the challenging scenario described in Figure 8. In this simulation we assume that the reference signal is a desired course angle (i.e. not a step reference, as it is not realistic in this context as previously remarked). Disturbance is modeled with two components: a filtered Gaussian noise, of the order of 2 − 3 • ; and an aperiodic square pulse which refers to unpredictable external disturbance (e.g. wave current, wind gust). It is possible to note from Figure 8 that the API controller not always provide a satisfactory tracking of the reference signal. On the other hand, the other controllers have similar good performances, but the FAPI is characterised by a reduced control effort.

Conclusion
This chapter gives a comparison between a conventional PI regulator tuned according to Zhuang-Atherton rules with three less conventional controllers: a variable integral component PI (VIPI), an adaptive PI (API) and a fuzzy adaptive PI (FAPI). The VIPI is characterised by one time variant parameter, i.e. the integral one, and only one more degree of freedom (the parameter σ). Both the API and the FAPI have two time variant parameters and more degrees of freedom, as for instance the dissipative and anti-dissipative coefficients that regulate the parameters' update laws. Simulations show that the VIPI generally outperforms the simple PI both in terms of the control effort, which is always inferior, and in terms of settling time. The VIPI is very convenient, as it only contains one more parameter than the conventional PI, and better performances are usually achieved without requiring a complex tuning procedure for the extra parameter. On the other hand, the adaptive controllers require a more laborious tuning procedure (as more parameters are involved), and not always the control performance is so satisfactory, especially for the API, at least for the proposed examples. However, the FAPI, although provides similar control results to the PI and the VIPI, is characterised by a reduced small effort, both in terms of the absolute value and its derivative; for this reason it is particularly suitable in particular control applications: for instance when control components with moving parts are involved (e.g. valves) frequent fluctuations of the control action should be avoided to skip the high expenses of valve wear and maintenance programs. Ongoing and future work will follow several directions: • Robustness performances will be further investigated, so to account for time variant process plants. In some industrial applications, the plant coefficients change according to different factors (e.g. temperature, age, wear and tear of the machines).
• The controllers can be further compared on their ability to prevent wind-up phenomena.
• The proposed framework can be easily extended to decentralised Multiple Input Multiple Output (MIMO) control problems.
• The FAPI controller exhibits the best performance in terms of control effort, and for this reason it will be used in a real application in underwater robotics.