Abstract
Since the non-singleton fuzzy logic controllers (NFLCs) can effectively reflect the uncertainty brought by the inputs, they are used for balance control and position control of the mobile two-wheeled self-balancing robot (MTWSBR) in this paper. The similarity between the inputs and the antecedent fuzzy sets as the firing strength, that is, the similarity-based non-singleton fuzzy logic controller (Sim-NFLC), is proposed to deal with the problem of information loss caused by the standard non-singleton fuzzy logic controller (Sta-NFLC) in terms of the interaction of the inputs and antecedents. A comparative study among singleton fuzzy logic controllers (SFLCs), Sta-NFLCs and Sim-NFLCs, and interval type-2 fuzzy logic controllers (IT2FLCs) and general type-2 fuzzy logic controllers (GT2FLCs) are also shown. The simulation results show that the performance of Sim-NFLCs is better than that of SFLCs and Sta-NFLCs. The similarity-based general type-2 fuzzy logic controller (Sim-NGT2FLC) gets the best performance in handling the input uncertainty.
Keywords
Introduction
Mobile robot system is a typical multi-variable, nonlinear, naturally unstable system [1–3]. Mobile two-wheeled self-balance robot (MTWSBR) has been developed rapidly, because it has been widely used in our daily life. In real applications, the MTWSBR is affected by environmental disturbances and parameter perturbations. Sensor measurements may appear numbers of uncertainties, incompleteness and possibly inaccurate information [4, 5]. Therefore, the ability of deal with uncertainties becomes an indispensable module for the MTWSBR.
Fuzzy logic controllers (FLCs) have excellent performance in terms of dealing with uncertainty, and is widely used in nonlinear systems [5–8]. Many FLCs have been applied to control the balance and position of the MTWSBR in previous papers, which mainly are singleton fuzzy logic controllers (SFLCs) [9–13]. The singleton fuzzifier maps a clear value to a fuzzy singleton number [14] (When x = x′, μ (x) =1; when x ≠ x′, μ (x) =0). The SFLC is simple and impersonal, but cannot handle the uncertainties in inputs well. Therefore, the expected performance can not implemented by the SFLC in a closed-loop system with measurement noises.
Non-singleton fuzzy logic controller (NSFLC) is an extension of the SFLC. The input signal is blurred into a fuzzy set (FS) rather than a clear value (When x = x′, μ (x) =1; when x ≠ x′, μ (x) ≠0). Therefore, the performance of NSFLC is superior to the SFLC in the face of multiple uncertainties [5, 15]. In recent years, the general type-2 fuzzy logic controller (GT2FLC) has obtained some results in theory and application: [16] uses GT2FLC to process dynamic uncertainty for synchronization of uncertain fractional order chaotic systems; GT2FLC has been applied to control a mobile robot in [17], which achieved better results than traditional fuzzy control; [18] studies on forecasting problems based on the data of torque and revolutions per minute (rpm) of permanent magnetic drive by general type-2 fuzzy logic systems, etc. The interval type-2 fuzzy logic controller (IT2FLC) outperforms the type-1 fuzzy logic controller (T1FLC), especially under different kinds of uncertainties. General type-2 fuzzy set (GT2FS), as an extension of interval type-2 FS, can better handle real systems with uncertainty. Therefore, the GT2FLC obtain better performance than that of the IT2FLC [17, 19–24]. Compared with the type-1 FS and interval type-2 FS, the degrees of freedom of GT2FS have been expanded. Therefore, it has potential advantages in dealing with uncertain complex system. Compared with the non-singleton T1FLC and the non-singleton IT2FLC, the non-singleton GT2FLC (NGT2FLC) may provide better performance in the presence of input uncertainties, but few works have been implemented in the design of NGT2FLC. Therefore, designing NGT2FLC is still major significant and challenging for practical systems.
Besides the fuzzifier, the NSFLC has the same structure as the SFLC. In the inferencing of fuzzy logic systems, the firing strengths are obtained by interacting between the inputs and antecedent membership functions (MFs). Standard NFLC (Sta-NFLC) is most commonly used. The firing strength of Sta-NFLC is determined by the maximum membership grade of the intersection between the inputs and antecedent MFs. However, using the maximum point of the intersection to determine the firing strength results in a large amount of information loss between the inputs and the antecedent MFs [5, 25].
Aiming at these problems, this paper proposes similarity-based NGT2FLC (Sim-NGT2FLC) to adjust the balance and position of the MTWSBR. In this approach, the firing strength of each rule is calculated by the similarity between the inputs and antecedent FSs. Sim-NGT2FLC can better handle uncertainty to improve the position control of MTWSBR in an unknown environment.
The main academic contributions of the paper are provided as follows: A similarity-based general type-2 T-S fuzzy logic model is used to approximate the mathematical model of MTWSBR for enhancing the system’s ability to handle input uncertainties. Sim-NGT2FLC is first applied to adjust the balance and position of MTWSBR simultaneously in the presence of uncertainties. A large number of comparative studies between SFLCs, Sta-NFLCs and Sim-NFLCs, and IT2FLCs and GT2FLCs are implemented. Simulation results show that the effectiveness of the proposed Sim-NGT2FLC for the MTWSBR.
The structure of this paper is as follows. Section II mainly introduces the GT2FS. Section III briefly introduces the structural composition of the GT2FLC and the definition of the firing strength; Section IV presents the dynamic model of MTWSBR and the balance and position Sim-NGT2FLCs of MTWSBR. In section V, the corresponding simulation results and discussions are presented. Section VI draws conclusions and provides the direction of future work.
General type-2 fuzzy set
Figure 1 shows the three-dimensional and top view of the GT2FS. GT2FSs are 3-D MF whose secondary MFs are type-1 FSs. The secondary membership degree is

General type-2 fuzzy set. (a) Three-dimensional representation; (b) top view.
The vertical slice of a GT2FS is shown in Fig. 2. The corresponding of the vertical slice to each x is described as:

Vertical slice representation of a GT2FS.
The α-cut (α ∈ [0, 1]) of the secondary MF
In the formula (3), the interval [a
α
(x) , b
α
(x)] is located on the y axis. We can also combine each slice to get the 3-D general type-2 MF (GT2MF) (
With formula (4), we can get the horizontal slice representation of a GT2FS.
The horizontal slice can be regarded as an IT2FS whose secondary membership degree is equal to α (instead of 1 as standard IT2FS). Thus it not only can simplify the computational but can use all the calculations of IT2FSs to deal with GT2FSs [28–30]. Therefore, the horizontal slice is used in this paper.
Common shapes of the secondary MFs are triangle and symmetrical trapezoid [27, 31]. This paper uses triangle as the secondary MF.
It can be observed from Fig. 4 that the two triangle base angle points of the secondary MF are respectively located in the UMF (

Horizontal slice representation of a GT2FS.

Horizontal slice representation of a GT2FS.
When w = 0, the secondary MF is a right-angled triangle whose right angled is perpendicular; when w = 1/2, the secondary MF is an isosceles triangle; when w = 1, the secondary MF is a left-angled triangle whose left angled is perpendicular. The α-cut
This section will briefly introduce the background material, including the structural composition of a GT2FLC and two methods of obtaining the firing strength (standard method and similarity-based method).
Structural composition of a GT2FLC
Figure 5 shows the structure diagram of a GT2FLC, which includes five modules as follows:
Fuzzifier: The general type-2 non-singleton fuzzifier maps the input x = x′ into a general type-2 fuzzy number, which is a GT2MF associated with the input. The secondary MF of the GT2MF is a type-1 MF, and the FOU of each α-plane is an interval type-2 MF. The FOU of a standard GT2MF is a type-1 MF when α = 1 [14].
As shown in Fig. 6, according to the type of blurring, four fuzzifiers of the GT2FLC are built: singleton fuzzifier, type-1 non-singleton fuzzifier, interval type-2 non-singleton fuzzifier and general type-2 non-singleton fuzzifier.
Fuzzy rule: IF-THEN rules are commonly used. Suppose there is p inputs for x = [x1, . . . , x
p
] ∈ X, an output of y ∈ Y, and M rules, where the lth rule is as follows [16]:
Inference engine: it combines fuzzified inputs with IF-THEN rules using a t-norm to get the firing strength.
Type-reduction: the inference output GT2FS by calculating the center of gravity is converted into a type-1 FS.
Defuzzifier: defuzzification combines all activated output sets in a way to get a clear output value.

Structure diagram describing a GT2FLC.

Different types of fuzzifier. (a)singleton fuzzifier; (b) type-1 non-singleton fuzzifier; (c) interval type-2 non-singleton fuzzifier; (d) General type-2 non-singleton fuzzifier.
In this section, two approaches for determining the firing strength are briefly introduced, namely the standard method and the similarity-based method. In most practical applications, input data is usually corrupted by noise. Therefore, capturing noise (uncertainty) becomes especially important.
Suppose there are two given FSs, A (transform the input data x into a non-singleton MF) and B (for the antecedent MF). (α ∈ [0, 1])
The standard reasoning method is most common in the design of FLC. As can be observed in Fig. 7, the firing strength of Sta-NFLC is determined by the maximum membership degree grade of the intersection between the inputs and antecedent MFs [8, 14]. When x = x′, the firing strengths of lth rule with the secondary membership degree α are as follows:
Among them, The upper and lower firing strengths of the lth rule under α level are
Recent literature indicates that the standard method not only results in substantial information loss in terms of the interaction of the inputs and antecedent MFs, but is unable to separate of input uncertainty and linguistic antecedent uncertainty [5, 25]. Aiming at these problems, this paper shows two examples in Figs. 7 and 8. From the two figures, we can see that two different degrees of fuzzy input X1 (dark red) and X2 (light red) interact with the same antecedent MF A (yellow), and different firing strengths are expected. However, the result shows two firing strengths are equal with the standard method to determine the firing strengths. Even if large difference exists among the input and the antecedent MF in Fig. 8, the firing strengths of standard method are 1. Through the above two cases, the magnitude of the firing strength ignores the uncertainty brought by the input in some special cases. In other words, the input uncertainties are not reflected in the firing strenth and act on the system output.

The intersection of two different input fuzzy sets X1 and X2 with a single antecedent fuzzy set A.

The intersection of two different input fuzzy sets X1 and X2 with a single antecedent fuzzy set A. Note that the firing strengths for the standard NSFLS approach are equal to one.
Based on the above discussions, using the maximum point of the intersection to determine the firing strength results in a large amount of information loss between the inputs and the antecedent MFs and imprecise firing strength is likely to appear. The standard inference method may not necessarily be the best choice in terms of capturing the interaction between inputs and antecedent FSs with the highest fidelity possible [15]. In order to improve this problem, the similarity-based inference method is used in this paper. In this approach, the firing strength of each rule is calculated by the similarity between the inputs and antecedent FSs instead of being calculated by the standard approach.
Similarity is often used on FSs to measure the similarity degree between two FSs [15, 43]. Similarity function s: A × B ⟶ [0, 1], where A and B are the same type of FS. It must satisfy the following four attributes [15, 33]: Reflexivity: Symmetry: Overlapping: if Transitivity: if
This paper adopts the ZXLD similarity measure function for GT2FSs [33]. This similarity measure function first defined the similarity between two GT2FSs as a Type-1 FS [34]. When x = x′, in the lth rule, the similarity is shown in formula (10). In the discrete domain, formula (11) can be obtained, where n is the number of discretization levels (we set n = 100).
Main results
For further analysis the performance of the proposed Sim-NGT2FLC, it is used to adjust the balance and position of the MTWSBR.
Mathematical model of the MTWSBR and similarity-based GT2 T-S fuzzy modeling
Let the state variable be
The distance from the wheel axle to the center of gravity is l = 0.0622m; The moment of inertia of the body about the Y axis is n
yb
= 0.00128kg · m2; The moment of inertia of each wheel about its axis is n
wa
= 0.00014kg · m2; τ
i
is the combination of measurement uncertainties and external disturbances of the system (i = 1, 2, 3). Referring to [36], we can get the mathematical model of the MTWSBR, as shown in (12).
It can be seen from formula (12) that the nonlinearity of the system is caused by sine and cosine functions. The nonlinearity can be eliminated by locally approximating (let x1 reaching 0 and
Figure 9 shows the 3-D GT2MFs of the antecedent X
i
. The mathematical expression of the secondary MF is shown in formula (6). It can be seen that the two upper and lower membership functions of the antecedents are complementary to reduce the computational complexity and facilitate analysis. The standard firing interval and similarity-based firing interval can be obtained according to the formula (9) and formulas (10)-(11), respectively. The expressions of the antecedents of the general type-2 T-S fuzzy model are as follows:

The antecedents of the general type-2 T-S fuzzy model. (a) Horizontal slice representation; (b) Three-dimensional representation.
In order to directly get the clear output and reduce the complexity of the type-reduction calculation, the N-T defuzzification method [36, 42] is used for the GT2 T-S fuzzy model in this paper.
Compared with the existence results [36, 44–47], this paper proposes a similarity-based general type-2 T-S fuzzy model. With similarity reasoning, the corresponding calculation expression of firing strength has been improved.
Figure 10 shows the overall control diagram of the MTWSBR, where the balance controller and position controller use respectively the similarity-based general type-2 T-S fuzzy model and the similarity-based general type-2 Mamdani fuzzy model [36].

Overall control diagram for the MTWSBR.
The fuzzy rules of the similarity-based general type-2 balance controller are as follows:
It is noted that the firing strengths are obtained by the similarity between the inputs and antecedent FSs. Substituting formula (15) into (14), we can get the formula (16). U i is the local feedback gains. It can be obtained by Lyapunov stability theory. The detailed process to solve U i is similar to [36, 40]. When U i is determined, the singleton general type-2 balance controller is extended the similarity-based general type-2 balance controller.
The Mamdani fuzzy rules for the similarity-based general type-2 position controller are as follows:

FOU of the antecedents and consequents. (a) Three-dimensional representation; (b) top view.
Ranges of the input and output variables
The rules in Table 2 have been shown in the literature [36]. Compared with the existing results [36, 47], the similarity reasoning algorithm is used for the balance and position controllers in this paper. [36] has used singleton IT2FLC. [47] has used the standard firing interval. However, the general type-2 fuzzy logic, non-singleton fuzzifier and similarity reasoning algorithm have been applied to improve the existing results. It has ability to get better control results.
Fuzzy rules of the GT2FLCs for position control
When only the balance controller is working, initial state is set to x0 = [0.48, 0, 0, 0] T , and the control performance of SGT2FLC, Sta-NGT2FLC and Sim-NGT2FLC are contrasted.
It can be seen from Figs. 12 and 13 that, compared with SGT2FLC and Sta-NGT2FLC, Sim-NGT2FLC has high response speed, high stability and good control effect.

The balance control only without random disturbance.

The balance control only with random disturbances in the control variable.
When the balance and position controllers are tested together, the expected position is selected as D d = 0.7. To illustrate the effectiveness of the controller proposed in this paper, a comparative study between SGT2FLC, Sta-NGT2FLC and Sim-NGT2FLC, and Sim-NGT2FLC and Sim-NIT2FLC is also shown.
In order to visually display the performance of different FLCs, the performance indicators, including ISE,IAE and ITAE, are used in this paper [48–50]. The performance indicators under different cases are computed in Tables 3–6. In these tables, b is the inclination angle error of the balance controllers, and p is the position error of the position controllers.
Performance index results of the IT2FLCs with different firing strength methods
Performance index results of the GT2FLCs with different firing strength methods
Performance index results of the GT2FLCs using different firing strength methods with impulse noise
Performance index results of the Sim-GT2FLC and Sim-IT2FLC for the position control with impulse noise
It can be observed from Figs. 14–18 and Tables 3–6 that the Sim-NFLCs are faster to reach the desired position in comparison to the SFLCs and the Sta-NFLCs. Comparing the results of the Sim-NGT2FLC and the Sim-NIT2FLC, it can be seen obviously that the Sim-NGT2FLC is more rapid to reach the desired position and has better control performance. In the 6th second, the impulse noise (width is 0.1s and amplitude is 1) is added to the state x1. For the impulse noise, the result of the SGT2FLC is divergent and cannot be stabilized; The adjustment time under the Sim-NGT2FLC is less than that under the Sta-NGT2FLC and the Sim-NT2FLC. Observing the error integration of the position, the Sim-NFLCs have the smallest error integral by lateral correlation; the Sim-NGT2FLC has the smallest error integral by longitudinal comparison.

Results of the GT2FLCs using different firing strength methods.

Results of the GT2FLCs using different firing strength methods with impulse noise (width is 0.1s and amplitude is 1).

Results of the IT2FLCs using different firing strength methods.

Compare Sim-NGT2FLC with Sim-NIT2FLC for the position control.

Compare Sim-NGT2FLC with Sim-NIT2FLC for the position control with impulse noise (width is 0.1s and amplitude is 1).
In summary, all the results show that, when there are input uncertainties, the Sim-NFLC is much more stable and more rapid to reach the desired position. Meanwhile, the Sim-NGT2FLC proposed in this paper is feasible and effective by the above simulation results.
In this paper, a Sim-GT2FLC is proposed to adjust the balance and position of the MTWSBR. In order to reduce information loss in terms of the interaction of the inputs and antecedents as possible, the firing strength of each rule is calculated by using the similarity between the inputs and the antecedent FSs rather than the maximum of their intersection. The simulation results show that, in the presence of input uncertainties, the Sim-NFLCs can obtain superior control performance compared to the Sta-NFLCs. By comparing with the control performance of the Sim-NIT2FLC and other controllers, the Sim-NGT2FLC in this paper shows the superiority to control the MTWSBR.
In future work, we will focus on reducing the complexity of the NGT2FLCs and improving the ability to deal with higher-level uncertainties. Moreover, it is very important to verify the proposed method by experiments.
Footnotes
Acknowledgment
This work is supported by the National Key R&D Program of China (2018YFB1307402) and the National Natural Science Foundation of China (61703291).
