Simple analytical model reveals the functional role of embodied sensorimotor interaction in hexapod gaits

Insects have various gaits with specific characteristics and can change their gaits smoothly in accordance with their speed. These gaits emerge from the embodied sensorimotor interactions that occur between the insect’s neural control and body dynamic systems through sensory feedback. Sensory feedback plays a critical role in coordinated movements such as locomotion, particularly in stick insects. While many previously developed insect models can generate different insect gaits, the functional role of embodied sensorimotor interactions in the interlimb coordination of insects remains unclear because of their complexity. In this study, we propose a simple physical model that is amenable to mathematical analysis to explain the functional role of these interactions clearly. We focus on a foot contact sensory feedback called phase resetting, which regulates leg retraction timing based on touchdown information. First, we used a hexapod robot to determine whether the distributed decoupled oscillators used for legs with the sensory feedback generate insect-like gaits through embodied sensorimotor interactions. The robot generated two different gaits and one had similar characteristics to insect gaits. Next, we proposed the simple model as a minimal model that allowed us to analyze and explain the gait mechanism through the embodied sensorimotor interactions. The simple model consists of a rigid body with massless springs acting as legs, where the legs are controlled using oscillator phases with phase resetting, and the governed equations are reduced such that they can be explained using only the oscillator phases with some approximations. This simplicity leads to analytical solutions for the hexapod gaits via perturbation analysis, despite the complexity of the embodied sensorimotor interactions. This is the first study to provide an analytical model for insect gaits under these interaction conditions. Our results clarified how this specific foot contact sensory feedback contributes to generation of insect-like ipsilateral interlimb coordination during hexapod locomotion.

Insects have various gaits with specific characteristics and can change their gaits smoothly in accordance with their speed. These gaits emerge from the embodied sensorimotor interactions that occur between the insect's neural control and body dynamic systems through sensory feedback. Sensory feedback plays a critical role in coordinated movements such as locomotion, particularly in stick insects. While many previously developed insect models can generate different insect gaits, the functional role of embodied sensorimotor interactions in the interlimb coordination of insects remains unclear because of their complexity. In this study, we propose a simple physical model that is amenable to mathematical analysis to explain the functional role of these interactions clearly. We focus on a foot contact sensory feedback called phase resetting, which regulates leg retraction timing based on touchdown information. First, we used a hexapod robot to determine whether the distributed decoupled oscillators used for legs with the sensory feedback generate insect-like gaits through embodied sensorimotor interactions. The robot generated two different gaits and one had similar characteristics to insect gaits. Next, we proposed the simple model as a minimal model that allowed us to analyze and explain the gait mechanism through the embodied sensorimotor interactions. The simple model consists of a rigid body with massless springs acting as legs, where the legs are controlled using oscillator phases with phase resetting, and the governed equations are reduced such that they can be explained using only the oscillator phases with some approximations. This simplicity leads to analytical solutions for the hexapod gaits via perturbation analysis, despite the complexity of the embodied sensorimotor interactions. This is the first study to provide an analytical model for insect gaits under these interaction conditions. Our results clarified how this specific foot contact sensory feedback contributes to generation of insect-like ipsilateral interlimb coordination during hexapod locomotion. a1111111111 a1111111111 a1111111111 a1111111111 a1111111111

Introduction
Legged animals prefer specific gaits and change these gaits in accordance with their locomotion speeds. For example, quadruped animals use a walking gait at lower speeds but use a trotting gait at higher speeds. These gaits are characterized by the relative phases between the limbs (called interlimb phase relationship) [1,2]. In the walking gait, the swinging movements of the legs propagate from back to front, while in the trotting gait, the diagonal legs move in phase. During the transition between these gaits, some quadrupeds, such as dogs, change their ipsilateral phase relationships instantly in a manner similar to the human walk-run transition, whereas other quadrupeds, such as sheep, change their phase relationship with a smooth transition depending on their locomotion speed, as shown in Fig 1A [3].
Insects also change their gaits, e.g., between metachronal and tripod gaits, depending on their locomotion speeds, as observed in stick insects [4][5][6][7], cockroaches [8][9][10], and flies [11]. Like quadrupeds, the gaits of insects are also characterized by the relative phases between their limbs. In the metachronal gait, the swinging movements of the legs propagate from posterior to anterior in a manner similar to the quadrupedal walking gait (we call this gait the direct wave gait), while in the tripod gait, the diagonal legs move in phase, like the quadrupedal trotting gait. There is a near-antiphase relationship between the left and right limbs, irrespective of  [3]. Dogs change their phase relationship suddenly at a Froude number of approximately 0.5, while sheep change their phase relationship smoothly based on locomotion speed. B: Ipsilateral relative phases ((fore leg-hind leg)/2) of stick insects for gait cycle (where the locomotion speed decreases as the gait cycle increases) [4]. Data points and error bars show the average values and the errors of the mean values of the measured results, respectively. Stick insects change their phase relationships smoothly based on locomotion speed in a manner similar to sheep. the locomotion speed. While insects can choose gaits in which the swinging movements of the legs propagate from anterior to posterior (we call this gait the retrograde wave gait), as observed in some centipedes [12], they do not use the retrograde wave gait and prefer to use the direct wave gait like quadrupeds. Furthermore, similar to sheep, insects change their ipsilateral relative phases smoothly based on their locomotion speed, as shown in Fig 1B. Locomotion is a complex process that requires various components with real-time interaction between motor control functions and body dynamics through sensory feedback (embodied sensorimotor interaction) [13]. For example, it is known that stick insects do not generate coordinated motor outputs without sensory feedback [14,15], which indicates that sensory feedback plays a critical role in shaping these motor patterns. To attempt to understand the locomotion mechanisms of insects, many researchers have developed bio-inspired control models that use sensory feedback. It is important to clarify the functional role of sensory feedback, because sensory feedback has been shown to be an important factor in adaptive and coordinated leg movements in many studies [16][17][18][19][20][21]. Cruse and colleagues [22][23][24][25] identified six rules required to establish interlimb coordination based on behavioral studies, and proposed a bio-inspired controller using an artificial neural network, called Walknet. This network creates various movements for hexapod models and robots, including gait transitions, curve walking and searching behavior, as observed in stick insects. Daun-Gruhn [26] developed an oscillator network model of stick insect walking based on use of central pattern generators (CPGs) for each leg joint along with sensory feedback, which generated the insect like gaits by introducing excitatory and inhibitory synaptic connections among the oscillators for the ipsilateral front to rear legs. Neuromechanical models of the insect were also proposed based on physiological findings to demonstrate adaptive walking using sensory feedback [27][28][29].
While these models can replicate insect gaits, the functional role of sensory feedback in interlimb coordination is still not fully understood. It is not clear when and how sensory feedback affects the insect gaits, which is an important factor in the design of the robotic controller. This is largely because these models are too complex (i.e., they have multiple sensory feedback channels, neurons, and muscles). In particular, the effects of embodied sensorimotor interactions are too complex to be analyzed using these models. Owaki et al. [30] proposed minimal model to describe the hexapedal interlimb coordination solely by using the local and neighboring leg loading information. However, they investigated them experimentally with the robot. To the best of our knowledge, no study to date has investigated this effect analytically (i.e., by representing the effects of sensory motor interaction with an analytical solution for the system). An analytical understanding of this effect would be helpful in providing a deeper understanding of the gait generation mechanism and for the design of the robotic controller.
In this paper, we designed a minimal control model for hexapod locomotion. A single oscillator is used to control the movement of each leg. While the contralateral oscillators are constrained to be antiphase, there is no connection between the ipsilateral oscillators. The ipsilateral coordination is formed by the local sensory feedback (i.e., foot contact information). The local sensory feedback, in the form of phase resetting, modulates the oscillator rhythm based on local tactile information. We investigated the effects of sensory feedback on hexapod gaits using a hexapod robot and found that the robot generated two gaits through the sensory feedback; one of these gaits had the following major characteristic properties of insect gaits [5].
The other gait satisfied P2 but the swing movement propagated from anterior to posterior (i.e., a retrograde wave gait). Next, we propose a simple physical model that is amenable to mathematical analysis to explain the above gait mechanisms analytically. This simple model consists of a rigid body that uses massless springs as legs; the legs are controlled using oscillator phases with phase resetting and its governing equations are reduced such that they can be explained using only the oscillator phases with some approximations. This simplicity allows us to reach analytical solutions for the hexapod gaits via perturbation analysis, despite the complex nature of the embodied sensorimotor interactions.
The main contribution of this work is the elucidation of the functional role of specific foot contact sensory feedback on hexapod gaits using both the real physical robot and the simple model. In particular, we demonstrated that the direct and retrograde wave gaits were produced through local sensory feedback using touchdown information, and these gaits changed smoothly depending on the locomotion speed. These results suggest that the local sensory feedback contributes to generation of insect-like ipsilateral interlimb coordination. Furthermore, we explained these mechanisms analytically using the simple model, which then allowed us to discuss the differences between the direct and retrograde wave gaits, and the reason for the smooth gait transition. In addition, the simple model shows when and how the sensory feedback affects the gaits. Because the simple model proposed here was able to extract the essence of the gait generation mechanism, this simple model analysis can also be applied to future investigations of other sensory feedback mechanisms and legged locomotion systems.

Hexapod robot and its controller with sensory feedback
We used a hexapod robot (AMOS II [17]; see Fig 2A) consisting of one body with six legs (Legs 1-6). Fig 2B shows the physical model of the robot that was used for the computer simulations. Joint 1 is a yaw joint that moves the leg from back to front, while joints 2 and 3 are pitch joints that lift the leg up and down. A touch sensor is installed on the tip of each leg.
We developed the control system for this robot using phase oscillators that were inspired by the physiological concepts of CPGs and sensory feedback described in [31][32][33] (Fig 3). Here, an overview of the system is given. We used six phase oscillators (designated Oscillators 1-6) with phases of ϕ i (0 ϕ i < 2π, i = 1, . . ., 6), and designed the trajectory of the tip of each Leg i relative to the body using ϕ i (Fig 4). The trajectory is composed of a line segment with length s for the stance phase (0 ϕ i < 2βπ) and a simple ellipsoid curve with height d for the swing phase (2βπ ϕ i < 2π), where β is the duty factor (i.e., the ratio between the stance phase and step cycle durations). We set the duration of the swing phase to be T sw = const., as is often observed in insects [4,5]. The walking speed v can then be given as v = (1 − β)s/βT sw . Each joint was controlled using a proportional-derivative (PD) feedback controller to generate the desired joint angle, which was calculated using inverse kinematics.
The phase oscillators have a basic frequency and the phases of these oscillators are modulated based on the interactions among them and the local sensory feedback. In insect gaits, changes in the ipsilateral phase relationships are dependent on speed, while the contralateral phase relationships are almost in antiphase [5]. To ensure that the system is simple, we modeled the interactions such that contralateral oscillators remain in antiphase. However, there are no direct relationships among the ipsilateral oscillators.  Physiological evidence has shown that detection of an increasing load on a leg promotes the retraction of that leg [34,35], and there are also some interneurons that cause a reset of the rhythmicity in motoneuron activities [36]. Based on these findings, we incorporated the phase resetting mechanism with foot contact signal as the local sensory feedback mechanism [31][32][33]. More specifically, when Leg i touches the ground during the swing phase (2βπ ϕ i < 2π) as indicated by point R in Fig 4A, the phase ϕ i is reset to zero (see the Materials and Methods section).
Because the leg movements of our robot are determined by these oscillation phases, the relative phases between the oscillators (ψ 1 (= ϕ 2 − ϕ 1 ) and ψ 2 (= ϕ 3 − ϕ 2 )) thus explain the gait, which is produced by interactions among the oscillators and the sensory feedback. In this study, we varied the locomotion speed v using the duty factor β to determine whether our robot produced gaits that satisfy insect gait properties P1 and P2 through the embodied sensorimotor interactions using computer simulations and robot experiments; however, these properties were neither predesigned nor predetermined.

Simulation results
We performed computer simulations using the robot model ( Fig 2B) and various locomotion speeds by changing β from 0.5 to 0.65 in even steps (where the oscillator frequency changed from 0.05 to 0.0035 Hz, and the locomotion speed changed from 0.015 to 0.008 body lengths per second). At each locomotion speed, stable gaits were found by changing the various initial values of the relative phases (ψ 1 , ψ 2 ). Fig 5A and 5B show the time profiles of the relative phases (ψ 1 , ψ 2 ) for the six initial conditions for duty factors of β = 0.5 and 0.65, respectively. Data points are plotted when Leg 2 touches the ground (we use this condition for the Poincaré section). Depending on their initial relative phases, the phases converge to one of two different sets, irrespective of β. This means that there are two stable gaits: the direct and retrograde wave gaits. Fig 5C and 5D show the basins of attraction for the relative phases (ψ 1 , ψ 2 ) for β = 0.5 and 0.65, where the red circles converge to the direct wave gait and the green x points converge to the retrograde wave gait. To calculate the basins, 400 lattice points are given on the relative phase plane as initial values and their convergence after 200 Poincaré mapping steps is examined. The direct wave gait has larger size of basins than the retrograde wave gait. Fig 6A and 6B show the relative phases (ψ 1 , ψ 2 ) of the converged gaits that were plotted when Leg 2 contacted the ground. Fig 6C shows the maximum absolute eigenvalue that was calculated based on a linear stability analysis of these gaits. These results show that our robot has two stable gaits (i.e., the direct and retrograde wave gaits), and that the relative phases of the two gaits change smoothly with locomotion speed, as per insect gaits (P2). We also note that the horizontal axis of One of the gaits obtained in the simulations is the direct wave gait, which satisfies the following phase relationship: This relationship is derived from Fig 6A and 6B. The red circles in these figures are close to the line ψ = 2(1 − β)π. In this gait, the swing movement of the legs propagates from posterior to anterior. The middle leg (the fore leg) lifts off just after the hind leg (the middle leg) touches the ground, as shown in Fig 7A. This gait therefore fulfils both insect gait properties P1 and P2. When β = 0.5, at least three legs are always in contact with the ground and the movements of these three legs are in phase, which means that this is a tripod gait. In contrast, when β = 0.65, at least four legs are always in contact with the ground, but the leg movements are not in phase. Because the swing movement of these legs propagates from posterior to anterior, this is a metachronal gait. The other gait is the retrograde wave gait, which satisfies the following phase relationship: This relationship is derived from Fig 6A and 6B. The green x points in these figures are close to the line ψ = 2βπ. In this gait, the swing movement of the legs propagates from anterior to posterior and the middle leg (the hind leg) lifts off just after the fore leg (the middle leg) touches the ground, as shown in Fig 7B. This gait does not fulfil insect gait property P1. When β = 0.5, this corresponds to a tripod gait because at least three legs are always in contact with the ground and the movements of the three legs are in phase. However, when β = 0.65, while at least four legs are always in contact with the ground, the swing movement of the legs propagates from anterior to posterior, which differs from the metachronal gait. In addition, the retrograde wave gait has smaller size of basins than the direct wave gait (Fig 5C and 5D). Furthermore, the retrograde wave gait has higher maximum eigenvalues than the direct wave gait in the Jacobian matrix of the Poincaré map ( Fig 6C). This means that the retrograde wave gait tolerates smaller disturbances than the direct wave gait and that it takes more time for disturbances to vanish from the retrograde wave gait than for the direct wave gait.

Robot experimental results
To validate the simulation results above, we performed experiments using the hexapod robot (Fig 2A). We used various values for the duty factor β in the range from 0.5 to 0.65, and used six initial values for the relative phases (ψ 1 , ψ 2 ) for each β. Fig 8A and 8B show the time profiles of the relative phases (ψ 1 , ψ 2 ) that were plotted when Leg 2 touched the ground for duty factors of β = 0.5 and 0.575, respectively. Irrespective of the value of β, the relative phases converged to one of two different sets, which again means that there are two stable gaits. These two gaits correspond to the direct and retrograde wave gaits from the simulation results. Fig 9 shows the relative phases (ψ 1 , ψ 2 ) of the converged gaits for β where the data points of the robot experiments are the average values from three gait cycles after the robot walked for over two minutes for each trial. There are two different gaits (the direct and retrograde wave gaits) and the relative phases changed smoothly with changes in the locomotion speed, as shown in the simulation results in Fig 6A and 6B. The results for ψ 1 for the direct wave gait and ψ 2 for the retrograde wave gait differ slightly from the simulation results (dotted lines in Fig 9). To clarify the reasons for these differences, we performed computer simulations that involved reduction of the PD feedback gains of the joint controller. The feedback gain of the motor controller in our robot is low because of hardware limitations. The simulation results that corresponded to low gain feedback (indicated by the solid lines in Fig 9) were closer to the robot experimental results. While small differences still exist because of the limitations of the hardware, the robot experimental results are consistent with these simulation results. The direct and retrograde wave gaits of the robot for a duty factor of β = 0.6 are shown in the Supporting Information in S1 and S2 Movies, respectively.

Analysis using the simple physical model
Our hexapod robot produced characteristic interlimb coordination based on the phase relationships among the ipsilateral oscillators that were dependent on the locomotion speed, despite the lack of direct interaction among the ipsilateral oscillators. This result emerged from the local sensory feedback, which was composed of phase resetting. To clarify the contribution of this embodied sensorimotor interaction to the determination of the phase relationship, we used a simple physical model of our hexapod robot and investigated its gait mechanism from a stability viewpoint. Here, we briefly explain the simple physical model. Full details are presented in the Materials and Methods section. The simple physical model (Fig 10) is reduced from our hexapod robot model and the oscillator-based controller on the basis of certain physical assumptions. The model consists of a Analytical description of hexapedal embodied sensorimotor interaction rigid body (mass: M; length: 2a; width: 2b) and six massless spring legs. The spring legs, which each have a spring constant of K, are vertically attached at the bottom of the body at intervals of a and represent the physical influence of the feedback controllers for the leg joints on the body (see assumption A1 in the Materials and Methods section). Based on the leg trajectory that was designed based on the oscillator phase ϕ i (Fig 4), we determine the root position Δx i and the neutral length L i of the spring using ϕ i . Because our robot walked with a long gait cycle (i.e., at low speed), we investigated this simple model using its static equilibrium. We then obtained approximate solutions and determined the stability of these solutions.

Simple model analysis results
We derived periodic solutions for the two different gaits (the direct and retrograde wave gaits). The fixed points in the Poincaré section, which corresponds to the touchdown points of Leg 2 without loss of generality, for these solutions are given by and c Rw  Analytical description of hexapedal embodied sensorimotor interaction simulations ( Fig 6); ψ 1 = ψ 2 = 2βπ + O((K Ã ) −1 ) for the direct wave gait and ψ 1 = ψ 2 = 2(1 − β)π + O((K Ã ) −1 ) for the retrograde wave gait. In addition, these fixed points have similar dependences on the feedback gain (see Fig 9).
Additionally, we obtained the maximum eigenvalues of the Jacobian matrix of the Poincaré map of (ψ 1 , ψ 2 ) for these two gaits: where λ Dw and λ Rw represent the eigenvalues for the direct and retrograde wave gaits, respectively. The gait stability is dependent on s Ã /a Ã and these gaits are asymptotically stable for small values of s Ã /a Ã . While the two gaits have the same stability (λ Dw = λ Rw ) for s Ã /a Ã = 0, the direct wave gait is more stable than the retrograde wave gait (λ Dw < λ Rw ) for s Ã /a Ã > 0, as determined in the simulation results ( Fig 6C).  Analytical description of hexapedal embodied sensorimotor interaction

Interlimb coordination generated by local sensory feedback
In this study, we have investigated the effects of local sensory feedback, in the form of phase resetting, on the interlimb coordination during hexapod locomotion using a minimalistic modeling approach. In contrast to similar previous approaches [31,[37][38][39], the ipsilateral oscillators in our model had no direct interactions. Our results show that our robot simulation model and the robot using the local sensory feedback generate two different gaits: direct and retrograde wave gaits. The direct wave gait is similar to an insect gait. In addition, the interlimb coordination of the two generated gaits changed smoothly, as observed in insect gaits ( Fig 1B) [4,5,8,11]. These gaits are not designed; instead, they emerge as a result of the embodied sensorimotor interaction. In addition, the simple model analysis replicates the results of both the robot simulations and experiments well, and the analysis also reveals the essence of the stability mechanism through analytical solutions. The model shows that these phenomena can happen when the walking speed is slow and the legs are elastic, as per physical assumptions A1-7 in the Materials and Methods section. These results indicate that local Analytical description of hexapedal embodied sensorimotor interaction sensory feedback with phase resetting contributes to generation of ipsilateral interlimb coordination during hexapod locomotion, which is consistent with physiological indications [40,41]. Some works have been performed to understand the interlimb coordination mechanism. For example, Cruse and colleagues [22][23][24][25] identified six rules to establish interlimb coordination based on behavioral studies, and proposed a bio-inspired controller using an artificial neural network called Walknet. This network created various movements for hexapod robots, including gait transitions, curve walking and searching behavior, as observed in stick insects. Daun-Gruhn [26] developed an oscillator network model of stick insect walking based on the use of CPGs for each leg joint and sensory feedback. This model had both excitatory and inhibitory synaptic connections for the oscillators for the ipsilateral front to rear legs. While these works achieved insect-like walking behavior, their models were complicated to allow clarification of the interlimb coordination mechanism. Our analytical expression gives a better understanding of the functional effects of foot contact sensory feedback for interlimb coordination.
Similar studies using quadruped robots proposed a simple local sensory feedback mechanism that used leg loading information [42][43][44], and showed that interlimb coordination of the type observed in quadruped animals emerges through embodied sensorimotor interactions. Owaki et al. [30] showed that the hexapod robot can generate insect like interlimb coordination solely by using the local and neighboring leg loading information designed by the Tegotae based approach. Their minimal model reproduced various insects' gait pattern including the adaptation to leg amputation. Although the Tegotae approach and our approach use foot contact sensory feedback as local sensory information to achieve insect-like ipsilateral interlimb coordination, our approach relies only on the regulation of leg retraction timing while the Tegotae approach is based on a function that quantitatively measures a perceived reaction (i.e., sensor feedback) and an expectation (intention) of a controller which can be considered as an internal model. In addition, because of the simplicity of phase resetting, our simple model allows us to give an analytical explanation as to why the local sensory feedback determines the gaits in hexapods, which have not been explained in above studies (see the Materials and Methods section).

Direct and retrograde wave gaits
Our robot simulation model and our robot generate both the direct and retrograde wave gaits using the local sensory feedback. In addition, the direct wave gait has a larger basin and a lower maximum eigenvalue than the retrograde wave gait. This means that perturbations in the direct wave gait disappear more rapidly than those in the retrograde wave gait and the direct wave gait can tolerate larger disturbances. Hughes [8] stated that at the liftoff of the fore legs, the center of mass (COM) in the retrograde wave gait within the supporting polygon is less than that in the direct wave gait. Our results suggest that the direct wave gait is better for robust walking, as proposed by Hughes. In addition, the main reason why the stabilities of the two gaits are different is determined via the simple model analysis, as shown in the Materials and Methods section. The analysis results indicate that the retrograde wave gait is more stable than the direct wave gait when the model walks in the backward direction, which shows that the position of the COM relative to the supporting polygon affects the stability of the gait through embodied sensorimotor interaction.

Smooth and discontinuous gait transitions
While some quadruped animals such as dogs can change their gaits discontinuously depending on their locomotion speed, as shown in Fig 1A, other quadruped animals such as sheep, and certain insects, such as stick insects, change their gaits smoothly, as shown in Fig 1B. Schöner et al. [45] suggested that these gaits are the result of self-organization in a complex dynamic system. From this perspective, the differences between smooth and discontinuous gait transitions can be explained in terms of the gait stability structures.
Discontinuous gait transitions indicate that only some parts of the interlimb coordination can exist stably, and that these parts are separated. The appearance of hysteresis within the gait transition reflects this stability structure [33,46]. In previous work [32], we used a simple quadruped model and an oscillator network with phase resetting to show that saddle-node bifurcations induce discontinuous gait transitions and hysteresis using a dynamic stability analysis.
In contrast, smooth gait transitions indicate that all interlimb coordination within a specific range can exist stably. In this study, we show that the change in the gait of our robot simulation model occurs smoothly and is dependent on the locomotion speed (Fig 6A and 6B), as observed in stick insects (Fig 1B). In the case of the direct wave gait, the model generates a metachronal gait at slow speeds (β = 0.65), and this gait transits smoothly to a tripod gait (β = 0.5) as the speed increases. This dependence of the gait on the locomotion speed can be explained via an analysis of the static stability of the body dynamics using our simple model, as shown in Fig 11. These results indicate that the discontinuous gait transition mechanism arises from dynamic stability, while the smooth gait transition mechanism can be explained based on static stability.

Role of sensory feedback in fast and slow locomotion
It has previously been suggested that sensory feedback does not play a primary role in highspeed locomotion [47]. For example, the high-speed walking motions of cockroaches were analyzed using a simple planar model that was composed of a rigid body with massless spring legs [48,49], and the results showed that self-stabilization based on intrinsic musculoskeletal properties makes a greater contribution to the generation of locomotion than the sensory feedback.
Conversely, it has also been suggested that sensory feedback plays a critical role in lowspeed locomotion, as observed in stick insects [47,50]. For example, a neuromechanical model of a stick insect leg showed that the three leg joints were all controlled by independent bistable neural circuits with sensory feedback [51]. In addition, computer simulations and robot experiments involving low-speed movement demonstrated that coordinated leg joint movements are generated by neuromechanical interactions through sensory feedback [52]. Some studies proposed use of positive feedback of the angular velocity for joint control [24,53], which contributes to the adjustment of the leg trajectory and thus reduces mechanical stress [28]. Our model focuses on the embodied sensorimotor interactions produced by local sensory feedback to clarify the mechanisms of low-speed insect gaits.

Limitations and future work
Because we used a minimalistic modeling approach, there are obviously differences between our model and actual insects. For example, while we assumed that the left and right oscillators were in antiphase, there is no evidence to date of strong coupling of the left and right leg pairs in insects [6,54]. In addition, it has also been reported that insect gaits cannot be identified unequivocally depending on individual situations [54]. In particular, when insects walk backwards, they do not tend to show well-coordinated gaits [55]. In addition, it has been reported that stick insects can achieve interlimb coordination even if their body postures are fixed dorsally to a holder [56]. Our model cannot explain this behavior because our model achieves interlimb coordination through regulation of the leg retraction timings, which can vary according to changes in the body posture. While we did succeed in clarifying the effects of sensory feedback on ipsilateral interlimb coordination, the above properties cannot be explained based on the focused sensory feedback alone. We would therefore like to analyze these properties in future by considering other types of sensory feedback, e.g., joint angle feedback.
Physically, the mass and size of the robot are unlike the corresponding properties of insects. In addition, the robot's joints are controlled by high-gain servo motors, while insects use muscles to control their joints. In the neural model, we used a simple CPG-based controller and a sensory feedback model. However, our simple model and the associated analysis can provide meaningful insights into both the biological sciences and engineering, as many studies have shown [57][58][59][60]. In particular, because our simple model extracted the essential components that are required for hexapod static walking, it can provide a basis for further analysis of insect gaits and offer hints for adaptive walking design. For example, the constraint that has been imposed between the left and right oscillators can easily be removed from our simple model for the purposes of further analysis. Additionally, other gait types that we did not analyze in this work, such as the tetrapod gait [54], can also be investigated more easily using our simple model than through use of a complex insect model. Sensory feedback with leg loading information can also be applied to our simple model. This simple model will also be helpful in the design of a distributed control method for legged robots that can adapt to leg amputation, because the model is simple to formulate. In addition, our analysis can be extended to multilegged and quadruped models. The direct wave gait has also been observed in quadrupeds and millipedes. Conversely, the retrograde wave gait has also been observed in some centipedes. It will also be possible to analyze the effects of sensory feedback on these gaits by simply extending our analysis. In the future, we will test on uneven ground as well as investigate mechanisms underlying continuous and discontinuous gait transitions.

Hexapod robot
The hexapod robot (AMOS II [17] in Fig 2) is composed of a single body and six legs (Legs 1-6). Each leg consists of three links (Links 1-3), which are connected using joints that are controlled by servo motors (Joints 1-3). Joint 1 is a yaw joint that moves the leg from back to front. Joints 2 and 3 are the pitch joints that lift the leg up and down. A touch sensor has been installed on the tip of each leg. Table 1 lists the physical parameters of the robot in the case where all six legs are identical. The robot is battery-powered and is controlled using an external host computer (central processing unit (CPU): Intel Core i5 2.5 GHz; memory: 8 GB) with commands sent at 1/30 s intervals. Communications between the robot and the computer are conducted via the serial interface. The serial cable remains slack so that it does not affect the locomotion of the robot. For computer simulation of our hexapod robot model, we used the LPZROBOTS computer simulator, which is based on the Open Dynamics Engine (ODE) [61].

Controller
Phase oscillator and motor control The phase oscillators follow these dynamics: where ω is the basic locomotion frequency and g i is the interaction between the oscillators (see the section below entitled Hexapod gait in the phase oscillator model). k i f represents the sensory feedback, which is incorporated in a first-order lag system using y i and the time factor τ (= 1 s) (see the section below entitled Sensory feedback).
For motor control, the tip of Leg i follows a trajectory relative to the body that is based on ϕ i (Fig 4). During the stance phase (0 ϕ i < 2βπ), the leg tip moves along a line segment that runs between the anterior extreme position (AEP) and the posterior extreme position (PEP), which lies parallel to the body. During the swing phase (2βπ ϕ i < 2π), the leg tip moves along a simple ellipsoid curve that includes both the AEP and the PEP. β is the duty factor (i.e., the ratio of the stan phase and step cycle durations). We used the distance between the AEP and PEP, denoted by s = 6 cm, and the height of the ellipsoid, denoted by d = 6 cm. Each joint was controlled using a PD feedback controller to generate the desired joint angle that was calculated using inverse kinematics.
We set the duration of the swing phase to be T sw = const., as is often observed in insects [4,5]. The step cycle duration T p , the basic frequency ω in (6), the stride length S l and the locomotion speed v are then given by T p = T sw /(1 − β), ω = 2(1 − β)π/T sw , S = s/β, and v = (1 − β)s/βT sw , respectively, i.e., they are all determined based on β. We set T sw = 5 s in the experiments and 10 s in the simulations.
Hexapod gait in the phase oscillator model Because the leg movements of our robot are determined by the oscillation phases, the relative phases between the oscillators must explain the gait, which are produced by interactions among the contralateral oscillators and the sensory feedback.
In insect gaits, the ipsilateral phase relationships change depending on the speed of motion, while the contralateral phase relationships are almost in antiphase [5]. To ensure a simple system, we assume that the contralateral legs alternate in phase. Therefore, the interactions between the oscillators g i in (6) are described as follows (Fig 3): We used a large value for k c (= 10) so that the relative phases between the left and right oscillators are constrained to values of π. There is no direct interaction that could produce another relationship among the oscillators (ipsilateral coordination). Because the relative phases between the left and right legs are set in antiphase, the gait in our phase oscillator model can be explained using the two relative phases ψ 1 (= ϕ 2 − ϕ 1 ) and ψ 2 (= ϕ 3 − ϕ 2 ), which are determined based on locomotion dynamics. Sensory feedback Sensory feedback plays an important role in determining the coordinated motor outputs of the CPGs during locomotion [14,50,[62][63][64][65]. Physiological evidence has shown that detection of an increasing load on the leg promotes leg retraction [34,35], and some interneurons can cause a reset of the rhythmicity during motoneuron activities [36]. The motor outputs of the CPGs are thus modulated by phase shifting and rhythm resetting based on foot contact information (phase resetting).
Based on these findings, we incorporated the phase resetting mechanism from our previous work [31] and thus determined k i f in (7) by where t i o is the time when Leg i touches the ground and δ() is the Dirac delta function. When Leg i touches the ground during the swing phase (2βπ ϕ i < 2π), as indicated by point R in Fig 4A, the phase ϕ i is then reset to zero. We denote 0 i ðt i o Þ here as 0 td i (i.e., the touchdown phase). In this paper, we used a first-order lag system with time factor τ to vary the phase value continuously [66] for the robot simulation model. Because of this phase resetting process, leg load detection triggers retraction of the leg. This can be regarded as a simplified description of the sensory feedback process in insects that was described above [34,35].

Simple physical model
Physical assumptions To clarify the underlying mechanisms that allow our hexapod robot to produce two different gaits and to change the phase relationship between the tripod and metachronal gaits smoothly with changes in the locomotion speed, we develop a simple physical model (Fig 10) based on the following assumptions: A1 Because the legs of the robot are much lighter than its body, we neglect the mass of its legs. We also replace the physical influence of the PD feedback controllers of the leg joints on the body through use of spring legs. The angular displacements from the commanded angles in the joints yield forces that are proportional to these displacements because of the PD feedback controllers in the robot simulation model and in the robot. We therefore model this effect simply using the springy leg in the simple model. Specifically, we use six massless springs (with spring constant K) that are vertically attached (spaced at interval a) to the bottom of the body (mass: M; length: 2a; width: 2b). Touchdown and liftoff both occur at the neutral length and the springs only work during the stance phase.
A2 Because the gait cycle of our robot was more than 20 s, which ensures that the robot's gait is static, we investigated the static equilibrium while neglecting the horizontal friction that occurs between the leg tips and the ground.
A3 Because the leg trajectory was designed to ensure that our robot walks in a straight line (Fig 4B), we have neglected the yaw motion.
A4 Based on the leg trajectory that was designed based on the oscillator phase ϕ i , we determine the root position Δx i and the neutral length L i of the spring using ϕ i (Δx i = Δx i (ϕ i ), L i = L i (ϕ i )). We also assume that the toe position can be changed without any dynamics.
A5 Because the feedback gains of our robot are large enough to follow the desired leg trajectory, particularly in the computer simulations, we used a large value for the spring constant K and use this constant as an order parameter in the stability analysis.
A6 Because the relative phases of the left and right oscillators are constrained to a value of π in (6), we use ϕ i+3 = ϕ i + π(i = 1, 2, 3).
A7 Because the time constant τ in (7) is much shorter than the gait cycle, we neglect the delay in the sensory feedback process (τ = 0).
In the simple model, we use the inertial frame S G (x G , y G , z G ), which is fixed on the ground, and the robot coordinate frame S R (x R , y R , z R ), which is fixed on the body, with an origin that is located at the COM. q G and q R are the vectors on S G and S R , respectively. x R is the walking direction of the model and z G is the vertical direction. The robot posture is represented by the pitch angle Δθ p and the roll angle Δθ r . We denote the position of the COM by r G R on S G and the position of the tip of Leg i by x R ti on S R . The length of Leg i is represented by L i − Δl i , where Δl i is the compression. The displacement of the root of Leg i in the x R direction is represented by Δx i .
The positions of each of the leg tips x R ti ði ¼ 1; . . . ; 6Þ on S R are given by Based on the leg tip trajectory of our robot shown in Fig 4B, the neutral length of the leg spring L i and the displacement of the associated root Δx i are given as functions of the oscillator phase ϕ i , as follows: ð11Þ where L is the neutral spring length during the stance phase.
To clarify the parameter dependence of the gait stability, we normalized the physical parameters. Specifically, we normalized the length parameter p with respect to L as p Ã = p/L and used the relative spring constant as given by K Ã = KL/Mg, where () Ã indicates a dimensionless parameter. We assume the orders of the dimensionless parameters used for the stability analysis as follows: Dl Ã i ; Dy p ; Dy r ' OððK Ã Þ À 1 Þ; ð15Þ We neglect O((K Ã ) −2 ) here. However, the inequality of (14) means that we do not neglect the Phase description of the model position and posture based on equilibrium of force and moment When the vertical distance from the leg root to the ground is less than the neutral length L Ã i , and the compression of the leg spring Dl Ã i ! 0, the leg is in contact with the ground. Otherwise, the leg must be in the air. Let S = {i j Leg i on the ground} be the set of stance legs. When Leg i is in contact with the ground, the following constraint applies: where () z indicates the z element and the matrix R G R is the approximate rotation matrix from S R to S G given by The constraint of (16) is approximated here using the dimensionless height h Ã (¼ ðr GÃ R Þ z ) as where the equation for Dl Ã i is only applicable when i 2 S. Based on this constraint, Dl Ã i can be determined using Δθ r , Δθ p , h Ã , and ϕ i .
The ground reaction force is given by the sum of the spring compression forces of the stance legs, which is equivalent to the gravitational force, and thus yields the following equation: In addition, the equilibria of the moments around the COM in the pitch and roll directions are approximated as follows: where () x and () y indicate the x and y elements, respectively. From (18), (19), and (20), Δθ r , Δθ p , and h Ã can be determined using the oscillator phase ϕ i with the dimensionless parameters a Ã , b Ã , d Ã , s Ã , and K Ã . Phase dynamics Based on assumptions A6 and A7, the phase dynamics of (6) can be reduced to where k iþ3 f indicates the sensory feedback from the leg on the opposite side and the coefficient 1/2 for both k i f and k iþ3 f comes from assumption A6 (a detailed explanation is presented in S1 Appendix in the supplementary file).
The sensory feedback k i f only works at the foot contact. Because the model position h Ã and the posture (Δθ r , Δθ p ) are represented by ϕ i , k i f in (9) is explained using ϕ i . The state variables in this system are therefore summarized by ϕ 1 , ϕ 2 , and ϕ 3 , and the gait is then represented by the relative phases ψ 1 (= ϕ 2 − ϕ 1 ) and ψ 2 (= ϕ 3 − ϕ 2 ).
Single constraint on the phase relationship immediately before a touchdown event In this model, when the leg touches the ground, the vertical distance from the leg root to the ground is equal to the neutral length (Dl Ã i ¼ 0). Because the model position and posture are described using ϕ i , this equality gives only a single constraint for ϕ i .

Derivation of periodic solutions and their stabilities
In this section, we derive periodic solutions for the direct and retrograde wave gaits and investigate the stability of these solutions through linear stability analysis. First, we deal with the direct wave gait, and then deal with the retrograde wave gait based on the symmetry properties of these gaits.
In one gait cycle, each leg experiences the swing and stance phases once. Because the relative phases between the oscillators change only at the moment of foot contact by phase resetting, as in (21), the reset value must be identical for all the oscillators for the periodic solution. This means that the phase value immediately before foot contact must be identical for all the oscillators (i.e., 0 td Fig 13 shows the sequence of the touchdown and liftoff events for the legs with the direct wave gait in the range around 1/2 < β < 2/3. The touchdown event of Leg i is denoted by event Ti. Events T2, T6, T1, T5, T3, and T4 thus occur in that order for a single gait cycle. Because of the right and left symmetries of the simple model and the antiphase relationship between the left and right oscillators, our model thus has axial symmetry. Because the amount of phase resetting is determined by the geometric conditions at each event (Dl Ã i ¼ 0), the amount of phase resetting that occurs at event Ti is made to be equivalent to that at event T(i + 3) by shifting each oscillator phase by π. Because the relative phases are only influenced by the amount of phase resetting that occurs at each event, as in (21), and because the phase shift by π does not affect the relative phases, we can then assume that events T4, T5, and T6 are equivalent to events T1, T2, and T3, respectively. Therefore, we investigate the sequence T2, T3, T1, T2, T3, and T1 for a single gait cycle, which means that we only need to examine half of the repeating events: T2, T3, and T1.

Direct wave gait
We denote the sets of stance legs immediately before event Ti(i = 1, 2, 3) by S Ti , which is based on the relative phases ψ 1 * ψ 2 * 2(1 − β)π as S T1 ¼ f2; 4; 6g; S T2 ¼ f1; 3; 4; 5g; S T3 ¼ f1; 2; 5; 6g: The details of these sets are presented in S2 Appendix of the supplementary file. We use the timing immediately before event T2 for the Poincaré section and find the fixed point for the relative phases ðĉ T2 1 ;ĉ T2 2 Þ to produce the periodic solution; here, we denote the value immediately before event Ti by ðÞ Ti and the value of the periodic solution immediately before event Ti byðÞ Ti . Phases (ϕ 1 , ϕ 2 , ϕ 3 ) evolve over time, and the relative phases (ψ 1 , ψ 2 ) evolve as events occur. Fig 14 shows how the phases (ϕ 1 , ϕ 2 , ϕ 3 ) and the relative phases (ψ 1 , ψ 2 ) at each event evolve as a result of the sensory feedback, where event T2' indicates event T2 after half a gait cycle, and the value next to "Sensory feedback" indicates the amount of change in the oscillator phase caused by phase resetting (21). Immediately before event T2 (the Poincaré section), 0 T2 2 is equal to 0 td 2 , and the relative phases are represented by ðc T2 1 ; c T2 2 Þ, as per Fig 14. Immediately after event T2, the phase ϕ 2 is changed to p þ 0 td 2 =2 by the sensory feedback. The relative phases immediately after event T2 are also changed as shown in Fig 14 because of the sensory feedback. Next, event T3 occurs. Immediately before event T3, 0 T3 3 is equal to 0 td 3 . Because no leg touchdown event occurs between events T2 and T3, the relative phases immediately before event T3 are the same as those immediately after event T2, which is indicated by the equals sign in Fig 14. While we omit further explanation of Fig 14 here, we can see that the state variables ð0 Ti 1 ; 0 Ti 2 ; 0 Ti 3 Þ immediately before each event Ti are represented by the relative phases on the Poincaré section ðc T2 1 ; c T2 2 Þ and ð0 td 1 ; 0 td 2 ; 0 td 3 Þ. To find the periodic solution, we then solve for0 td 2 ð¼0 td 1 ¼0 td 3 Þ,ĉ T2 1 , andĉ T2 2 , which can be determined from the phase relationship Dl Ã 1 ¼ 0, Dl Ã 2 ¼ 0, and Dl Ã 3 ¼ 0 immediately before events T1, T2, and T3, respectively. As a result,ĉ T2 1 andĉ T2 2 are given by c Dw 1 and c Dw 2 , respectively (see (3)). A detailed explanation of this derivation is presented in S3 Appendix. Analytical description of hexapedal embodied sensorimotor interaction Retrograde wave gait Next, we derive the periodic solution for the retrograde wave gait and investigate its stability by considering the conditions of symmetry between the direct and retrograde wave gaits. We denote the flow of the oscillator phases by the stride parameter s Ã and the initial values 0 T2 1 ; 0 T2 2 , and 0 T2 3 immediately before event T2 by Φ s Ã ðt; 0 T2 1 ; 0 T2 2 ; 0 T2 3 Þ. Because the model movements for the direct wave gait with s Ã > 0 and for the retrograde wave gait with −s Ã < 0 are identical except for the walking direction, we can then write Based on this symmetry condition,ĉ T2 1 andĉ T2 2 for the retrograde wave gait are given by c Rw 1 and c Rw 2 , respectively (see (4)). Additionally, the eigenvalues of the evolution matrix ðl Rw 1 ; l Rw 2 Þ become l Rw The maximum eigenvalue l Rw 1 ð¼ l Rw Þ thus determines the stability of this gait. Stability mechanism In this section, the mechanism by which the perturbations evolve in this stability analysis is explained briefly by focusing on a specific leg. The perturbations in the relative phases change the body inclination through the elasticity of the leg and thus change the timing of the leg touchdown, which induces changes in the relative phases through phase resetting, as shown in S3 and S4 Appendixes. As a result, the perturbations change after the leg touchdown event. This process reduces the perturbations after a single gait cycle through six leg touchdown events, as shown in (24) and (26).
In addition, because the legs propel the body (s Ã 6 ¼ 0), the relative foot positions between the legs at the leg touchdown point are different for the two gaits (direct and retrograde wave gaits), as characterized by (25). Therefore, the body inclination angles induced by the perturbation are different for the two gaits. This changes the phase resetting intensity, and the stability then differs between the two gaits, as characterized by the length s Ã /a Ã in (24) and (26).
Supporting information S1 Movie. Direct wave gait in the robot experiments. This movie shows the direct wave gaits of the robot at a duty factor of β = 0.6. The swing movement propagates from back to front. Additionally, this is the metachronal gait because all four legs are almost always in contact with the ground. (MP4) S2 Movie. Retrograde wave gait in the robot experiments. This movie shows the retrograde wave gaits of the robot at a duty factor of β = 0.6. While all four legs are almost always in contact with the ground, the swing movement propagates from front to back. (MP4) S1 Appendix. Effect of the phase interaction between left and right on phase resetting. This appendix explains how assumptions A6 and A7 reduce the original phase dynamics of (6) to the reduced phase dynamics of (21). (PDF) S2 Appendix. Set of stance legs immediately before each event for the direct wave gait. This appendix explains how the set of stance legs immediately before each event is determined for the direct wave gait. (PDF) S3 Appendix. Derivation of periodic solution for the direct wave gait. This appendix explains how the periodic solution for the direct wave gait in (3)