**3. PID-like fuzzy controller**

The design of controllers based on fuzzy logic plays an essential role in intelligent systems due to the ease of design and implementation, which must be subject to direct collaboration with the person in charge of monitoring the process to be controlled; that is, the design of the controller must be based on the experience of the system operator under certain conditions to establish the linguistic variables that the controller must obey [9, 26]. The fuzzy logic is used to tune the gains of a PID structure controller. The general form of the PID controller is depicted in Eq.(17).

$$u(t) = k\_p e(t) + k\_i \int\_0^t e(\tau)d\tau + k\_d \frac{de(t)}{dt} \tag{17}$$

This system is known as a PID-like fuzzy controller [27, 28]. The fuzzification range for computing *kp*, *kd*, and *ki* gains, in its crisp value form, is selected according to the error, rate of change in error, and the integral of error, respectively. **Figure 6** depicts the structure proposed for the outer loop or master loop. The master loop controls the longitudinal velocity according to the angular velocity.

**Figure 7** presents the structure of the internal loop. It consists of a PI structure capable of controlling the current of the tire coupled to the DC motor. Whether there is an imbalance in the speeds, it means that there is a skid in the wheel. The current must be reduced to equalize the angular velocity with the longitudinal one. That is the aim of the internal structure.

**Figure 8** presents a generalized form to propose the range of operation. As one can see, the three linguistic variables contain seven linguistic values, namely negative big (NB), negative medium (NM), negative small (NS), zero (ZE), positive small (PS), positive medium (PM), and positive big (PB). A "d" and "i" are added at the beginning of each linguistic value to identify if they refer to the derivative or integral linguistic variable. The linguistic values present triangular and Gaussian shapes. For the

**Figure 6.** *Fuzzy tuner structure.*

*PID-like Fuzzy Controller Design for Anti-Slip System in Quarter-Car Robot DOI: http://dx.doi.org/10.5772/intechopen.110497*

**Figure 7.** *Fuzzy tuner structure.*

linguistic variable of error and integral of error, **Figure 8a** and **b**, respectively, triangular membership functions are used in the design since, according to the control theory, the proportional and integral actions are not as susceptible to noise. On the other hand, in the derivative error linguistic variable, **Figure 8b**, it is used a Gaussian membership function as a zero value to smooth the values of the derivative gain. The ranges of the fuzzyfication stages are ½ � �1, 1 , ½ � �10, 10 , and ½ � �5, 5 , for *kp*, *kd*, and *ki*, respectively.

**Tables 1–3** present the fuzzy associative matrices (FAM) for computing *kp*, *kd*, and *ki*. The inference process corresponds to a one-to-one fuzzy relationship. Likewise, it can be seen that four-linguistic values NM, NS, PS, and PM map to a single value S to calculate the output value for *kp*. This relationship is used to ensure that the gain values work within a suitable range of values. The value of *Kp* never takes the zero value in this controller, only an almost zero (AZ) linguistic value. Generally, when the present error is obtained, it enters the fuzzification stage and is evaluated for the rules shown in **Table 1**. The range of values the proportional gain can take is shown in **Figure 9a**. *kp* can bring any value between [1.9,9.8] and depends on the error at an instant of time. It is important to mention that *kp* must not be negative for any reason.

Similar to *kp*, *kd* maps four linguistic values, namely dNM, dNS, dPS, and dPM map to a single value S. *kd* can be zero (Z) according to the derivative error. The idea of giving a zero value to *kd* is to reduce the oscillation caused by the slight variation of the change in error. The range proposed for the *kd* gain goes from 0,1 ½ � *:*4 .


**Table 1.** *FAM of kP.*


**Table 2.** *FAM of kd.*
