1 Introduction

Over the past decade, the field of all terrain robots has emerged as one of the most interesting and provoking grounds to researchers worldwide due to its wide choices of consideration, whether it is legged or wheeled or tracked vehicles or hybrid vehicles for locomotion. Today with the advancement of technology, researchers have an urge to design and develop robotic vehicles that can maneuver and perform tasks like natural beings having legs (Tian et al. 2014; Tedeschi and Carbone 2014; Khoramshahi et al. 2013; Roennau et al. 2013; Li et al. 2012a; Murphy et al. 2011; Loc et al. 2010; Raibert et al. 2008; Soyguder and Alli 2007). The reason is that legged robots have high degree of terrain adaptability and maneuverability. It can negotiate any kind of terrain by adjusting the lengths of its legs to maintain the desired body position and orientation during navigation. The travelled path consists of a series of discrete points only in contact with the terrains, not like a long continuous path followed by a wheeled or tracked robot. However, coordination of various leg joints so as to produce the desired gait pattern and maintain stability during locomotion is extremely complex (Song and Waldron 1989). Considering these aspects, a six-legged robot is better suited than others for maneuverability over any kind of terrain. It has many advantages compared to two- or four-legged robots. It provides better static stability and is less susceptible to deadlock situations. The six-legged robot is more robust because it is able to walk with one or two failed legs (Yang 2009; Shih et al. 2012), since it is possible to define stable gaits by using either four or five legs. Also, compared to eight- or more-legged robots, its power consumption is less, since with the increase in the number of legs; a lot of actuators are to be controlled through a continuous coordination in addition to complicacies in kinematics and dynamics of legged mechanisms (Santos et al. 2006; Sandoval-Castro et al. 2013; Roy and Pratihar 2014; Akdag et al. 2012). Therefore, a six-legged robot is a kind of optimal robotic structure to be used for varying terrains. But then, to successfully design a six-legged robotic structure for maneuverability over varying terrains, the kinematic and dynamic analyses of its complex motion mechanism are very essential. For that, a suitable mathematical model of the complex six-legged robotic mechanism describing its kinematics and dynamic behavior during locomotion is necessary to develop. So far as the kinematics is concerned, some researchers tried to develop the kinematic model of the robot based on Denavit–Hartenberg (DH) parameters (Tarokh and Lee 2009; Roy and Pratihar 2012, 2013, 2014; Barreto et al. 1998), while others tried to investigate the kinematics of legged robots using screw theory and vector algebra (Wang et al. 2011, 2014; Howard et al. 1996) to eliminate the ambiguities involved with the DH parameters.

Most of the previous studies on kinematics are based on the consideration that legged robots are parallel mechanism systems. But, the kinematics of legged robots is far more complicated compared to that of the parallel mechanism robots like Gough-Stewart platform mechanism etc. (Qian et al. 2014; Chi et al. 2013; Zhang et al. 2011, 2013; Alvarado et al. 2010; Zhang and Gao 2012; Kelaiaia et al. 2012) due to added number of DOF in the system (Lee and Song 1990). Moreover, the foot placement and lifting of a leg in a walking robot change the total topology of the mechanism. Also, due to more number of driven joints, the control of a legged robot is much more complex than that of parallel robots. The developed kinematics models for the six-legged robots by some other researchers were simplified with the assumptions like the steady-state condition of the trunk body for different speeds, zero pitching and rolling angles of the trunk body, no change in the leg’s position (i.e., no slippage) in support phase (Figliolini et al. 2007; Hauser et al. 2008; Yoneda et al. 1997). More recently, some researches have studied the radially symmetric six-legged robots (Wang et al. 2010, 2011; Li et al. 2012b; Bombled and Verlinden 2012), a transition from rectangular six-legged robots. Some other studies on kinematics of multi-legged robots have also been reported recently (Soyguder and Alli 2012). But, those studies carried out by various investigators were focused mainly on the design and straight-forward gait generation of a six-legged robot. In addition to that, the developed control algorithms were mainly suitable for locomotion over flat terrain, although some efforts had been made for uneven terrain locomotion.

In some other studies, the kinematics models of the six-legged robots were developed by treating trunk body, swing legs and support legs as separate entities and the robots’ motion was confined to flat terrain (Roy and Pratihar 2013; Silva et al. 2005; Shkolnik and Tedrake 2007). However, that could not depict the actual motion behavior of the robotic system. If the motion of the legged robots is studied in depth, it reveals that the movement of a swing leg depends not only on the motion of its own joints, but also on the movement of support legs and angular motions (roll, pitch, yaw motions) of the trunk body. An attempt has been made in the present study to address this problem, since the dependency of all the legs with respect to others cannot be avoided while developing the kinematics and dynamic models of the system. Moreover, if the kinematics of the system is not correctly analyzed, it will largely affect its dynamics related to the study of foot-terrain interactions, power consumption, dynamic gait stability etc.

Turning gait is one of the most general and important gaits for omnidirectional walking robotic vehicles (Estremera et al. 2010; Kumar and Waldron 1988; Lee and Orin 1988; Yang 2008). Still then, the locomotion strategies for six-legged robots walking over varying terrains with turning motion capability have not received much attention. A very few studies have been reported till date, which analyzed the kinematic and dynamic analysis of turning gaits of multi-legged robots, but the said studies compromised with the complexity of the mathematical model. Some studies on turning motion analysis of a rectangular six-legged robot were carried out on flat terrain assuming the center of gravity of the robot to be coincident with the geometric center of the trunk body and the height of trunk body to be at a constant height during locomotion (Roy and Pratihar 2012, 2014; Orin 1982; Zhang and Song 1991; Hirose et al. 1986; Miao and Howard 2000; Pratihar et al. 2000). A few other studies carried out by the researchers in the recent past dealt with the locomotion of symmetrical hexapod robot on varying terrains with the assumptions that the gravity center of the body is maintained at a constant height at all times, the body is kept always parallel to the support plane formed by supporting feet during locomotion, slippage between foot and ground is ignored with the limitations like small turning angles, stride length of typical gaits during turning is maintained at low value (Wang et al. 2010, 2011). But, in reality, the center of gravity of the trunk body may not coincide with the geometric center during locomotion. Also, in addition to the above, varying body heights, effects of trunk body on the swing and support legs, considerable slippage between support legs and terrain, uneven topology etc. have to be taken into account to make the motion of the robot more realistic. Therefore, kinematics model should be capable enough to mimic all issues related to trunk body movement, motion planning, gait and foot trajectory planning of a real robot in the spatial environment. Moreover, the kinematic model should support the constrained dynamic model of a realistic six-legged robot to address the issue of coupling effect. Most of the previous models were unable to emphasize upon these issues due to considerable simplifications assumed in the kinematic models, as discussed above. Further, the previously developed kinematic models were not validated, since the process is time-consuming and might not be cost effective. No such notable studies have been reported till date for implementation of the developed motion planning algorithms on a virtual model of a six-legged robot and improving its performance using virtual prototyping (VP) technology prior to developing its physical prototype. The present kinematic model of the realistic six-legged robot has emphasized upon all such issues for negotiating varying terrains during turning motion.

The main contribution of this study is the development of a new kinematic model of a hexapod robot using a generalized classical approach that will tackle the coupling effects in the study of dynamics related to locomotion in varying terrains (flat level to elevated, even to uneven, and others) with any type of gait. The kinematic constraint equations formulated by this approach can be directly used with the coupled dynamic model to solve for the feet forces, joint torques etc. To deal with spatially complex environment, the actual behavior of robot that depends on the motion planning algorithms for the trunk body, swing and support legs in three-dimensional (3D) Cartesian space with turning gaits is also proposed. Moreover, an attempt has been made in this study to the model slippage between the foot and terrain during support phase of the legs to make the motion more realistic. Further, the results of the present study on kinematics analysis of the system have been compared with those obtained using VP tools. To the best of the authors’ knowledge, no such study on a hexapod robot with turning motion capabilities has been reported in the literature.

The paper has been divided into five major sections. Section 2 presents the description of proposed hexapod walking robot. Section 3 describes the analytical approach used for mathematical modeling and simulation of a realistic hexapod robot. A numerical illustration and validation using CAD/CAE (Computer Aided Engineering) approach of the simulation results have been presented in Sect. 4. Finally, Sect. 5 ends with some concluding remarks.

2 Description of proposed hexapod walking robot

A 3D CAD model (shown in Fig. 1) of a realistic hexapod robot is developed in a solid modeling commercial package Computer Aided Three Dimensional Interactive Application Version 5 (CATIA V5) using the following two main steps as mentioned below.

Fig. 1
figure 1

A realistic six-legged robot (3D CAD model)

  • Step 1: Modeling of various components of the robot in the part modeling workbench

  • Step 2: Assembling of the components in assembly workbench using suitable constraints

The model consists of a rectangular type trunk body and six identical legs. All the legs are similar with three legs on either side of the central axis that are evenly distributed. Each leg is composed of three links, namely coxa, femur and tibia. The kinematic link lengths of the links are represented by l ij , where i = 1 to 6 denotes the leg number and j = 1 to 3 indicates the joint number. The links are interconnected by two revolute joints (joints i2 and i3) and attached to the trunk body by a third rotary joint (joint i1). The offset distance between the links are denoted by d ij . Each of the joints of a leg is independently controlled by one actuator or DC servomotor. Therefore, with the six DOF of the trunk body and three DOF in each leg, it is required to synchronize eighteen joint angles of the robotic system to accomplish the desired task. The main body-parts of the robot are made of aluminum (density: 2.74e−6 kg/mm3). Table 1 shows the physical parameters of the realistic robot. The total mass of the robot without payload is estimated to be equal to 2.456 kg.

Table 1 Physical parameters of the robot

3 Mathematical modeling and simulation: analytical approach

The problem statement of the present study is as follows: a hexapod robot has to plan its gait parameters and path of motion simultaneously during turning on a varying terrain maintaining a stable configuration.

The following assumptions are made in the present study:

  1. 1.

    Motion planning of the robot is in 3D Cartesian space.

  2. 2.

    Before computing the motion of the robot, a number of potential feethold vertical positions across the varying terrain are already identified.

  3. 3.

    The trunk body turns with constant radius in an anticlockwise direction and its motion characteristics are governed by a cubic polynomial. This makes the trunk body height to vary with respect to the ground during turning.

  4. 4.

    During turning, there is slippage between the foot and ground throughout the support phase. The magnitude of slip is small and its trajectory is simplified to a straight path in the horizontal plane of the local reference frame.

3.1 Reference systems in Cartesian space

In the present study, the robot is considered as a rigid multibody system with multiple reference frames (both global and local frames) attached to it. As shown in Fig. 2, G 0 is the static global reference frame and G is the dynamic global reference frame. The respective frames corresponding to XYZ coordinate systems coincide at O. The system has been generalized by using orientation vector of bryant angles (Hahn 2003), η G  = [α G β G θ G ]T. These angles take into account the terrain elevation along the three axes, i.e., α G denotes sloping angle, β G represents banking angle and θ G indicates the initial angular position of the robot with respect to the frame G 0 . The reference frame L 0 , that is fixed to the body, is attached at an arbitrarily chosen location P 0 on the trunk body (refer to Fig. 3). At each of the joints, i.e., i1, i2 and i3, two local reference frames are attached to indicate successive joint states, i.e., one state at time t and the next state after infinitesimal rotation or at time t + ∆t. More specifically, frames \( \varvec{L}_{i}^{{\prime }} \) and \( \varvec{L}_{i}^{{\prime \prime }} \) are located at point S i ; frames \( \varvec{L}_{i1}^{{\prime }} \) and \( \varvec{L}_{i1}^{{\prime \prime }} \) are at point P i 1 and frames \( \varvec{L}_{i2}^{{\prime }} \) and \( \varvec{L}_{i2}^{{\prime \prime }} \) are at point P i 2 . Moreover, frames \( \varvec{L}_{i3}^{{\prime }} \) and L i3 (L i3 is assumed parallel to frame G) are attached at the tip point P i 3 , which follows a pre-determined trajectory in 3D Cartesian space. To signify the turning angle (\( \theta_{i3}^{{L_{i3} }} \)), one more reference frame has been considered at point P i 3 , i.e., \( \varvec{L}_{i3}^{{{\prime \prime \prime }}} \) (refer to Fig. 4).

Fig. 2
figure 2

Reference Frames G 0, G

Fig. 3
figure 3

Reference frames and Vector diagram of Leg ‘i’ during support phase a plan view, b elevation view

Fig. 4
figure 4

Topography of terrain and swing leg trajectory planning for ith leg in turning motion

The vectors of Cartesian coordinates of P 0 , P ij with respect to G are represented by \( {\mathbf{p}}_{0}^{G} = ({\mathbf{r}}_{{P_{0} O}}^{G} ,{\varvec{\upeta}}_{0} ) \, \in {\mathbb{R}}^{6} \), \( {\mathbf{p}}_{ij}^{G} = ({\mathbf{r}}_{{P_{ij} O}}^{G} ,{\varvec{\upeta}}_{ij} )\,\,\, \in \,{\mathbb{R}}^{108} \), respectively, where \( {\mathbf{r}}_{{P_{0} O}}^{G} = [\begin{array}{*{20}c} {x_{{P_{0} O}}^{G} } & {y_{{P_{0} O}}^{G} } & {z_{{P_{0} O}}^{G} } \\ \end{array} ]^{T} \), \( {\varvec{\upeta}}_{0} = [\begin{array}{*{20}c} {\alpha_{0} } & {\beta_{0} } & {\theta_{0} } \\ \end{array} ]^{T} \), \( {\mathbf{r}}_{{P_{ij} O}}^{G} = [\begin{array}{*{20}c} {x_{{P_{ij} O}}^{G} } & {y_{{P_{ij} O}}^{G} } & {z_{{P_{ij} O}}^{G} } \\ \end{array} ]^{T} \), \( {\varvec{\upeta}}_{ij} = [\begin{array}{*{20}c} {\alpha_{ij} } & {\beta_{ij} } & {\theta_{ij} } \\ \end{array} ]^{T} \).

The displacement vector of the trunk body and the associated joints of each leg are first calculated with respect to dynamic global reference frame G and subsequently, transformed to static global reference frame G 0 using the transform \( {\mathbf{A}}^{{G_{0} G}} \). Therefore, the vector of Cartesian coordinates of P 0 , P ij with respect to G 0 are \( {\mathbf{p}}_{0}^{{G_{0} }} = ({\mathbf{r}}_{{P_{0} O}}^{{G_{0} }} ,{\varvec{\upeta}}_{0} )^{T} \,\, \in {\mathbb{R}}^{6} \), \( {\mathbf{p}}_{ij}^{{G_{0} }} = ({\mathbf{r}}_{{P_{ij} O}}^{{G_{0} }} ,{\varvec{\upeta}}_{ij} )^{T} \,\, \in {\mathbb{R}}^{108} \), respectively. Since each of the joints of leg i has one DOF revolute joint, the bryant angles can be further reduced to η i1 = [0 0 θ i1]T, η i2 = [0 β i2 0]T, η i3 = [0 β i3 0]T, respectively by following Z–Y–Y convention.

The kinematic diagram of ith leg of the realistic hexapod robot is shown in Fig. 3. Here, \( \phi \) is twisted angle of the coxa (in the present study \( \phi \) = 0), l i is the projective distance between points S i and P i3 , d is diameter of the foot-pad, \( l_{i3}^{{\prime }} \) is the distance between joint i3 and foot-pad center. From the geometrical configuration shown in Fig. 3, the following relations are obtained:

$$ {\text{Bounding}}\,{\text{angle}},\quad \psi = \tan^{ - 1} \left( {{d \mathord{\left/ {\vphantom {d {2l_{i3}^{{\prime }} }}} \right. \kern-0pt} {2l_{i3}^{{\prime }} }}} \right) $$
(1)
$$ {\text{Kinematic}}\,{\text{link}}\,{\text{length}},\quad l_{i3} = {{l_{i3}^{{\prime }} } \mathord{\left/ {\vphantom {{l_{i3}^{{\prime }} } {\cos \psi }}} \right. \kern-0pt} {\cos \psi }} $$
(2)

The ranges of the joint variables: θ i1, β i2, β i3 for turning motions are restricted by the geometrical structure of the robot.

3.2 Kinematic constraint equations of the system with respect to frame G

The full kinematic model of the multi-legged robotic system that relates the position and orientation of the trunk body with that of the joint angles of the swing legs and legs in contact with the terrain has been developed in the following section. As discussed in Sect. 2, the trunk body consists of six degrees of freedom. Each of the legs consists of three rotary joints located at S i , P i 1 and P i 2 , while each of the feet tips is assumed to be spherical joint in stance phase located at P i 3 (refer to Fig. 3). In the following section, the vector loop and orientation loop equations describing the position and orientation of P 0 , S i , P ij of leg i are considered with respect to frame G. Therefore, the holonomic constraint equations that govern the state of the trunk body and ith leg of the robotic system are given by a set of equations, as shown in Eq. (3).

$$ {\mathbf{g}}_{i} ({\mathbf{p}}_{i} ) = \left( {\begin{array}{*{20}c} {{\mathbf{g}}_{1} ({\mathbf{p}}_{0} )} \\ {{\mathbf{g}}_{2} ({\mathbf{p}}_{0} )} \\ {{\mathbf{g}}_{3i} ({\mathbf{p}}_{i} )} \\ {{\mathbf{g}}_{4i} ({\mathbf{p}}_{i} )} \\ {{\mathbf{g}}_{5i} ({\mathbf{p}}_{i} )} \\ {{\mathbf{g}}_{6i} ({\mathbf{p}}_{i} )} \\ {{\mathbf{g}}_{7i} ({\mathbf{p}}_{i} )} \\ {{\mathbf{g}}_{8i} ({\mathbf{p}}_{i} )} \\ {{\mathbf{g}}_{9i} ({\mathbf{p}}_{i} )} \\ \end{array} } \right) \equiv \left( {\begin{array}{*{20}c} {{\mathbf{r}}_{{P_{0} O}}^{G} - \left. {{\mathbf{r}}_{{P_{0} O}}^{G} } \right|_{{t = t_{0} }} - \int {{\mathbf{f}}(t)} } \\ {{\varvec{\upeta}}_{0} - \left. {{\varvec{\upeta}}_{0} } \right|_{{t = t_{0} }} - \int {{\mathbf{g}}(t)} } \\ {{\mathbf{r}}_{{P_{0} O}}^{G} + {\mathbf{A}}^{{GL_{0} }} {\mathbf{r}}_{{S_{i} P_{0} }}^{{L_{0} }} + {\mathbf{A}}^{{GL^{\prime\prime}_{i} }} {\mathbf{r}}_{{P_{i1} S_{i} }}^{{L^{\prime\prime}_{i} }} - {\mathbf{r}}_{{P_{i1} O}}^{G} } \\ {{\mathbf{P}}_{r}^{T} (x,y).{\mathbf{A}}^{{L^{\prime\prime}_{i} G}} .{\mathbf{A}}^{{GL^{\prime}_{i} }} .{\mathbf{P}}_{r} (z)} \\ {{\mathbf{r}}_{{P_{i1} O}}^{G} + {\mathbf{A}}^{{GL^{\prime\prime}_{i1} }} {\mathbf{r}}_{{P_{i2} P_{i1} }}^{{L^{\prime\prime}_{i1} }} - {\mathbf{r}}_{{P_{i2} O}}^{G} } \\ {{\mathbf{P}}_{r}^{T} (x,z).{\mathbf{A}}^{{L^{\prime\prime}_{i1} G}} .{\mathbf{A}}^{{GL^{\prime}_{i1} }} .{\mathbf{P}}_{r} (y)} \\ {{\mathbf{r}}_{{P_{i2} O}}^{G} + {\mathbf{A}}^{{GL^{\prime\prime}_{i2} }} {\mathbf{r}}_{{P_{i3} P_{i2} }}^{{L^{\prime\prime}_{i2} }} - {\mathbf{r}}_{{P_{i3} O}}^{G} } \\ {{\mathbf{P}}_{r}^{T} (x,z).{\mathbf{A}}^{{L^{\prime\prime}_{i2} G}} .{\mathbf{A}}^{{GL^{\prime}_{i2} }} .{\mathbf{P}}_{r} (y)} \\ {{\mathbf{r}}_{{P_{i3} O}}^{G} - {\mathbf{r}}_{i}^{G} } \\ \end{array} } \right) = \left( {\begin{array}{*{20}c} {{\mathbf{0}}_{3} } \\ {{\mathbf{0}}_{3} } \\ {{\mathbf{0}}_{3} } \\ {{\mathbf{0}}_{2} } \\ {{\mathbf{0}}_{3} } \\ {{\mathbf{0}}_{2} } \\ {{\mathbf{0}}_{3} } \\ {{\mathbf{0}}_{2} } \\ {{\mathbf{0}}_{3} } \\ \end{array} } \right) $$
(3)

Further, the present problem is about solving the joint displacements, velocities and accelerations for a specified trunk body motion and swing leg trajectory for a selected gait on varying terrains. Therefore, the trunk body motion constraints, given by g 1 (p 0 ), g 2 (p 0 ) and swing leg motion constraints given by g 9i (p i ) are basically considered as the driving constraints in the present problem. \( {\mathbf{P}}_{r}^{T} (x,y) \), \( {\mathbf{P}}_{r}^{T} (x,z) \), P r (z) and P r (y) are basically the matrix projectors (refer to Appendix 1). Further, f (t) and g (t) are the functions that govern the motion of the trunk body at any instant of time, the details of which are given in Sect. 3.5.1. Also, \( {\mathbf{r}}_{i}^{G} \) is the coordinates of the tip point of link l i3 at any instant of time for both the stance and swing phases of leg i due to gait planning and motion planning. The local components of S i , P i 1 , P i 2 and P i 3 are fixed for a robotic structure and are given by \( {\mathbf{r}}_{{S_{i} P_{0} }}^{{L_{0} }} \), \( {\mathbf{r}}_{{P_{i1} S_{i} }}^{{L_{i}^{{\prime \prime }} }} \), \( {\mathbf{r}}_{{P_{i2} P_{i1} }}^{{L_{i1}^{{\prime \prime }} }} \), \( {\mathbf{r}}_{{P_{i3} P_{i2} }}^{{L_{i2}^{{\prime \prime }} }} \), respectively. Also, \( {\mathbf{A}}^{{GL_{0} }} \), \( {\mathbf{A}}^{{GL_{i}^{{\prime }} }} \), \( {\mathbf{A}}^{{GL_{i}^{{\prime \prime }} }} \), \( {\mathbf{A}}^{{GL_{i1}^{{\prime }} }} \), \( {\mathbf{A}}^{{GL_{i1}^{{\prime \prime }} }} \), \( {\mathbf{A}}^{{GL_{i2}^{{\prime }} }} \), \( {\mathbf{A}}^{{GL_{i2}^{{\prime \prime }} }} \) are the transformation matrices related to different local frames with respect to frame G. \( {\mathbf{A}}^{{L_{i}^{{\prime \prime }} G}} \), \( {\mathbf{A}}^{{L_{i1}^{{\prime \prime }} G}} \), \( {\mathbf{A}}^{{L_{i2}^{{\prime \prime }} G}} \) are orthogonal matrices of \( {\mathbf{A}}^{{GL_{i}^{{\prime \prime }} }} \), \( {\mathbf{A}}^{{GL_{i}^{{\prime \prime }} }} \), \( {\mathbf{A}}^{{GL_{i2}^{{\prime \prime }} }} \), respectively. The transformation matrices associated with different frames in the system are mentioned in Appendix 2.

3.3 Inverse kinematics of the robotic system

To dynamically control a hexapod robot in 3D Cartesian space, it is essential to compute the explicit inverse kinematic solutions of the system relating both the joint velocities and accelerations of the legs to the given trunk body and leg tip displacement at any instant of time.

Determination of the joint variables θ i1, β i2, β i3 (both in stance and swing phases) of ith leg of the hexapod robot are fundamental to the correct motion of the system and consequently, its stability. In stance phase (shown in Fig. 3), the position vector of S i with respect to frame G and frame \( \varvec{L}_{{\varvec{i}3}}^{{\prime }} \) can be computed using vector loop equations given by

$$ {\mathbf{r}}_{{S_{i} P_{i3} }}^{G} = {\mathbf{r}}_{{P_{0} O}}^{G} + {\mathbf{r}}_{{S_{i} P_{0} }}^{G} - {\mathbf{r}}_{{P_{i3} O}}^{G} $$
(4)
$$ {\mathbf{r}}_{{S_{i} P_{i3} }}^{{L_{i3}^{{\prime }} }} = - {\mathbf{r}}_{{P_{i3} P_{i2} }}^{{L_{i3}^{{\prime }} }} - {\mathbf{r}}_{{P_{i2} P_{i1} }}^{{L_{i3}^{{\prime }} }} - {\mathbf{r}}_{{P_{i1} S_{i} }}^{{L_{i3}^{{\prime }} }} $$
(5)

It is to be noted that the position vectors: \( {\mathbf{r}}_{{P_{0} O}}^{G} \) and \( {\mathbf{r}}_{{P_{i3} O}}^{G} \) are time dependent and govern the motions of trunk body and swing leg’s trajectory, respectively, with respect to the frame G. These predefined time derivative functions of the trajectories (both trunk body and swing legs) for locomotion analysis over any kind of terrain are basically the boundary conditions (BCs) provided to the inverse kinematic model in order to determine the joint angles at any instant of time (refer to Sect. 3.5 for details).

Equation (4) can also be written as follows:

$$ {\mathbf{r}}_{{S_{i} P_{i3} }}^{G} = {\mathbf{A}}^{{GL^{\prime}_{i3} }} .{\mathbf{r}}_{{S_{i} P_{i3} }}^{{L^{\prime}_{i3} }} = (a_{i,} b_{i,} c_{i} )^{T} \quad ({\text{say}}), $$
(6)

where a i , b i , c i denote the coordinates of \( {\mathbf{r}}_{{S_{i} P_{i3} }}^{G} \) and

$$ {\mathbf{A}}^{{GL_{i3}^{{\prime }} }} = {\mathbf{A}}^{{GL_{i2}^{{\prime \prime }} }} = {\mathbf{A}}^{{GL_{0} }} .{\mathbf{A}}^{{L_{0} L_{i2}^{{\prime \prime }} }} \quad ({\text{frames}}\,L_{i3}^{{\prime }} \,{\text{and}}\,L_{i2}^{{\prime \prime }} \,{\text{are}}\,{\text{parallel}}) $$
(7)

Since \( {\mathbf{A}}^{{L_{0} G}} \) and \( {\mathbf{A}}^{{GL_{0} }} \) are orthogonal transformation matrices, Eqs. (5), (6) and (7) can be rearranged to obtain the governing equation of the system as follows:

$$ {\mathbf{A}}^{{L_{0} G}} .{\mathbf{r}}_{{S_{i} P_{i3} }}^{G} = {\mathbf{A}}^{{L_{0} L_{i2}^{{\prime \prime }} }} .{\mathbf{r}}_{{S_{i} P_{i3} }}^{{L_{i3}^{{\prime }} }} $$
(8)

Substituting the transformation matrices, as mentioned in Appendix 2, and coordinates of the local components and thereafter, using the method of elimination, the joint angles can be obtained as follows:

$$ \theta_{\text{i1}} = \gamma - 2n\pi - 2{ \tan }^{ - 1} \left( {{{\left( {k_{i1} \pm k_{i4}^{{}} } \right)} \mathord{\left/ {\vphantom {{\left( {k_{i1} \pm k_{i4}^{{}} } \right)} {\left( {d_{i} + k_{i2} } \right)}}} \right. \kern-0pt} {\left( {d_{i} + k_{i2} } \right)}}} \right),\,\,\,n \in I $$
(9)
$$ \beta_{\text{i2}} = \phi - 2n\pi - 2{ \tan }^{ - 1} \left( {{{\left( {k_{i6} \pm k_{i7} } \right)} \mathord{\left/ {\vphantom {{\left( {k_{i6} \pm k_{i7} } \right)} {k_{i8} }}} \right. \kern-0pt} {k_{i8} }}} \right) $$
(10)
$$ \beta_{\text{i3}} = 2n\pi \pm 2{ \tan }^{ - 1} \sqrt {{{\left( {1 - k_{i5} } \right)} \mathord{\left/ {\vphantom {{\left( {1 - k_{i5} } \right)} {\left( {1 + k_{i5} } \right)}}} \right. \kern-0pt} {\left( {1 + k_{i5} } \right)}}} ,\,\,\,n \in I $$
(11)

where

$$ d_{i} = d_{i1} + d_{i2} - d_{i3} $$
(12)
$$ \begin{aligned} k_{i1} & = - \left( {a_{i} \left( {\cos \beta_{0} \cos \theta_{0} } \right) + b_{i} \left( {\cos \alpha_{0} \sin \theta_{0} + \sin \alpha_{0} \sin \beta_{0} \cos \theta_{0} } \right)} \right. \\ & \quad \left. { +\, c_{i} \left( { \sin \alpha_{0}\, \sin \theta_{0} - \cos\alpha_{0} \sin \beta_{0} \cos \theta_{0} } \right)} \right) \\ \end{aligned} $$
(13)
$$ \begin{aligned} k_{i2} & = - \left( { - a_{i} \left( {\cos \beta_{0} \sin \theta_{0} } \right) + b_{i} \left( {\cos \alpha_{0} \cos \theta_{0} - \sin \alpha_{0} \sin \beta_{0} \sin \theta_{0} } \right)} \right. \\ & \left. {\quad +\, c_{i} \left( {\sin \alpha_{0} \cos \theta_{0} + \cos \alpha_{0} \sin \beta_{0} \sin \theta_{0} } \right)} \right) \\ \end{aligned} $$
(14)
$$ k_{i3} = - \left( {a_{i} \left( {\sin \beta_{0} } \right) - b_{i} \left( {\sin \alpha_{0} \, \cos \beta_{0} } \right) + c_{i} \left( {\cos \alpha_{0} \, \cos \beta_{0} } \right)} \right) $$
(15)
$$ k_{i4} = \sqrt {k_{i1}^{2} + k_{i2}^{2} - d_{i}^{2} } $$
(16)
$$ k_{i5} = {{\left( {\left( {k_{i3} - l_{i1} .\sin \phi } \right)^{2} + \left( {k_{i4} - l_{i1} .\cos \phi } \right)^{2} - l_{i2}^{2} - l_{i3}^{2} } \right)} \mathord{\left/ {\vphantom {{\left( {\left( {k_{i3} - l_{i1} .\sin \phi } \right)^{2} + \left( {k_{i4} - l_{i1} .\cos \phi } \right)^{2} - l_{i2}^{2} - l_{i3}^{2} } \right)} {2l_{i2} .l_{i3} }}} \right. \kern-0pt} {2l_{i2} .l_{i3} }} $$
(17)
$$ k_{i6}^{{}} = \left( {k_{i3} - l_{i1} . {\text{s}}\phi } \right) $$
(18)
$$ k_{i7}^{{}} = \sqrt {\left( {k_{i3} - l_{i1} . {\text{s}}\phi } \right)^{2} + \left( {k_{i4} - l_{i1} . {\text{c}}\phi } \right)^{2} - \left( {l_{i2} + l_{i3} .k_{i5} } \right)^{2} } $$
(19)
$$ k_{i8}^{{}} = l_{i2} + l_{i3} .k_{i5} + k_{i4} - l_{i1} . {\text{c}}\phi $$
(20)

To compute the swing phase angles, it is necessary to substitute \( k_{i1}^{{\prime }} = - k_{i1} \), \( k_{i2}^{{\prime }} = - k_{i2} \) and \( k_{i3}^{{\prime }} = - k_{i3} \).

The evaluation of joint angles with respect to time leads to that of the kinematic motion parameters (like velocity, acceleration, trace of aggregate center of mass etc.) for a specified gait and motion planning of the robot on varying terrains. The velocity and acceleration vectors of the links i1, i2 and i3 of ith leg with respect to G are represented by \( {\mathbf{v}}_{ij}^{G} = ({\dot{\mathbf{r}}}_{{P_{ij} O}}^{G} ,{\varvec{\upomega}}_{{L_{ij}^{{\prime }} G}}^{{L_{ij}^{{\prime }} }} )\, \in \,{\mathbb{R}}^{108} \), \( {\dot{\mathbf{v}}}_{ij}^{G} = ({\ddot{\mathbf{r}}}_{{P_{ij} O}}^{G} ,{\dot{\varvec{\upomega}}}_{{L_{ij}^{{\prime }} G}}^{{L_{ij}^{{\prime }} }} )\) where i = 1 to 6, j = 1 to 3.

The translational velocities and accelerations of the links are calculated based on the constrained kinematic equations set represented by Eq. (3). A close analysis of the locomotion of a legged robot reveals that the calculation of angular velocities (\( {}^{{\varvec{G}_{0} }}{\varvec{\upomega}}_{ij} \)) and accelerations (\( {}^{{\varvec{G}_{0} }}{\dot{\varvec{\upomega}}}_{ij} \)) of the joints of all the legs with respect to global reference frame are very critical. During the swing phase, they are dependent on the coordinates of both P 0 and P i3, whereas during the support phase, they are dependent on the coordinates of P 0 only. A summary of the mathematical details are as given below.

For support legs,

$$ {}^{\varvec{G}}{\varvec{\upomega}}_{ij} = {\mathbf{J}}_{{r_{ij} }} .{\dot{\mathbf{p}}}_{0}^{G} $$
(21)
$$ {}^{\varvec{G}}{\dot{\varvec{\upomega }}}_{ij} ={\mathbf{J}}_{{r_{ij} }} .\ddot{\mathbf{p}}_{0}^{G} +{\dot{\mathbf{J}}}_{{r_{ij} }} .{\dot{\mathbf{p}}}_{0}^{G} $$
(22)

For swing legs,

$$ {}^{\varvec{G}}{\varvec{\upomega}}_{ij} = {\mathbf{J}}_{{r_{ij} }} .{\dot{\mathbf{p}}}_{0}^{G} + {\mathbf{J}}_{{r_{ij} }}^{{\prime }} .{\dot{\mathbf{p}}}_{i3}^{G} $$
(23)
$$ {}^{\varvec{G}}{\dot{\varvec{\upomega}}}_{ij} = {\mathbf{J}}_{{r_{ij} }} .\ddot{\mathbf{p}}_{0}^{G} + {\dot{\mathbf{J}}}_{{r_{ij} }} .{\dot{\mathbf{p}}}_{0}^{G} + {\mathbf{J}}_{{r_{ij} }}^{{\prime }} .\ddot{\mathbf{p}}_{i3}^{G} + {\dot{\mathbf{J}}}_{{r_{ij} }}^{{\prime }} .{\dot{\mathbf{p}}}_{i3}^{G} $$
(24)

Here, \( {}^{\varvec{G}}{\varvec{\upomega}}_{ij} = {\varvec{\upomega}}_{{L^{\prime}_{ij} G}}^{{L_{ij}^{{\prime }} }} \), where i = 1 to 6 and j = 1 to 3. \( {\mathbf{J}}_{{r_{ij} }} \), \( {\dot{\mathbf{J}}}_{{r_{ij} }} \), \( {\mathbf{J}}_{{r_{ij} }}^{{\prime }} \), \( {\dot{\mathbf{J}}}_{{r_{ij} }}^{{\prime }} \) are the Jacobian matrices, the details of which are given in Appendix 3.

The kinematic motion parameters represented with respect to global reference frame G 0 are given by the following equations:

$$ {\dot{\mathbf{r}}}_{{P_{ij} O}}^{{G_{0} }} = {\mathbf{A}}^{{G_{0} G}} .{\dot{\mathbf{r}}}_{{P_{ij} O}}^{G} $$
(25)
$$ \ddot{\mathbf{r}}_{{P_{ij} O}}^{{G_{0} }} = {\mathbf{A}}^{{G_{0} G}} .\ddot{\mathbf{r}}_{{P_{ij} O}}^{G} $$
(26)

where \( {\mathbf{A}}^{{G_{0} G}} \) is the transformation matrix for transformation of frame from G to G 0. The angular motion parameters with respect to frame G 0 are equal to that with respect to frame G, since the angular orientation vector η G that defines the terrain topology as discussed in Sect. 3.1, is constant. Therefore,

$$ {}^{{\varvec{G}_{0} }}{\varvec{\upomega}}_{ij} = {}^{\varvec{G}}{\varvec{\upomega}}_{ij} $$
(27)
$$ {}^{{\mathbf{G}_{0} }}{\dot{\varvec{\omega }}}_{ij} = {}^{\mathbf{G}}{\dot{\varvec{\omega }}}_{ij} $$
(28)

The aggregate center of mass of the robotic system with respect to the frame G is given by the expression:

$$ {\mathbf{r}}_{{C_{m} O}}^{G} = \frac{{m_{0} {\mathbf{r}}_{{C_{0} O}}^{G} + \sum\nolimits_{i = 1}^{6} {\sum\nolimits_{j = 1}^{3} {m_{ij} {\mathbf{r}}_{{C_{ij} O}}^{G} } } }}{{m_{0} + \sum\nolimits_{i = 1}^{6} {\sum\nolimits_{j = 1}^{3} {m_{ij} } } }}, $$
(29)

where m 0 is the combined mass of the trunk body and payload, m ij is the mass of link l ij (i = 1 to 6, j = 1 to 3), \( {\mathbf{r}}_{{C_{0} O}}^{G} \) and \( {\mathbf{r}}_{{C_{ij} O}}^{G} \) are the displacement vectors from points C 0 (location of combined Center of Mass (COM) of trunk body and payload) and C ij (location of COM of link l ij ) represented in frame G.

Therefore, aggregate center of mass of the system with respect to frame G 0 is given by,

$$ {\mathbf{r}}_{{C_{m} O}}^{{G_{0} }} = {\mathbf{A}}^{{G_{0} G}} .{\mathbf{r}}_{{C_{m} O}}^{G} $$
(30)

Equation (30) has been generalized to calculate the aggregate COM of the robot locomoting over any kind of terrain with the predefined motion planning and gait planning. It is to be noted that, for the robot’s stability, observation of the COM of the system is very important. It gives an insight into the leg characteristics, i.e., whether there is a proper synchronization among the different legs and whether the legs are able to provide necessary support to the trunk body of the system. If the center of mass is not correctly monitored, a situation might arise, when the system loses balance and falls, or its motion will be inefficient, causing greater energy consumption.

3.4 Terrain model

In the present study, the terrain along which the robot will maneuver varies from smooth to irregular topographies like flat, slope, banking, staircase, undulation etc. The data points of the topology are predefined. The kinematics of the robotic system can be intimately connected to the represented terrain in two methods.

In the first method, the topology of the terrain is defined with respect to frame L i3 by points P i3 (starting point of swing) and \( {\mathbf{P}}_{i3}^{{\prime }} \) (subsequent end points of swing). The height \( h_{in}^{{\prime }} \) (i is the leg number and n is the duty cycle number) measured along Z with respect to frame L i3 (as shown in Fig. 4) is basically the height of the terrain, where the foot tip of swing leg i touches the terrain in the nth cycle. The height Hm in (i is the leg number and n is the duty cycle number) along Z with respect to frame L i3 is the maximum height of the terrain on the path of swing in the nth cycle. The data points with respect to frame L i3 are transformed to global reference frame G. The values of \( h_{in}^{{\prime }} \) and Hm in are provided as inputs for simulations. It is to be noted that the robot performs foot placement at ideal position, which results from the path (both trunk body and legs) and gait planning.

The second method is about the issue of map-based foot placement and subsequently, path generation. The robot can plan a path from the initial to final positions based on given topographic map information as input. The topography of the terrain is developed on a CAD workbench and its data points with respect to the global reference frame G are extracted. During simulation, the algorithm calculates the maximum height (Hm in ) of the topography in the workspace through which the leg has to traverse. Moreover, the support point coordinate \( z_{{P_{i3} O}}^{G} \) with respect to global frame G, i.e., the height of terrain \( h_{in}^{{\prime }} \) with respect to local frame L i3 is determined based on the information of the coordinates \( x_{{P_{i3} O}}^{G} \) and \( y_{{P_{i3} O}}^{G} \). In other words, during each step, the foot-tip of the ith leg searches for the possible foot placement location or points and determines the coordinate that helps the robot to continue an efficient gait. During the swing of each leg, it is assumed that the maximum height of swing trajectory is always greater than that of topography by ∆h.

3.5 Motion planning

To carry out inverse kinematics of a realistic hexapod robot, it is necessary to consider realistic motion characteristics of the trunk body (for location P 0 ) and tip of swing legs (for location P i 3 ) during locomotion. It is assumed that the motions are regulated by a function, which is basically ADAMS (Automated Dynamic Analysis of Mechanical Systems) step function that approximates the Heaviside step function with a cubic polynomial. It is given by the following expression:

$$ h = h_{a} + a.\Delta ^{2} \left( {3 - 2\Delta } \right),\quad {\text{for}}\,t_{a} \,{\text{to}}\,t_{b} $$
(31)

where

$$\begin{aligned} {}&a = h_{b} - h_{a} ,\\ & \quad (h_{a} = {\text{initial}}\,{\text{step}}\,{\text{value}}\,{\text{at}}\,{\text{time}}\,t_{a} ,\\ & \quad\ h_{b} = {\text{final}}\,{\text{step}}\,{\text{value}}\,{\text{at}}\,{\text{time}}\,t_{b} )\end{aligned} $$
(32)
$$ \Delta = (t - t_{a} )/(t_{b} - t_{a} ) $$
(33)

It is to be noted that Eq. (31) has a smooth function value during the transition over a specified interval of an independent variable. It also has smooth changes in the first derivatives of the function at the transition points of the function making the first derivative continuous. This is the basis for consideration of Eq. (31) in the present study.

3.5.1 Trunk body motion planning

During locomotion, the trunk body should have an uninterrupted and continuous motion for the given initial position, orientation (roll, pitch and yaw) and maximum rate of change of angular displacement of the trunk body. In the present study, the authors have tried to formulate the angular constraint derivatives g(t) = [g x (t) g y (t) g z (t)]T along with the translational constraint derivative f(t) = [f x (t) f y (t) f z (t)]T. The six driving constraint equations (i.e., three translational and three angular constraints) constituting the six degrees of freedom of the trunk body, govern the state of the inverse kinematics problem. This makes the locomotion more realistic, such that the body can be raised, lowered or tilted in accordance with the legs’ movements. This is very much essential for a robot to maneuver in an uneven terrain with stable gaits strategy. These constraints are assumed to follow a cubic polynomial as discussed earlier.

During turning, the function that governs the yaw motion, i.e., the rate of change of angular displacement (\( \dot{\theta }_{0} (t) \)) of the trunk body at any instant of time along z-axis of frame G is given by,

$$ \begin{aligned} g_{z} (t) & = \left. {\dot{\theta }_{0} } \right|_{{t = t_{0} }} +\, {\text{a}}_{{\dot{\theta }_{0} }} \Delta_{a}^{2} (3 - 2\Delta_{a} )\quad {\text{for}}\;\;t_{0} \,{\text{to}}\,t_{1} \\ & = \left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} \quad {\text{for}}\;\;t_{1} \,{\text{to}}\,t_{2} \\ & = \left. {\dot{\theta }_{0} } \right|_{{t = t_{2} }} - \,{\text{a}}_{{\dot{\theta }_{0} }} \Delta_{d}^{2} (3 - 2\Delta_{d} )\quad {\text{for}}\;\;t_{2} \,{\text{to}}\,t_{3} \\ \end{aligned} $$
(34)

where,

$$ {\text{a}}_{{\dot{\theta }_{0} }} = \left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} - \left. {\dot{\theta }_{0} } \right|_{{t = t_{0} }} $$
(35)
$$ \Delta_{a} = (t - t_{0} )/(t_{1} - t_{0} ) $$
(36)
$$ \Delta_{d} = (t - t_{1} )/(t_{2} - t_{1} ) $$
(37)

Here, t 0 is the initial time of start of trunk body motion, t 1 is the time taken to reach the maximum angular displacement rate, t 2 is the time of start of retardation of the trunk body, t 3 is the total time of motion of the robot. Similarly, the functions: g x (t) and g y (t) that govern the pitching and rolling motions of the trunk body, respectively, are regulated by a cubic polynomial like that given in Eq. (31). Once the angular constraint derivative g(t) is determined, the angular velocity of the trunk body (\( {\varvec{\upomega}}_{{L_{0} G}}^{{L_{0} }} \)) can be easily calculated and is given by the expression:

$$ {\varvec{\upomega}}_{{L_{0} G}}^{{L_{0} }} = \left( {\begin{array}{*{20}l} {{\text{c}}\beta_{0} \text{c} \theta_{0} \dot{\alpha }_{0} + \text{s} \theta_{0} \dot{\beta }_{0} } \hfill \\ { - {\text{c}}\beta_{0} \text{s} \theta_{0} \dot{\alpha }_{0} + \text{c} \theta_{0} \dot{\beta }_{0} } \hfill \\ {{\text{s}}\beta_{0} \dot{\alpha }_{0} { + }\dot{\theta }_{0} } \hfill \\ \end{array} } \right) $$
(38)

The function f(t) governs the translational motion of the trunk body at any instant of time, such that,

$$ \begin{aligned} {\dot{\mathbf{r}}}_{{P_{0} O}}^{G} & = {\mathbf{f}}(t) = [{\text{f}}_{x} (t){\text{ f}}_{y} (t){\text{ f}}_{z} (t)]^{T} \\ & = \left[ {\begin{array}{*{20}c} { - \rho_{0} {\text{g}}_{z} (t)\sin \theta_{0} } & {\rho_{0} {\text{g}}_{z} (t)\cos \theta_{0} \,} & {\dot{z}_{{P_{0} O}}^{G} } \\ \end{array} } \right]^{T} \\ \end{aligned} $$
(39)

where ρ 0 is the turning radius of point P 0, \( \dot{z}_{{P_{0} O}}^{{G_{{}} }} \) is the translational motion of the trunk body along z-axis of frame G and follows a cubic polynomial like that in Eq. (31).

Hence, the velocity vector of the trunk body, \( {\mathbf{v}}_{0}^{G} = ({\dot{\mathbf{r}}}_{{P_{0} O}}^{G} ,{\varvec{\upomega}}_{{L_{0} G}}^{{L_{0} }} )\, \in \,{\mathbb{R}}^{6} \) is considered to be one of the basic inputs to the inverse kinematics of the system. Subsequently, the velocity vector of the trunk body can be transformed to static global reference frame G 0 using the transformation matrix \( {\mathbf{A}}^{{G_{0} G}} \).

3.5.2 Swing leg trajectory planning

Trajectory planning of the swing legs with turning gait strategy is computationally intensive though it is a fundamental step in the study of kinematics and dynamics of the hexapod robot. In the present model, the robot has the ability to adjust its parameters according to the topography of the terrain. The swing leg moves through a predefined trajectory in 3D Cartesian space with the strokes of the swing legs positioned on the inner side are shorter compared to those of the swing legs placed on the outer side. The trajectory of the swing is considered to be a local behavior of the leg with respect to frame L i 3 . After successful computation, the local coordinates are transformed to the global coordinates of the leg with respect to the frame of reference G.

The following steps are required to compute the coordinates of the feet-tips during swing phase and their relevant feetholds in stance phase.

Step 1:

Selection of initial inputs for calculation of the trajectory of swing leg i with respect to frame G. The relevant inputs are as follows:

For trunk body: (a) angular stroke \( s_{0}^{c} \) (for turning motion), (b) initial position and orientation, (c) maximum rate of change of displacement (both angular and translation).

For Legs: (a) initial joint positions with respect to local frames, (b) initial joint angles, (c) trajectory ascend (γ xz , γ yz ) and descend angles (\( \gamma_{xz}^{{\prime }} \, , \, \gamma_{yz}^{{\prime }} \)).

For Terrain: (a) terrain height at the initial point of support, i.e., h in (height of point P i3 w.r.t. frame G) and subsequent heights at the end of swing phases, i.e., \( h_{in}^{{\prime }} \), (b) maximum height of terrain Hm in , (c) minimum gap between maximum height of swing and maximum height of terrain ∆h (refer to Fig. 4).

Other Relevant Input is the turning radius ρ 0.

Step 2:

Calculation of the foot tip’s motion parameters during swing leg trajectory planning with respect to the frame L i3 using BCs P i3 (initial foothold position), Q i3 (point at which swing height reaches the maximum and translational velocity along Z with respect to frame G is zero), R i3 (point at which translational velocity along X with respect to frame G reaches the maximum), T i3 (point of start of retardation) and \( {\mathbf{P^{\prime}}}_{i3} \) (point of foothold after the end of swing phase). Refer to Appendix 4 for details. Also, the turning foot tip radius ρ i , as shown in Fig. 4, is calculated from the forward kinematics discussed in Sect. 3.2.

Step 3:

Transformation of the foot tip’s motion parameters from local reference frame L i3 to dynamic global reference frame G.

Once the motion parameters have been computed with respect to frame L i3 , it is important to transform the same to frame G using vector loop equations as stated below (refer to Fig. 4). Therefore,

$$ {\mathbf{r}}_{{P_{i3}^{s} O}}^{G} = {\mathbf{r}}_{{P_{i3} O}}^{G} + {\mathbf{A}}^{{GL_{i3}^{{{\prime \prime \prime }}} }} .{\mathbf{r}}_{{P_{i3}^{s} P_{i3} }}^{{L_{i3}^{{{\prime \prime \prime }}} }} $$
(40)

Here, the suffix s for the point \( {\mathbf{P}}_{i3}^{s} \) represents swing, \( {\mathbf{A}}^{{GL_{i3} }} = {\mathbf{I}}_{3} \) (identity matrix), \( {\mathbf{A}}^{{GL_{i3}^{{{\prime \prime \prime }}} }} = {\mathbf{A}}^{{L_{i3} L_{i3}^{{{\prime \prime \prime }}} }} \). Refer to Appendix 1 for details.

Step 4:

Transformation of the foot tip’s motion parameters from frame G to G 0 for a fixed orientation vector η G using the transform \( {\mathbf{A}}^{{G_{0} G}} \).

3.6 Foot slip during support phase

In the present study, an attempt has been made to make the motion of the legs more realistic by taking into account foot slip during foot-terrain interaction in support phase. The translational velocity along Z-direction gradually comes to zero and thereafter, slip occurs till the start of the next swing phase. It is assumed that the slip of the leg tip occurs in XY plane of global frame G at a slip angle, ε s and the slip velocity, \( v_{xy}^{{N_{i3} }} \) with respect to local frame N i3 (refer to Fig. 5a) instantaneously comes to zero at the time of lift from point P i3 of the next phase. It is to be noted that the slip velocity of the support leg instantaneously comes to zero at the time of take off at point P i3. Also, the slip trajectory is simplified to a straight path, which starts at the beginning of support phase (point \( {\mathbf{P^{\prime}}}_{i3} \)) and ends at the start of next swing phase P i3, as shown in Fig. 5a. The slip velocity \( v_{xy}^{{N_{i3} }} \) is assumed to be regulated by a cubic polynomial like the Eq. (31) and is given by,

$$ \begin{aligned} v_{xy}^{{N_{i3} }} (t) & = \left. {v_{xy}^{{N_{i3} }} } \right|_{{t = t_{0}^{su} }} +\, a_{xy} .\Delta_{{a_{xy} }}^{2} (3 - 2\Delta_{{a_{xy} }}^{{}} )\quad {\text{for}}\;\;t_{start}^{su} \,{\text{to}}\,t_{1}^{su} \\ & = \left. {v_{xy}^{{N_{i3} }} } \right|_{{t = t_{1}^{su} }} \quad \hbox{for}\;\;t_{1}^{su} \,\hbox{to}\,t_{2}^{su} \\ & = \left. {v_{xy}^{{N_{i3} }} } \right|_{{t = t_{2}^{su} }} - \,a_{xy} .\Delta_{{d_{xy} }}^{2} (3 - 2\Delta_{{d_{xy} }}^{{}} )\quad {\text{for}}\;\;t_{2}^{su} \,\hbox{to}\,t_{end}^{su} \\ \end{aligned} $$
(41)

where for every support phase of leg i, \( t_{start}^{su} \), \( t_{1}^{su} \), \( t_{2}^{su} \) and \( t_{end}^{su} \) (suffix su represents support) indicate the initial start time (at point \( {\mathbf{P}}_{i3}^{{\prime }} \)), time taken to reach maximum slip velocity, time of start of retardation, and end time of leg’s slip (at point P i3 of the next swing phase), respectively (refer to Fig. 5b). Also,

$$ a_{xy} = \left. {v_{xy}^{{N_{i3} }} } \right|_{{t = t_{1}^{su} }} - \left. {v_{xy}^{{N_{i3} }} } \right|_{{t = t_{0}^{su} }} $$
(42)
$$ \Delta_{{a_{xy} }}^{{}} = \left( {t - t_{0}^{su} } \right)/\left( {t_{1}^{su} - t_{0}^{su} } \right) $$
(43)
$$ \Delta_{{d_{xy} }}^{{}} = \left( {t - t_{1}^{su} } \right)/\left( {t_{2}^{su} - t_{1}^{su} } \right) $$
(44)

The values of \( t_{start}^{su} \) and \( t_{end}^{su} \) can easily be computed for a leg in support phase during a duty cycle as discussed in the next Sect. 3.7. Further, assuming the relation as mentioned below, the values of \( t_{1}^{su} \) and \( t_{2}^{su} \) can also be obtained.

$$ \Delta t^{su} = t_{1}^{su} - t_{start}^{su} = t_{end}^{su} - t_{2}^{su} $$
(45)

The slip velocity with respect to global frame G is given by the expression:

$$ v_{xy}^{G} = {\mathbf{A}}^{{GN_{i3} }} .v_{xy}^{{N_{i3} }} $$

Here, the transformation matrix \( {\mathbf{A}}^{{GN_{i3} }} = {\mathbf{I}}_{3} \), since the frame local N i3 is assumed to be parallel to global frame G.

Fig. 5
figure 5

Foot slip during support phase of ith leg a a scheme of foot-terrain interaction kinematics, b slip velocity versus time

The components of slip velocities along X and Y axes are given by the following expressions:

$$ v_{x}^{G} = v_{xy}^{G} .\cos \varepsilon_{s} = v_{xy}^{{N_{i3} }} .\cos \varepsilon_{s} $$
(46)
$$ v_{y}^{G} = v_{xy}^{G} .\sin \varepsilon_{s} = v_{xy}^{{N_{i3} }} .\sin \varepsilon_{s} $$
(47)

The displacement of the leg tip with respect to frame G at any instant of time during slip (i.e., \( {\mathbf{r}}_{{P_{i3}^{su} O}}^{G} \) as shown in Fig. 5a) can be calculated by integrating Eq. (46) and (47) with respect to time t respectively. Thereafter, using the transformation matrix \( {\mathbf{A}}^{{G_{0} G}} \), the displacement of the tip can be computed with respect to fixed global reference frame G 0. The magnitude of slip velocity is assumed to be small, since too much slip of the leg tip will make the robotic structure staggered and the desired robot motion may not be achieved for a specific task. It is to be remembered that the effect of the foot-terrain interaction is more important to study, while tackling the coupled-dynamics problems.

3.7 Gait planning

To move the robot’s legs in a sequential manner, it is necessary to have an effective gait planning and an efficient algorithm to address the movement of the trunk body and legs walking on the curved path in varying terrains. In the present study, focus has been made on the gait strategies with duty factor (DF) = 1/2 (refer to Fig. 6) for locomotion along with the total gait cycle time, swing phase time and stance phase time (Song and Waldron 1989). During turning motion, the robot starts to maneuver in a circular path with radius, ρ 0 (at point P 0) and angular stroke, \( s_{0}^{c} \) of the trunk body. At the start of motion, the initial rate of change of angular displacement of the trunk body with respect to point P 0 is considered to be \( \left. {\dot{\theta }_{0} } \right|_{{t = t_{0} }} \), while the maximum rate of change of angular displacement is \( \left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} \), as discussed in Sect. 3.5.1. Figure 7 shows the rate of change of angular displacement of the trunk body along z-axis of frame G with n gait cycles. The total time of motion of the robot is equivalent to the time taken to complete n duty cycles, i.e., \( \left. {t_{3}^{s} } \right|_{n} = t_{3} \) (suffix s represents swing) and is calculated as follows:

$$ t_{3} = t_{0} + 2\Delta t + \left( {{1 \mathord{\left/ {\vphantom {1 {\left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} }}} \right. \kern-0pt} {\left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} }}} \right)\left[ {{{n.\left( {6{\text{s}}_{0}^{{\prime \prime }} } \right)} \mathord{\left/ {\vphantom {{n.\left( {6{\text{s}}_{0}^{{\prime \prime }} } \right)} {\rho_{0} }}} \right. \kern-0pt} {\rho_{0} }} - \left( {\left. {\dot{\theta }_{0} } \right|_{{t = t_{0} }} +\, {{{\text{a}}_{{\dot{\theta }_{0} }} } \mathord{\left/ {\vphantom {{{\text{a}}_{{\dot{\theta }_{0} }} } 2}} \right. \kern-0pt} 2}} \right).\left( {{1 \mathord{\left/ {\vphantom {1 {\Delta_{a}^{{\prime }} }}} \right. \kern-0pt} {\Delta_{a}^{{\prime }} }}} \right) - \left( {\left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} -\, {{{\text{a}}_{{\dot{\theta }_{0} }} } \mathord{\left/ {\vphantom {{{\text{a}}_{{\dot{\theta }_{0} }} } 2}} \right. \kern-0pt} 2}} \right).\left( {{1 \mathord{\left/ {\vphantom {1 {\Delta_{d}^{{\prime }} }}} \right. \kern-0pt} {\Delta_{d}^{{\prime }} }}} \right)} \right] $$
(48)

where \( s_{0}^{{\prime \prime }} \) is the displacement of trunk body per division in a gait cycle shown in Fig. 6; \( \Delta_{a}^{{\prime }} \) and \( \Delta_{d}^{{\prime }} \) are the first derivatives of ∆ a and ∆ d with respect to time, respectively; \( \left. {\dot{\theta }_{0} } \right|_{{t = t_{0} }} \) and \( \left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} \) are the minimum and maximum rate of change of angular displacements of the trunk body along z-axis of frame G at time t 0 and t 1 respectively, ∆t is the duration of acceleration and deceleration of the trunk body (refer to Appendix 5 for details).

Fig. 6
figure 6

Wave gait (DF = 1/2) under investigation

Fig. 7
figure 7

Rate of change of angular displacement of the trunk body along Z-axis of frame G with respect to time

The end time for each of the gait cycles is calculated as follows:

$$ \left. {t_{3}^{s} } \right|_{1} = t_{1} + \left( {{1 \mathord{\left/ {\vphantom {1 {\left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} }}} \right. \kern-0pt} {\left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} }}} \right)\left[ {{{6{\text{s}}_{0}^{{\prime \prime }} } \mathord{\left/ {\vphantom {{6{\text{s}}_{0}^{{\prime \prime }} } {\rho_{0} }}} \right. \kern-0pt} {\rho_{0} }} - \left( {\left. {\dot{\theta }_{0} } \right|_{{t = t_{0} }} +\, {{\left. {\dot{\theta }_{0} } \right|_{{t_{1} t_{2} }} } \mathord{\left/ {\vphantom {{\left. {\dot{\theta }_{0} } \right|_{{t_{1} t_{2} }} } 2}} \right. \kern-0pt} 2}} \right).\left( {{1 \mathord{\left/ {\vphantom {1 {\Delta_{a}^{{\prime }} }}} \right. \kern-0pt} {\Delta_{a}^{{\prime }} }}} \right)} \right], $$
(49)
$$ \left. {t_{3}^{s} } \right|_{2} = \left. {t_{3}^{s} } \right|_{1} +\, {{6{\text{s}}_{0}^{{\prime \prime }} } \mathord{\left/ {\vphantom {{6{\text{s}}_{0}^{{\prime \prime }} } {\left( {\left. {\rho_{0} .\dot{\theta }_{0} } \right|_{{t = t_{1} }} } \right)}}} \right. \kern-0pt} {\left( {\left. {\rho_{0} .\dot{\theta }_{0} } \right|_{{t = t_{1} }} } \right)}}, $$
(50)
$$ \begin{array}{*{20}c} \vdots & \vdots & \vdots \\ \end{array} $$
$$ \left. {t_{3}^{s} } \right|_{n - 1} = \left. {t_{3}^{s} } \right|_{n - 2} +\, {{6{\text{s}}_{0}^{{\prime \prime }} } \mathord{\left/ {\vphantom {{6{\text{s}}_{0}^{{\prime \prime }} } {\left( {\left. {\rho_{0} .\dot{\theta }_{0} } \right|_{{t = t_{1} }} } \right)}}} \right. \kern-0pt} {\left( {\left. {\rho_{0} .\dot{\theta }_{0} } \right|_{{t = t_{1} }} } \right)}}, $$
(51)
$$ \left. {t_{3}^{s} } \right|_{n} = t_{3} . $$
(52)

After the calculation of end time for each of the gait cycles, the time of swing and support phase of each of the legs during the cycle can be sequenced according to the gait diagram, as shown in Fig. 7. This helps to form a proper synchronization between the legs and trunk body.

4 Numerical illustrations and validation

In this section, the capabilities of the developed kinematic model to tackle varying terrain conditions are tested with two case studies adopting the tripod wave gait (DF = 1/2), since it is a standard gait for hexapod walking robots. A flowchart shown in Fig. 8 illustrates the steps to be followed to carry out the inverse kinematic analysis.

Fig. 8
figure 8

Flowchart of computational algorithm for the inverse kinematic analysis

Furthermore, the numerically simulated results have been verified through the application of VP tools like MSC.ADAMS®. The components of the robot have complex geometries and therefore, it is difficult to model the same in MSC.ADAMS® workbench. Moreover, perfectly defining the constraints like revolute joints of the robot is also cumbersome. Therefore, to execute an error-free model in MSC.ADAMS®, it is necessary to preprocess it. The following important preprocessing steps are followed to achieve the same:

  • Step 1: Translating the CAD model into CATIA SimDesigner (commercially available CAD package) workbench

  • Step 2: Defining the constraints like joints, contacts in the CAD parts etc.

  • Step 3: Exporting the model into MSC.ADAMS® keeping all the complex geometries, material, constraints etc. intact.

  • Step 4: Importing the .cmd file in MSC.ADAMS® workbench

In ADAMS workbench, the imported model is further preprocessed by defining the trunk body and tip point motion parameters as inputs. These inputs are basically the computed results obtained from the analytical approach, which is discussed in Sect. 3. Suitable markers that define the location and orientation of the motion on the bodies (trunk body and the legs) in 3D space are added to the points P 0 and P i3 (i = 1 to 6). In the general point motion tool (added to the defined markers) of MSC.ADAMS®, the input motions are prescribed by using Akima fitting function. The input motion corresponds to the rate of change of displacement of the trunk body (both translational and angular) and leg tip (translational) with respect to terrain as reference and defined in global coordinates. After preprocessing, the simulation is executed in MSC.ADAMS® solver for the same number of step size and end time, as solved analytically. Thereafter, post processing of the computed results is done and these are compared with the analytical results.

4.1 Case study I: Turning motion along a banked surface

In the present case study, an attempt has been made to maneuver the robot without payload over a banking surface using its turning motion capabilities with DF = 1/2. The rate of change of translational displacement (along X, Y and Z) of the trunk body with respect to global frame G follows the relationship, as given below (also refer to Eq. (39)).

$$ {\dot{\mathbf{r}}}_{{P_{0} O}}^{G} = \left( { - \rho_{0} \dot{\theta }_{0} \sin \theta_{0} ,\rho_{0} \dot{\theta }_{0} \cos \theta_{0} ,0} \right)^{T} $$
(53)

At time t = 0, the position and orientation of P 0 with respect to global frame G is given by \( {\mathbf{p}}_{0}^{G} \) = {1.3, 0.75, 0.15, 0, 0, 30}T. The initial velocity components are assumed to be equal to zero. The maximum rate of change of angular displacement of the trunk body along Z direction with respect to frame L 0 is assumed to be equal to \( \left. {\dot{\theta }_{0} } \right|_{\hbox{max} } \)  =  \( \left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} \)  = +0.1 rad/s with \( \dot{\alpha }_{0} \)  = 0, \( \dot{\beta }_{0} \)  = 0, in the present case. The turning radius of the trunk body throughout the motion of the robot is considered as ρ 0 = 1.5 m. The initial joint angles θ i1 of all the joints of the robot are calculated using some geometrical relations described Appendix 4.III. Here, all the joint angles are noted in the order of [θ i1, β i2, β i3] (for i = 1 to 6) as [5°, −16°, −69°] for leg 1, [12°, 16°, 69°] for leg 2, [12°, −16°, −69°] for leg 3, [18.5°, 16°, 69°] for leg 4, [22°, −16°, −69°] for leg 5, [27.5°, 16°, 69°] for leg 6. In addition to the above, the other necessary inputs are η G  = [0, −15°, 0]T, maximum height of swing along Z with respect to frame L i3 = 0.005 m (=Hm in  + Δh) for all duty cycles. Since the terrain surface is flat, \( h_{in}^{{\prime }} \) = 0 for all duty cycles. Also, the maximum slip velocity is assumed to be equal to 0.001 m/s with a slip angle of εs = 45°. The simulations are run for three duty cycles, i.e., n = 3 with DF = 1/2 and \( s_{0}^{c} \)  = 0.120 m in MATLAB.

The total time of motion of the robot for three duty cycles is calculated to be equal to 5.75 s (1st cycle—2.05 s, 2nd cycle—1.65 s, and the 3rd cycle—2.05 s, respectively) as calculated using Eq. (49). The 2nd cycle time is less compared to the 1st and 3rd cycle time due to the effects of acceleration and deceleration on the trunk body in the starting and ending cycles, respectively. The variations of the angular displacement rates of the trunk body during the robot’s motion along the banked surface are computed using Eqs. (31) and (34) followed by the computation of the translational displacement rates of the trunk body, based on the Eq. (53) (Refer to Fig. 9a, b). It can be observed from Fig. 9a, b that the translational displacement rate along Z axis and angular displacement rate along X and Y axes are zero. This means that the trunk body is always at a constant height with respect to the frame G in the present case study.

Fig. 9
figure 9

Trunk body motion on a banked surface for three duty cycles a rate of change of translational displacement, b rate of change of angular displacement

The position, velocity and acceleration of the leg tip P i3 (i = 1 to 6) are computed with respect to frame G 0 based on the motion and gait planning algorithms, as discussed in Sects. 3.5.2, 3.6 and 3.7. The trace of the position of P i3 (i = 1 to 6) is plotted in 3D cartesian space, as shown in Fig. 10. The projections of the 3D motion trajectories of all the legs to the XY plane show the curve paths followed by the robot’s legs to execute turning motion. Here, the effect of slip is negligible, since the slip velocity (in XY plane) is very less compared to the swing velocity of the legs. In Fig. 11, it is interesting to note the motion of the tip of leg 1 in XY plane of frame G during the support phase for a given gait sequence, which actually illustrates the slippage condition. The maximum slip distance as obtained from calculations is approximately equal to 0.001 m.

Fig. 10
figure 10

3D motion trajectory of leg tip P i3 on a banked surface with respect to frame G 0 a legs 1 and 2, b legs 3 and 4, c legs 5 and 6

Fig. 11
figure 11

Translational velocities of tip point P 13 (Leg 1) with respect to frame G, showing slip motion during support phase in XY plane

After the computations in MATLAB are over, the relevant motion data (velocity) of the trunk body and leg tip are imported into MSC.ADAMS®, as the inputs. The simulations are subsequently run in MSC.ADAMS® solver for a total cycle of 5.75 s with a time-step of h = 0.05 s. Some of the snapshots of the robot simulated in MSC.ADAMS®, while traversing the banked surface using wave gait strategy and turning motion capabilities are shown in Fig. 12. The visualized motion of the robotic system is as desirable with the gait sequences: 1–4–5 and 2–3–6. The simulated results are in agreement with the computed data of the proposed motion planning algorithm, which further prove its efficacy. The corresponding simulation time is indicated for each snapshot. The results of kinematic analysis of leg 1 obtained in MATLAB are compared with those of MSC.ADAMS®, and a close match has been obtained (refer to Fig. 13). The joint angles are lying within the expected limits, which show that at no time during the motion, the configuration of the robot is staggered and there is no interference between the legs during the motion. The differences in the values of angular displacement of the legs vary in the range of (−3.8°, 9.1°) approximately. Also, the magnitude of angular velocities of joint 12 and 13 (refer to Fig. 13e, h) are less compared to that of joint 11 (refer to Fig. 13b). Moreover, Fig. 13b shows that the angular velocity of joint 11 during swing phase varies steadily at a faster rate compared to that during support phase. Maximum angular velocity of the joint occurs during swing phase of the cycle, which is due to the effect of trunk body motion on the swing motion of the robot’s leg. Further, the position of the aggregate COM of the system in 3D Cartesian space obtained analytically is compared with the simulated results in MSC.ADAMS®. The analytical data are in close agreement with those obtained with MSC.ADAMS® (refer to Fig. 14).

Fig. 12
figure 12

Snapshots of a realistic six-legged robot simulated in MSC.ADAMS® for maneuverability over a banking surface with turning motion capabilities using wave gait (DF = 1/2)

Fig. 13
figure 13

Comparative graphs of the kinematic analysis of a realistic six-legged robot during turning motion on a banked surface using wave gait (DF = 1/2) for leg 1. Joint 11 a angular displacement, b angular velocity, c angular acceleration. Joint 12 d angular displacement, e angular velocity, f angular acceleration. Joint 13 g angular displacement, h angular velocity, i Angular acceleration

Fig. 14
figure 14

Comparison of the analytical results of the aggregate COM of the system with respect to frame G 0 during turning motion on a banked surface with that of MSC.ADAMS®

4.2 Case study II: Turning motion on an uneven terrain

Locomotion analysis of a hexapod robot over an uneven terrain is complex. An attempt has been made in the present case study to explore the turning motion capabilities of the robot with payload on such terrains with DF = 1/2. The surface irregularities of the terrain are assumed to be small with values ranging from 5 mm to 8 mm with respect to local frame L i3 on the path of the leg swing. To make the motion of robot realistic on such topography, both translational and angular displacement rates of the trunk body are taken into consideration. The angular displacement rates of the trunk body are governed by functions g x (t), g y (t) and gz(t) along their respective axes, whereas the translational displacement rates (along X, Y and Z) of the trunk body are governed by the Eq. (39), as discussed in Sect. 3.5.1.

In the present case, at time t = 0 s, the position and orientation of the point P 0 with respect to frame G is given by \( {\mathbf{p}}_{0}^{G} \) = {1.73, 1.0, 0.15, 1, −2, 30}T. The initial velocity components of the bodies in the system are assumed to be equal to zero. The maximum and minimum rate of change of angular displacements of the trunk body along the axes X and Y with respect to frame L 0 are given by \( \left. {\dot{\alpha }_{0} } \right|_{\hbox{max} ,min} \)  = ±0.01 rad/s, \( \left. {\dot{\beta }_{0} } \right|_{\hbox{max} ,min} \) = ±0.01 rad/s, whereas the maximum rate of change of angular displacement of the trunk body along Z is assumed to be equal to \( \left. {\dot{\theta }_{0} } \right|_{\hbox{max} } = \left. {\dot{\theta }_{0} } \right|_{{t = t_{1} }} \)  = +0.1 rad/s. Similarly, the maximum rate of change of translational displacements of the trunk body along the respective axes with respect to frame G are given by \( \left. {\dot{x}_{{P_{0} O}}^{G} } \right|_{\hbox{max} } = - \rho_{0} \left. {\dot{\theta }_{0} } \right|_{\hbox{max} } \sin \left. {\theta_{0} } \right|_{{t = t_{1} }} \), \( \left. {\dot{y}_{{P_{0} O}}^{G} } \right|_{\hbox{max} } = - \rho_{0} \left. {\dot{\theta }_{0} } \right|_{\hbox{max} } \cos \left. {\theta_{0} } \right|_{{t = t_{1} }} \) and \( \left. {\dot{z}_{{P_{0} O}}^{G} } \right|_{\hbox{max} } \) = 0.005 m/s (refer to Fig. 15). The turning radius (ρ 0) of the point P 0 on the trunk body is assumed to be equal to 2.0 m. Also, the joint angle θ i1 (i = 1to 6) for the robot’s initial configuration are calculated using geometrical relations given in Appendix 4.III. If the joint angles of leg i are in the order of [θ i1, β i2, β i3] (for i = 1 to 6), then the corresponding joint angles are [11.5°, −16°, −69°] for leg 1, [18°, 16°, 69°] for leg 2, [16.5°, −16°, −69°] for leg 3, [22.5°, 16°, 69°] for leg 4, [24°, −16°, −69°] for leg 5, [29.5°, 16°, 69°] for leg 6. The other relevant inputs are related to the topography of the terrain, namely (i) Hm in and (ii) \( h_{in}^{{\prime }} \) with respect to frame L i3 (refer to Fig. 4). For three duty cycles (n = 3), the values of Hm in is in the order of [Hm i1 , Hm i2 , Hm i3 ] for i = 1 to 6, such that, [0.005, 0.005, 0.005] corresponds to Leg 1, [0.006, 0.008, 0.003] corresponds to Leg 2, [0.004, 0.005, 0.002] corresponds to Leg 3, [0.006, 0.006, 0.004] corresponds to Leg 4, [0.006, 0.008, 0.003] corresponds to Leg 5 and [0.005, 0.005, 0.005] corresponds to Leg 6 (all values are in m). Similarly, the values of \( h_{in}^{{\prime }} \) are in the order of [\( h_{i1}^{{\prime }} \), \( h_{i2}^{{\prime }} \), \( h_{i3}^{{\prime }} \)] for i = 1 to 6, such that, [0.003, 0.005, −0.003] corresponds to leg 1, [0.004, 0.006, 0.0] corresponds to leg 2, [0.0042, 0.004, −0.002] corresponds to leg 3, [0.002, 0.002, −0.003] corresponds to leg 4, [0.0064, 0.006, 0.0] corresponds to leg 5 and [0.003, 0.005, 0.003] corresponds to leg 6 (all values are in m). The value of Δh is kept equal to 0.002 m. In addition to the above, the other necessary inputs are η G  = [0, 0, 0]T. Since, there is slippage of the legs during support phase, the maximum slip velocity is assumed to be equal to 0.005 m/s with a slip angle of εs = 45° for all the legs. The simulations are run for three duty cycles with DF = 1/2 and \( s_{0}^{c} \) = 0.150 m in MATLAB.

Fig. 15
figure 15

Trunk body motion on an uneven terrain for three duty cycles a rate of change of translational displacement, b rate of change of angular displacement

The total simulation time computed in MATLAB to execute the motion of the robot for three duty cycles is 5.45 s (1st cycle—2.0 s, 2nd cycle—1.45 s, 3rd cycle—2 s), as calculated using Eq. (49). It is to be noted that the robot completes the 2nd cycle faster than the other two. This is due to the effect of acceleration and deceleration time of the robot during the 1st and 3rd cycles, respectively. In the present case study, the vertical height of the trunk body is not kept constant and it varies with time due to the rate of change of translational displacement along Z and that of angular displacement in YZ and XZ planes (refer to Fig. 15).

The kinematic motion parameters (like position, velocity and acceleration) of the tip point P i3 (i = 1 to 6) are calculated with respect to frame G 0 based on the motion and gait algorithm (refer to Sects. 3.5.2, 3.6 and 3.7). The data points of the path followed by the robot’s leg tip during turning motion are plotted in 3D Cartesian space, as shown in Fig. 16. Also, the projected data points on the XY plane show the curved path followed by the robot during turning. The effect of slip velocity on the path of trajectory of the robot’s leg is small, though there is a slippage of approximately 0.005 m in the XY plane during the support phase of the legs.

Fig. 16
figure 16

3D motion trajectory of leg tip P i3 on an uneven terrain with respect to frame G 0 a legs 1 and 2, b legs 3 and 4, c legs 5 and 6

To validate the computed results in MATLAB, the velocity data of the trunk body and the leg tip P i3 are imported into MSC.ADAMS® as relevant inputs and preprocessed. The simulations are run in MSC.ADAMS® solver for the total cycle time of 5.45 s with a time step of h = 0.05 s, as computed in MATLAB. Visualization of the simulated data (refer to Fig. 17) of the robot maneuvering on an uneven terrain shows that the motion of the robot is stable and according to the desired sequence of 1–4–5 and 2–3–6 walking gait. This also proves the efficacy of the proposed motion planning algorithms. The corresponding simulation time is indicated for each snapshot. Moreover, the comparative study of the kinematic motion parameters of leg 6 shows that the results are in close agreement (refer to Fig. 18). The joint angles are within the expected limit, which also proves that the robot’s configuration is not staggered and collision between the legs can be avoided during the robot’s motion. The deviation of the angular displacement of leg 6 is in the approximate range of (5.9°, −12.2°). Another observation can be made from the plotted graphs of the angular velocities of joints 61, 62 and 63 (refer to Fig. 18b, e, h) like the magnitude of angular velocity of joints 62 and 63 is less compared to that of joint 61. A close look on Fig. 18b shows that during the swing phase, the angular velocity of joint 61 varies steadily at a faster rate compared to angular velocity of that joint during support phase. Moreover, the maximum angular velocity of the joint occurs during the swing phase of a cycle. This is due to the effect of trunk body motion on the swing motion of the robot’s leg. So, the joint i1 (i = 1 to 6) is the most predominate joint, since it controls the motion sequence of the legs of the robot. Further, comparative analysis of the displacement of the aggregate COM of the robot with payload is carried out. The results are plotted in Fig. 19 to show that the analytical results are in close agreement with the MSC.ADAMS® results. Moreover, the COM varies in 3D Cartesian along X, Y, and Z with respect to frame G 0, which gives a realistic picture of the robot’s motion in varying terrains. The results further prove the efficacy of the method of analysis introduced in this contribution for the kinematics of the system.

Fig. 17
figure 17

Snapshots of a realistic six-legged robot simulated in MSC.ADAMS® for maneuverability over an uneven terrain with turning motion capabilities using wave gait (DF = 1/2)

Fig. 18
figure 18

Comparative graphs of the kinematic analysis of a realistic six-legged robot during turning motion on a uneven terrain using wave gait (DF = 1/2) for leg 6. Joint 11 a angular displacement, b angular velocity, c angular acceleration. Joint 12 d angular displacement, e angular velocity, f angular acceleration. Joint 13 g angular displacement, h angular velocity, i angular acceleration

Fig. 19
figure 19

Comparison of the analytical results of the aggregate COM of the system with respect to frame G 0 during turning motion on an uneven terrain with that of MSC.ADAMS®

5 Conclusion

In this contribution, kinematic model of a hexapod robot for turning gaits in varying terrains has been developed, simulated and its performance is tested (or validated) on a CAD model, and visualized using the available VP tools. All feasible solutions related to translational and angular displacements, velocities and accelerations of the joints of all the legs are computed with the help of this model. The analytical results of the kinematic model are in good agreement with those obtained with MSC.ADAMS®. It also shows that the developed motion planning algorithms (both trunk body and swing leg trajectory planning) have significant effects on the inverse kinematic analysis of the closed chain formed by the feet in stance phase relative to the trunk body motion or open chains formed by the feet in swing phase. This approach can be used for locomotion analysis of legged robots with other types of gaits and for straight-forward motion, crab motion etc. on any kind of terrain.

A number of iterations can be carried out to improve the desired performance of the realistic robot in the present study using the VP tools prior to the development of its first physical prototype. The proposed method can also be extended to tackle the problems related to kinematics of general multi-legged walking robots with turning gaits in complex environment. Moreover, the developed constraint equations can be used as the direct aid to study the constrained, coupled multibody dynamics of the robot with impact and slip phenomena. This has been kept in the scope of future work.