1. Introduction
As the demand for marine exploration and development continues to grow, underwater robots have emerged as the preferred choice to replace human intervention to ensure safer and more stable underwater operations. Traditionally, underwater robots have relied primarily on propellers for propulsion. However, propeller-based propulsion systems have several limitations, such as high noise, low efficiency, poor yaw stability [
1], and limited maneuverability, which make them unsuitable for certain mission areas. Fish, having evolved over millions of years, demonstrate remarkable underwater locomotion capabilities [
2]. Leveraging advances in disciplines such as biology and robotics, researchers have developed bio-inspired robotic fish that mimic the propulsion mechanisms of real fish. Chen et al. introduce a tensioning integral robotic fish and provide a detailed description of its overall structure, stiffness, and mechatronics. The results indicate that the use of tensioning integral nodes can improve swimming performance [
3]. A bionic robotic fish driven by ionic polymer–metal composite (IPMC) actuators is presented, and the effect of passive fins on swimming performance is investigated [
4]. Michael S et al. [
5] were the first to mimic the propulsion mechanism of fish in the presentation of an efficient bionic robotic fish. Du et al. [
6] designed a novel tuna-inspired robot with rapid swimming and exceptional maneuverability. Dong et al. designed an innovative bionic gliding robotic fish, which has excellent gliding performance [
7]. Liao et al. [
8] propose a robotic fish consisting of multiple pulling wires to simulate muscles, as well as an elastic element to simulate the spine of the fish, achieving a swimming speed of 0.54 m/s. Zhong et al. presented a robotic fish featuring an active line-driven body combined with a soft compliant tail for efficient wave swimming, closely resembling real fish behavior, reaching a maximum speed of 2.15 body length/s [
9]. These advancements in robotic fish technology demonstrate the potential to overcome limitations associated with traditional underwater propulsion methods.
Early research in the field of robotic fish has primarily focused on the structural design and implementation of locomotion. To further advance the practical applications of bio-inspired robotic fish, current efforts are directed toward enhancing their autonomy and intelligence, with the ultimate goal of improving their operational capabilities and cognitive functions. These endeavors encompass a range of tasks, including water exploration [
10], autonomous obstacle avoidance [
11,
12], kinematic optimization [
13], target tracking [
14], path planning [
15], and path following [
16]. These studies are dedicated to developing control strategies that empower robotic fish to effectively handle diverse tasks in underwater environments. In practical applications, robotic fish can be applied to ocean monitoring, undersea operations, aquatic life observation, pollution search, etc. [
17], showcasing its immense potential value. Among the various features, path following plays a critical role in enhancing the autonomy and intelligence of bio-inspired robotic fish. It enables them to efficiently perform tasks, such as patrolling and sampling, in underwater environments.
According to existing research, a typical path-following controller consists of two main components, namely a guidance subsystem and an inner-loop controller. The guidance subsystem commonly employs a line-of-sight (LOS) guidance law that aligns the fish’s heading with the line of sight to achieve the desired position. This approach is straightforward and practical and has been widely applied in the control of unmanned surface vessels. Conversely, the inner-loop controller employs various control methods for angle control, such as sliding mode control, PID control, and model predictive control. For example, Liu et al. [
18] used a fixed-radius LOS and an improved deep deterministic policy gradients (DDPG) algorithm to control a bio-inspired dolphin to follow a three-dimensional path. Chen et al. [
16] employed traditional LOS to achieve real-time desired yaw and pitch angles and used a fuzzy PID controller for tail-joint control and a PID controller for pectoral fin attack-angle control to achieve bio-inspired three-dimensional spiral path tracking. However, the simulation results showed less than ideal tracking performance.
In practical applications, LOS, which relies solely on position error as feedback, may demonstrate reduced tracking performance in the presence of external disturbances. Furthermore, when the lateral tracking error of the robotic fish is zero, regardless of any errors along the path, the desired angle provided by the guidance system will align with the path angle, resulting in deviation from the intended path and consequent degradation of tracking performance. Fossen et al. [
19] introduced an integral LOS (ILOS) to compensate for the sideslip angle caused by ocean currents. They utilized an adaptive approach to estimate and compensate for the sideslip angle and demonstrated the effectiveness of the proposed ILOS using the Lyapunov stability theory. In order to overcome the mutual constraint between lateral tracking error and along-track error in traditional LOS, Qu et al. [
20] introduced an iterative mechanism to find the optimal path point within a single control cycle to ensure zero along-track error. Through theoretical analysis, an extended-state LOS (ELOS) was derived based on the variable distance to adaptively compensate for the current yaw-tracking error and sideslip angle. Experimental results demonstrated that ELOS surpasses traditional LOS and ILOS in terms of tracking performance. However, its convergence rate is slow, and its observer is complex. Dai et al. [
21] proposed a novel path factor update law utilizing a logarithmic-type boundary-layer function (BLF) to limit the along-track error within a constrained range during a single control cycle, effectively addressing the issue of along-track error impeding the convergence of lateral tracking error. These innovative approaches are aimed at enhancing the tracking performance of bio-inspired robotic fish by compensating for the limitations of traditional LOS and mitigating the effects of external disturbances as well as mutual constraints between different tracking errors. However, it should be noted that, in certain cases, automatic compensation for errors was not achieved.
In summary, LOS shows great potential for path-tracking applications. However, traditional LOS methods for path tracking are limited by slow convergence, inadequate tracking accuracy, and significant interference from the sideslip angle of robotic fish. We work on solving the problems of traditional LOS for robotic fish path-tracking applications and the perturbation problems caused by the side-slip angle of robotic fish. Therefore, this study introduces an adaptive LOS (ALOS) control strategy that incorporates a compensation mechanism for the sideslip angle using a finite-time observer (FTO). The results of experiments conducted in a water tank validate the effectiveness of the proposed guidance strategy, showing faster convergence speed and lower steady-state error when compared to traditional guidance methods. The bio-inspired robotic fish achieves precise and stable path tracking, thus confirming the effectiveness of this closed-loop control strategy.
The paper makes two significant contributions:
- (1)
A dynamic look-ahead distance adjustment mechanism was adopted to improve the convergence speed and reduce the overshoot of the traditional LOS;
- (2)
An FTO is proposed to estimate and correct the sideslip angle, effectively solving the path deviation problem.
The remainder of this paper is organized as follows.
Section 2 describes the mechanical structure and electrical system of the wire-driven robotic fish.
Section 3 presents the kinematic model based on the CPG model, as well as the proposed FTO-based ALOS (FTALOS) as a path-following control guidance subsystem for the robotic fish and stability analysis. Pool experimental validation and result analysis are performed in
Section 4. Finally, conclusions and future work are summarized in
Section 5.
3. CPG-Based Path Following Control Design
3.1. CPG-Base Model
3.1.1. CPG Model
The rhythmic tail-swinging motion observed in natural fish is driven by a CPG and dynamically modulated by sensory inputs, such as water flow, temperature, pressure, and olfactory and visual information. This movement aids fish in adapting to changes in water flow and aquatic environments. Based on meticulous observations of actual fish movement, we propose an enhanced CPG model that is suitable for the proposed wire-driven biomimetic robotic fish. The model is derived from Ijspeert’s successful CPG model applied to gait generation control in biomimetic salamanders [
24,
25]. Manduca et al. [
26] used a CPG model to control the torque on the caudal fin. Korkmaz et al. [
27] employed the CPG model, fuzzy logic, and a sensory feedback mechanism to achieve three-dimensional motion. Given that our robotic fish has only one motor drive, we simplify the CPG model by removing complex coupling and introducing the concept of temporal ratio to describe varying durations in recovery and flapping phases during turning. The final expression of the CPG model is as follows:
where,
,
, and
represent the real-time values of the caudal fin beating bias, amplitude, and phase, while
represent the beating amplitude, bias, frequency, and time ratio taken for one complete cycle in the CPG high-level control commands. Additionally,
and
are design parameters used to control the sensitivity of the CPG commands. The time ratio is defined as the ratio between the restore phase (
) and the beat phase (
). This parameter can be utilized to control the turning rates. By adjusting the parameters in the high-level control commands of CPG, different swimming modes can be generated, and smooth transitions between different modes can be achieved without sudden changes in the control variables.
The first and second differential equations represent second-order linear differential equations, indicating that the current amplitude m converges to the CPG input . The rate of convergence is contingent upon the coefficient , while the offset exhibits similar behavior. When given inputs and , an oscillatory gait is initiated, at which point a non-zero input b begins to polarize.
3.1.2. Kinematic Model
The kinematic model diagram is shown in
Figure 2. Due to the fact that robotic fish typically do not engage in long-term depth adjustments, and adjustments to weight distribution are made during design to ensure stability in the roll direction during swimming, depth variations can be disregarded, and the roll angle and pitch angle can be set to zero, resulting in the simplified two-dimensional planar kinematic equation as follows:
where
stands for the world coordinate system which is stationary, and
and
represent the position of the robotic fish in the world coordinate system.
denotes the coordinate system bound to the motion of the robotic fish, whose direction is shown in
Figure 2, and the velocity of the robotic fish in the
-axis and
-axis are
and
, respectively. Meanwhile,
denotes the angular velocity of rotation around the
-axis.
represents the yaw angle of the robotic fish, i.e., the angle between the
-axis of the robotic fish’s motion coordinate system and the
-axis of the world coordinate system.
3.1.3. Combined Motion
This subsection describes how the CPG model drives the robotic fish to perform motion. The CPG model, as presented in Equation 1, is capable of generating stable swimming vibration gaits of the caudal fin. Theoretically, the swinging caudal fin will generate the force to be applied to the dynamics model, and the generalized acceleration generated by the dynamics model will be integrated to get the generalized velocity, which will be applied to the kinematic model, thus driving the robotic fish to move. However, due to the complex structure of the highly propulsive robotic fish designed in this paper and the complexity of fluid mechanics, it is difficult to establish an accurate dynamics model. So, this paper does not establish a dynamics model but assumes that the acceleration process of the robotic fish is very short and that the robotic fish can soon reach equilibrium. That is, the total propulsive force is equal to the drag force. Therefore, the dynamics model can be ignored, and the mapping relationship from the CPG input to the motion state of the robot fish, i.e., the kinematic model, can be established. When the CPG input parameters are
, the caudal fin of the robotic fish oscillates symmetrically along the central axis, which produces forward thrust, i.e.,
in Equation 2, and the average angular velocity
is zero. Therefore, the robotic fish swims forward, as shown in
Figure 3a. While the input is
, the caudal fin of the robotic fish is polarized, thus generating a lateral force, and the angular velocity
, as shown in (b) and (c) of
Figure 3. It can be seen that the purpose of controlling the motion of the robotic fish is thereby achieved by changing the input of the CPG.
3.2. Outer-Loop Controller Design
To facilitate description, let us establish a coordinate system as shown in
Figure 4. The desired path is defined as
= (
(
),
(
)), where ϖ is a coefficient related to the path. Taking a point on the desired path as the origin and its tangential direction as the X-axis, we establish the
coordinate system. Based on the geometric relationships in
Figure 4, the tracking error of the robotic fish can be expressed in the
coordinate system as follows:
where
represents the rotation matrix between the world coordinate system and the
coordinate system, and it is defined as:
where
is the tangent angle or path angle at the current path point, which can be defined as follows. Assuming that
and
are twice differentiable with respect to
To achieve path following for the robotic fish, a certain guidance method is required to steer the fish towards the desired path and ensure it swims along that path. In the traditional LOS, the desired heading angle is defined as:
By causing the controlled object to move according to the desired heading angle mentioned above, the controlled object can eventually converge to the desired path. However, the traditional line-of-sight guidance law has three drawbacks:
- (1)
coupling and mutual constraint exist between the convergence of along-track and cross-track errors;
- (2)
when the cross-track error is zero, the desired heading angle is outputted by the guidance subsystem equals the path angle;
- (3)
the constant and relatively large lookahead distance results in a slow convergence speed.
Due to drawback 1, the along-track tracking error of the robotic fish may not be zero throughout the entire motion process, and it can be comparable to the cross-track error [
20]. When the desired path is a straight line, only a zero cross-track error is required for the robotic fish to follow the intended path. However, when the desired path is a curved path, both components in two directions must be zero simultaneously for successful path following. Therefore, the fish may have difficulty in accurately implementing path following. In fact, T. Fossen et al. have shown that, for a non-closed path, there exists an optimal path point
where the along-track tracking error
is zero [
19]. For a closed path, multiple optimal path points may exist at the same time, and in this case, the one closest to the previous optimal path point is selected. Therefore, the optimal path point within a single control cycle can be obtained using the following equation:
For drawback 2, when the cross-track error reaches zero, regardless of the magnitude of the along-track error, the desired yaw-angle output from the guidance subsystem will be strictly equal to the path angle. In this case, if the along-track error is non-zero, the angle will guide the robotic fish toward the desired path. However, when the along-track error is zero, indicating that the robotic fish is already on the desired path, it will cause the robotic fish to deviate from the desired path, thus affecting the path-following performance. In the traditional LOS approaches, the derivation process commonly disregards the influence of the sideslip angle. Despite its typically small magnitude, it becomes significant when the cross-track tracking error of the robotic fish nears zero and cannot be overlooked. Moreover, the sideslip angle can provide a certain heading angle compensation to mitigate the deviation phenomenon in the traditional law. Therefore, we proposed a side-slip angle observer to correct the output of the guidance system and improve the path-following performance of the robotic fish.
By differentiating Equation (3), the tracking-error kinematics can be obtained as follows:
where
represents the velocity of the path point,
is the real-time synthesized motion velocity of the robotic fish; and
is the sideslip angle which is defined as the angle between
and
, i.e., atan(
). By calculating the optimal path point
that minimizes
according to Equation (7) and assuming that sin
and cos
1, based on the fact that beta is generally <10°. At the same time, it is assumed that the side-slip angle of the robotic fish changes slowly during the movement, i.e., there exists
= 0. The equation can be reduced to:
The side-slip angle observer can be designed as below:
where
is the estimated value of
, and
represents the estimation error of
.
is the estimated value of the side-slip angle
, and
denotes the square root sign function. With the action of this observer, the estimation errors
and
will converge to zero, i.e.,
and
.
Proof. Subtract Equation (9) from Equation (10), and we can
get:
Choosing the Lyapunov function as
and taking the derivative of
:
With
Lemma 1 in [
28], let
and
. Then, the following inequality holds:
It is noted that there should exist a constant
satisfying
, such that
, which implies
. Therefore, we can derive the following equation:
According to
Lemma 2 in [
28], for the nonlinear autonomous system
,
, if there exists a positive definite continuously differentiable scalar function
,
satisfies the following conditions:
where
. Then, the system is finite time stable at the origin, i.e., there exists a time
T:
such that
.
The estimation error
will converge to
within a finite time, and the convergence time
satisfies the following condition:
Therefore, under the action of the observer, we can approximate
to
and
to
. Based on the estimated value of the sideslip angle obtained from the observer, the yaw control law of the guidance subsystem is given by:
Under the influence of this desired yaw angle, the robotic fish’s lateral error can converge to zero. □
Proof. Assuming that the robotic
fish can perfectly track the desired yaw angle, when the desired yaw angle is
substituted into the observer, the following can be obtained:
Taking the Lyapunov function as
and differentiating it, it can be derived that:
where
. According to the Lyapunov stability theory, it can be concluded that
will eventually converge to zero.
To address drawback 3, the selection of the lookahead distance plays a crucial role. Thus, an adaptive LOS strategy is proposed. When encountering a large lateral tracking error
, indicating that the fish is significantly deviating from the desired path, it is advantageous for the fish to swiftly approach the desired path. In this case, opting for a smaller lookahead distance would result in the desired yaw angle being nearly perpendicular to the path angle, thereby enabling faster convergence with the desired path. On the other hand, conversely, when facing a small lateral tracking error, it is preferable to utilize a larger lookahead distance in order to minimize overshooting during convergence. In this scenario, emphasis should be placed on aligning the desired yaw angle with the path angle. It is important to note that, while a smaller lookahead distance facilitates convergence speedily, an excessive focus on convergence can lead to oscillations. Therefore, employing a time-varying formula for calculating lookahead distance can mitigate these issues:
where
represents the upper limit of the time-varying lookahead distance, while
represents the lower limit. The parameter
serves as a positive design parameter that controls the sensitivity of the lookahead distance to the lateral tracking error. By modifying the value of
, the sensitivity of the lookahead distance to variations in the lateral tracking error can be regulated, which facilitates the trade-off of convergence speed and oscillations during the tracking process. The flowchart of ALOS is shown in
Figure 5.
Figure 6 illustrates the overall framework of the FTALOS control method for path tracking.
where
is the real-time position of the robotic fish,
is the tracking signal of
,
is the tracking signal of
, and
is the optimal control synthesis function, which is defined as [
28]:
3.3. Inner-Loop Controller Design
In the previous section, the primary function of the outer-loop controller is to simplify the path-tracking control problem by transforming it into a lateral tracking-error stabilization control problem. This is further enhanced through the implementation of an improved LOS, which subsequently converts it into a yaw-tracking control problem. Therefore, an effective yaw-tracking controller is necessary, involving the utilization of LOS as the outer-loop controller for deriving the desired yaw-angle signal. Subsequently, the inner-loop yaw-tracking controller generates the corresponding motor control signal, thereby driving the robotic fish to accurately follow the intended path.
The compliant and flexible design of the tail in the proposed biomimetic robotic fish structure in
Section 2 enhances energy efficiency while achieving natural fish-like swimming. However, accurately establishing the dynamic model of the robotic fish presents challenges, making the application of model-based control methods impractical. Conversely, PID controllers have been widely employed in various control tasks due to their simplicity, robustness, and ability to achieve satisfactory control performance without requiring a precise model of the controlled system. Therefore, we utilize a PID controller as the inner-loop yaw-tracking controller, with its specific control output defined as follows:
where
is bias, one of the inputs of the CPG model.
represents the tracking error at the i-th time instant, where
is the current yaw angle and
is the desired yaw angle. The parameters
,
, and
are the proportional, integral, and derivative gains of the controller, respectively.
represents the sampling period.
To improve the robustness of the controller, an incremental PID approach is employed. By taking the difference of Equation (24), we obtain:
The inclusion of the integral term introduces the potential for integral windup. As a result, it is essential to evaluate whether the control signal has reached saturation when calculating the adjustment to the control signal. If saturation is identified, the integral component is disregarded, and only the proportional and derivative terms are retained. This approach, commonly known as an anti-windup mechanism, effectively mitigates the negative impacts of integral saturation.
It is important to note that the MPU6050 obtains the current orientation angles through velocity integration, where the Z-axis angle represents a relative angle rather than an absolute angle. Upon power-up, the Z-axis angle is initialized to 0°, indicating that the fish’s head direction at power-on is considered the 0° direction. Typically, the range of variation for the Z-axis angle is [−180°, 180°]. Therefore, significant angle jumps may occur when the fish’s yaw direction is opposite to the initial direction at power-up, such as a jump from 180° to −180° or from −180° to 180°. In order to mitigate abrupt changes in the yaw-tracking error and prevent erroneous control commands due to angle discontinuities, it is essential to preprocess the yaw angle obtained from the fish’s attitude sensor before updating the control signal. The specific preprocessing steps are as follows:
Note that the Z-axis angle sampled by the MPU6050 is not the actual yaw angle but the direction in which the fish head is pointing because the fish head will oscillate during the swimming process. In order to get the actual yaw angle, we need to approximate the yaw angle by first-order filtering:
where
is the filtering factor,
is the yaw angle corresponding to the current sampling cycle,
is the yaw angle of the previous cycle, and
is the pointing of the head of the fish captured by the MPU6050 in the current cycle, with a sampling period of 0.02 s.
5. Conclusions
In this paper, an FTALOS guidance subsystem is proposed to achieve a planar path following a bio-inspired robotic fish equipped with a compliant and flexible tail fin driven by a cable mechanism. Initially, the kinematic model of the underwater bio-inspired robotic fish is introduced based on coordinate transformations. Subsequently, an ALOS guidance strategy is proposed, which incorporates compensation for the sideslip angle. Moreover, an incremental PID controller for yaw-tracking control is introduced and experimentally validated to evaluate its ability to track the yaw angle. The integration of the guidance subsystem and the PID heading controller is synergistically implemented, and the efficacy of the proposed tracking strategy is verified through experiments. The experimental results demonstrate that the robotic fish guided by the proposed FTALOS exhibits minimal overshoot and achieves a lower steady-state error compared to the traditional LOS and CLOS.
In the future, we will develop advanced mechanical structures to enhance the swimming efficiency and experimental reproducibility of robotic fish. Moreover, our focus will remain on refining control algorithms, including model-free control based on reinforcement learning, to enable robotic fish to autonomously learn and improve controller robustness. Furthermore, we will conduct outdoor experiments with random perturbations to track more complex paths.