2.1. Locomotion of Ant and Bio-Inspiration
Insects are a group of animals with a large number and type of species. Among all creatures (including bacteria, fungi, and viruses), insect species account for more than 50% of the total. The distribution of insects is so wide that no other creature can compare to them. Furthermore, the structural diversity and physiology of insects enables them to adapt and survive under a variety of environmental conditions, which has allowed them to prosper and remain powerfully competitive [
28]. One of the most important reasons that insects have survived for millions of years is that they have flexible movement abilities [
29], which have provided inspiration to the exploration of legged robots [
30,
31]. Most insects have a large number of legs which are symmetrically distributed on both sides of body, therefore, arranging each of leg allows them to cross all kinds of terrains [
32].
The movement of an ant is closely related to the coordination of its legs. It can choose various gaits according to different conditions, which improves their adaptability [
33]. Through observation, in most cases, the movement of an ant is realized by swinging two group legs (Group I: right front leg (RF), left middle leg (LM), right hind leg (RH); Group II: left front leg (LF), right middle leg (RM), left hind leg (LH).) alternately. This tripod gait is very efficient. In some special occasions such as uneven ground, an ant will swing its six legs in an orderly way to remain stable. Sometimes, the movement of an ant will be irregular, however, we found that regardless of gait, the trajectories of each foot tip was the same, but the phases were different. These abundant gait patterns of ants have been of great help in studying the locomotion of legged robots [
34].
An ant experiment platform was carefully established and experiments planned for studying ant movement. The platform is shown in
Figure 1a, and consisted of a high-speed camera, camera shelf, experiment box, and PVC board. Both the experiment box and camera shelf were made of transparent acrylic board so that it had little influence on the photography. The PVC board was placed in the experiment box and divided into four parts (“I” path for straight gait, “U” path for switching between straight and turning, “S” path for always turning and switching direction of turn, and free movement area). The ant moved in these paths and the gait and trajectory observed. To obtain a clear photograph, the high-speed camera was set at 240 fps. A
Camponotus japonica ant [
35] was chosen for the experiments, and is shown in
Figure 1b. This type of ant has a big trunk and long legs. The whole body is nearly 10 mm long, and the leg more than 5 mm. This made it convenient to observe, and this structure has a wide movement space and high athletic performance [
36]. The results of the experiments are described in detail below.
2.1.1. ‘I’ Path for Straight Gait
The ant in the “I” path is shown in
Figure 1c. The shooting time was 0.5 s. According to the marks, the ant adapted a tripod gait in straight motion [
37]. At 0 s, the Group I legs were in the swing phase, and the Group II were in the stance phase. At 0.0625 s, the states of these two group legs were reversed. At 0.125 s, they returned to their original state. According to this rule, the legs of the two Groups swung alternately and supported the body to move forward until 0.5 s.
2.1.2. ‘U’ Path for Switching between Straight and Turning
The movement of ant in the “U” path is shown in
Figure 1d. In the beginning, the ant kept moving in a straight line. At 0.25 s, the tentacle of the ant detected an obstacle and started to turn. Then, it changed to straight motion again at 0.5 s. This phenomenon was really interesting, so we slowed down the video between 0.25 s and 0.5 s to observe the trajectory of the foot tip during the moment, and captured six pictures, which are shown in
Figure 1e. At 0.25 s, the legs of Group I were in the supporting state and turned to the swing state at the next moment. In contrast, the legs of Group II began to support the body. During 0.25–0.375 s, the legs of Group I began to change to the satisfied trajectory for turning, and this process ended before touching down. After transition, these legs began to support the body to make the trunk turn. During 0.375–0.5 s, like with the Group I legs, the legs of the Group II completed the transition in the swing state and drove the ant to turn after touching down. At this moment, the conversion process of the ant from straight to the turn was completed. The ant performed good stability through the short process since the trajectory always changed in the air. This is because only the leg in the support state affects movement, which why the locomotion of an insect can change smoothly.
2.1.3. ‘S’ Path for Always Turning and Switching Direction of Turn
The movement of an ant in the “S” path is shown in
Figure 1f. The whole running time was 4 s. The dashed line with the arrow represents the path and direction of the ant. In this process, the trajectory of the center of gravity (COG) coincided with the ideal path. In one gait period, the trunk of the ant will turn in a small angle. Therefore, the turning of an ant can be viewed as a superposition of multiple arcs and a repetition of a single gait.
2.1.4. Free Movement
In the free movement area, the gait pattern of an ant is very manifold. The tripod gait is shown in
Figure 1g. At 0.1 s, six legs were in the support state; at 0.2 s, the Group I legs were in the swing phase, and the Group II legs were in the stance phase; at 0.3 s, the movement form of the legs from both Groups began to interchange; at 0.4 s, the Group I legs were in the stance phase, and the Group II legs were in the swing phase; at 0.5 s, the legs returned to their initial state. Usually, ants move forward with a tripod gait, especially in fast motion. For six-legged insects, this gait is the most efficient and stable. Sometimes, an ant will choose a quadruped gait [
38], which is shown in
Figure 1h. At all times, at least four legs are in the support state, which provides great stability. Aside from their typical gaits, ants will use irregular gaits in special circumstances. These irregular gaits also play an important role in ant movement.
In short, ants use different movement patterns to cope with different environments. Especially in turning, ants can go through all kinds of crooked paths and will adjust their direction when an obstacle is detected. However, the key to the change of movement is the change of foot tip trajectory. That is to say, the movement of an ant is determined totally by the trajectory of the foot tip. According to the state of the foot, the trajectory can be divided into the stance phase and the swing phase. When the ant walks in a straight line, the swing trajectory is approximately an arc. This arc is linked with the trajectory of the stance phase and forms a closed loop. The support trajectory is approximately a straight-line relative to the body, or can be considered as an arc with a large radius. The turning movement of an ant is also very flexible. The swinging trajectory is an arc, but the support trajectory becomes a curve in the horizontal plane [
39]. In the supporting trajectory, the inner side of the turn has a larger curvature than that of the outside. The legs in the stance phase provide power for moving and control the direction of the ant. As for robots, the foot trajectory for straight and turning can also be planned as per the path of the ant. As long as the curvature of the trajectory is regulated according to requirement, the robot can perform different movements.
2.2. Material and Platform
The SmartHex experimental robot platform is shown in
Figure 2a. The robot adopts a bionic structure and lightweight design principle. The six legs were divided into two groups and were distributed to the side of the robot trunk, respectively [
40]. The total weight was 5.4 Kg. The shank, foot, and connector of the digital motor were all made with an aluminum alloy. The trunk was made out of hollowed-out carbon fiber. Each leg had three rotator joints. The parameters of each leg are shown in
Figure 2b. The torque of each joint was provided by a smart motor. The rotation axis of the root joint was parallel to the forward direction of the robot, which provided lateral support force. The rotation axis of the hip joint and knee joint were perpendicular to the root joint, which provided power for moving forward [
41]. The robot was equipped with a Kinect camera (Microsoft, Redmond, WA, USA), a power module, a control panel, and a sensor system [
42]. Kinect cameras were used to detect obstacles and terrain recognition. The power module provided power for the entire robot. The control board was used for communication between the host computer and the digital servo system. The sensor system was used to acquire attitude signals and current signals. The hardware architecture of the robot is shown in
Figure 2c. It was mainly composed of the host computer, lower computer, and digital servo motors. The computation of the algorithm was done in the host computer and obtained the motion data of each leg. Then, these data were transmitted to the Cortex-M4 control board (ARM, Cambridge, UK). After processing, the data were used for driving the motions. The signal acquisition was mainly dependent on the current detection units and the attitude sensor. These feedback signals were sent back to the host computer for detecting the movement condition of the robot.
The framework of the control strategy is shown in
Figure 2d. The whole system was composed of a command and parameter setting, gait planning, path generation, foot trajectory generation, experimental prototype, feedback signal, and a radius correction algorithm. The command provided the input for the control system. Gait planning was controlled by the gait parameters and turning angle in a period. Additionally, path generation was controlled by the reference radius, system radius, and turning angle velocity. At the beginning of correction, the system radius equaled the reference radius. The robot then adjusted the system radius to eliminate the deviation. When the deviation was 0, the system radius converged to a value. It was regarded that the system radius was a parameter that drove the robot to obtain the desired real radius. Together, the gait planning module and the path generation module generated the trajectory of the foot tip. Through the inverse kinematics, the control signals of each leg were obtained to drive the robot. The feedback signals of the yaw angle and COG coordinates were transmitted to the radius correction algorithm module and system radius was calculated. The whole algorithm architecture was in closed loop control and could achieve different movement forms according to the parameters.
2.3. Extended Turning Strategy
During turning, the trajectory of the COG must coincide with the desired trajectory. Regardless of the kind of gait used, the trajectory of the COG is made up of many small arcs of a gait cycle [
43]. The center angle of an arc was defined as gait angle
θ. The turning process was regarded as a repeat of a single gait cycle. Therefore, taking a gait cycle as an example, the strategy of turning was analyzed.
The gait pattern of turning can be described by
Figure 3 where the abscissa represents the gait angle, and the ordinate represents the number of legs. The colored rectangle represents the position of the swing phase in a gait cycle. The blank represents the leg in the stance phase. We assumed that the swing phases of each leg were all in the last section of a gait cycle at the beginning of planning, which is shown in
Figure 3(a1). The angle
θswing and the starting point
M of the swing phase can be expressed as:
where
β is the duty factor. When the robot turns in tripod gait, the gait chart is shown in
Figure 3b. The change from
Figure 3(a1,a2) can be considered as the phase of swing moved to a special position. In this way, the planning of wave gait can be represented by
Figure 3b. After moving, the start angle
Mi’ and end angle
Mi’’ of the swing phase of each leg are as follows:
where
i represents the number of legs,
θ represents gait angle; and
fix[] represents the integer operation. It is known that regardless of gait, the phase of swing state of any leg can be described by Equations (3) and (4).
As is well-known, the turning of a robot is realized during the stance phase. When the leg lifts off the ground, it does not have any impact on the movement of the robot. Only when the leg touches the ground, can the movement of robot be realized via by the moving of the leg. When the leg is in the stance phase during the movement, the foot is stationary relative to the earth coordinate system, and it is mobile in the COG coordinate system. The stance trajectories of each leg for turning are calculated by the relative motion between the COG and foot as it is not an arc of a cycle, but curves. The world coordinate is established at the center of the turning path, and uses it as a reference coordinate. When the robot moves, the path of COG coordinate is an arc with a radius of
R in the world coordinate, and the positive direction of the
X axis always points to the center of the arc. When the body moves into a random middle position
Bδ of a gait period, according to the coordinate transformation, the coordinates of the foot tip
in the coordinate system
Bδ are as follows:
where
is the rotation operator from initial coordinate
BI to initial coordinate
Bδ of a gait period;
is the translation operator from
BI to
Bδ;
ω is the turning angular velocity;
is the coordinate of the foot tip in the
BI coordinate;
T is the gait period; and the range of
t is [0 ≤
t ≤ (1-
β)
T].
To ensure that there is no impact and smooth transition can be maintained between the foot tip and ground when they come into contact or separation, the quartic polynomial is adopted to plan the trajectory of the swing phase [
44]. The function of the swing trajectory is:
The coefficients of each component are:
where [
T] is the time matrix; and [
X] is the coordinate matrix.
When the radius parameter R in the turning algorithm is large, the turning can be extended to the straight line. However, when R is too large, the arc length of a gait angle θ will become larger, that is, the path of the robot’s COG in a gait cycle will be longer. Nevertheless, due to the constraints of leg geometry, the robot may not be able to reach when R is very large. Therefore, it is necessary to calculate the maximum turning angle of the robot in a gait period.
When the robot turns to the end point of the stance phase
θis, the position of the foot tip in the COG coordinate is:
where
R is the turning radius. When the root joint, knee joint, and foot tip can form a triangle, that means that the leg satisfies the geometric constraint. The geometric constraint equations of each leg can be expressed as:
where
is the position of the root joint under the COG coordinate.
L2 and
L3 represent the length of thigh and shank, respectively. Maximum turning angle in one gait cycle is:
According to the analysis above, as long as the radius is changed, the transition between the turning and straight can be achieved. However, it will cause irregularity in the signal of each joint when the motion parameters are changed suddenly. At the same time, that will lead to discontinuity in the foot trajectory and reduce stability. If the strategy of the transition radius is adopted slowly, although the influence on stability is reduced, the transition time is too long, which is not good for the robot’s speed of response. Therefore, a transition strategy that satisfies rapidity and stability was proposed. By imitating the switch method of an ant, as long as the moment of switch is controlled in the swing phase and finished before touching down, the switch could be achieved instantaneously and guarantee stability.
Each leg of the robot was designed to be controlled independently. After receiving the turn signal, the movements of each leg were detected respectively. If the foot was in the stance phase at that moment, the radius remained unchanged. It changed instantaneously until it entered the swing phase and reached the highest point of the trajectory. In another case, if the foot was in the swing phase at that moment, similarly, the radius remained unchanged. It changed instantaneously until it entered the swing phase again and reached the highest point. Each leg was controlled according to the method above, and they did not affect each other. The pseudo code of the extended turning algorithm is shown in Algorithm 1.
Algorithm 1: Extended turning algorithm. |
Initialize: the length of thigh L1, the length of shank L2, gait coefficient β, radius of turning R, angle velocity ω, Flagchange = 0, Flagswing = 0. |
Initial movement form: |
(1) Movement form change detection |
If (Flagchange = 1) |
(2) Calculating the maximum turning angle in one gait cycle θmax |
(3) Planning the gait of robot. Generating start angle Mi’ and end angle Mi’’ in swing phase of each leg |
(4) Generating the trajectory function of foot tip based on quartic polynomial |
(5) Generating the control signal of each joint according to inverse kinematics |
(6) Leg state detection |
If (Flagswing = 1) |
(7) Change the corresponding parameters of the leg |
else |
(8) Jump to (6) |
end |
else |
Repeat the initial movement form and jump to (1) |
end |
Until: The change of parameters is completed and new movement is formed. |
2.4. Radius Correction Algorithm
Straight motion is the simplest and most efficient form of movement for ants. Through our experiments, we found that regardless of the situation, an ant will first choose straight motion. The ant in the “U” path is shown in
Figure 4a. Initially, the ant moved straight, which can be regarded as a turning with infinite radius. The yellow circle indicated that the tentacle of the ant had detected an obstacle and had momentarily deviated from the desired trajectory. Then, the ant began to adjust its turning radius. The radius adjustment of the ant in the “S” path is shown in
Figure 4b where the dashed line represents the path and the yellow lines represent the body direction. It can be concluded that the ant was constantly adjusting its yaw angle during turning. In other words, it kept adjusting its radius as much as possible for the body to move along its trajectory. Therefore, the path correction of an ant is completed by adjusting the radius.
Due to foot tip slippage, the real turning trajectory of a robot will deviate from the desired trajectory just like an ant. Thus, the trajectory of a robot can be corrected much like an ant. Therefore, the path correction of the robot in this paper was implemented by modifying the radius in real-time.
A sketch of the radius calculation is shown in
Figure 5. Supposing that the robot goes to the
Ci point at the time of
ti, and reaches the
Ci+1 point at the time of
ti+1. The feedback signals at the time of
ti and
ti+1 are the yaw angle (
γi,
γi+1) and COG coordinate (
Ci = (
xi,yi),
Ci+1 = (
xi+1,yi+1)), respectively. An isosceles triangle was developed by constructing auxiliary lines through the two points
Ci Ci+1 and was perpendicular to their direction of yaw. The two auxiliary lines intersected at the
O point. The line
OCi was the real radius in this period. According to the cosine theorem, the real turning radius
is:
There is a proportional relationship between the system radius and the real radius, that is:
The system radius is a parameter in the program. Therefore, the corrected system radius is:
where
is the real radius in the
ith feedback;
is the system radius in the
ith feedback;
is the reference radius of our expectation; and initialization of system radius is
.
Correction error of the system radius in
ith feedback is:
This algorithm requires the robot to acquire the COG coordinate and the yaw angle parameter during the movement. It needs to establish a running environment map model and positioning system, therefore, it is impractical for a robot in a strange environment and will reduce the generality. When the error is stable at zero, the system radius will converge to be a constant. We can take the converged system radius directly as the system radius of the robot motion. Hence, a simplified algorithm for radius correction was proposed based on this. Since there is a certain relationship between the reference radius and system radius, the focus of the simplified algorithm as to find this relationship by fitting in order to obtain a more accurate system radius.
After
k periods, the system radius stabilizes. The system radius from the
kth to (
k + n)th periods is collected and the average is:
where
is the system radius under duty factor
β and reference radius
Rref at the
ith moment;
is the average system radius under duty factor
β and reference radius
Rref. In this way, the average system radius under different duty factors and reference radiuses can be worked out.
The curves of the system radius under different reference radiuses and duty factors (
β = 1/2,
β = 3/4,
β = 4/5, and
β = 5/6) during the correction are shown in
Figure 6.
Regardless of the duty factor and the reference radius, after correction, the system radius will eventually converge at a certain value. Taking the data after stabilization and calculating their average, the average system radius was obtained. After that, taking the average system radius as the abscissa and the corresponding reference radius as the ordinate and fitting them together, the fitting curve is shown in
Figure 7a. The equation is:
The parameters of Equation (16) are shown in
Table 1.
In the previous section, only the radius correction curves of several typical gaits were fitted. As the duty factor and the reference radius both increase linearly, we used the above data to fit the surface to obtain the system radius under an arbitrary reference radius and gait where the X axis is duty factor
β, the Y axis is the reference radius
Rt, and the Z axis is the system radius
Rs. When 0.5 <
β < 3/4, the phenomenon that two front legs or two hind legs lift together appeared. This state for a hexapod robot is likely to cause a COG beyond the support polygon and lead to collapse. Therefore, a duty factor in the range of 0.5 <
β < 3/4 was not recommended and was excluded in the fitting. To improve the fitting accuracy, polynomial equation fitting was adopted. The fitting surface is shown in
Figure 7b. The parameters of the surface equation are shown in
Table 2.
The whole radius correction algorithm can be summarized by the pseudo code, which is shown in Algorithm 2.
Algorithm 2: Radius correction algorithm. |
Initialize: coordinate of COG P; yaw angle γ; reference radius Rref; and system radius Rs: Rref = Rs; sample period T; duty factor β; minimum duty factor βmin; maximum duty factor βmin; minimum reference radius Rref,min; maximum reference radius Rref,max; |
for (β = βmin; β < βmax; β++) |
for (Rref = Rref,min; Rref < Rref,max; Rref++) |
Repeat: |
(1) Input Rs and β |
(2) when ith sample period , collect feedback signals Pi and γi |
(3) when (i+1)th sample period, collect feedback signals Pi+1 and γi+1 |
(4) Calculate real radius in ith correction period |
(5) Input to the system radius corrector and output corrected system radius |
(6) Replace the system radius with the corrected system radius |
Until: The radius error are eliminated and record the system radius under the Rref and β of this cycle |
end |
end |
(8) Fitting the under different Rref and β, the radius correction surface equation is obtained |
Result: The radius correction surface equation can correct radius error directly. |