Abstract
1. Introduction
Nature, for engineers and roboticists, has been a rich source of metaphors providing uncountable examples of locomotion system. The crawling motions, inspired of the snakes, worms and other limbless animals, are good instants that develop remarkable functional locomotion systems (Ávila, 2006).
The main motive of developing the crawling devices, such as it is described in this work; significantly relate to enhance remote sensing capabilities emergency situations, such as rescue and inspection in areas where motion is constrained, i.e. in situations involving disaster such as earthquakes, fires, or even hostile environments. Hirose investigated the locomotion of limbless animals for the first time. He was inspired by their motions to design and control a mobile robot within articulated body (Hirose & Morishima, 1990). After him, many researchers started to investigate these types of motions (Saito & et al., 2002, Crespi & Ijspeert, 2006).
Merino et al. presented description of a crawling gait for a modular robot and discussed about pros and cons of crawling locomotion rather than quadruped system. In their described locomotion pattern, a kinematics chain of modules was considered in which motion course begins with an open loop sub-mechanism and progression is achieved by the propagation of an undulatory wave from the rear to the front of the robot. In fact, crawling motion was formed based on lifting in the vertical direction to advance segments of body forward, using friction (Merino & Tosunoglu, 2004).
In continuation, the dynamic model of it was developed based on Newton-Euler laws that were involved with joint forces and extra calculation (Spranklin, 2006). Moreover, in this same work a gradient based optimization method was used to obtain the optimal motion with minimum effort metric. However, these type optimization methods have two significant drawbacks as follows:
These methods can only guarantee local optimally and convergence.
They need gradient and Hessian information, which for problems involving even moderate systems, approximation of this information takes a complicated calculation and may lead to ill condition, instability, and poor convergence behaviour.
Instead, the Genetic Algorithm (GA) is an efficient heuristic method for optimization problems, and does not require the derivative information of objective function, and has robust characteristic for avoidance of being trapped in local optima.
Recently, GA has been successfully applied to various motion synthesis problems. For example, genetic algorithm is applied to solve the position and movement of an end-effecter on the tip of a two-joint robot arm (Yano & Tooda, 1999). In other work, GA determines the parameters, which are the interior points to be interpolated to formulate the polynomial representing the trajectory, to minimize the fitness of the desired objective function (Lianfang & Curtis, 2004) Also, optimal trajectory selection for a three DOF manipulator with minimum energy consumption using GA is done by (Ata, 2007). In this work the angle of last link made with the x-axis is considered as cost function and needs to be optimized.
This work includes three main segments; first description of crawling gait, second, development of its dynamic model and third finding the optimal motion with minimum effort metric utilizing the GA. The remainder of this paper is organized as follows: Section 2 describes the crawling gait and some assumptions to develop the dynamic model In section 3 the Lagrangian formulation of a planner manipulator with revolute joints is derived including a closed loop chain and reaction forces due to connection between the tip of last link and the ground By introducing B-spline curves in section 4 we discuss. about trajectory planning and optimization In section 5 we present a brief review of a simple GA and its advantages The best results of simulation which obtained by GA brought in section 6 and finally in section 7 the contribution of the paper is summarized.
2. Gait Description
In this section basic motion pattern is described and assumptions of model in order to develop dynamics formulation, for each step motion, are explained.
In figure 1, a sequence of the joint configurations is shown that it should result in a forward motion if the robot is driven through them (Ghanbari & et. al, 2008) The distance travelled by the robot per complete cycle will be:

The basic motion pattern [11].
According to the shown figure, this basic motion pattern can be resolved in four sub-mechanisms M1, M2, M‘2, and M’1. The joint angles that should be reached at the end of each step are given in Table 1.
Joint angles at end of each step.
In each sub-mechanism, we consider friction is provided sufficiently that at least one link is non-moving or ground link. These ground links are shown with dark colour in all figures.
Also, with due attention to figure 1, a symmetry condition in motion sequences is cleared. Thus, only both first sub-mechanisms are sufficient for modelling as two manipulators according to figures 2 and 3. Then for last both sub-mechanisms, we reverse coordinate system and use opposite trajectory directions. It should be noted that in these models the angles are measured in a local joint coordinate system, and after solving each sub-problem, those should be mapped to their global coordinate system.

Manipulator model of M1 [11].

Manipulator model of M2 [11].
Sub-mechanisms M1 is the first part of gait sequence and it is considered as a 3-R planar manipulator with two DOF, because the tip of the third link remains in constant contact with the ground during the motion. In other words we have a redundantly actuated closed chained system. It is worth noting that, a system is redundantly actuated when the number of actuated joints is greater than the degree of freedom of the mechanism.
Considering identical link length, the geometric constrain of systems can be formulated as:
where
3. Dynamic Analysis
In the following, we develop the dynamic model of a 3-DOF planner manipulator with revolute joints, including a closed loop chain and reaction forces, due to connection between the tip of last link and the ground. The manipulator is supposed to move in the vertical plane
Let
where and henceforward, for abbreviation we use
Also, height of centriod point of
The dynamic model is based on the Lagrangian formulation. Hence, calculating the total of kinematic energy, total of gravity potential energy, and generalized forces will be needed. First, we derive each of them.
Considering identical link and
The total of gravity potential energy will be:
Non-conservative forces acing on the system are represented by generalized forces,
where, λp = lp(cosφp + μsinφp), and μ̄ = μ sgn (
Now, using the Euler-Lagrange equations, motion equations of the dynamic system can be written as:
Substituting the Eqs. (7), (8), and (9) into Eq. (10) we will have:
The motion equations of the sub-mechanism M2 are also derived similarly, and results obtained as:
4. Trajectory Planning
4.1 Cost Function Definition
In previous section we derived the dynamic equations for our crawling gait model in a close form, which they can be summarized as follows:
where, Mnxn is the mass matrix of manipulator, Cnxn is the matrix of centrifugal coefficients, Gnx1 is vector of gravity terms, and, Dnxn is the subtraction matrix with Dpq = δpq - δp(q-1), where δ is Kronecker Delta.
Now, in this section, we intend to use this model to generate optimal joint trajectories that minimize a certain metric as cost function as:
subject the boundary conditions:
where Ψ penalizes deviations from the constrains and
It is noted that with this definition for cost function, the last joint of both sub-mechanisms can be allowed to be passive, and by this way, considering a set of trajectories for
4.2 B-spline Curves
In this stage, we use B-spline curves to define the trajectory of the actuators, that in our formulation it has been transferred into joint space. B-spline curves can be thought of as a method for defining a sequence of degree (
where
Since
By parameterizing the trajectories in term of B-splines, the original optimal control reduces to a parametric optimization problem of the form:
Here, our problem has been converted to a parametric optimization problem and we require an efficient heuristic optimization method that be used to minimize the cost function.
5. Genetic Algorithm
Genetic Algorithm (GA) is a sort of population-oriented search techniques which uses probabilistic transition rules to evolve multiple potential solutions. GA does not require the derivative information of objective function and constraints and has robust characteristic for the problems with multiple local minima. These properties of GA can give advantages over the other conventional optimal trajectory planners of a robot manipulator (Lee, 1999). The genetic algorithm based on the principles of genetics and natural selection so that repeatedly changes a population of individual solutions to evolve a state that maximizes the “fitness” (i.e., minimizes the cost function) (Haupt, 2004).
A simple GA commonly uses binary coded strings for parameter representation, which is also called a “chromosome”, might look like the figure 4.

Schema of a chromosome.
At each cycle, as shown in figure 5, the GA selects individuals at random from the current population to be parents and uses them to generate the children for the next generation. Over successive generations, the population evolves toward an optimal solution.

Flowchart of a simple GA.
The GA uses three main types of rules at each step to create the next generation from the current population (Chettibi, 2006):
Selection rules select the individuals, called parents, which contribute to the population at the next generation.
Crossover rules combine two parents to form children for the next generation.
Mutation rules apply random changes to individual parents to form children.
It is mentioned that, similar to other heuristic optimization methods, GA for a constrained optimization problem is also fundamentally based upon a penalty function approach.
6. Simulation Study
Our simulation includes generating optimal motion of a redundantly actuated closed chain using GA, which follows the shown algorithm in Fig. 6. Note that an exactly actuated closed chain can be considered as a special case of this general case.

Fitness Evaluation algorithm.
In this algorithm, the evaluation of fitness of individuals involves calculating of effort metric for a discrete sampling of a motion obtained by a set of certain joint trajectories. For this end we approximate the effort metric as:
where
Specification of dynamic parameters.
In both sub-mechanisms last joint is treated as passive joint and its displacement and time derivatives are calculated using the constraint relationship. The simulation is run for each sub-mechanism using the GA parameters given in Table 3. The quadruplet B-splines are considered to make joint angle profiles and five bits are allocated to encode each variable parameter (control point value). Also, the random pairing method is chosen as selection rule of GA. Finally, the obtained cost values are given in Table 3. The results achieved by GA for each sub-mechanism show reduction in torque consumption in compression with the results achieved by Spranklin, who have used gradient based method. The reason of this reduction is that GA is a global search method which is robust against trapping in local optimality point.
Genetic Algorithm parameters and results.
The best control points set of each sub-problem is obtained as below. It is worth noting that, the boundary values of joint angles are repeated to achieve the desired boundary conditions.
Sub-mechanism M1:
Joint 1 {0,0
43.594,40.781,36.562
45,45}
Joint 2 {0,0
-16.875,-40.781,-16.875
-45,-45}
Sub-mechanism M2:
Joint 1 {0,0
36.563,5.625,21.094
45,45}
Joint 2 {45,45
-14.063,16.875,-5.625
-45,-45}
Joint 3 {-45,-45
-37.969,-1.406,-7.031
-45,-45}
The displacement profile of each free joint in sub-mechanism M1, according to obtained optimal trajectory, and its associated consumed torque is shown in figures 7 and 8 and figures 10 and 11, respectively. Snapshots of motion are also illustrated in figure 9. Similarly, results of the sub-mechanism M2 is shown in figures 12 to 18, according to its optimal solution.

Optimal joint displacements in M1, joint 1.

Optimal joint displacements in M1, joint 2.

Snapshots of optimal motion in sub-mech. M1.

required torque according to optimal joint trajectories in sub-mechanism M1, joint 1.

required torque according to optimal joint trajectories in sub-mechanism M1, joint 2.

Optimal joint displacements in M2, joint 1.

Optimal joint displacements in M2, joint 2.

Optimal joint displacements in M2, joint 3.

Snapshots of optimal motion in sub-mech. M2.

required torque according to optimal joint trajectories in sub-mechanism M2, joint 1.

required torque according to optimal joint trajectories in sub-mechanism M2, joint 2.

required torque according to optimal joint trajectories in sub-mechanism M2, joint 3.
7. Conclusion
In this paper a new crawling gait to develop in a modular robot was described. Then each of gait steps was modeled as a manipulator and derived the dynamic formulation of them by Lagrangian method in explicit form. Imposing the geometric constrains of system, a redundantly actuated closed chain mechanism was analyzed and expressed an algorithm to solve it. Next, the optimal joint trajectories for a motion with minimum effort metric were presented utilizing GA. B.spline curves are used to convert the original optimal control problem into a parametric optimization problem. Finally our models were simulated and achieved results were represented for optimal motion of each of them. Efficiency of GA to search a global solution was shown by comparing the results with obtained results in previous similar work.
