## 1. Introduction

Forward kinematics problem of parallel robots is a very difficult problem to solve in comparison to the serial manipulators due to their highly nonlinear relations between joint variables and position and orientation of the end effector. This problem is almost impossible to be solved analytically. Numerical methods are the most common approaches to solve this problem. Nevertheless, the possible lack of convergence of these methods is the main drawback. In this chapter, two types of neural networks – multilayer perceptron (MLP) and wavelet based neural network (wave-net) - are used to solve the forward kinematics problem of the HEXA parallel manipulator. This problem is solved in a typical workspace of this robot. Simulation results show the advantages of employing neural networks, and in particular wavelet based neural networks, to solve this problem.

## 2. Review of forward kinematics problem of parallel robot

The idea of designing parallel robots started in 1947 when D. Stewart constructed a flight simulator based on his parallel design (Stewart, 1965). Then, other types of parallel robots were introduced (Merlet, 1996). Parallel manipulators have received increasing attention because of their high stiffness, high speed, high accuracy and high carrying capability (Merlet, 2002). However, parallel manipulators are structurally more complex, and also require a more complicated control scheme; in addition, they have a limited workspace in compare to serial robots. Therefore, parallel manipulators are the best alternative of serial robots for tasks that require high load capacity in a limited workspace.

A parallel robot is made up of an end-effector that is placed on a mobile platform, with *n* degrees of freedom, and a fixed base linked together by at least two independent kinematic chains (Tsai, 1999). Actuation takes place through *m* simple actuators, (see Fig. 1).

Similar to serial robots, kinematic analysis of parallel manipulators contains two problems: forward kinematics problem (FKP) and inverse kinematics problem (IKP). In parallel robots unlike serial robots, solution to IKP is usually straightforward but their FKP is complicated. FKP involves a system of nonlinear equations that usually has no closed form solution (Merlet, 2001).

Traditional methods to solve FKP of parallel robots have focused on using algebraic formulations to generate a high degree polynomial or a set of nonlinear equations. Then, methods such as interval analysis Merlet, 2004), algebraic elimination (Lee, 2002), Groebner basis approach Merlet, 2004) and continuation (Raghavan, 1991) are used to find the roots of the polynomials or to solve nonlinear equations. The FKP is not fully solved just by finding all the possible solutions. Further schemes are needed to find a unique actual position of the platform among all the possible solutions. Use of iterative numerical procedures (Merlet, 2007), (Wang, 2007) and auxiliary sensors (Baronet et al., 2000) are the two commonly adopted schemes to further lead to a unique solution. Numerical iteration is usually sensitive to the choice of initial values and nature of the resulting constraint equations. The auxiliary sensors approach has practical limitations, such as cost and measurement errors. No matter how the forward kinematics problem may be solved, direct determination of a unique solution is still a challenging problem.

Artificial neural networks (ANNs) are computational models comprising numerous nonlinear processing elements arranged in patterns similar to biological neural networks. These computational models have now become exciting alternatives to conventional approaches in solving a variety of engineering and scientific problems. Traditional neural networks are back propagation networks that are trained with supervision, using gradient-descent training technique which minimizes the squared error between the actual outputs of the network and the desired outputs. Two common types of them are multilayer perceptron (MLP) and radial basis function (RBF) are used in modeling of different problems. Recently wavelet neural networks have been presented by Zhang et al. in 1992 based on wavelet decomposition (Zhang et al., 1992). The proposed wavelet neural network (WNN) inspired by feed forward neural networks and wavelet decompositions is an efficient alternative to multilayer perceptron (MLP) and redial basis function (RBF) neural networks for process modeling and classifying problems. The structure of proposed WNN is similar to that of the radial basis function (RBF) networks, except that their main activation function is replaced by orthogonal basis functions with simple network topology (Zhang, 1995). The WNN can further result in a convex cost index to which simple iterative solutions such as gradient descent rules are justifiable and are not in danger of being trapped in local minima when choosing the orthogonal wavelets as the activation functions in the nodes (Zhang et al., 1992). Wave-nets are a class of wavelet-based neural networks with hierarchical multiresolution learning. Wave-nets were introduced by Bakshi and Stephanopoulos (Bakshi & Sephanopolus, 1993). Then, their nature and applications were thoroughly investigated by Safavi (Safavi & Romagnoli, 1997). There have also been other attempts at using wavelets for NNs, with the learning algorithms that are different from wave-nets (Szu et al., 1992).

Some researchers have tried using neural networks for solving the FKP of parallel robots (Geng et al., 1992), (Yee, 1997). Almost all of prior researches have focused on using ANNs approach to solve FKP of Stewart platform. Few of them have also applied this method to solve FKP of other parallel robot (Ghobakhlo et al., 2005), (Sadjadian et al., 2005). In this chapter, we focus on HEXA parallel robot, first presented by Pierrot (Pierrrot et al.,1990), whose platform is coupled to the base by 6 RUS-limbs, where R stands for revolute joint, U stands for universal joint and S stands for spherical joint (see Fig. 2). Complete description of HEXA robot is presented in Section 2.

The solution of IKP of HEXA was first presented in (Pierrrot et al., 1990) by F. Pierrrot who solved the system of nonlinear equations and obtained a unique solution for the problem. A numerical solution for FKP of HEXA parallel robot was presented by J.P. Merlet in (Merlet, 2001). FKP of this robot has no closed form solution and at most 40 assembly modes (assembly modes are different configurations of the end-effecter with given values of joint variables) exist for this problem. He suggested iterative methods for solving HEXA FKP. But, these methods have some drawbacks, such as being lengthy procedures and giving incorrect answers (Merlet, 2001). Utilization of the passive joint sensors; however, enables one to find closed form solutions. In (Last et al., 2005) it has been shown that a minimum number of three passive joint sensors are needed for solving the FKP analytically.

In this chapter, two neural network approaches are used to solve FKP of HEXA robot. To carry out this task, we first estimate the IKP in some positions and orientations -posses- of the workspace of the robot. Then a multilayer perceptron (MLP) network and a wave-net are trained with data obtained by solving IKP. We test the networks in the other positions and orientations of the workspace. Finally the simulation results will be presented and these two networks will be compared.

The rest of the chapter is organized as follows: Section 2 contains HEXA mechanism description. Kinematic modeling of the manipulator is discussed in Section 3 where inverse and forward kinematics are studied and the need for appropriate method to solve forward kinematics is justified. MLP network and wave-net method to solve FKP are discussed in section 4. In section 5 the results of solving FKP for HEXA parallel manipulator robot by these networks are presented. Comparison of these networks and conclusion are discussed in section 6.

## 3. Mechanism description

There are different classes of parallel robots. Undoubtedly, the most popular member of the 6-RUS class is the HEXA robot (Pierrrot et al., 1990), of which an improved version is already available. The first to propose this architecture, however, was Hunt in 1983 (Hunt, 1983). Some other prototypes have been constructed by Sarkissian in 1990 (Sarkissian et al., 1990), by Zamanov (Zamanov et al. 1992) and by Mimura in 1995 (Mimura, 1995). The latter has even performed a detailed set of analyses on this type of manipulator. Two other designs are also commercially available by Servos & Simulation Inc. as motion simulation systems (Merlet, 2001). Finally, a more recent and more peculiar design has been introduced by Hexel Corp., dubbed as the “Rotary Hexapod” (Merlet, 2001). Among these different versions, Pierrrot’s HEXA robot is considered in this chapter (see Fig. 2).

All types of HEXA robots are 6-DOF parallel manipulators that have the following characteristics:

a) With multiple closed chains, it can realize a greater structural stiffness.

b) To prevent the angular error of each motor from accumulating, it can realize a higher accuracy of the end-effecter position.

c) As all the actuators can be placed collectively on the base, it can realize a very light mechanism.

Consequently, HEXA enjoys the advantages of faster motions, better accuracy, higher stiffness and greater loading capacities over the serial manipulators (Uchiyama et al., 1992).

## 4. Kinematic modeling

As in the case of conventional serial robots, kinematics analysis of parallel manipulators is also performed in two phases. In forward or direct kinematics the position and orientation of the mobile platform is determined given the leg lengths. This is done with respect to a base reference frame. In inverse kinematics we use position and orientation of the mobile platform to determine actuator lengths. For all types of parallel robots, IKP is easily solved. For HEXA parallel robot this problem was solved by Pierrrot (Pierrrot et al., 1990). Brief solution of IKP is presented by Bruyninckx in (Bruyninckx, 1997). Fig. 3 shows one mechanical chain in HEXA design. In each chain, M specifies the length of the crank which is the mechanical link between the revolute and universal joints, and L gives the length of the rod which connects universal and spherical joints. Other parameters, H, h and a, are introduced as shown in Fig. 4 The relationship between the joint angles θ_{ i,j} (i=1,2,3 and j=1,2), robot parameters and position and orientation of the end-effector can be obtained from the following procedure. The joint angle θ_{ i,j} moves the end point of crank of ith leg to the position p_{i} given by

In this equation, the joint angle θ_{i,j} is the only unknown variable. The positions p_{i} are connected to a mobile platform pivot point t_{i} by links of known length L. Matrix _{i,j} (see Fig. 3). Matrix R(X, θ_{,j}) is the rotation matrix corresponding to a rotation about the X axis by the angle θ_{i,j} :

In each chain, a loop closure formulation can be adopted as follows (see Fig. 3):

withIt is possible to solve (3), (4), (5), for θ_{i,j} :

where

And_{i}in the reference frame constructed in the actuated R joint (Pierrrot et al., 1990). The same equations can be used to derive the HEXA forward kinematic model, but the closed form solution to FKP can not be found. So, we propose to use numerical schemes by neural network approach for solving FKP in the workspace of the robot.

## 5. Artificial neural networks

The inspiration for neural networks comes from researches in biological neural networks of the human brains. Artificial neural network (ANN) is one of those approaches that permit imitating of the mechanisms of learning and problem solving functions of the human brain which are flexible, highly parallel, robust, and fault tolerant. In artificial neural networks implementation, knowledge is represented as numeric weights, which are used to gather the relationships between data that are difficult to realise analytically, and this iteratively adjusts the network parameters to minimize the sum of the squared approximation errors using a gradient descent method. Neural networks can be used to model complex relationship without using simplifying assumptions, which are commonly used in linear approaches. One category of the neural networks is the back propagation network which is trained with supervision, using gradient-descent training technique and minimizes the squared error between the actual outputs of the network and the desired outputs.

### 5.1. Multilayer perceptron (MLP)

The MLP is one of the typical back propagation ANNs and consists of an input layer, some hidden layers and an output layer, as shown in Fig. 5.

MLP is trained by back propagation of errors between desired values and outputs of the network using gradient descent or conjugate gradient algorithms. The network starts training after the weight factors are initialized randomly. Valid data consisting of the input vector and the corresponding desired output vector is fed to the network and the difference between the output layer result and the corresponding desired output result is used to adjust the weights by back propagation of the errors. This procedure continues until errors are small enough or no more weight changes occur. A first challenge in training the back propagation neural network is the choice of the appropriate network architecture, i.e. number of hidden layers and number of nodes of each layer. There is no available theoretical result which such choice may rely on. This can only be determined by user’s experience (Medsker et al., 1994).

### 5.2. Wavelet based neural network (wave-net)

The hierarchical multiresolution wavelet based network, namely wave-net, was first introduced by Bakhshi (Bakshi and Sephanopolus, 1993) and was further investigated by Safavi (Safavi and Romagnoli, 1997). There has been another approach to develop wavelet based neural network with almost an MLP structure presented by Zhang (Zhang et al., 1992). However, the latter type of neural network lacks an efficient use of the capabilities of wavelets and multiresolution analysis and therefore is not considered in this chapter.

#### 5.2.1. Wavelets and multiresolution analysis (MRA)

Wavelets are a new family of localized basis functions and have found many applications in quite a large area of science and engineering (Daubechies, 1992). These basis functions can be used to express and approximate other functions. They are functions with a combination of powerful features, such as orthonormality, locality in time and frequency domains, different degrees of smoothness, fast implementations, and in some cases compact support. Wavelets are usually introduced in a multiresolution framework developed by Mallat (Mallat, 1989). These are shortly explained in the following. Consider a function F(X) in L2(R), where L2(R) denotes the vector space of all measurable, square integrable one-dimensional functions. The function can be expressed as

where

Here, the function φ_{m,k} (not to be confused with the orientation angle φ)is called a scaling function of the multiresolution analysis (MRA) and a family of scaling functions of the MRA is expressed as;

*ψ*

_{m,k}(not to be confused with the orientation angle

*ψ*), can easily be obtained from φ

_{m,k}. A family of wavelets may be represented as:

To gain a thorough understanding of the role of scaling functions and wavelets within the multiresolution approximation framework see (Daubechies, 1992).

#### 5.2.2. Wave-net learning

Equation (11) describes the basic framework of a wave-net in that it explains how each wavelet co-operates in the whole approximation scheme. It also shows that the scaling functions are only used at the earliest stage of approximation to produce F_{0}, after which the approximation scheme uses only wavelets. Fig. 6 depicts a typical wave-net structure. The hierarchical nature of the scheme is also obvious. Once the first approximation to a function F is obtained, that is F_{0}, one can get a better approximation, namely F_{-1}, by including wavelets of the same dilation factor as the scaling function, here m=0. Adding wavelets of the next highest resolution, here m= -1, leads to an approximation F_{-2}, finer than the previous one F_{-1}. This process is continued until the original function is reconstructed or an arbitrary degree of accuracy for the approximation is obtained.

In the above hierarchical approach, wavelets with different dilations and translations are incorporated.

The approaches to find the network coefficients, a_{m,k} and d_{m,k} are presented by Safavi (Safavi and Romagnoli, 1997).

## 6. Neural network solution for FKP

In order to model HEXA FKP with neural networks, first, a typical workspace for the robot is determined. Then, IKP is solved in some points of the workspace and finally the MLP and wave-net are trained with the data of IK solution in the typical robot workspace.

### 6.1. The workspace analysis

It is well known that parallel manipulators have a rather limited and complex workspace. Six parameters consisting of three coordinates of position of center of mass for mobile platform in the base frame (X, Y, Z) and three RPY orientation angles of mobile platform with respect to the base frame (three angles of mobile platform orientation in space consist of φ, ψ and θ angles, see Fig. 3) vary in the HEXA workspace.

Complete analysis of HEXA workspace is presented in (Bonev et al., 2000) by A. Bonev. We use a typical workspace shown in Fig. 7. In this workspace, end-effector can move 300 millimeters in both directions of X and Y axes; also it can move 600 millimeters in positive Z direction. In all positions of the workspace, mobile platform can rotate in the range of [-π/3, π/3] for φ, ψ and θ angles. Fig. 7 shows the typical workspace which is used in this chapter. The geometric parameters of the robot are given in Table 1.

### 6.2. Neural network solution for FKP

Now a MLP network can be trained with the data generated by the solution of IKP. In order to model the FKP in terms of 6 variables of positions and orientations of the mobile platform, a MLP network with a configuration of 6×13×13×13×13×13×6 has been developed with the smallest error and has been used to model FKP. In other words, the ANN model has 6 inputs consisting of 6 joint angles, 5 hidden layers with 13 neurons in each layer, and 6 neurons in the output layer. The activation functions used in the hidden layers and the output layer are logarithmic and pure linear, respectively. The number of patterns used for training and test are 17500 and 35000, respectively. The network is trained over 1200 epochs with error back propagation training. Each network is evaluated by comparing the predictions and the true outputs, resulting in a prediction error for each orientation angle. The autocorrelation coefficients are also computed for the predicted error of each orientation angle.

### 6.3. Wave-net solution for FKP

In order to model the FKP with wave-net, MRA framework is used to approximate this process in different resolutions. Inputs, outputs and the number of patterns used for training and test are similar to the MLP network. The network is trained in resolutions m=0,-1 and -2 and the best results of modeling are reached at resolution -2. Figure 10 shows the training results for the successive resolutions zero, -1 and -2 for the X, Y, Z positions. For φ, ψ and θ angles the results are not represented due to the similarity and also to save space.

### 6.4. Modeling results

In this section the result of modeling FKP are presented. Error parameters in the tables are:

*mse* ; maximum squared error performance function

*mae* ; maximum absolute error performance function

*nrmse* ; normalized root minimum square error

Figures 8-11 show the modelling error and the correlations between the outputs of networks and the target outputs.

#### 6.4.1. Modeling results with the MLP network

Table 2 and Figs. 8 and 9 show the results of FKP solution by MLP; Table 2 shows the resulted errors of FKP modeling.

It is apparent from Table 2 that *mse*, *mae* and *nrmse* in all joints are less than 2*10^{-5}, 0.01 and 0.01 respectively, in test data. *mae* indicates maximum absolute error of modeling; therefore, maximum error of position and orientation of mobile platform is not bigger than 1 millimeter in position and 0.1 degrees in orientation in the worst case. *mse* shows the maximum of the average of errors in all points and so the average error of FKP solution in the typical workspace is less than 2*10^{-5}. R in Table 2 indicates linear regression between output of the network and the target data. The closer regression to 1, the better the modeling is. The linear regression of all joints is more than 0.99 which shows very good quality modeling results. Fig. 9 shows the error of modeling in 1000 sample test points of typical workspace. For these sample posses the errors of modeling in position and orientation are very small and can be neglected.

#### 6.4.2. Modeling results with wave-net

Figures 10 and 11 show the results of FKP solution by wave-net. Table 3 shows the resulted errors of FKP modeling. In Table 3 *mse* and *mae* in all joints are less than 10^{-6}, 10^{-2}, respectively, for test data. Therefore, maximum error orientation of mobile platform is not greater than 10^{-2} degrees in orientation for the worst case. Besides, the average error of FKP solution in the typical workspace is less than e-6. *R* (linear regression) in Table 3 of all joints is more than 0.999 which shows good modeling results. So, comparing the results of the MLP network and wave-net, wave-net model has smaller prediction error for FKP modeling of HEXA robot.

## 7. Comparison of MLP and wave-net results

In section 6 two approaches were used to model the FKP of HEXA robot – MLP network and wavelet based neural network. Though both neural network approaches showed great potential for this study, some comparison between these two approached are presented here. It is apparent from the results that errors of modelling by wave-net is less than MLP network, also the required time for modeling by wave-net is smaller than MLP; therefore, the wave-net modeling shows superior results in comparison to the MLP. Table 4 shows the results of modeling with these networks.

Figure 11 shows the linear regression between target X and Y positions and wave-net outputs. The same regressions can be obtained for φ, θ and ψ angles and Z position which are omitted here because of the similarity.

Variable | mse | mae | nrmse | R |

X | 1.3232e-005 | 0.0089 | 0.01 | 0.999 |

Y | 5.76992e-006 | 0.0076 | 0.0094 | 0.999 |

Z | 1.79034e-005 | 0.0091 | 0.0045 | 0.999 |

φ | 5.77768e-006 | 0.01 | 0.0073 | 0.988 |

θ | 1.20364e-006 | 0.009 | 0.0034 | 0.988 |

ψ | 2.1676e-006 | 0.0087 | 0.0045 | 0.999 |

Variable | mse | mae | R |

Ψ | 8.2568e-010 | 2.5947e-004 | 1 |

Y | 2.6346e-013 | 4.6090e-006 | 1 |

Z | 1.2103e-006 | 4.7103e-002 | 0.9999 |

Φ | 1.1402e-09 | 2.9911e-004 | 0.9999 |

Ө | 8.2568e-09 | 2.5947e-003 | 1 |

X | 1.8501e-015 | 3.1252e-008 | 1 |

## 8. Conclusion

In this chapter, we proposed to use neural networks for FK solution of HEXA robot, which can be elaborated to generate the best estimation of forward kinematics of the robot. The research results in this chapter are quite important as they solve a problem for which there is no known closed form solution. Besides, the presented solution in this research has the better prediction and obtains smaller error in compare to the other works which have studied FKP of HEXA robot to the best of our knowledge.