MGA-based Inverse and Forward NARX Fuzzy Model Parameters used for encoding.

## 1. Introduction

The PAM robot arm is belonged to highly nonlinear systems where perfect knowledge of their parameters is unattainable by conventional modeling techniques because of the time-varying inertia, hysteresis and other joint friction model uncertainties. To guarantee a good tracking performance, robust-adaptive control approaches combining conventional methods with new learning techniques are required. Thanks to their universal approximation capabilities, neural networks provide the implementation tool for modeling the complex input-output relations of the multiple *n* DOF PAM robot arm dynamics being able to solve problems like variable-coupling complexity and state-dependency. During the last decade several neural network models and learning schemes have been applied to on-line learning of manipulator dynamics (Karakasoglu et al., 1993), (Katic et al., 1995). (Ahn and Anh, 2006a) have optimized successfully a pseudo-linear ARX model of the PAM robot arm using genetic algorithm. These authors in (Ahn and Anh, 2007) have identified the PAM manipulator based on recurrent neural networks. The drawback of all these results is considered the *n*-DOF robot arm as *n* independent decoupling joints. Consequently, all intrinsic coupling features of the *n*-DOF robot arm have not represented in its recurrent NN model respectively.

To overcome this disadvantage, in this study, a new approach of intelligent dynamic model, namely MISO NARX Fuzzy model, firstly utilized in simultaneous modeling and identification both joints of the prototype 2-axes pneumatic artificial muscle (PAM) robot arm system. This novel model concept is also applied to (Ahn and Anh, 2009) by authors.

The rest of chapter is organized as follows. Section 2 describes concisely the genetic algorithm for identifying the nonlinear NARX Fuzzy model. Section 3 is dedicated to the modeling and identification of the 2-axes PAM robot arm based on the MISO NAR Fuzzy model. Section 4 presents the experimental set-up configuration for MISO NARX Fuzzy model-based identification. The results from the MISO NARX Fuzzy model-based identification of the 2-axes PAM robot arm are presented in Section 5. Finally, in Section 6 a conclusion remark is made for this paper.

## 2. Genetic algorithm for NARX Fuzzy Model identification

The classic GA involves three basic operations: reproduction, crossover and mutation. As to derive a solution to a near optimal problem, GA creates a sequence of populations which corresponds to numerical values of a particular variable. Each population represents a potential solution of the problem in question. Selection is the process by which chromosomes in population containing better fitness value having greater probability of reproducing. In this paper, the roulette-wheel selection scheme is used. Through selection, chromosomes encoded with better fitness are chosen for recombination to yield off-springs for successive generations. Then natural evolution (including Crossover and Mutation) of the population will be continued until a desired termination or error criterion achieved. Resulting in a final generation contained of highly fitted chromosomes represent the optimal solution to the searching problems. Fig. 1 shows the procedure of conventional GA optimization.

It needs to tune following parameters before running the GA algorithm:

*D*: number of chromosomes chosen for mating as parents

*N* : number of chromosomes in each generation

*L*_{t}: number of generations tolerated for no improvement on the value of the fitness before MGA terminated

*L*_{e}: number of generations tolerated for no improvement on the value of the fitness before the extinction operator is applied. It need to pay attention that

*q*: percentage of chromosomes are survived according to their fitness values in the extinction strategy

The steps of MGA-based NARX Fuzzy model identification procedure are summarized as:

Implement tuning parameters described as above. Encode estimated parameters into genes and chromosomes as a string of binary digits. Considering that parameters lie in several bounded region

_{k}

The length of chromosome needed to encode w_{k} is based on _{k} and the desired accuracy _{k}. Set i=k=m=0.

Generate randomly the initial generation of N chromosomes. Set i=i+1.

Decode the chromosomes then calculate the fitness value for every chromosome of population in the generation. Consider ^{th} generation.

Apply the Elitist strategies to guarantee the survival of the best chromosome in each generation. Then apply the G-bit strategy to this chromosome for improving the efficiency of MGA in local search.

Reproduction: In this paper, reproduction is set as a linear search through roulette wheel values weighted proportional to the fitness value of the individual chromosome. Each chromosome is reproduced with the probability of

with j being the index of the chromosome (j=1,…,N). Furthermore, in order to prevent some strings possess relatively high fitness values which would lead to premature parameter convergence, in practice, linear fitness scaling will be applied.

Crossover: Choose D chromosomes possessing maximum fitness value among N chromosomes of the present gene pool for mating and then some of them, called best chromosomes, are allowed to survive into the next generation. The process of mating D parents with the crossover rate p_{c} will generate (N-) children. Pay attention that, in the identification process, it is focused the mating on parameter level rather than on chromosome level.

Mutation: Mutate a bit of string (_{m}.

Compare if

Compare if k=L_{e}, then apply the extinction strategy with k=0.

Compare if m=L_{t}, then terminate the MGA algorithm; otherwise go to Step 3.

Fig. 2 shows the procedure of modified genetic algorithm (MGA) optimization.

## 3. Identification of the 2-Axes PAM robot arm based on MISO NARX fuzzy model

### 3.1. Assumptions and constraints

Firstly, it is assumed that symmetrical membership functions about the y-axis will provide a valid fuzzy model. A symmetrical rule-base is also assumed. Other constraints are also introduced to the design of the MISO NARX Fuzzy Model (MNFM).

All universes of discourses are normalized to lie between –1 and 1 with scaling factors external to the DNFM used to give appropriate values to the input and output variables.

It is assumed that the first and last membership functions have their apexes at –1 and 1 respectively. This can be justified by the fact that changing the external scaling would have similar effect to changing these positions.

Only triangular membership functions are to be used.

The number of fuzzy sets is constrained to be an odd integer greater than unity. In combination with the symmetry requirement, this means that the central membership function for all variables will have its apex at zero.

The base vertices of membership functions are coincident with the apex of the adjacent membership functions. This ensures the value of any input variable is a member of at most two fuzzy sets, which is an intuitively sensible situation. It also ensures that when a variable’s membership of any set is certain, i.e. unity, it is a member of no other sets.

Using these constraints the design of the DNFM input and output membership functions can be described using two parameters which include the number of membership functions and the positioning of the triangle apexes.

### 3.2. Spacing parameter

The second parameter specifies how the centers are spaced out across the universe of discourse. A value of one indicates even spacing, while a value larger than unity indicates that the membership functions are closer together in the center of the range and more spaced out at the extremes as shown in Fig.3. The position of each center is calculated by taking the position the centre would be if the spacing were even and by raising this to the power of the spacing parameter. For example, in the case where there are five sets, with even spacing (p =1) the center of one set would be at 0.5. If p is modified to two, the position of this center moves to 0.25. If the spacing parameter is set to 0.5, this center moves to (0.5)^{0.5} = 0.707 in the normalized universe of discourse. Fig. 3 presents Triangle input membership function with spacing factor = 0.5.

### 3.3. Designing the rule base

As well as specifying the membership functions, the rule-base also needs to be designed. Again idea presented by Cheong in was applied. In specifying a rule base, characteristic spacing parameters for each variable and characteristic angle for each output variable are used to construct the rules.

Certain characteristics of the rule-base are assumed in using the proposed construction method:

Extreme outputs more usually occur when the inputs have extreme values while mid-range outputs generally are generated when the input values are mid-range.

Similar combinations of input linguistic values lead to similar output values.

Using these assumptions the output space is partitioned into different regions corresponding to different output linguistic values. How the space is partitioned is determined by the characteristic spacing parameters and the characteristic angle. The angle determines the slope of a line through the origin on which seed points are placed. The positioning of the seed points is determined by a similar spacing method as was used to determine the center of the membership function.

Grid points are also placed in the output space representing each possible combination of input linguistic values. These are spaced in the same way as before. The rule-base is determined by calculating which seed-point is closest to each grid point. The output linguistic value representing the seed-point is set as the consequent of the antecedent represented by the grid point. This is illustrated in Fig. 4a, which is a graph showing seed points (blue circles) and grid-points (red circles). Fig. 4b shows the derived rule base. The lines on the graph delineate the different regions corresponding to different consequents. The parameters for this example are 0.9 for both input spacing parameters, 1 for the output spacing parameter and 45 for the angle theta parameter.

### 3.4. Parameter encoding

To run a MGA, a suitable encoding for each of the parameters and bounds for each of them needs to be carefully decided. For this task the parameters given in Table 1 are used with the shown ranges and precisions. Binary encoding is used as it is felt that this allows the MGA more flexible to search the solution space more thoroughly. The numbers of membership functions are limited to the odd integers inclusive between (3 – 9) in case MGA-based PAM robot arm Inverse and Forward TS fuzzy model and between (3–5) in case MGA-based PAM robot arm Inverse and Forward NARX Fuzzy model identification. Experimentally, this was considered to be a reasonable constraint to apply. The advantage of doing this is that this parameter can be captured in just one to two bits per variable.

For the spacing parameters, two separate parameters are used. The first, within the range [0.1– 1.0], determines the magnitude and the second, which takes only the values –1 or 1, is the power by which the magnitude is to be raised. This determines whether the membership functions compress in the center or at the extremes. Consequently, each spacing parameter obtains the range [0.1 – 10]. The precision required for the magnitude is 0.01, meaning that 8 bits are used in total for each spacing parameter. The scaling for the input variables is allowed to vary in the range [0 – 100], while that of the output variable is given the range [0 – 1000].

Parameter | Range | Precision | No. of Bits |

Number of Membership Functions | 3-9 | 2 | 2 |

Membership Function Spacing | 0.1 – 1.0 | 0.1 | 7 |

Membership Function | -1 - 1 | 2 | 1 |

Rule-Base Scaling | 0.1 – 1.0 | 0.01 | 7 |

Rule-Base Spacing | -1 - 1 | 2 | 1 |

Input Scaling | 0 - 100 | 0.1 | 10 |

Output Scaling | 0 - 1000 | 0.1 | 17 |

Rule-Base Angle | 0 - 2π | π/512 | 11 |

### 3.5. Inverse and forward MISO NARX fuzzy models of the 2-Axes PAM robot arm

The newly proposed Inverse and Forward MISO NARX Fuzzy model of the PAM robot arm presented in this paper is improved by combining the extraordinary predictive and adaptive features of the Nonlinear Auto-Regressive with eXogenous input (NARX) model structure. The resulting model established a nonlinear relation between the past inputs and outputs and the predicted output, the system prediction output is combination of system output produced by real inputs and system historical behaviors. It can be expressed as:

Here, n_{a} and n_{b} are the maximum lag considered for the output, and input terms, respectively, n_{d} is the discrete dead time, and f represents the mapping of fuzzy model.

The structure of the newly proposed MISO NARX TS fuzzy model is that this MISO NARX TS fuzzy model interpolates between local linear, time-invariant (LTI) ARX models as follows:

Rule j: if z_{1}(k) is A_{1,j} and … and z_{n}(k) is A_{n,j} then

where the element of z(k) “scheduling vector” are usually a subset of the x(k) regressors that contains the variables relevant to the nonlinear behaviors of the system,

while the f_{j}(q(k)) consequent function contains all the regressor q(k)=[X(k) 1],

In the simplest case, the NARX type zero-order TS fuzzy model (singleton or Sugeno fuzzy model which is not applied in this paper) is formulated by simple rules consequents as:

Rule j: if z_{1}(k) is A_{1,j} and … and z_{n}(k) is A_{n,j} then

with the z(k) contains all inputs of the NARX model:

Thus the difference between NARX fuzzy model and Fuzzy TS model method is that the output from Inverse TS fuzzy model is linear and constant, and the output from Inverse NARX fuzzy model is NARX function. But they have same fuzzy inference structure (FIS).

The block diagrams presented in Fig. 5a and Fig. 5b illustrate the difference between the MGA-based PAM robot arm Inverse MISO TS Fuzzy model and the MGA-based PAM robot arm Inverse MISO NARX Fuzzy model identification. Forwardly, the block diagrams presented in Fig. 5b and Fig.5c illustrate the difference between the MGA-based PAM robot arm Inverse MISO NARX11 Fuzzy model identification and Inverse MISO NARX22 Fuzzy model identification.

Likewise, the block diagrams presented in Fig. 6a and Fig. 6b illustrate the difference between the MGA-based PAM robot arm Forward MISO TS Fuzzy model and the MGA-based PAM robot arm Forward MISO NARX Fuzzy model identification. Forwardly, the block diagrams presented in Fig. 6b and Fig.6c illustrate the difference between the MGA-based PAM robot arm Forward MISO NARX11 Fuzzy model identification and Forward MISO NARX22 Fuzzy model identification.

## 4. Identification of inverse and forward MISO NARX fuzzy models

The schematic diagram of the prototype 2-Axes PAM robot arm and the block diagram of the experimental apparatus are shown in Fig.7 and Fig. 8.

In general, the procedure which must be executed when attempting to identify a dynamical system consists of four basic steps (Fig. 9).

To realize Step 1, Fig. 10 presents the PRBS input applied simultaneously to the 2 joints of the tested 2-axes PAM robot arm and the responding joint angle outputs collected from both of them. This experimental PRBS input-output data is used for training and validating not only the Forward MISO NARX Fuzzy model (see Fig. 10a) but also for training and validating the Inverse MISO NARX Fuzzy model (see Fig. 10b) of the whole dynamic two-joint structure of the 2-axes PAM robot arm.

PRBS input and Joint Angle output from (40–80)[s] will be used for training, while PRBS input and Joint Angle output from (0–40)[s] will be used for validation purpose. The range (4.3 – 5.7) [V] and the shape of PRBS voltage input applied to the 1^{st} joint as well as the range (4.5 – 5.5) [V] and the shape of PRBS voltage input applied to rotate the 2^{nd} joint of the 2-axes PAM robot arm is chosen carefully from practical experience based on the hardware set-up using proportional valve to control rotating joint angle of both of PAM antagonistic pair. The experiment results of 2-axes PAM robot arm position control prove that experimental control voltages u_{1}(t) and u_{2}(t) applied to both of PAM antagonistic pairs of the 2-axes PAM robot arm is to function well in these ranges. Furthermore, the chosen frequency of PRBS signal is also chosen carefully based on the working frequency of the 2-axes PAM robot arm will be used as an elbow and wrist rehabilitation device in the range of (0.025 – 0.2) [Hz].

## 5. Experiment results

Three different identification models were carried out, which include MGA-based 2-axes PAM robot arm’s MISO UUdot fuzzy model identification, MGA-based 2-axes PAM robot arm’s MISO NARX11 fuzzy model identification, and MGA-based PAM 2-axes robot arm’s MISO NARX22 fuzzy model identification, respectively.

### 5.1. MGA-based 2-axes PAM robot arm forward MISO NARX fuzzy model identification

The identification procedure bases on the experimental input-output data values measured from the 2-axes PAM robot arm. Table 1 tabulates fuzzy model parameters used for encoding as optimized input values of MGA optimization algorithm. The range (3–5) permits the variable of number of membership functions obtaining 2 different odd values would be chosen by MGA (3 and 5). Block diagrams in Fig.5a, Fig.5b and Fig.5c illustrate the MGA-Based 2-axes PAM robot arm’s forward MISO Fuzzy model identification.

The fitness value of MGA-based optimization calculated based on Eq. (8) is presented in Fig. 11 (with population = 40 and generation = 150).

This Figure represents the fitness convergence values of both Forward Fuzzy models of both joints of the 2-axes PAM robot arm corresponding to three identification methods. This Figure shows that the fitness value of Forward MISO UUdot fuzzy model falls early at 10^{th} generation into a local optimal trap equal 1050 with joint 1 and 1250 with joint 2. The reason is that UUdot fuzzy model can’t cover nonlinear features of the 2-axes PAM robot arm implied in input signals U [v] and Udot [v/s]. On the contrary, the fitness value of Forward MISO NARX fuzzy model obtains excellently the global optimal value (equal 2350 with joint 1 and 12600 with joint 2 in case of Forward MISO NARX11 fuzzy model and equal 9350 with joint 1 and 10400 with joint 2 in case of Forward MISO NARX22 fuzzy model). The cause is due to novel Forward MISO NARX fuzzy model combines the extraordinary approximating capacity of fuzzy system with powerful predictive and adaptive potentiality of the nonlinear NARX structure implied in Forward NARX Fuzzy Model. Consequently, resulting Forward MISO NARX11 and Forward MISO NARX22 fuzzy model as well cover excellently most of nonlinear features of the 2-axes PAM robot arm implied in input signals U(z)[v] and Y(z-1) [deg].

Consequently, the validating result of the MGA-based identified 2-axes PAM robot arm’s Forward MISO NARX fuzzy model presented in Fig. 12 also shows a very good range oferror (< [

model and <[

These results assert the outstanding potentiality of the novel proposed MISO NARX fuzzy model not only in modeling and identification but also in advanced control application as well.

### 5.2. MGA-based 2-axes PAM robot arm Inverse MISO NARX fuzzy model identification

The identification procedure bases on the experimental input-output data values measured from the 2-axes PAM robot arm. Table 1 tabulates fuzzy model parameters used for encoding as optimized input values of MGA optimization algorithm. The range (3–5) permits the variable of number of membership functions obtaining 2 different odd values would be chosen by MGA (3 and 5). Block diagrams in Fig.6a, Fig.6b and Fig.6c illustrate the MGA-Based 2-axes PAM robot arm’s Inverse MISO Fuzzy model identification.

The fitness value of MGA-based optimization calculated based on equation (8) is presented in Fig. 13 (with population = 40 and generation = 100). This Figure represents the fitness convergence values of both Inverse Fuzzy models of both joints of the 2-axes PAM robot arm corresponding to three different identification methods. This Figure shows that the fitness value of Inverse MISO UUdot fuzzy model falls early (at 8^{th} generation with joint-1 and 48^{th} generation with joint-2) into a local optimal trap equal 5250 with joint 1 and 7480 with joint 2. The reason is that UUdot fuzzy model seems impossible to learn nonlinear features of the 2-axes PAM robot arm implied in input signals U [deg] and Udot [deg/s]. On the contrary, the fitness value of Inverse MISO NARX fuzzy model obtains excellently the global optimal value (equal 485000 with joint 1 and 676000 with joint 2 in case of Inverse MISO NARX11 fuzzy model and equal 235000 with joint 1 and 98400 with joint 2 in case of Inverse MISO NARX22 fuzzy model). The cause is due to proposed Inverse MISO NARX fuzzy model combines the extraordinary approximating capacity of fuzzy system with powerful predictive and adaptive potentiality of the nonlinear NARX structure implied in Inverse NARX Fuzzy Model. Consequently, MGA-based Inverse MISO NARX11 and Inverse MISO NARX22 fuzzy model as well cover excellently all of nonlinear features of the 2-axes PAM robot arm implied in input signals U(z)[deg] and Y(z-1) [V].

Consequently, the validating result of the MGA-based identified 2-axes PAM robot arm’s Inverse MISO NARX fuzzy model presented in Fig. 14 also shows a very good range of error (< [

These results assert the outstanding potentiality of the novel proposed Forward and Inverse MISO NARX fuzzy model not only in modeling and identification of the 2-axes PAM robot arm but also in advanced control application of nonlinear MIMO systems as well.

## 6. Conclusion

In this study, a new approach of MISO NARX Fuzzy model firstly utilized in modeling and identification of the prototype 2-axes pneumatic artificial muscle (PAM) robot arm system which has overcome successfully the nonlinear characteristic of the prototype 2-axes PAM robot arm and resulting Forward and Inverse MISO NARX Fuzzy model surely enhance the control performance of the 2-axes PAM robot arm, due to the extraordinary capacity in learning nonlinear characteristics and coupled effects as well of MISO NARX Fuzzy model. Results of training and testing on the complex dynamic systems such as PAM robot arm show that the newly proposed MISO NARX Fuzzy model which is trained and optimized by modified genetic algorithm presented in this study can be used in online control with better dynamic property and strong robustness. This resulting MISO NARX Fuzzy model is quite suitable to be applied for the modeling, identification and control of various plants, including linear and nonlinear process without regard greatly changing external environments.

## Acknowledgments

This research was supported by the DCSELAB - Viet Nam National University Ho Chi Minh City (VNU-HCM) and the NAFOSTED, Viet Nam.