Analysis of Heading Stability due to Interactions between Pectoral and Caudal Fins in Robotic Boxfish Locomotion

Investigating the interaction between fins can guide the design and enhance the performance of robotic fish. In this paper, we take boxfish as the bionic object and discuss the effect of coupling motion gaits among the two primary propulsors, pectoral and caudal fins, on the heading stability of the body. First, we propose the structure and control system of the bionic boxfish prototype. Second, using a one/two-way fluid–structure interaction numerical method, we analyse the key parameters of the prototype and discuss the influence of pectoral and caudal motion gaits on the hydrodynamic performance. Finally, effect of the pectoral and caudal interactions on heading stability of the prototype is systematically analyzed and verified in experiments. Results show that the course-deviating degree, oscillation amplitudes of yawing, rolling, and pitching exhibited by the prototype are smaller than that caused by single propulsor when the motion gaits of both pectoral and caudal fins are coordinated in a specific range. This paper reveals for the first time the effect of interactions between pectoral and caudal fins, on the stability of body's course by means of Computational Fluid Dynamics and prototype experiments, which provides an essential guidance for the design of robotic fish propelled by multi-fins.


Introduction
Fish have become the focus of research by scholars and engineers because of their ability to swim with high mobility, speed, and stability [1][2][3]. The development of fish-like underwater robots has given a new impetus to human exploration of the oceans [4]. As the research of robotic fish has developed, scholars have used various technical means to enhance the locomotion performance of the bionic prototypes, such as robotic fish with tandem multi-joints tail for efficient maneuvering [5][6][7], relying on flexible passive joint to achieve locomotion [8][9][10], or even able to leap out of the water [11]. Meanwhile, rejecting the limitations of traditional structure, the soft robotic fish relying on smart materials for propulsion also have excellent advantages [12,13]. The continuous innovation of underwater bionic technology will lead the research of robotic fish from the design to undertaking certain application tasks. Nevertheless, stable and reliable prototype design and operable maneuvers have always been the basis for the development of robotic fish.
Depending on the typical locomotor parts, scholars have classified fish and fish-like robots into two modes: body and/ or caudal fin (BCF) and median and/or paired fin (MPF) [14]. However, most fish do not rely strictly on a single type of fin to achieve locomotion, e.g., black surfperch or bluegill sunfish use only the pectoral fins when swimming at low speeds and switch to pectoral and caudal combined movements at higher speeds [15], while some bony fish actively control the coordinated movement of pectoral, caudal, dorsal, and anal fins to accomplish daily activities [16]. Under the disguise of rigid carapace, boxfish are usually considered to be very clumsy, or stable. Under such a notion, scholars have found that the vortex attached to the keels of their carapace have the effect of making their body self-stabilizing during forward swimming [17,18]. However, Van Wassenbergh et al. [19] have demonstrated that the carapace of boxfish is unstable with fluid perturbation by means of Digital Particle Image Velocimetry (DPIV) and Computational Fluid Dynamics (CFD). With the regulation of multiple fins motion, boxfish can use the instability of the body to achieve maneuvering behaviors such as yawing and pitching, but also be able to reduce the underwater recoil movements of cruising. Accordingly, the influence of coordinated motion relationship between fins on fish cruising is currently a direction worthy of in-depth exploration by scholars and engineers [20].
Currently, some scholars have conducted research on the kinematic performance of fish under the effect of fin-fin interactions [21][22][23]. Through CFD, Han et al. [24] systematically studied the effect of motion phase between dorsal/anal fin and caudal fin on the hydrodynamic performance. Numerical analysis showed that increasing the area of dorsal/anal fin surface or allowing dorsal/anal fin to leading-phase flap can effectively increase the locomotor performance of caudal fin. Mignano et al. [25] built a fixed experimental platform with multi-fins to investigate the relationship of position and motion phase between the anal fin, dorsal fin, and caudal fin. Experimental results showed that the appropriate position and motion phase between dorsal and caudal fins can improve the platform thrust and reduce the generated lateral force. Ding et al. [26] developed an untethered robotic fish driven by multi-fins. By measuring yaw angle variation of the prototype during its forward swimming, effect of motion interaction between the anal and caudal fins was investigated. The experiments showed that the prototype was able to maintain a minor oscillation amplitude of the yaw angle, that is, a minimum of 4.32°, when the anal and caudal fins flapping with a certain phase lag. Yet, most of the analyses of fin-fin coupling motion interactions are still on the study of both median fins (anal/dorsal fins) and caudal fin. Although pectoral and caudal fins are the two most important propulsors of fish, and the robotic fish that propelled by both pectoral and caudal fins show better locomotor maneuverability [27][28][29][30], the effect of coupling relationship between pectoral and caudal fins on the cruising performance, especially the stability of forward swimming, has not been systematically analyzed. Furthermore, the analysis of interactions between pectoral and caudal fins will not only enable the robotic fish to modulate its swimming stability and thus be suitable for carrying sensors to undertake operational tasks, but also be a theoretical basis for revealing the locomotion mechanism of fish with multi-fins.
In this paper, we develop a 6 degrees of freedom (DOFs) boxfish-like bionic robot, which achieving motion through the oscillation of two 2-DOFs pectoral fins and a 2-DOFs caudal fin. An artificial Central Pattern Generator (CPG) network is designed to realize the bionic control of the prototype. Then we adopt a one/two-way fluid-structure interaction (FSI) numerical approach to first analyse the effect of the pectoral and caudal fin flexibility on the propulsion performance. Then, the oscillation phase lag between the 2-DOFs caudal joints is discussed numerically, while the hydrodynamic performance of the pectoral fins has been analyzed in our previous work [31]. Further, hydrodynamic performance of the prototype affected by its pectoral and caudal fins motion is evaluated numerically. Finally, we have measured attitude of the prototype during its untethered forward swimming to verify the effect of pectoral and caudal fins coupling motion on the prototype's heading stability.
The remainder of this paper is organized as follows. In section 2, structure and control system of the designed robotic boxfish are introduced. In section 3, numerical analysis of the characteristic parameters of the pectoral and caudal fins is presented. In section 4 experiments are performed systematically to demonstrate the regularity of forward swimming stability for the prototype under pectoral and caudal fins coupling actuation. Conclusions and future work are given at the end of this paper.

Robotic Boxfish Structure
Boxfish, a family of bony fish, whose bodies are rigid in the front two-thirds to three-quarters of the length, modulate maneuverability and stability through their pectoral, anal, dorsal, and caudal fins [32]. By actively controlling the coordinated motion of multiple fins, boxfish exhibit less recoil movements during cruising; in other words, their bodies perform less postural angular oscillation while swimming forward [33]. Inspired by the swimmers with multi-fins, the bionic prototype we designed imitates the shape of boxfish and consists of two pectoral fins and a caudal fin as the main actuators. Since the main consideration at this stage is the heading stability of body under the influence of pectoral and caudal fins coupling motion, the roles of dorsal and anal fins are omitted. Since the structure of bony fishes' fin is generally composed of radial fin rays and a thin collagenous membrane, each fin ray is capable of bending and threedimensional twisting driven by separate muscles attached to the fin-base [34]. Therefore, the pectoral fins of boxfish are capable of fluctuation flapping, expanding or contracting, as well as bending in both the chordwise and spanwise directions. Considering the large size of mechanical actuator structure, the movement of muscles at the fin-base could not be imitated, so we simplify the pectoral fin of our prototype into a structure with 2 servomotors orthogonal each side to simulate twisting of the fin-base and flapping of the fin-surface, respectively. The caudal part of the prototype is equipped with two servomotors in series to achieve a smooth oscillation, and all actuators of the prototype are waterproof, as shown in Fig. 1.
The main body of the prototype is a sealed cabin made of hard resin through 3D printing, which consists of two parts, the back and the belly of it. These two parts are sealed against water with an O-ring set in the middle. As seen in Fig. 1d, inside the sealed cabin, electronic devices such as the printed circuit board (PCB), a 10,000 mAh Li-ion battery, a wireless communication module, two inertial measurement units (IMU-1, IMU-2) and so on are fixed. The mouth of the prototype is equipped with a seal-test nozzle for checking the tightness of the sealed cabin, while the anal region is installed with a pressure sensor (MS5837-30BA), two circular connectors for charging the battery and downloading programs to the PCB, respectively.
The overall density of the prototype can be adjusted by placing steel weights inside the sealed cabin, so that after several adjustments, the prototype can be suspended in water. After counterweighting, the total weight of the prototype is about 3.77 kg. Figure 2 shows the actual prototype, and specifications of the prototype are listed in Table 1. Notably, the pectoral and caudal fin surfaces of the prototype are made of carbon fiber plates (CFP) with silicone membrane. Among them, the CFP is designed in the form of a radial skeleton to achieve different degrees of flexibility. That is, the pectoral and caudal skeletons are more rigid at the front end and more flexible at the trailing end, thus making it more conducive to the generation of leading-edge vortex and the shedding of trailing-edge vortex through the interaction

Swimming Motion Control
The electronic hardware system of the prototype is composed of the power supply, a voltage/current monitoring module, a microcontroller unit (MCU), a wireless communication module, sensoring system, actuators, and other peripheral devices, as shown in Fig. 3a. Electronic power output from the 8.4 V Li-ion battery is passed through the voltage/current monitoring module, and then to the DC-DC module and servomotors, respectively. The voltage/current monitoring module can detect the instantaneous voltage and power consumption of the whole prototype, while on-board DC-DC modules convert battery voltage to 5 V and 3.3 V for peripheral devices and MCU. We choose the 433 MHz radio band wireless module as the communication unit between upper computer and the prototype, and signals sent from the module can transmit about 1.5 m underwater. In addition, the purpose of carrying two IMUs onboard is to average the measured attitude angles during subsequent experiments and to reduce the measurement error of a single sensor.
To simulate the periodic and supple rhythmic movements of birds, fish or other animals in nature, artificial CPG models have been designed for motion control of the bionic robots and successfully applied to various forms of robotic fish [35]. According to [36], we simplify the motion of those 6 DOFs of fins as sinusoidal oscillation, and construct an artificial CPG unit corresponding to a single DOF, that is, the i-th CPG oscillation unit is implemented as follows: where ϕ i , r i , x i , and θ i are the state variables of the oscillation unit, which represent the instantaneous phase, amplitude, offset angle, and output angle of the oscillator unit i, respectively. The υ i , R i , X i are the control parameters that need to be set artificially, representing the desired frequency, oscillation amplitude and offset angle of the i-th CPG unit, respectively. The relationship between CPG units is determined by the coupling constant and the desired phase lag between unit j and i, that is, parameters w ij and Δφ ij . The parameters a i and b i are constant positive gains, controlling the dynamic performance that r i and x i transition to the desired value R i and X i , respectively.
In addition, the desired phase lag Δφ ij can be understood as: The Φ j and Φ i determine the intrinsic oscillation phase of unit j and unit i, respectively. When Δφ ij is positive, it means that the oscillator unit j is in-phase ahead of unit i. Meanwhile, the Δφ ji is the opposite of the Δφ ij .  Since the prototype has a total of 6 DOFs, namely, driven by 6 servomotors, it is necessary to integrate 6 CPG oscillation units to constitute the artificial CPG network of the prototype, and the diagram is shown in Fig. 3b.
The required correlations are established between DOFs, e.g., different motion phase lags between the twisting DOF of the two pectoral fins (CPG 1 , CPG 4 ) can realize the pectoral fins oscillating asynchronously. And the variation of motion phase lags between unilateral pectoral fin's twisting and flapping (CPG 1 , CPG 2 ) can enable the pectoral fin to generate thrust in forward or backward direction. The output angles of CPG oscillator units 1 ~ 6 correspond to the rotation angles of the servomotors. To simplify the control parameters of CPG network, the constant coefficients w ij are all set to 2 and the positive gains a i and b i are all set to 20, through several experimental adjustments. Certainly, it is worth noting that motion phase lags between actuators are valid only when the oscillation frequency of each unit is the same, therefore, υ i = υ.
Control program of the prototype runs as shown in Fig. 3c, based on the hardware and software system configured, the bionic prototype can satisfy the smooth switching of motion gaits and monitoring of attitude in real time.

Numerical Analysis
In our early work [31], we implemented a one-way FSI analysis on hydrodynamics of the rigid pectoral fin. Based on this, we incorporate a two-way FSI analysis and propose a one/two-way FSI numerical approach. Utilizing this method, we analyse the optimal characteristic parameters of the prototype's pectoral and caudal fins, and then make a preliminary discussion on the motion performance of the (CPG i is abbreviated as C. i ). c Flow chart of the prototype's running system prototype affected by its pectoral and caudal fins coupling motion.

One/Two-Way FSI Method
To improve propulsion performance of the prototype and to analyse more realistically the deformation of each fin surface under the compound effect of its own oscillation and fluid resistance, we use the platform Abaqus and XFlow to establish asynchronous two-way data exchange channels for the fin surfaces. As shown in Fig. 4, a simplified model of the bionic prototype is first built using the Abaqus/CAE, and the dimensions and positions of its fins are consistent with those of the actual prototype. Where, the CFP skeletons are set up as Shell and embedded in the silicone membranes created as hyperelastic body. Next, the pectoral and caudal fins are divided into nonlinear meshes and the mesh file is exported for import into the fluid domain of XFlow. The rest of the bionic model, meanwhile, are rigid and can be directly imported into XFlow for configuration, so they are not involved in the calculation of the structure domain and serve as display bodies in the Abaqus/CAE, for saving resources of the computation. The fins are able to move after the configuration of their motion parameters. Finally, the fin surfaces are set as the fluid-structure data exchange surfaces and waiting for configuration in the fluid domain.
After configuring the fluid domain environment, we import the same simplified bionic model as in Abaqus/CAE to XFlow, including rigid components such as the fish body, simplified joints of the pectoral and caudal DOFs, etc., and the mesh model of the above-mentioned fin surfaces. For the parts that need not consider their deformation, they can be directly imported into the fluid domain as rigid bodies and defined their motion, at this time, motion of the rigid body only has a unilateral effect on fluid, so the simulation of them is a form of one-way FSI analysis. The motion of imported rigid parts is consistent with that in the structure domain, so the joint movement of the fin surfaces and the rigid parts is smooth and coordinated. Finally, the two-way data exchange channels are built, that is, the pressure variables on the fin surfaces in the fluid domain are transferred to the structure domain to participate in the calculation as loads, while new displacement variables of the fins in the structure domain participate in the next-step calculation of the fluid domain as loads, which forms the asynchronous co-simulation. In a single case, the fluid domain has been quasi-steady after 3 periods of the fins flapping, and we finish the simulation of a single case after the bionic model has run for 6 periods. It is worth noting that the flow direction in the fluid domain is positive in the x-axis according to the world coordinate system. And when the net force in the x-direction applied by fluid to the bionic model is negative, the model has forward momentum, although its center of mass is fixed in the co-simulation process.
The local coordinates of each fin's DOFs are shown in Fig. 5. Corresponding to the artificial CPG network designed in Section 2.2, the output angle of each DOF can be expressed as:  We select the pectoral motion parameters that can produce better propulsion performance as constant values, that is, the twisting amplitudes of the fin-base R 1 and R 4 are set to 40°, the flapping amplitudes of the fin surface R 2 and R 5 are set to 30°, and the offset angles X 1 , X 2 , X 4 , and X 5 are all at 0°, the phase lags Δφ 21 and Δφ 54 between the twisting and flapping are 90° [31]. For the two caudal joints, the oscillation is symmetrical with respect to the fish body-axis during straight swimming, so their offset angles X 3 and X 6 are 0°, and the oscillation amplitudes R 3 and R 6 are set to 15°. The motion frequency υ of the six DOFs is set to 1 Hz. For the undefined motion parameters, they are the variables need to be considered in this paper.

Effect of the Caudal Flexibility on Propulsion Performance
It is not known whether the softened caudal fin can improve propulsion performance of the prototype, so we first discuss the effect of the caudal flexibility. Since the stiffness distribution of fin surface is not the focus of this paper, only the above CFP skeleton structure is used in our current work, and different thicknesses of the CFP are given to produce different overall flexibility. Thickness of the caudal skeleton is configured in the Abaqus/CAE with three characteristic values of 0.5 mm, 0.3 mm, and 0.2 mm, respectively, and the oscillation phase lag Δφ 63 between the two caudal joints is temporarily set to 90°. At this time, the pectoral fins do not oscillate and are fixed, so only the caudal fin surface is set as the FSI data-exchanging boundary. Only motion of the two caudal joints is configured in the structure and fluid domains, and all the geometry parts except the caudal surface are regarded as rigid bodies directly imported into the fluid domain. Flow velocity in the fluid domain is set to 0.1 m/s, and the comparison of the overall thrust and lateral force applied to the bionic model among the above three cases is shown in Fig. 6a and b. When thickness of the caudal skeleton is reduced from 0.5 mm to 0.3 mm, its flexibility increases, and the average net propulsive force generated by the bionic model increases significantly, while amplitude of the generated lateral force decreases. The reduction of the lateral force amplitude can reduce yawing amplitude when the prototype swims freely, which is beneficial to maintain the stability of heading. However, when the thickness is reduced from 0.3 mm to 0.2 mm, (9) 4 = X 4 + R 4 sin 2 t − Δ 41 , the flexibility further increases, so that the amplitude of the lateral force can still decrease, but average net thrust force of the model decreases instead. We fixed the caudal fin with 0.5 mm, 0.3 mm, and 0.2 mm thick CFP skeleton onto the prototype, respectively, and the prototype swims at about 0.11 m/s, 0.13 m/s, and 0.11 m/s when driven by the aforementioned motion parameters of the caudal fin alone. It is worth mentioning that the caudal fin surface of the prototype equipped with the 0.5 mm thick CFP skeleton shows almost no passive deformation during forward swimming. Once again, setting the flow velocity to 0.11 m/s, 0.13 m/s, and 0.11 m/s in the fluid domain within cases where the thickness is 0.5 mm, 0.3 mm, and 0.2 mm, respectively, it can be seen that the tail with 0.5 mm thick CFP resembles the rigid plate, and the flexible deformation of the model's tail with 0.3 mm or 0.2 mm thick CFP is basically consistent with the actual situation, as shown in Fig. 6. As a result, when the motion parameters of the caudal DOFs are constant, the appropriate increase of the surface flexibility helps to improve the propulsive force and reduce the lateral yawing amplitude, so we can choose the flexible caudal fin with the characteristic thickness of 0.3 mm in both subsequent numerical calculations and prototype experiments.

Effect of the Phase Lag between Two Caudal Joints on Propulsion Performance
The CFP skeleton with 0.3 mm thickness is selected to ensure the flexibility of the caudal fin, while influence of the phase lag between oscillations of the two caudal joints on propulsion performance with this fin surface driving needs to be considered for analysis. We use the same numerical method as above, setting flow velocity of the fluid domain to 0.1 m/s and the phase lag Δφ 63 between two caudal joints as the variable parameter varying from 0° to 315° with an interval of 45°. After each calculation, the net thrust force and lateral force amplitude of the model during three motion periods of 3 ~ 6 s are, respectively, averaged, and the obtained results along with phase lag Δφ 63 are shown in Fig. 7.
In a constant head-on water flow of 0.1 m/s, the average net thrust (F x -AVG) and lateral force amplitude (F z -R) applied to the model both decrease as the phase lag Δφ 63 increases, reaching the minimum when the Δφ 63 is 180°. Subsequently, as the phase lag Δφ 63 increases further, the resulting average net thrust and lateral force amplitude both increase. Considering that the average net thrust is the direct influence factor for prototype's swimming speed, while the lateral force amplitude will exert lateral torque on the fish body, causing prototype to produce head-shaking oscillation, therefore, for the selection of motion parameters, it is necessary to ensure the body to maintain a large net propulsive force, but also to minimize the amplitude of lateral force.
Based on this, the propulsive performance of the prototype is ideal when the phase lag between the two caudal joints is 90°. Therefore, in the subsequent simulations and experiments, we set Δφ 63 to a constant value of 90°.

Effect of the Pectoral Flexibility on Propulsion Performance
The same method as in Section 3.2 is used to make the pectoral fins on both sides with different CFP thicknesses, at which time the caudal part does not move and is not as the object of co-simulation. Thickness of the pectoral skeleton is configured with three characteristic values of 0.5 mm, 0.3 mm and 0.2 mm for comparison simulation, and twisting of the two pectoral fin-base moves in the same phase, that is, Δφ 41 is 0°. The flow velocity is set to 0.1 m/s, and the comparison of the overall thrust and vertical lift force applied to the bionic model among above cases is shown in Fig. 8.
Although the pectoral flexibility degree increases somewhat with decreasing the CFP thickness, the flexibility has a smaller range of influence on the overall thrust and lift force generated by the bionic model. Nevertheless, the  Fig. 7 Effect of the phase lag between the two caudal joints on propulsion performance enhanced degree of the pectoral flexibility is able to increase the average net propulsive force and reduce the amplitude of vertical lift to a small extent. Reason for this is that the span-chord ratio of the pectoral fin is smaller than that of the caudal fin, so that the hydrodynamic drag acts to make the bending deflection of pectoral fin surface insignificant when the stiffness distribution of its surface is constant. Therefore, the thickness of pectoral CFP skeleton has less effect on the thrust/lift force. Although, the effect of pectoral or caudal fin stiffness distribution on propulsive performance is also a research direction of our interest, this problem is simplified in this paper so as to mainly focus on the interactions between pectoral and caudal fins coupling motion. As a result, we will use rigid pectoral fins instead of flexible ones in the subsequent simulations, to reduce the consumption of computational resources for co-simulation. For the prototype, 0.2 mm thick CFP skeletons will be fixed on to increase the propulsive force and reduce the pitching amplitude of the body as much as possible.

Effect of the Pectoral and Caudal Fins Coupling Motion on Propulsion Performance
Interactions among pectoral and caudal fins are mainly reflected in the motion gaits of them. For the bionic model or the prototype, these interactions are mainly embodied in the twisting phase lag between the two pectoral fins, that is, synchronization or not of the pectoral fins feathering on both sides, and the phase lag between unilateral pectoral flapping and caudal front joint oscillation. Thus, combined with the above artificial CPG network, it can be seen that the interactions among pectoral and caudal fins are specifically how the motion phase lag Δφ 41 and Δφ 32 affect on the propulsion performance of the bionic model or the prototype. We configure the Δφ 41 and Δφ 32 to vary from 0° to 315° with an interval of 45°, respectively, as combined variables, set the flow velocity of the fluid domain to 0.1 m/s. After 6 motion periods of a case corresponding to each pair of combined parameters, the net propulsive force and the amplitude of lift force applied to the bionic model by the fluid, as well as the net torque applied in the z 0 -axis direction on the model's mass center are averaged for the three periods from 3 to 6 s. As shown in Fig. 9a, under the joint effect of the pectoral and caudal different motion gaits, the average net torque in the z 0 -direction, which can also be described as the yaw torque, shows a more obvious periodic sinusoidal-like variation with increase of the phase lag Δφ 32 . And when the phase lag Δφ 41 increases from 0° to 360°, the absolute value of the yaw torque is smaller near 180°. This reflects that if the twisting phase lag between the two pectoral fins is narrow when the prototype is swimming forward, the wider the range of yaw torque variation caused by the Δφ 32 changing, that is, variation degree of the course-deviating angle will be more pronounced. When the two pectoral fins twist completely asynchronously (Δφ 41 = 180°), the variation range and absolute value of yaw torque are smaller, thus the theoretical degree and variation range of the course-deviating angle caused by the varying phase lag Δφ 32 are smaller.
The average net thrust force applied to the bionic model is shown in Fig. 9b. Both the phase lags Δφ 41 and Δφ 32 have a little effect on the propulsive force generated by the model or the prototype. However, with the in-phase twisting of the two pectoral fins, motion gait corresponding to the Δφ 32 within a specific range is able to make the model generate a slightly larger propulsive force. Combined with Fig. 9a, the collaborative motion gaits of the pectoral and caudal fins in this range cause a larger degree of yaw torque for the model, which is not suitable for a normal stable forward swim for a prototype, but might be a choice for activities such as rapid attitude adjustment.
As shown in Fig. 9c, the average amplitude of lift force applied to the bionic model is less affected by the phase lag Δφ 32 and more significantly affected by the change in the Δφ 41 . When twisting phase lag between the two sides of the Fig. 8 Effect of the pectoral flexibility on propulsion performance. a Comparison of the overall thrust force applied to the bionic model. b Comparison of the overall lift force applied to the bionic model pectoral fins transitions from in-phase to out-of-phase, the average amplitude of lift force applied gradually decreases, reaching minimum as the two pectoral fins twist completely asynchronously. For a free-swimming robotic fish, the variation of its attitude is a combination of yawing, pitching, and rolling, therefore, the average lift variation amplitude of the fixed body is just a preliminary reflection of the prototype's pitching amplitude. While the amplitudes of rolling and yawing are affected by the joint motion of pectoral and caudal fins, which should be measured and analyzed by forward swimming experiments of the untethered prototype in this paper.

Experimental Setup
The stability of fish forward swimming is mainly reflected in the recoil movements, that is, course-deviating or not, and the oscillation amplitudes of yawing, rolling, and pitching [37,38]. We measure attitude variation of the prototype during forward swimming, so as to discuss the influence law of the pectoral and caudal fins coupling motion on heading stability of the prototype. As shown in Fig. 10, experimental platform is set up. As the prototype is counterweighted to be suspended in water, each experiment we let the prototype completely submerged in pool with its back about 400 mm from the water surface, and the prototype runs according to the control program shown in Fig. 3c, recording its attitude at 25 Hz through the two IMUs mounted, and sending the attitude angles data to upper computer each case. The prototype needs to be powered off and on again before each experiment to eliminate the accumulated error of the two IMUs, and then control signal is transmitted to the prototype through the wireless communication module, which lets the prototype to swim according to the specified motion parameters, record and send back its attitude data. Figure 11 shows the attitude angles collected from the two IMUs in the experiment for one case. Although angle values of the two IMUs are slightly deviated and the initial position of the prototype is slightly shifted by the perturbation of fluid when powered on (the three-axis attitude angles are not be 0 initially), the amplitudes of the three-axis attitude angles and the degree of course-deviating are relative differences that are not affected by the specific values. Meanwhile, we repeat the measurement three times, and can get a total of six groups of data from the two IMUs for each case, so that the final results are obtained by averaging. To reduce the disturbance of the experimental environment, we wait until the water surface of the pool is calm before starting each case of experiment.

Results and Discussions
First, we repeat measurements on the attitude angles of the prototype relying on the caudal fin or pectoral fins propel alone during its forward swimming, and the results are shown in Table 2. When only the caudal fin is propelling, the artificial CPG parameters of the prototype are same as the constants in Section 3.1, except that the amplitudes R 1 , R 2 , R 4 , and R 5 of the pectoral DOFs are set to 0. Therefore, there is no more motion phase lags between the pectoral and caudal fins. While the caudal fin does not move, the prototype relies on both sides of the pectoral fins to achieve forward swimming, only the R 3 and R 6 of the two caudal DOFs are set to 0, and twisting phase lag between the two pectoral fins is still set according to Section 3.5. Table 2 shows that the course-deviating degree of the prototype is not easily detectable when driven by the caudal fin alone. However, the prototype shows yawing oscillation, while it is also able to exhibit a fairly small range of periodic rolling and pitching oscillation under the unilateral torque Schematic diagram of experimental scene Fig. 11 Attitude angles of the prototype for one case (forward swimming when the phase lag Δφ 41 is 135°, Δφ 32 is 0°). a IMU-1 (LPMS-IG1), IMU-2 (HI226DK). b Yaw angle collected from the two IMUs. Amplitude of the curve represents the yawing oscillation amplitude of the prototype. Offset angle of the yaw curve center within 5 s represents the course-deviating degree of the prototype. c Roll angle collected from the two IMUs. d Pitch angle collected from the two IMUs of the caudal fin. When the prototype relies on both pectoral fins alone to achieve forward swimming, its pectoral twisting motion on both sides completely in-phase or completely out-of-phase allows the prototype to maintain its course. In contrast, the phase-lagged twisting of the two pectoral fins among other ranges causes the prototype to exhibit counterclockwise (CCW) or clockwise (CW) course-deviating, specifically, when the left pectoral fin (DOF 1 ) moves ahead of the right pectoral fin (DOF 4 ) and the phase lead is less than 180°, the prototype is subject to CCW yaw torque and deviates to the left. Conversely, when twisting of the right pectoral fin is no more than 180° in-phase ahead of the left side, the prototype deviates to the right. Unlike the caudal fin, we cannot get the periodic yawing oscillation on the prototype propelled by pectoral fins alone. However, the pectoral fins on both sides are able to produce periodic rolling and pitching oscillation effect on the prototype, and the two attitude angles show opposite trends, that is, when the pectoral fins transition from a completely in-phase twisting to a completely out-of-phase one, the rolling amplitude becomes larger and the pitching amplitude becomes smaller, and the variation trend of the rolling amplitude is greater than the pitching amplitude.
Results shown in Fig. 12 are able to evaluate the heading stability of the prototype, which is affected by the same pectoral and caudal coupling parameters as in Section 3.5. As seen in Fig. 12a, variation of the course-deviating degree is consistent with the numerical simulation results in Fig. 9a, and it is worth noting that, combined with the measurements in Table 2, the prototype that rely on pectoral fins alone for propulsion exhibit course-deviating degree that are within the range of variation shown in Fig. 12a. That is, when the gait of the pectoral twisting motion on both sides is constant, incorporating the caudal fin motion can amplify the effect of the course-deviating degree, but can also weaken such an effect, depending on the motion gait between pectoral and caudal fins. Meanwhile, when the pectoral fins on both sides of the prototype twist completely out-of-phase, the variation range of course-deviating degree caused by the Δφ 32 is narrow, and there exists a certain range of the phase lag Δφ 32 , which can enable the prototype to keep its heading.
Combined with Table 2, the yawing amplitude of the prototype is mainly caused by the oscillation of its caudal fin. Figure 12b also shows that the yawing amplitude of the prototype varies more significantly with the phase lag Δφ 32 . When the phase lag Δφ 41 is closer to 180°, the variation of the prototype's yawing amplitude is more moderate with the Δφ 32 changing. Compared with the yawing amplitude when caudal fin propelling alone, the amplitude becomes larger or weaker when the pectoral fins in-phase motion is incorporated, depending on the motion gait Δφ 32 . Meanwhile, combining caudal motion can reduce yawing amplitude of the prototype when the both pectoral fins twisting tend to be out-of-phase, and the amplitude is minimized within a specific range of the phase lag Δφ 32 . Figure 12c similarly demonstrates the phenomenon of Table 2, that is, as the Δφ 41 transitions from in-phase to completely out-of-phase, rolling amplitude of the prototype gradually increases during the forward swimming. And with increase of the phase lag Δφ 32 , the prototype's rolling amplitude varies in a sinusoidal-like trend. Moreover, when the two pectoral twisting motion tend to be in-phase, this sinusoidal-like trend is more moderate, while when both pectoral fins twist completely out-of-phase, the rolling amplitude variation is the most drastic. Besides, with increase of the phase lag Δφ 41 , the Δφ 32 corresponding to the minimum rolling amplitude exhibited by the prototype is increasing. In conclusion, although rolling attitude of the prototype is mainly caused by the motion of pectoral fins, the addition of the caudal fin oscillation is able to expand or weaken the degree of body's rolling amplitude.
As shown in Fig. 12d, when twisting motion of the two pectoral fins transitions from in-phase to completely out-ofphase, pitching amplitude of the prototype tends to decrease, and basically reaches the minimum when the phase lag Δφ 41 is 180°. And pitching amplitude variation of the prototype shows a sinusoidal-like trend as the phase lag Δφ 32 increases as well. In contrast to the rolling amplitude variation, this sinusoidal-like trend is more dramatic when both pectoral fins tend to move in-phase, while be more moderate when both pectoral fins move completely out-of-phase. With the incorporation of caudal fin movement, there exists a specific range of coupling motion gaits with the pectoral fins for reducing the prototype's pitching amplitude. As a result, combined with the simulation analysis in effect of the pectoral and caudal fins coupling motion on propulsion performance, we can conclude that the two primary propulsors for fish or prototype, the pectoral and caudal fins, can have a direct effect on the heading stability of their body. Moreover, the appropriate coupling motion gaits of the pectoral and caudal fins can reduce the coursedeviating degree and oscillation amplitudes generated by a single propulsor, that is, appropriate gaits can weaken the degree of oscillation such as rolling, and pitching caused by the pectoral fins motion, and can also keep the orientation with a small yawing amplitude to ensure the stability of the body forward swimming. More importantly, the pectoral and caudal motion gaits that produce this weakening effect exist in one range at the same time, that is, when phase lag between the two pectoral fins is 180° and phase lag between the unilateral pectoral flapping and the caudal front joint oscillation ranges from 225° to 315°, the prototype is not only able to maintain its forward course, but also a lower amplitudes of yawing, rolling and pitching. Our conclusion, which is consistent with scholars' observation of the pectoral and caudal motion gaits on small puffers during their stable swimming, verifies biologists' speculation that the pectoral and caudal fins coupling effect can stabilize the fish body [39]. For the phase lag between unilateral pectoral flapping and caudal front oscillation, only an ideal range is given in this paper, which is due to the fact that, according to the diversity of structures and movements, the optimal phase lag value corresponding to different forms of robotic fish will vary somewhat. For the bionic boxfish prototype we developed, we choose a phase lag of 180° between the two pectoral fins and 270° between the left pectoral flapping and the caudal front joint oscillation as the control parameters for straight swimming. At this point, the vortex generated in the numerical simulation and the actual swimming gaits of the prototype can be seen in our supplementary movie S1, and its straight forward swimming is shown in Fig. 13.

Maneuvering Performance
As shown in Fig. 14, the prototype swims straight forward, when the upper computer sends a command to turn it, caudal Fig. 12 Evaluation on heading stability of the prototype with pectoral and caudal fins coupling motion. a Course-deviating degree. b Yawing oscillation amplitude. c Rolling oscillation amplitude. d Pitching oscillation amplitude fin of the prototype swings CCW to one side of the body and maintains a "C" shape. At the same time, phase lag between two DOFs of the pectoral fin on the caudal fin side changes from 90° to -90°, where the fluid wave generated starts to pass to the head side of the body, while two driving DOFs of the pectoral fin on the other side maintain the same gait as in straight swimming. As a result, pectoral fins on both sides also generate the torque that rotates the prototype. Under the joint effect of pectoral and caudal fins, the prototype makes a CW turning response, and after the body turns about 180°, the caudal fin returns to the neutral position and resumes the straight swimming motion gaits together with the pectoral fins, thus completing the motion of turning sharply while forward swimming (see supplementary movie S2).
We use the method of reference [40] to evaluate the maneuverability of the prototype by assessing the minimum turning space required for its forward travel. Specifically, the video (60 FPS) of its sharply turning is processed, and paths of the seal-test nozzle and root of the caudal fin during the prototype's sharply turning are plotted separately, then the maximum radius of the inner tangent circle for the two paths is the minimum turning space required for the prototype to swim forward. Since the size of pectoral fins on our prototype is larger than that of the live fish, the minimum turning space we marked is set with a margin to accommodate the passage of the pectoral and caudal fins tip. At this point, the ratio of the minimum turning space to the full length of prototype r space / L is 0.35, which is in general agreement with the value observed by biologists for boxfish.
In addition, by changing combination of the motion parameters of pectoral and caudal fins, our prototype can achieve three-dimensional movements such as upward floating, downward diving, and inverted swimming (see supplementary movie S3).

Conclusions
In this paper, we first propose a novel bionic robotic boxfish, whose pectoral fins can simulate the compound three-dimensional motion of twisting and flapping. With the synergistic propelling of the pectoral and caudal fins, the prototype is able to achieve a more stable swimming and also shows a high maneuverability. Second, we develop a one/two-way FSI numerical analysis method to verify that a certain flexibility of the fin surface can produce better propulsion performance, then discuss the hydrodynamics of the bionic boxfish model with pectoral and caudal fins coupling motion. Finally, influence of the pectoral and caudal fin interactions on the heading stability of the prototype is systematically analyzed after experimental measurements. Results show that when phase lag between the two pectoral fins is 180° Fig. 13 Screenshots of prototype swimming straight forward Fig. 14 Snapshot sequence of the robotic fish with a sharply turning motion. The red solid line is the trajectory of the prototype's seal-test nozzle, the yellow solid line is the trajectory of the root of its caudal fin, and the white dashed line is the trajectory of the marker point on the prototype's mass center and the phase lag between unilateral pectoral flapping and caudal front joint oscillation ranges from 225° to 315°, the prototype can not only maintain its forward course, but also keep the oscillation amplitudes lower than the yawing, rolling and pitching generated by a single kind of propulsor. We systematically investigate the effect of interactions between two important propulsors, pectoral and caudal fins, on the heading stability of the robotic fish by combining CFD and actual experiments for the first time, and the analysis methods are of guidance value for improving the swimming performance of robotic fish. At the same time, this paper provides an important theoretical basis for the development of robotic fish driven by multi-fins.
In the future, we will rely on this stable bionic prototype with vision sensors, etc. to realize the ability of autonomous positioning and obstacle avoidance. Meanwhile, the role of anal and dorsal fins on the freely swimming of the robotic fish is also a direction worth exploring, and we expect to develop a soft bionic boxfish that is driven by 5 fins and can dynamically adjust its stability and maneuverability.