1. Introduction
Animals possess remarkable locomotion capabilities and adaptability to their environment, serving as the primary inspiration for developing advanced robotic controls [
1,
2]. By mimicking terrestrial creatures, various legged robots have been developed, demonstrating excellent locomotion performance [
3,
4,
5]. However, their controllers are mostly based on traditional methods, such as the Central Control Hub method [
6], Inverse Dynamics Model Control [
7], and Optimization-based Control [
8]. The performance of these control methods heavily relies on the accuracy of the robot model and environmental conditions, and optimizing control parameters is a complex task. Therefore, in recent years, control methods inspired by biological CPGs, which do not rely on precise robot and environment models, have gained widespread attention.
The rhythmic patterns of animal locomotion are generated by a neural network known as the Central Pattern Generator (CPG) [
9,
10]. CPGs are widely present in vertebrates and invertebrates, primarily responsible for generating coordinated, rhythmic movements such as crawling, flying, swimming, jumping, walking, and running [
11]. Inspired by this, researchers have developed various CPG oscillator models [
12,
13,
14] and applied them in engineering practice. To address issues like sinking, imbalance, and control complexity for hexapod robots walking on lunar soil, Shu et al. successfully achieved stable walking on lunar simulant by combining a biomimetic structure design with an umbrella-like foot-end expansion mechanism and generating rhythmic signals based on a CPG [
15]. Mao et al. proposed a bionic soft rectal robot system, which innovatively adopts a double-layer sphincter-like actuator optimized by a multi-layer perceptron, achieving precise pressure control with high contraction rate and rapid response [
16]. Sun et al. integrated vestibular reflexes with various CPGs to generate adaptive body postures, enabling the robot to walk on different sloped terrains [
17]. Gong et al. proposed a control method for an underwater hexapod robot based on super-twisting sliding mode and fuzzy CPG. By designing heading/speed controllers and parameter fuzzy mapping, combined with LOS guidance, path tracking was achieved. Experiments verified that this method ensures motion coordination while maintaining high tracking accuracy [
18]. Zhong et al. applied CPG to motion control and gait planning for hexapod robots, adjusting relevant robot motion parameters based on feedback information. Experiments proved that this method enables stable walking of hexapod robots on rough terrain, with good agility, stability, and environmental adaptability [
19]. Fukui et al. used vestibular sensory feedback to modulate the CPG, allowing the robot to autonomously change its gait according to speed, thereby safely traversing terrain with unknown obstacles at various speeds [
20]. Chen et al. proposed a lightweight control strategy based on reinforcement learning and CPG, enabling robotic fish tails to adaptively adjust under complex flow fields and structural variations. Through training in real flow environments and extensive multi-scenario experiments, the proposed method outperformed traditional PID control in terms of tracking accuracy, stability, and response speed, demonstrating strong robustness and adaptability [
21]. Liu et al. developed a biomimetic tactile perception CPG controller based on an improved Matsuoka oscillator feedback mechanism, integrating high-level “brain” commands with low-level “reflex arc” tactile feedback. The controller regulates sensory inputs through both reinforcement learning and local reflex responses, successfully driving a soft snake-like robot to navigate flexibly in dense obstacle environments and narrow passages. Both simulation and real-world experiments validated its superior tactile perception and locomotion capabilities [
22]. Chen et al. proposed a lightweight heading control strategy based on reinforcement learning by combining RL-based decision making with CPG-based execution, enabling physical training and deployment on low-computational-power platforms. The method was validated on a robotic fish trained in a recirculating water tank and demonstrated strong generalization ability, robustness, and adaptability under complex flow conditions and tail-fin damage scenarios. Its control accuracy and stability were significantly superior to those of conventional PID methods [
23].
Although the introduction of CPG into robot motion control has improved steady-state motion performance and adaptive capability, in scenarios such as walking in narrow environments, detecting landmines, and avoiding obstacles, robots need to follow predefined trajectories, requiring accurate and robust trajectory tracking performance [
24]. Trajectory tracking is a key advantage of autonomous robots, but there is currently limited research on this topic. During trajectory tracking, interactions exist between the robot’s components and between the robot and the environment, making it challenging to develop effective, accurate, and robust controllers for trajectory tracking. Control methods commonly used for trajectory tracking include Sliding Mode Control (SMC) [
25,
26] and Model Predictive Control (MPC) [
27,
28], among others. Based on a trajectory tracking model, Chen et al. established a non-singular terminal sliding mode control algorithm based on an NTSM reaching law, enabling precise tracking of the reference trajectory by a hexapod robot in simulation, and validated the effectiveness of the control method through experiments [
24]. Mera Manuel et al. proposed a method based on sliding mode robust control for a unicycle robot kinematic model closer to reality, introducing a novel sliding surface to reduce chattering effects on the heading angle, thereby achieving trajectory tracking control for the unicycle robot under disturbances [
29]. Huang et al. proposed a Linear Time-Varying Model Predictive Controller (LTV-MPC) based on an online estimator, solving the trajectory tracking problem for electro-hydraulic actuators in the presence of time-varying parameters, high-frequency external load disturbances, measurement noise, and some unmeasurable states. Experiments showed that the LTV-MPC controller has strong adaptive capability and robust trajectory tracking performance [
30]. Liu et al. combined the A* algorithm with the dynamic model of a four-wheel independent steering robot for trajectory planning, then established a robot kinematic model with dynamic constraints and a model predictive controller, achieving high-speed trajectory tracking control for the robot. Simulations and experiments verified the effectiveness and practicality of the trajectory tracking method [
31]. At present, there are few studies on trajectory tracking for hexapod robots, although trajectory tracking is one of the key functions for robots to accomplish operational tasks. Therefore, this paper mainly investigates the realization of trajectory tracking for a hexapod robot by using a high-level control strategy (e.g., MPC) to regulate the low-level motion controller (CPG), while simultaneously improving the robustness and adaptability of locomotion.
Model Predictive Control, due to its advantages such as convenient modeling, good system robustness, stability, and the ability to incorporate multiple constraints into rolling optimization, has been widely applied to motion control of various robots with good results [
32,
33,
34,
35,
36]. The crawling motion of the hexapod robot is a nonlinear problem with multiple constraints, and frequent switching of crawling gaits is required during trajectory tracking to ensure tracking accuracy of the reference trajectory. Therefore, this paper employs a CPG network as the underlying motion controller to ensure smoothness during motion control, while introducing algorithms like Model Predictive Control as the upper-level controller to adjust the CPG network parameters in real-time, thereby accomplishing the trajectory tracking task.
The main academic contributions of this paper are summarized as follows. First, a dynamic model of the underwater hexapod robot is established. By introducing a steering parameter and a kinematic model, the linear and angular velocities of the underwater hexapod robot are related to the CPG parameters, and a conversion function is constructed through experimental fitting. Second, by integrating the output of the model predictive controller with the parameters of the CPG network via the conversion function, a novel CPG-based model predictive control approach (MPC–CPG controller) is proposed, in which the MPC serves as the planning layer to regulate the execution-layer CPG. Finally, the effectiveness of the proposed MPC–CPG controller in trajectory tracking is validated through simulation experiments.
The remaining part of this paper is arranged as follows:
Section 2 presents the mathematical model of the underwater hexapod robot.
Section 3 presents the detailed design framework of the MPC-CPG controller. The simulation and experimental verification were conducted in
Section 4, and the conclusion is given in
Section 5.
3. MPC-CPG Controller Design Based on Dynamics
3.1. Motion Modeling Based on CPG
Inspired by bionic principles and simulating biological central pattern generators, researchers have developed various mathematical models of CPG oscillators, commonly including recurrent neural oscillators, phase oscillators, and Hopf oscillators [
39]. This paper selects the Hopf oscillator as the basic unit of the CPG network to construct the underlying motion control network. The mathematical model of the CPG network is expressed as follows
where
and
represent the state variables of the i-th oscillator, respectively.
and
represent the oscillation frequency and amplitude of the i-th oscillator, respectively.
and
represent the coupling factor and phase difference in the i-th oscillator, respectively, i = 1, 2, …, 6.
To analyze the existence and stability of the limit cycle of the Hopf oscillator, the following Lyapunov function is introduced:
Taking the time derivative yields:
Substituting the Hopf oscillator dynamics gives:
It can be observed that when , holds for all , and the origin is a stable focus. When , the origin becomes an unstable focus and trajectories are repelled from the origin.
Let . For sufficiently large , holds, which implies that system trajectories are bounded and form a trapping region. According to the Bendixson criterion, there exists at least one limit cycle in this region. Furthermore, based on the Chepkac theorem, the system admits at most one stable limit cycle. Therefore, for , the Hopf oscillator possesses a unique and stable limit cycle, and all trajectories converge asymptotically to the same periodic orbit regardless of initial conditions.
This property guarantees that the CPG network can generate stable and robust rhythmic signals for locomotion control.
The CPG network structure constructed through coupling terms is shown in
Figure 4. The output signals generated by the CPG network are appropriately scaled by mapping functions and then sent to the hip, knee, and ankle joints of the robot’s six mechanical legs to drive coordinated motion of each joint. The upper-level controller adjusts the output of the CPG network in real time to change the foot-end force, ultimately achieving the trajectory tracking control objective.
The robot’s steering motion during crawling is achieved by adjusting the swing frequency and amplitude of the left and right mechanical legs to create a speed difference. To facilitate control of the speed difference between the two sides, a steering parameter
is introduced, and the parameter
and the stride length
are set to satisfy the following relationship
where
represents the maximum stride length of the mechanical leg,
,
is the maximum amplitude output by the CPG network, L is the projection length of the mechanical leg on the ground. Given that
is relatively small, to simplify the control algorithm, it can be approximated that
.
represents the number of the mechanical leg, consistent with the oscillator number,
corresponds to the left legs,
corresponds to the right legs.
The velocities of the left and right legs are
where
is the velocity of the left legs,
is the velocity of the right legs, and
is the swing frequency of the mechanical legs.
The velocity difference between the two sides
is
Thus, it can be seen that when , , the robot turns left; when , , the robot turns right; when , , the robot moves straight.
The moving velocity of the robot’s center is
As shown in
Figure 5, when a velocity difference is generated between the left and right legs, the underwater hexapod robot begins to turn.
Where
is the maximum stride length of the mechanical leg, 2k is the width of the robot,
is the yaw angle of the body. The angular velocity of the robot can be expressed as
Thus, the motion model of the underwater hexapod robot based on CPG is
3.2. MPC-CPG Controller Design
The motion control of the underwater hexapod robot is a typical nonlinear problem with multiple constraints. During trajectory tracking, frequent adjustment of the crawling gait is often required to ensure tracking accuracy. Therefore, this paper uses a CPG network as the underlying motion controller to ensure smoothness and coordination of the motion process; simultaneously, an upper-level Model Predictive Controller is introduced to optimize and adjust the parameters of the CPG network in real time to complete complex trajectory tracking tasks. Model Predictive Control has advantages such as intuitive modeling, strong robustness, good stability, and is particularly adept at handling multi-constraint optimization problems. It has been widely applied to motion control of various robots with good results.
Modeling the robot’s crawling motion as a control system with input
and state quantity
, its general form is
Referring to the method described in the literature [
40], the linear error model of this system can be established as follows
where
is the state quantity corresponding to the reference trajectory,
,
,
.
Discretizing the above continuous model yields the discrete-time linear error model
where
,
, T is the sampling time.
The objective function is established as follows
where N
p is the prediction horizon, N
c is the control horizon.
Converting Equation (13) into the form of a state space is
where
,
, n is the dimension of the state quantity, and m is the dimension of the control quantity.
After derivation, the predicted output expression of the system is obtained
It can be seen from Equation (16) that the predicted output is calculated based on the current state and control input.
The expression form of the control quantity constraint and the control increment constraint during the movement of the underwater hexapod robot are as follows
The stability constraint (Terminal equality constraint) is as follows
Combine the constraints into a matrix form as
where
,
are the minimum and maximum values of the control variable in the control horizon.
,
is the column vector with the number of rows N
c, and
is the Kronecker product.
Substituting Equation (16) into Equation (14), Equation (14) is solved under the constraints of Equation (19). When the terminal conditions are met, the entire optimization process is completed and the global optimal solution is obtained, . According to the MPC principle, the first element of the control increment sequence is used as the actual control increment to act on the system, that is, .
Since the model predictive controller directly outputs the foot-end forces , , which cannot be directly used to adjust the CPG, a conversion function needs to be designed to map the MPC output to CPG parameters.
From Equation (7), it can be seen that both the CPG frequency
f and the steering parameter
can affect the robot’s crawling speed and angular velocity. Therefore, the conversion function to be designed relates the functional relationship between the foot-end forces
,
and f,
. As shown in
Figure 6, the relationship between the hip joint torque
during robot crawling and f,
was obtained through multiple experiments, and the experimental data were fitted.
From
Figure 6, it can be seen that as f and
increase, the output torque of the left leg’s hip joint also increases. To simplify the calculation, during the robot’s crawling control, the CPG frequency is fixed at
. Therefore, the crawling trajectory tracking control of the robot can be achieved simply by adjusting the steering parameters
.
When
, the relationship between torque and steering parameter
obtained by data fitting is
Combining the fitting function Equation (21) and the mechanical leg dynamics model Equation (6) yields the conversion function
By combining the model predictive controller with CPG through the transformation function, the control block diagram of the constructed MPC-CPG controller is shown in
Figure 7. The model predictive controller calculates the desired foot-end force for the next time step based on the error between the current reference trajectory and the actual trajectory. Then, the required torque for each joint is calculated through the mechanical leg dynamics model. Next, the conversion function is used to convert the calculated hip joint torque into the steering parameter
, which is input into the CPG network for parameter adjustment. Finally, the CPG outputs rhythmic control signals for each joint. This process repeats until the entire trajectory tracking task is completed.
4. Simulation Experiment
To comprehensively evaluate the adaptability and robustness of the MPC-CPG control architecture, simulation experiments were conducted for the bionic crawling characteristics of underwater hexapod robots, with a focus on testing key indicators such as the dynamic response characteristics and control accuracy of the system in circular and linear trajectory tracking tasks. The equation of the circular trajectory is
, the speed reference is
. The linear trajectory equation is
, the speed reference is
,
. The parameter settings of MPC and CPG are shown in
Table 2.
The simulation results of circular trajectory tracking are shown in
Figure 8. In terms of dynamic response characteristics, the system exhibits good transient performance under the MPC controller. The position error converges rapidly in the initial stage, entering the allowable error range within 15 s. The position and heading angle errors exhibit exponential decay characteristics during tracking, with a decay time of 3.2 s, indicating good damping characteristics of the system. The error analysis indicates that after reaching the steady state, the position tracking error is strictly controlled within ±0.17 m (9.8% of the body length), and the heading angle error remains within the range of 15°. Compared with sliding mode control, MPC control has a faster convergence speed and higher tracking accuracy. The position control accuracy fully meets the operational requirements in complex environments.
In terms of control allocation,
Figure 9 reveals the foot-end force allocation strategy optimized by the MPC. In the initial stage of motion, the controller adopted an asymmetric force allocation scheme: the right foot-end force first decreased and then increased, reaching a minimum of 8.76 N at t = 13 s. It then increased rapidly, peaking at 11.1 N at t = 25 s and stabilizing, while the left foot-end force showed a symmetric change process opposite to the right, eventually converging with the right force value to a steady state. This force allocation strategy optimally corrected the initial heading deviation while ensuring system motion stability, demonstrating the advantage of MPC in handling constraints.
By mapping the control quantities output by the MPC to the CPG parameter space using the designed conversion function, the variation process of the steering parameter shown in
Figure 10 was obtained. The parameter change shows obvious three-stage characteristics: in the initial adjustment stage from 0 to 13 s, the steering parameter rapidly increased from 45° to 52.4° to generate sufficient steering torque. In the fine adjustment stage from 13 to 23 s, the parameter is adaptively adjusted within the range of 34–52.4° to achieve precise tracking of the trajectory curvature. In the steady-state stage after 23 s, the parameter stabilized around 34°, where the system entered a constant-curvature circular motion mode and the motion state reached stability.
The output of the CPG network is shown in
Figure 11. Analysis of the CPG network output characteristics reveals the superiority of the underlying control system. As shown, the system only requires 1.5 s to complete the transition from transient to steady state, establishing stable phase-locked relationships among the oscillators. The amplitude of the left hip joint oscillator finally stabilized at 17°, while the right stabilized at 25°. The amplitude difference between the two sides provided precise steering torque for the system, enabling the underwater hexapod robot to complete trajectory tracking at a speed of 0.1 m/s and an angular velocity of 0.04 rad/s. It is particularly worth emphasizing that although the upper-level MPC control quantity fluctuated by over 25% within 10 s, after the threshold limiting and smoothing effect of the CPG, the actual control signals for the actuators changed smoothly without jumps, significantly improving the service life of the actuators.
The linear trajectory tracking results are shown in
Figure 12. Under MPC control, the system converges rapidly, and the position error enters the allowable range within 50 s. After reaching steady state, the tracking error is maintained within 0.12 m (6.9% of the body length), while the heading error remains within ±5°, which satisfies the operational requirements. Compared with sliding mode control, the MPC-based controller exhibits faster convergence speed and higher tracking accuracy.
Figure 13 and
Figure 14 show that during the first 50 s, under MPC regulation, the steering parameter rapidly increases from 45° to 78° and then gradually decreases back to 45°. Meanwhile, the left foot-end force quickly rises to a peak value of 16.3 N and then decreases to 9.5 N, whereas the right foot-end force drops to a minimum of 2.8 N before increasing to 9.5 N. Through this asymmetric force distribution, the robot executes a right-turn maneuver to eliminate the initial position error. After 50 s, the foot-end forces on both sides stabilize at 9.5 N, and the robot successfully completes linear trajectory tracking.
Figure 15 demonstrates the excellent performance of the lower-level control system. The system requires only 1.2 s to transition from the transient state to steady operation. Owing to the threshold limiting and smoothing effects of the CPG network, the actual actuator control signals vary smoothly without abrupt changes, and the maximum joint angular velocity is constrained within 30°/s, significantly improving actuator service life. Ultimately, the underwater hexapod robot completes linear trajectory tracking at a stable velocity of 0.1 m/s.
6. Limitations and Outlook
Although the proposed MPC–CPG controller demonstrates good trajectory tracking performance, it still has certain limitations. First, when the prediction horizon is extended or the model dimension is increased, the computational burden of MPC may impose challenges for real-time implementation. In addition, since the controller relies on a simplified dynamic model and an experimentally fitted parameter mapping, its performance may be affected under strong underwater turbulence or hydrodynamic uncertainties. Furthermore, the adopted dimensionality reduction strategy, which maps high-dimensional leg dynamics into a single steering parameter, inevitably reduces the control degrees of freedom and may neglect part of the leg dynamics. As a result, the proposed method is more suitable for low-speed, quasi-steady motion scenarios with planar trajectory tracking objectives.
Future work will focus on enhancing the adaptability and robustness of the control framework. Adaptive learning mechanisms will be introduced to improve model robustness, and multi-sensor fusion techniques will be incorporated to enhance state perception capability. Moreover, multi-parameter coordinated modulation of the CPG will be explored by jointly optimizing the phase, frequency, and amplitude of the oscillators in addition to the steering parameter, thereby enabling higher-dimensional gait regulation and stronger environmental adaptability.