**2.2 Development of Linear and Fuzzy Control Approaches**

**2.2.2 Fuzzy Control**

The original source is Odry et al. (2016a).

2.2.2.1 Fuzzy Logic Controllers

Lofti A. Zadeh introduced the fuzzy sets Zadeh (1965) by extending the classical two-valued logic{0,1}with the whole continuous interval [0,1]. This allows to introduce linguistic variables (such as small and large for reasoning about the current consumption) and associate them with membership functions. Fuzzy control is based on the application of these fuzzy sets, which result in that the inference mechanism of a FLC can be defined by simple IF-THEN linguistic rules. Hence, there is no need to define complex and precise models, instead the empirical rules and the approximate reasoning contribute to a heuristically defined control strategy. The FLC structure is depicted in Fig. 2.5 and its fundamental algorithm is composed of the following parts Wang (1997); K´oczy et al. (2000); Full´er (2000).

1. Fuzzification of the n-dimensional observation vector χ = (x1, x2, ..., xn) and calculation of the firing values of theith rule (i= 1, ..., r) defined as:

Ri : IFx1=X_{1}^{i} and ...and xn=X_{n}^{i} THENy=B^{i}. (2.21)
Let χj denote the jth dimension of the observation vector, then the firing value γ_{j}^{i}
rep-resents the fitting degree of the observation χ_{j} to the antecedent fuzzy setX_{j}^{i} in the jth
dimension of theith rule as

γ_{j}^{i} = max

χj {min{X_{j}^{∗}(χj), X_{j}^{i}(χj)}}, (2.22)
whereX_{j}^{∗}(χj) is the fuzzified observation.

2. Calculation of the applicability measure of theith rule, denoted byγ^{i}, as the minimum of
the aforementioned firing values. This weight determines the significance of the consequent
fuzzy set defined in the ith rule.

γ^{i}=min^{n}

j=1 γ_{j}^{i} (2.23)

3. Calculation of the consequent fuzzy set B^{i,∗} in the ith rule (i.e., assigning the so-called
firing level to the output fuzzy set defined in each rule) as the minimum of the applicability
measure γ^{i} and the fuzzy setB^{i} defined inRi:

B^{i,∗}(y) = min γ^{i}, B^{i}(y)

. (2.24)

4. The summarized conclusion (total fuzzy output) is obtained as the union of allB^{i,∗}
con-sequent fuzzy sets as:

B^{∗}(y) =max^{r}

i=1 B^{i,∗}(y). (2.25)

5. In case of Mamdani architectures, the defuzzification process maps back the output fuzzy
set to crisp domain. One of the common defuzzification techniques is the center of area
(COA) method, which determines the COA of the summarized conclusion fuzzy setB^{∗}(y).

The crisp output is calculated as:

y_{COA}=
R

y∈B^{∗}B^{∗}(y)ydy
R

y∈B^{∗}B^{∗}(y)dy . (2.26)

In case of zero-order Sugeno systems, constant singleton output membership functions
define the conclusion in each rule, i.e., constant (not fuzzy) function y = κ^{i} constitutes
the consequent in the ith rule in equation (2.21) instead of the fuzzy set B^{i}. This
in-creases computational efficiency and enables the computation of the crisp output y0 as
the weighted average over all rule outputs obtained in step 2:

y0 = Pr

i=1κ^{i}·γ^{i}
P_{r}

i=1γ^{i} , (2.27)

whereκ^{i} denotes the consequent (constant) singleton defined in the ith rule.

Crisp

Fuzzification Linguistic control strategy Defuzzification Fuzzy Logic Controller (FLC)

Figure 2.5: Structure of the fuzzy logic controller National (2018).

2.2.2.2 Elaboration of the Control Strategy

The goal is to design a heuristic fuzzy control scheme that drives both wheels through the actuators (DC motors) such a way that the robot can perform the prescribed control task.

The developed fuzzy approach differs from the solutions given by Huang et al. (2011) and Xu et al.(2013a) in both the design and elaboration procedures. Namely, an expert oriented design approach is employed here, which uses those simple heuristic knowledge oriented tools (such as the definition of input-output relations with the help of linguistic variables and simple IF-THEN rules-based observations) that fuzzy logic meant to offer Wang (1997).

The elaboration of the fuzzy control strategy consists of defining the FLCs and a control scheme that satisfies the control requirements. This heuristic procedure starts by aggregating the deductions related to the behavior of the dynamical system using both observations and human common sense. In order to ensure the anti-sway control of the robot the following main deductions shall be implemented with the control scheme.

1. If the speed error (e_{ν}) is positive, then the control voltage (u_{ν}) shall be positive (and
similarly the opposite scenario).

2. Moreover, the control voltage (uν) shall be modified (decreased or limited) in such a way to minimize the IB oscillations.

Based on both the aforementioned deductions and the results of LQG control, a control scheme that consists of three cascade-connected FLCs (hereinafter FLC1, FLC2, and FLC3) is proposed. This control scheme is depicted in Fig. 2.6, where the inputs and outputs of each FLC can be identified. Based on the aggregated initial deductions, both the corresponding input-output ranges and linguistic values are defined.

𝜃_{1}

Figure 2.6: Block diagram of the applied control structure.

The design and tuning of each FLC is performed on an intuitive, heuristic manner. The mem-bership functions related to the control variables are chosen with triangular and trapezoidal shapes, because those are commonly used in fuzzy control design. For the inputs of each FLC, three membership functions are chosen (by iterative tuning), uniformly distributed across their universes of discourse (see Fig. 2.7).

The control scheme is constructed using different PD-type and PI-type FLCs which are
interconnected in cascade way. Table 2.2 summarizes the inference mechanism of the employed
FLCs. Using the fuzzy sets N (negative), P (positive) and Z (zero) the fuzzy rules for the
PD-type and PI-type FLCs are shown in Table 2.3. The exact antecedents and the consequent
related to the tables are defined in the next paragraphs. The proposed architectures execute
weighted average defuzzification. Since, the T_{s} = 0.01 s sampling time in taken into account
(which equals to the sampling time of the applied sensors on the real robot), therefore, as an
example θ_{3,k} denotes the discrete time domain equivalent of the sampled signal θ_{3}(t): θ_{3,k} =
θ_{3}(kT_{s}).

𝑒_{𝜉} deg/s

Figure 2.7: Membership functions of the employed FLCs.

Table 2.2: Properties of the employed controllers.

AND method

OR

method Implication Aggregation Defuzzification

MIN MAX MIN MAX Weighted

average

Table 2.3: Rule base of PD and PI-type FLCs.

PD-type

FLC1 is responsible for the linear speed control of robot. The input (antecedent of each
rule) of the controller is the speed erroreν,k =νd,k−νk, while the output (or consequent) is the
variation of the command voltage ∆u_{ν,k}. As a result of iterative tuning±0.35 ms^{−1} and±3 V
are established for the universes of discourse ofeν and ∆uν, respectively. Since the acceleration
of the robot causes the oscillation of the IB (and we keep in mind that the differential term
increases the sensitivity), a PI-type FLC is employed, whose fuzzy rules are defined in Table
2.3. Moreover, weighted average defuzzification is applied, therefore, the crisp control voltage
uν,k for the speed control of the robot in the kth epoch is defined as:

u_{ν,k} =uν,k−1+
P3

i=1γ^{i}(e_{ν,k})·κ^{i}
P3

i=1γ^{i}(e_{ν,k}) , (2.28)

where γ^{i}(e_{ν,k}) returns the membership degree of the antecedent e_{ν,k} in the ith-rule and κ^{i} is
the singleton consequent.

The aforementioned controller (FLC1) only partly ensures the linear displacement of the
robot. Since the oscillation of the IB is not compensated, therefore the linear speed might
fluctuate. The task of FLC2 is to suppress the IB oscillations. Since oscillation occurs
when-ever the robot accelerates, FLC2 is designed such a way to decrease the control voltage u_{ν}
whenever oscillation is sampled. In this way the acceleration is restricted which results in the
suppression of the oscillation. The inputs of the controller are the oscillation error eθ3,k and
its time derivative e_{ω}_{3}_{,k}, while the output of the controller is the control voltage u_{θ}_{3}_{,k}. The
applied triangular and trapezoidal membership functions are shown in Fig. 2.7. The universes
of discourse of the input variables are defined based heuristic knowledge; for the oscillation error
and its time derivative±15 deg and±220 degs^{−1} ranges are defined, respectively, while for the
output control voltage±0.6 V is established. The employed fuzzy rules define a PD-type FLC
(see Table 2.3). Similarly to FLC1, the crisp output of the controller is calculated using the
weighted average method as:

u_{θ}_{3}_{,k} =
P9

i=1min γ^{i}(e_{θ}_{3}_{,k}), γ^{i}(e_{ω}_{3}_{,k})

·κ^{i}
P9

i=1min (γ^{i}(eθ3,k), γ^{i}(eω3,k)) , (2.29)
where γ^{i}(e_{θ}_{3}_{,k}) andγ^{i}(e_{ω}_{3}_{,k}) are the ith-rule fired membership function values and κ^{i} denotes
the singleton value of the consequent weighting factor of the ith rule (see Fig. 2.7).

FLC3 controls the yaw rate of the robot. The input of the controller is the error e_{ξ,k} =
ξ_{d,k} −ξ_{k}, while the output is the variation of the control voltage ∆u_{ξ,k}. The universes of
discourse of the input and output variables are chosen heuristically as ±30 degs^{−1} and±1.5 V,
respectively. The linguistic variables and membership functions are depicted in Fig. 2.7. By
combining the output with an integrator, as depicted in Fig. 2.6, a PI-type FLC is employed,
whose rule base is given in Table 2.3. The crisp control voltage of FLC3 is given as:

uξ,k =uξ,k−1+ P3

i=1γ^{i}(e_{ξ,k})·κ^{i}
P3

i=1γ^{i}(e_{ξ,k}) . (2.30)

The control voltages of the motors can be identified based on Fig. 2.6:

u1=uν+u_{θ}_{3} −u_{ξ},

u2=uν+u_{θ}_{3} +u_{ξ}. (2.31)

2.2.3 Initial Control Performances