3.2. Swarm-Fuzzy Logic Control Strategy
SFLC adjusts the controller parameters according to the actual situation detected and signal processed by the control system. In this control strategy, the conditions are implemented into fuzzy logic rules that process the data captured by the sensor. Fuzzy inference is then applied, and the actual control parameters can be obtained. The fuzzy logic rules for the inference are captured by PSO, which is used to tune the controller parameters and distinguish fuzzy membership subsets. The PSO is an iterative optimization method based on the population that took its inspiration from observation of biological societies such as a flock of birds, swarms of bees, and schools of fish [
25]. Moreover, PSO has a simple concept and is easy to implement in different optimization problems. In addition, it is possible to control the robustness of its parameters. PSO has few parameters to adjust, and it has a high probability of and efficiency in finding the global optimum. The PSO has a chance of finding the global optimum by providing a wide exploration area in the initial iterations to find the neighbor of the global optima and narrowing the searching space to find the best result [
26,
27]. It causes fast convergence and prevents it from being trapped to the local optimum, which makes it superior to various metaheuristic optimization methods, such as the grey wolf optimizer, whale optimization algorithm, and Jaya algorithm [
28].
Fuzzy logic is divided into three main parts: fuzzification, fuzzy inference machine, and defuzzification. Fuzzification is the input of the fuzzy control system, which produces the fuzzy quantity from the transformation of membership sets for fuzzy inference. Let us define
A as a fuzzy set, with the membership function characterized as follows:
where
Y is the universal base set.
is the subset of set
A, represented as follows:
There are several common types of membership functions, including triangular, trapezoidal, and Gaussian, and their graphs have different shapes.
The fuzzy inference machine synthesizes the obtained data from fuzzification and the defined linguistic if-and-then rules. The fuzzy inference is the kernel of fuzzy logic that processes the antecedent as the input by linguistic rules and concludes the consequent output.
Defuzzification is the process of converting the linguistic results of fuzzy inference to the actual quantitative and reasonable crisp values as the output of the fuzzy logic control. This can be achieved by various methods, such as the center of gravity, weighted average, the center of the largest area, and centroid methods. The control law for SLFC controller is given as follows:
where
is the controller parameter and
s represents the sliding filtered steady-state error as follows:
where
is the symmetric positive constant gain matrix;
e and
are steady-state error and its derivative as follows:
where
r and
x are the desired and actual angular trajectories. The tuning of controller parameters
and
are defined as the optimization problem and solved by PSO. The objective function of the optimization problem is integral time absolute error (ITAE) for the closed-loop control system, in which the controller is shown in Equation (13) and the plant is the hip and knee mathematical models. The objective function is expressed as follows:
where
t is elapsed time. Each particle of the PSO consists of design variables of controller parameters
and
. The initial particles are filled by random values between zero and one.
where
j and
are the number and maximum quantity of particles. The objective function is determined for each particle for evaluation. The minimum one is selected as the best particle, denoted as
p. The particles of the next generations are created by the summation of the current particle and the velocity of each particle, expressed as follows:
where
i is the number of iterations;
carries the velocity and direction of each particle toward the particles of the next iteration [
29]. The value of
is given as follows:
where
is positive constant of inertial weight, and
and
are self and social recognition positive constants;
g represents the best global particle determined after evaluation of particles in each iteration in comparison with the best particle
p;
is a random value between 0 and 1. The particles captured as global best
g of the last iteration are the optimal output of the algorithm.
The parameters of the PSO is expressed in
Table 2.
To tune the controller parameters
and
, the noted optimum problem is solved by PSO and compared by GA and beetle antennae search (BAS). The elapsed time is 10 s and the time step is 0.1 s. The population and generation numbers for GA and BAS are 20 and 200, respectively.
Table 3 compares numerical analysis of PSO and GA in the unit step response closed-loop control system for an LLAR hip joint.
The average of ITAE driven by PSO for ten different runs are 34.8% and 63.13% less than GA for hip and knee, respectively. Moreover, this value for PSO is 18% and 56% lower than BAS for hip and knee, respectively. Therefore, the controller parameters tuned by PSO are selected. The p-value comes from the ANOVA test for the ITAE of ten different running by PSO and GA. The p-value is lower than 0.005, which shows the ITEA for ten different runs is not repetitive.
Therefore, in the real-time control of the LLAR, the controller parameters and are chosen as follows:
is the constant value tuned by PSO. Its average values in
Table 3 are selected for hip and knee, which are 0.88 and 0.76, respectively.
is the output of the fuzzy inference. It is determined by the linguistic rules of the fuzzy controller based on its maximum and minimum obtained by PSO in
Table 3, which are 6.82 and 1.32 for hip and 6.95 and 2.64 for knee.
The parameter
is the output of the fuzzy inference by the linguistic rules and fuzzy sets. Five subsets are defined for
defuzzification membership function such as ZE, PS, PM, PB, and PL, in which their ranges are determined based on minimum and maximum of
driven by PSO, given as follows:
where
T represents the defuzzification subsets;
n denotes the number of defuzzification subsets; and
is the defuzzification subsets range step, expressed as follows:
The linguistic fuzzy logic rules are defined based on sliding filtered error
s and its derivative, as expressed in
Table 4. Defuzzification subsets are as: Zero (ZE), Positive Small (PS), Positive Medium (PM), Positive Big (PB), and Positive Large (PL).
The fuzzy logic rules are defined as follows:
where
and
are the input fuzzy subsets labels; and
represents output fuzzy subsets. Particularly, there are two examples of the fuzzy logic rules, written as follows:
The center of gravity technique and Zadeh fuzzy synthesis method are employed for fuzzy defuzzification [
30]. Pseudo code of SLFC is illustrated in Algorithm 2.
Algorithm 2 Pseudo code of SLFC |
- 1:
Input variables: , , , and - 2:
_________________________________________________________ - 3:
Output variables: , , and ; - 4:
_________________________________________________________ - 5:
Start; - 6:
Initialize particles by random values; - 7:
Evaluate initial population; - 8:
Select the initial p; - 9:
while (Number of iteration less than ) do; - 10:
Create new iteration; - 11:
Update velocity and position; - 12:
Select the p; - 13:
if p less than the previous g then; - 14:
Store it as g; - 15:
end if - 16:
end while - 17:
Select the particle of g as the result; - 18:
Determine for control law; - 19:
Set fuzzification and defuzzification linguistic rules; - 20:
Set fuzzification membership function for s and ; - 21:
Determine based on the results of PSO; - 22:
Implement the defuzzification membership function for ; - 23:
End.
|
Figure 4 and
Figure 5 illustrate membership functions for input and output for the SLFC for the hip.
3.3. Lyapunov Adaptive Control Strategy
LAC is defined to guarantee the stability of the non-linear dynamic system by the Lyapunov approach. It is mainly used in the control system to improve robustness in the presence of external forces. To clarify, consider the case that the LLAR is worn by the human object, hence the desired torque should be generated to minimize the steady-state-error
e thus the auxiliary variable
x converges to zero [
31,
32].
Theorem 1. Consider a non-linear dynamic system,where f is a Lipschitz function. Consider a function , which is a positive definite function and is a Lipschitz gradient. The Lyapunov function for a system is considered as follows [33]: Such a system is stable if the Lyapunov function V exists and its derivative is negative definite.
Proof. By considering Equation (9), the state-space variables are assumed as follows:
Therefore, the time-invariant vector differential of LLAR mathematical model is given as follows:
the control law is selected to observe the reference and output of the control system given as follows:
Here, the candidate Lyapunov function is chosen as follows:
where
P is a positive definite matrix used to simplify algebra without any loss of generality;
is the transpose of Equation (31); and
is the adaptation gain matrix, which is positive definite. Differentiating Equation (33) over time, it can be obtained,
where
and
, in which
and
are the estimation of controller parameters. Therefore,
from Equation (31),
Substituting Equation (31) into Equation (34), we can get,
Substituting Equation (32) into Equation (38) and simplifying, it can be given
It is assumed for a given positive-definite matrix Q, there is a positive-definite solution P such that . Thus, if the expressions and converge to zero, the differential of Lyapunov function will be , which is the negative, and Theorem 1 is satisfied.
Therefore, the parameters of controller are given as follows:
By applying the time domain integral of Equations (41) and (40), the parameters of the adaptive control system are represented as follows:
where
and
are the unknown parameters, which are determined by optimal tuning by PSO. The objective function of the PSO is ITAE, which is determined in the closed-loop control system by the control law given in Equation (32). The design variables are the two control parameters. The parameters of PSO are shown in
Table 2.
Table 5 compares the optimal results for
and
determined by PSO, GA, and BAS. The population and generation numbers for GA and BAS are 20 and 200, respectively.
The average of ITAE determined by PSO for ten different runs is 32.14% and 69.4% less than GA for hip and knee, respectively. This value for PSO is 50% and 71.1% lower than BAS. Hence the optimal results that have the lowest ITAE established by PSO for hip and knee are selected as and .