2.1. PI Control
PI control systems are some of the most widely used configurations in engineering, especially in applications where the goal is to maintain a constant or controlled output signal, thereby eliminating steady-state errors. As a result, PI control systems are essential in many industrial and engineering applications where precise control is required without excessive complexity [
17,
18,
19,
20].
These systems combine two basic components:
1. Proportional control (P). This component produces an output signal that is proportional to the current error, which is the difference between the desired (reference) signal and the measured (actual) signal. The proportional controller amplifies this error by a factor called the proportional gain (). However, this type of control alone does not eliminate steady-state errors; the system may still have small errors despite this control action.
2. Integral control (I). This component aims to eliminate the accumulated error that persists over time, taking into account the integral of the error over time, i.e., the greater the difference between the setpoint and the measurement, the stronger the corrective action, with a factor that depends on the integral gain (). This component helps to eliminate any residual errors that the proportional controller cannot eliminate, although it may cause the system to respond more slowly to sudden changes.
When both components are combined, the proportional action is responsible for responding quickly to system changes, while the integral action ensures that long-term errors are completely eliminated. This makes it an efficient choice for systems where a fast response is required without sacrificing the long-term accuracy. However, improper gain design can result in overtuning or slow system responses.
The equation for a PI controller is as follows:
where
is the control input, and
is the error.
Figure 1 shows the implementation of a PI controller in a closed-loop system.
Some advantages of the PI controller include the following:
- The elimination of steady-state errors due to integral action;
- Fast responses because the proportional component allows the system to adjust quickly to changes;
- Its design is relatively simple compared to that of other more complex types of controllers (such as PID controllers);
- It is robust to disturbances for a wide variety of systems with low to medium errors.
Some disadvantages are the following:
- It may have difficulty handling fast disturbances because the integral component may be slow to respond;
- If the gains are not set correctly, the controller may become unstable or cause overtuning, especially if the integral gain is too high;
- It is not suitable for systems with very fast changes, where the disturbances or variations are fast and do not involve long-term errors.
The PI scheme is sometimes chosen over other controllers because of its simplicity and flexibility. The calculation of its parameters is based on simple algebraic expressions, making it suitable for less demanding hardware, such as slow PLCs. In addition, PI controllers are good for processes that are stable and predictable, such as flow control in pipelines and heating systems.
In addition, the derivative term can lead to the amplification of high-frequency noise and the saturation of certain components of the system. Therefore, for some types of processes, the disadvantages of the derivative term often outweigh its advantages, and thus a PI controller is preferred.
2.2. Fuzzy Logic Control
Similar to the PI scheme, other classical control algorithms for complex processes have been successfully proposed and applied to linear systems, such as optimal, stochastic, adaptive, and robust controllers, among others. However, there are cases in which the process cannot be defined using linear models, and thus classical control techniques cannot be applied; for example, this pertains to the following:
- A mathematical model of the process to be controlled is not available, or it can only be obtained with great effort and cost;
- Even if a partial mathematical model of the process to control exists, the influence of unmodeled dynamics on the performance quality is significant and cannot be ignored;
- One of the process parameters or the operating point changes in an unpredictable way [
21];
- Only part of the information is available in quantitative form, while the rest of the information is only accessible in qualitative form.
Fuzzy logic control systems are an alternative to classical control systems that use binary logic. Instead of working with exact, defined values, these systems represent the uncertainty and imprecision inherent in many real-world situations, making decisions closer to the way humans reason.
This type of control is based on the principles of fuzzy logic, developed by Lotfi Zadeh in 1965 [
22], which departs from traditional logic by introducing intermediate degrees of truth, represented by values between 0 and 1. This defines fuzzy sets, where each element has a degree of membership; the fuzzy-logic-based controller is a rule-based inference system. This feature is particularly useful for modeling vague or imprecise concepts, such as “high temperature” or “moderate speed” [
23,
24,
25,
26,
27,
28,
29,
30,
31,
32].
The linguistic values taken by the variables in the rule base and the symbolic representation of the rules allow for some qualitative analyses of the stability of the system in which the fuzzy control is implemented. However, for the needs of a quantitative description and computation of the control output, a quantitative interpretation of the linguistic values is required. Membership functions represent the meaning of each linguistic value and thus indicate how the fuzzy operator classifies each of the variables involved in the process.
For computational efficiency, a uniform representation of the membership functions is required; this can be achieved by using functions with a uniform shape and easy parameterization. Therefore, the most popular choices for the shape of the membership functions include triangular, trapezoidal, and bell-shaped functions.
These functions are often chosen because they are easy to describe parametrically, can be stored with a minimal amount of memory, and can be efficiently manipulated by the inference engine in terms of real-time requirements. In this sense, it is easy to see that the triangular form is the most economical; this explains the predominant use of this type of function [
33].
Furthermore, similar to the PI algorithm, the controller is implemented in a feedback loop. The measured output y is compared with a setpoint or reference r, producing an error signal e that serves as the input to the fuzzy controller. This error is a crisp signal with measurement inaccuracies and sometimes disturbances. The error is then “fuzzified”, i.e., assigned to the appropriate fuzzy set and membership function, by means of an inference engine that relates the fuzzy sets using a fuzzy rule base. The result must then be “defuzzified”, i.e., converted into a crisp numerical signal u, to control the system actuators.
In summary, a fuzzy logic control scheme typically consists of the following components:
1. Fuzzifier: This component converts precise and quantifiable input signals into fuzzy values; precise numbers are converted into fuzzy categories or sets. For example, if the temperature of a room is 22 °C, it can be fuzzy classified as a “moderate temperature” with 80% confidence, a “cold temperature” with 10% confidence, and a “warm temperature” with 10% confidence.
2. Fuzzy inference: This stage uses a set or base of fuzzy logic rules that describe how the inputs should be combined to produce an output. These rules are based on experience or expert knowledge; an example might be “if the temperature is high, then the fan speed should be high”.
3. Defuzzifier: Once the system has calculated a fuzzy output, it must be converted into an accurate value so that it can be used in a physical system. The defuzzifier determines the exact value of the output by taking the “center of gravity” of the fuzzy distribution.
Figure 2 illustrates the fuzzy controller scheme [
34].
As mentioned above, this approach makes it possible to handle complex, nonlinear problems where traditional mathematical models may be inadequate, where the exact conditions are not always available or are difficult to determine [
32], or where absolute precision is not possible or necessary, such as the following:
- Temperature control in air conditioners;
- Speed control in electric motors;
- Navigation and guidance systems for autonomous vehicles;
- Complex industrial processes with high uncertainty.
For example, in a temperature control system, instead of simply turning a heater on or off at a specific temperature, fuzzy logic allows the heater’s output to be adjusted more flexibly, taking into account imprecise variables such as “slightly warm”, “moderately cold”, or “very hot”.