1 Introduction

Amphibious robots have advantages with respect to mobility and environmental adaptability. These factors have resulted in them becoming essential tools for scientific, industrial and, military applications in littoral zones. Recently, a variety of amphibious robots were designed with a focus on applications such as disaster rescue, resource exploration, and reconnaissance [1,2,3,4]. The designs of these robots are based on the principles of bionics and compound drive mechanisms [5,6,7,8,9,10]. Cui et al. [11] proposed a centipede-inspired amphibious robot named AmBot for monitoring the Swan-Canning River. The multi-leg actuation of a centipede was morphed into tracks and each leg-link was simplified to a track piece consisting of a base and a polystyrene-foam block. Vogel et al. [12] proposed a quadrupedal amphibious robot named RoboTerp. RoboTerp switches gaits to match terrains so that it can move on land and in water with the same legs. This approach mitigated the issues caused by significant turbulence in the robot’s surroundings. Zhong et al. [13] proposed an amphibious robot with flexible flipper legs. The flipper legs are composed of seven segments. The robot can adapt to various environments by adjusting the stiffness of each leg component.

Amphibious spherical robots are a special kind of amphibious robots that are shaped like balls. Conventional amphibious robots are driven by racks and wheels; it is easier, however, to control the inclination of amphibious spherical robots. They also have advantages in terms of maneuverability. Thus, amphibious spherical robots have become a popular research topic in the field of autonomous mobile robots. Rotundus AB [14] designed an amphibious spherical robot named Groundbot. Groundbot was proposed as an alternative design for a Mars rover. Groundbot is driven by a pendulum and is capable of navigating rough outdoor terrains at speeds of up to 3 m/s and climbing slopes of up to 15°–18°. Jia et al. [15] proposed a novel concept for amphibious spherical robots consisting of a spherical hull and two mechanical arms. The mechanical arms swing to roll the ball on land and provide a thrust vector in underwater environments. Our research team proposed an amphibious spherical robot [16,17,18,19]. The robot has a deformable mechanical structure that enables it to walk on land with legs, swim in water using vectored thrusters that provide a zero turning radius, and navigate littoral regions with an improved overstepping ability.

Due to the particularities of amphibious environments, designing practical control systems for amphibious robots remain a thorny problem. In terrestrial environments, the drive systems of amphibious robots should make online adjustments to the motion-control strategy to adapt to different terrains such as sand, mud, and rocks. In underwater environments, the amphibious robot should be able to adjust the speed and direction of motion, pick up and release loads, and respond to variations in the water flow. This results in a dynamic model that varies continuously. Hence, amphibious robots should have control systems that can adapt to different environments and are robust to environmental conditions that can interfere with their motion. There have been some studies on the control of robots that are either amphibious or spherical, but little research has focused specifically on amphibious spherical robots.

Yang et al. [20] designed a motion control system for a frog-inspired amphibious robot named FroBot. They analyzed the dynamic model of the FroBot and achieved smooth velocity control using a fuzzy Proportional Integral Derivative (PID) algorithm. Yue et al. [21] designed a control system for a spherical rolling robot and tried to solve the problem of underactuated vibrations during longitudinal movement. They proposed an adaptive hierarchical sliding mode control approach that incorporated data from a sensor-based state observer. Karavaev et al. [22] designed a system to control spherical rolling robots by propelling them with an internal omniwheel platform. There are various control algorithms for robots. Common ones are Central Pattern Generators (CPG), PID control, fuzzy control, neural network control, adaptive control, and sliding mode control. The control algorithm of existing works analyzed the dynamic and kinematic models to specify transitions from one steady-state motion to another. However, the subjects of all of these studies were either amphibious robots that were not spherical, or amphibious spherical robots that move by rolling. Thus, we cannot use any of the proposed control strategies with our amphibious spherical robot because it is driven by a compound drive mechanism with both legs and water-jets.

In this study, we designed and implemented an improved amphibious spherical robot with the aim of conducting exploration tasks in complex amphibious environments. We developed a mechanical model and a dynamic model to predict the motions of the robot on land and in water, respectively. We used these models as the basis for an adaptive motion control system for the robot’s compound drive system. The robot was equipped with an IMU to detect the inclination and motion information that served as feedback signals to the control system. We designed three types of walking gait for land-based motion. These provided different stabilities and motion speeds so that the robot could move through varied terrains. Furthermore, we improved the robot’s stability as it climbs up slopes by adjusting the gaits using an online adjustment mechanism. In the case of underwater motion, where the system function varies continuously, we implemented the online system with a forgetting factor least squares algorithm. Robust underwater motion control was achieved by a generalized prediction control algorithm. Two digital coded optical fiber liquid level sensors are used to identify the water land transition environment. Two liquid level sensors are arranged slightly below the water line at the front end and the rear end of the robot shell. When the robot enters the water from land, the front of the robot enters the water first, and the liquid level sensor in the front outputs high level. Only when the rear of the robot also enters the water, that is, only when both sensors output high levels at the same time, the controller considers that the robot completely enters the water. At this time, the control system controls the propulsion mechanism to make switching action. Similarly, in the process of the robot moving from water to land, if the front of the robot has landed, the liquid level sensor in the front outputs a low level, and the controller thinks that the robot will land, so as to switch the propulsion mechanism to land propulsion mode. When the liquid level sensors at the back end output low level, and the control system considers that the robot has completely landed. We ensured the real-time performance of the robot motion control system and reduced its power consumption by implementing it on a Zynq-7000 SoC. We conducted experiments to evaluate the motion of the robot at different speeds in varied amphibious environments. The motion of the robot through 4 Degrees-of-Freedom (DoF) was stable and its top speeds were 11.9 cm/s on land and 14.7 cm/s in water. Moreover, the stability and mobility of the robot meet the requirements for practical applications in various terrains.

The main contributions of the work are as follows. We designed and built an improved version of our previously reported amphibious spherical robot with the aim of making the robot capable of completing motions in varied amphibious environments. The contributions contain the configuration and synthesis of driving mechanism, the bio-inspired online gait adjustment mechanism for climbing slopes, the practical control improvements of an autonomous amphibious spherical robot as the embedded implementation of the microprocessor, and an online system recognition with a forgetting factor least squares algorithm.

The rest of this paper is organized as follows. We specify the mechanical and electronic design of our improved amphibious spherical robot in Sect. 2. The design and implementation of the adaptive quadruped gait for robotic motions on land are described in Sect. 3. The design of the generalized prediction control system for robotic motion in water is explained in Sect. 4. In Sect. 5, we report the results of our evaluation and experimental investigation. We draw conclusions and outline related future research in Sect. 6.

2 Amphibious Spherical Robots

2.1 Overview of Amphibious Spherical Robots

Our research team proposed a turtle-inspired amphibious spherical robot for precise and stealthy applications in narrow amphibious spaces. This proposal was followed up by studies into the robot’s kinematic performance [23], improved driving mechanism [24], robotic vision system [25] and mechanical reliability [26]. In this study, we designed and implemented an improved version of the amphibious spherical robot with more stable performance.

The improved amphibious spherical robot consists of an enclosed hemisphere hull (350 mm in diameter) and two openable quarter-sphere shells (360 mm in diameter), as shown in Fig. 1a, b. We installed four legs or compound driving units in a symmetrical configuration on the robot’s lower hemisphere. Each compound driving unit was equipped with two servo motors and a water-jet motor. The motion of the robot legs is actuated with "RC servomotor", whose control input is a Pulse-Width Modulation (PWM) signal that actually encodes the desired rotor angle and is then controlled by an internal control board. The electronic system was installed inside the waterproof upper hemisphere, where it is protected from environmental damage.

Fig. 1
figure 1

Mechanical structure of the amphibious spherical robot. a Axonometric drawing of the robot in land mode; b Axonometric drawing of the robot in underwater mode; c Front view of the robot in the walking state on land; d Front view of the robot in the roller-skating state on land; e Axonometric drawing of a leg; and f Axonometric drawing of the passive omni-directional wheel mechanism

In land mode, the two openable shells fold up and the robot turns into a quadruped that walks with four legs driven by servo motors and is capable of traversing rugged terrains. Wheeled locomotion is faster on flat ground, and it requires less power than legged locomotion. Hence, we designed the passive omni-directional wheel mechanism shown in Fig. 1f to assist the movement of the robot on land. Four omni-directional wheels were installed on a lifting platform that ascends and descends on two lead screws driven by servo motors. The lifting platform is lifted off the ground when the robot is in the walking state, as shown in Fig. 1c. The lifting platform descends to the ground as the robot transforms from the walking state to the roller-skating state. In this state, the four legs act as poles to move the robot forward, as shown in Fig. 1d.

In underwater mode, the two openable shells close and the robot becomes a ball-shaped underwater vehicle. The counterweight design puts the center of gravity on the axis of the ball so that the robot is suspended in water. The water-jet motors, which form the shanks of the robot, generate vectored thrusts in specialized directions. The magnitudes and directions of the vectored thrusts can be adjusted to enable the robot to move through four DoFs.

Figure 2 shows the diagram of the electronic system used in the amphibious spherical robot. The robot is powered by a set of Li-Po batteries with a total capacity of 24,000 mAh. The electronic system is restricted by the narrow load space and limited power resources. We fabricated the system around a Xilinx XC7Z020 SoC, which combines a dual-core ARM processor with Field Programmable Gate Arrays (FPGA). The ARM processor runs the Xillinux Linux operating system and provides a universal software platform for robotic applications. Functions involving real-time robotic applications, such as motor control and data pre-processing, were deployed on the FPGA section as digital circuits. We connected the SoC-based robot controller to a Raspberry Pi 3 by a network cable. The Raspberry Pi 3 serves as a co-processor for robotic vision applications. In our proposed robot system, the depth meter and Global Positioning System (GPS) module are adopted to detect the position information and assist in real-time inertial navigation error correction, as shown in Fig. 2. The Micro-Electro-Mechanical System (MEMS) inertial sensing module consisted of a gyroscope (ITG-3200), an accelerometer (ADXL345), and an electronic compass (HMC5883L), with built-in Kalman filter and quaternion solution algorithm. It can output sensing data such as heading angle, angular velocity, and acceleration through I2C interface. When the MEMS inertial sensing module is only used for attitude estimation, the complementary filtering method based on acceleration and angular velocity output can be used to give accurate pitch angle and roll angle.

Fig. 2
figure 2

Diagram of the electronic system used in the amphibious spherical robot

2.2 Challenges for Amphibious Spherical Robot Motion Control

The mobility and adaptability of the amphibious spherical robot benefit from the compound drive mechanism and deformable mechanical structure. However, we have not yet overcome the challenge of designing a practical control system for this robot. A robust robotic platform is required before we can realize intelligent functions such as visual servoing, automatic navigation, etc.

The symmetrical structure and relatively high center of gravity of the robot mean that it turns over easily when moving through rugged terrestrial terrains. Meanwhile the interface between the robot’s feet and the ground is very limited because the shanks are hollow jet tubes. This can cause the robot to slip and vibrate violently in the direction of the slope as it tries to climb. Moreover, the robot still moves slowly. Faster motion may be essential in emergency circumstances. Thus, the kinetic stability, mobility and environmental adaptability should be taken into account when designing gait systems for amphibious spherical robots. A simple gait system was designed and evaluated with a prototype amphibious spherical robot in an earlier study [27]. The robot was only capable of walking on flat ground because we only implemented a simple, static gait. This robot has the potential to work on a variety of terrains, such as sand, mud, rocky ground, and slopes. Hence, we should design and implement a range of gaits with automatic adjustment mechanisms to improve their stability and viability.

The spherical shape of the robot makes it easier to control in underwater environments, and confers advantages in terms of stabilizing its inclination. However, this shape increases the fluid resistance during motion and the effects of the water flows. Consequently, if we vary the motion parameters of the robot, or it encounters variations in the water flow, its dynamic model will change. Additionally, some specific applications may require the robot to pick up or release loads. This would also have an effect on the dynamic model. Thus, the control system for underwater environments must be adaptive and robust to factors that could potentially interfere with the motion of the robot. The fuzzy PID algorithm [28] and neural network PID algorithm [29] were adopted to control the underwater motion of the prototype amphibious spherical robot. These advanced control algorithms passed the simulation experiments but did not perform as well in actual experiments. We decided that an adaptive control algorithm designed for gradually varied-coefficient systems would be more practical and better suited to the characteristics of the amphibious spherical robot.

3 Adaptive Quadruped Gaits for Motion on Land

3.1 Simplified Mechanical Model and Walk Gait of the Amphibious Spherical Robot

Figure 3 shows the motion of the robot’s legs during the walking process. Servo motors rotate the upper and lower joints around the vertical and horizontal axes, respectively. Each step of the robot’s walk is composed of the following four operations on the legs: first, the vertical servo motor rotates anticlockwise to lift the shank of the leg; second, the horizontal motor rotates anticlockwise to stretch the leg; third, the vertical servo motor rotates clock-wise and the leg turns into the stance phase of the step; finally, the horizontal motor rotates clock-wise and the body of the robot is pushed forward by the force of friction with the ground.

Fig. 3
figure 3

Principles of the amphibious spherical robot’s walk. a Top and front views of the leg lifting; b Top and front views of the leg stretching; c Top and front views of the leg hitting the ground; and d Top and front views of the leg pushing the ground

As shown in Fig. 4, we developed a simplified mechanical model of the robot so that we could analyze the walking motion quantitatively. We used three-dimensional coordinates with the origin at the center of the sphere. The black solid lines and the blue dashed lines indicate the range of motion of the legs through the horizontal and vertical planes. We determined that \(r=22\sqrt{2}\) mm, l1 = 12 mm, l2 = 45 mm, l3 = 50 mm, l4 = 35 mm and l5 = 65 mm by mounting dimensions or part dimensions of a leg. αLF and βLF are, respectively, the angles that the left foreleg rotates through in the horizontal and vertical planes. The position of LegLF can be calculated from coordinates A1 and A, which are defined by Eqs. (1) and (2):

$$ \left\{ {\begin{array}{*{20}l} {x_{A} = r + \left( {l_{2} + l_{4} \cos \beta_{{{\text{LF}}}} + l_{5} \sin \beta_{{{\text{LF}}}} } \right)\cos \alpha_{{{\text{LF}}}} } \hfill \\ {y_{A} = r + \left( {l_{2} + l_{4} \cos \beta_{{{\text{LF}}}} + l_{5} \sin \beta_{{{\text{LF}}}} } \right)\sin \alpha_{{{\text{LF}}}} } \hfill \\ {z_{A} = - l_{1} - l_{3} + l_{4} \sin \beta_{{{\text{LF}}}} - l_{5} \cos \beta_{{{\text{LF}}}} ,} \hfill \\ \end{array} } \right. $$
(1)
$$ \left\{ {\begin{array}{*{20}l} {x_{{A{1}}} = r + \left( {l_{2} + l_{4} \cos \beta_{{{\text{LF}}}} } \right)\cos \alpha_{{{\text{LF}}}} } \hfill \\ {y_{A1} = r + \left( {l_{2} + l_{4} \cos \beta_{{{\text{LF}}}} } \right)\sin \alpha_{{{\text{LF}}}} } \hfill \\ {z_{A1} = - l_{1} - l_{3} + l_{4} \sin \beta_{{{\text{LF}}}} .} \hfill \\ \end{array} } \right. $$
(2)
Fig. 4
figure 4

Simplified mechanical model of the amphibious spherical robot. a Bottom view of the amphibious spherical robot; b Left-side view of the amphibious spherical robot

The commonly used classical gait of quadruped robot can be divided into five categories: walk, trot, pace, bound, and gallop [30]. Bound and gallop gaits have significant advantages in obstacle climbing ability and movement speed respectively, but they need the driving system to output strong explosive force to realize the jumping and taking off of the robot body. The gallop and bound gaits are not feasible because our spherical robot has limited power resources and they require a strong driving force. As the robot is symmetrical and its center of gravity is on the z-axis, the pace and trot gaits may cause the robot to roll. To maintain stability, the body of the robot should be supported by three legs. We selected a walking gait to ensure that the robot remains stable when carrying counter weights and working in adverse environments.

Over one walking cycle, the robot’s four legs move in the order “LegLF–LegRH–LegRF–LegLH”, as shown in Fig. 5. More than half of the legs are in the stance phase at any point during the walking cycle. The legs in the swing phase followed the sequence of operations shown in Fig. 3. Motion is induced as the robot’s center of gravity is gradually pushed forward. We can adjust the direction of the steps to turn the robot left or right, or allow it to move straight ahead. Thus, the four legs adopt stance phases and swing phases as they progress through each walking cycle. We can adapt the walking gait to different scenarios by varying the time spent in these phases. We designed the walking gaits used by the amphibious spherical robot by adjusting the duty factor of the stance phase, as shown in Fig. 6 and Table 1 [31]. The robot moves with the stable, standard, and fast walking gaits, when the duty factor is set to 80.0%, 75.0% and 66.7%, respectively. The four legs alternate between the swing and stance phases as they walk with the standard gait. This ensures that there are always three legs in the stance phase. The stable and fast walking gaits are achieved by, respectively, advancing and postponing the phase switch operations. The robot moves, respectively, 20% more slowly or quickly when it walks with these gaits instead of the standard gait. The stable gait keeps all four of the robot’s legs in the stance phase during the phase switch operations. This improves the robot’s stability on rugged terrains. In contrast, the fast gait makes the robot sway because its body is only supported by two legs during some parts of the fast walking cycle. Hence, the fast gait is only suitable for flat terrains.

Fig. 5
figure 5

Diagram of the walking gaits

Fig. 6
figure 6

Movement sequence charts for the designed gaits. a Stable walking gait; b standard walking gait; and c fast walking gait

Table 1 Overview of the designed gaits

The walking gaits can be implemented by configuring timers that output-specific sequences of PWM signals. As we needed to control eight servo motors in parallel, we implemented the walking gait system on digital circuits and deployed it to the FPGA section of the Xilinx XC7Z020 SoC. The walking gait system is stored on an Intellectual Property (IP) core that is connected to the ARM section of the SoC through an Advanced eXtension Interface (AXI) bus. The main robot control program runs on the ARM-Linux system and configures the gait system via the state register [32]. Figure 7a shows the state transition diagram of the gait system. After starting up, it can select the type of gait (stable walk gait, walk gait or fast walk gait) and direction of motion (walking straight, turning left or turning right). The robot can stop moving and stand still if it detects something interesting. As the robot cannot stand steadily on two legs in the stance phrase, it cannot transition directly from standby to the fast gait. The fast gait is only used for racing. Figure 7b shows the output control signals of the gait system. We use timers and frequency dividers to generate the eight PWM signals that control the servo motors. The frequencies of the clock signal and the PWM waves are 100 MHz and 100 Hz, respectively. We vary the gait by adjusting the durations of the intervals between the PWM signals (i.e., Delay1–4). We can also change the speed of the motor and the motion of the robot by varying the number of output pulses from each leg operation, k. The robot can recognize terrains to adjust its walking gaits. It also detects and tracks targets using cameras, which were introduced in the references [18] and [19].

Fig. 7
figure 7

Implementation of the robotic gait system. a State transition diagram of the robotic gait system; and b signal sequence diagram of the robotic gait system

3.2 Adjustments for Climbing Slopes

There is not enough friction for the robot to climb steadily up a slope in the gaits described above, as shown in Fig. 8a. The robot would slip downwards as it steps, so its body would make continuous pitching motions. The frequent tilting motions may interfere with the normal operation of the devices installed inside its body. Hence, we must adjust the walking gait to ensure that the robot remains stable as it climbs up slopes. We keep the robot platform horizontal and lowered its center of gravity by varying the rotations of the vertical motors, as shown in Fig. 8b. The rotations of the vertical motors can be incremented by adjustment angles, φLF, φRF, φLH, and φRH. From their initial positions, the left foreleg and left hind leg land at positions A and D, which are calculated using Eqs. (3) and (4):

$$ \left\{ {\begin{array}{*{20}l} {x_{A} = r + \left[ {l_{2} + l_{4} \cos (\beta_{{{\text{LF}}}} + \varphi_{{{\text{LF}}}} } \right) + l_{5} \sin (\beta_{{{\text{LF}}}} + \varphi_{{{\text{LF}}}} )]\cos \alpha_{{{\text{LF}}}} } \hfill \\ {y_{A} = r + \left[ {l_{2} + l_{4} \cos (\beta_{{{\text{LF}}}} + \varphi_{{{\text{LF}}}} } \right) + l_{5} \sin (\beta_{{{\text{LF}}}} + \varphi_{{{\text{LF}}}} )]\sin \alpha_{{{\text{LF}}}} } \hfill \\ {z_{A} = - l_{1} - l_{3} + l_{4} \sin (\beta_{{{\text{LF}}}} + \varphi_{{{\text{LF}}}} ) - l_{5} \cos (\beta_{{{\text{LF}}}} + \varphi_{{{\text{LF}}}} ),} \hfill \\ \end{array} } \right. $$
(3)
$$ \left\{ {\begin{array}{*{20}l} {x_{D} = - r - \left[ {l_{2} + l_{4} \cos (\beta_{{{\text{LH}}}} + \varphi_{{{\text{LH}}}} } \right) + l_{5} \sin (\beta_{{{\text{LH}}}} + \varphi_{{{\text{LH}}}} )]\cos \alpha_{{{\text{LH}}}} } \hfill \\ {y_{D} = - r - \left[ {l_{2} + l_{4} \cos (\beta_{{{\text{LH}}}} + \varphi_{{{\text{LH}}}} } \right) + l_{5} \sin (\beta_{{{\text{LH}}}} + \varphi_{{{\text{LH}}}} )]\sin \alpha_{{{\text{LH}}}} } \hfill \\ {z_{D} = - l_{1} - l_{3} + l_{4} \sin (\beta_{{{\text{LH}}}} + \varphi_{{{\text{LH}}}} ) - l_{5} \cos (\beta_{{{\text{LH}}}} + \varphi_{{{\text{LH}}}} ).} \hfill \\ \end{array} } \right. $$
(4)

where \(\beta_{{{\text{LF}}}} = \beta_{{{\text{LH}}}} = 0\), \(\alpha_{{{\text{LF}}}} = \pi /4\), and \(\alpha_{{{\text{LH}}}} = - \pi /4\). As \(\overrightarrow {AD}\) was vertical with the axis y, the coordinates of A and D should satisfy the condition defined in Eq. (5).

$$ z_{A} - z_{D} = \left( {y_{A} - y_{D} } \right)\tan \delta . $$
(5)
Fig. 8
figure 8

Analysis of the slope climbing motion. a Slope climbing without gait adjustment; b slope climbing with gait adjustment; c critical case with the left foreleg in slope climbing mode; and d critical case with the left foreleg in slope climbing mode

δ, which represents the angle of the slope, can be measured approximately online by the MEMS IMU. The adjustment angles can be determined by solving Eqs. (3), (4) and (5). We added a slight random disturbance to δ during the calculation process to reflect the fact that most slopes do not have constant gradients. We minimized the error in Eq. (5) by selecting adjustment angles corresponding to different gradients, as shown in Fig. 9. The FPGA-based gait system uses a look-up table compiled from the curves in Fig. 9 to adjust the motions of the robot’s legs so that it can climb slopes successfully.

Fig. 9
figure 9

Adjustment angles of the legs toward different slopes. a Adjustment angle of the forelegs toward different slopes; and b adjustment angles of the hind legs toward different slopes

Limitations in the mechanical structure of the legs mean that the robot can only climb gentle slopes. Figure 8c shows an example of a critical limitation, where the left foreleg is lying on the ground. The coordinates of A and B can be calculated using Eqs. (6) and (7):

$$ \left\{ {\begin{array}{*{20}c} {x_{A} = l_{4} \cos \varphi_{{{\text{LF}}}} + l_{5} \sin \varphi_{{{\text{LF}}}} } \\ {y_{A} = l_{4} \sin \varphi_{{{\text{LF}}}} - l_{5} \cos \varphi_{{{\text{LF}}}} } \\ \end{array} } \right., $$
(6)
$$ \left\{ {\begin{array}{*{20}c} {x_{B} = - \sqrt {d_{1}^{2} + d_{2}^{2} } \cdot \cos [\varphi_{{{\text{LF}}}} + \arctan (d_{2} /d_{1} )]} \\ {y_{B} = - \sqrt {d_{1}^{2} + d_{2}^{2} } \cdot \sin [\varphi_{{{\text{LF}}}} + \arctan (d_{2} /d_{1} )]} \\ \end{array} } \right., $$
(7)

where d1 = 21.5 mm, d2 = 20 mm, and yA = yB. Figure 8c shows another critical limiting case where the robot is only supported by its left hind leg. The maximum adjustment angles of LegLF and LegLH are φLFmax = 33.7° and φLH = 21.8°, respectively. Form the Fig. 8, we can obtain the maximum angle of the slope δmax = [φLFmax, φLHmax]min = 21.8°. Considering the structural deformation error of the robot, the flatness of the slope, and potential subsidence, the maximum angle of the slope δmax should be less than 21.8°. So, to avoid the front leg joint contacting the ground, we set the maximum climbing angle of the robot as 20°.

4 Generalized Prediction Control for Motion in Water

4.1 Simplified Underwater Dynamic Model

Unlike most autonomous underwater vehicles, our amphibious spherical robot has four vectored thrusters. These give it 4-DoFs of underwater movement. The characteristics of the robot’s motion vary because it has a deformable mechanical structure and carries variable loads. Moreover, as the robot is ball-shaped, its motion is easily affected by the flow of the surrounding water [33]. Thus, the parameters governing the robot’s dynamic model vary continuously. It is difficult to control robots robustly using classical PID algorithms, as they are highly reliant on the robots’ system transfer functions. It is possible that adaptive motion control algorithms can enable robots to respond to environmental variations and disturbances [34,35,36].

We simplified the control process using combinations of the horizontal and vertical motions as the 4-DoFs of underwater motion, as shown in Fig. 10. In the horizontal motion mode, we decouple the four legs by crossing them at certain angles. The four water-jet motors spurt or pump water to provide horizontal thrusts in specified directions. We translate and rotate the robot by adjusting the speed and rotary direction of the motors. In the vertical motion mode, the robot surfaces and dives by making vertical thrusts with the water-jet motors.

Fig. 10
figure 10

Principles of the amphibious spherical robot’s underwater motion. a Horizontal motion (lateral view); b horizontal motion (bottom view); c vertical motion (lateral view); and d vertical motion (lateral view)

We developed a dynamic model of the robot so that we could explore the form of its system transfer function. As shown in Fig. 11a, we defined a coordinate system (called the earth-fixed coordinate system) with respect to the earth and a coordinate system (called the body-fixed coordinate system) with respect to the robot itself. We took the center of the ball as the origin of the body-fixed coordinate system. The coordinates of the center of mass and the center of buoyancy are, respectively, \({r}_{\mathrm{B}}={\left[\mathrm{0,0},{z}_{\mathrm{B}}\right]}^{T}={\left[\mathrm{0,0},-0.0045\right]}^{T}\) and \({r}_{\mathrm{G}}={\left[\mathrm{0,0},{z}_{\mathrm{G}}\right]}^{T}={\left[\mathrm{0,0},0.062\right]}^{T}\). The location and the inclination of the robot can be calculated using Eq. (8):

$${\varvec{\eta}}=\left\{x,y,z,\varphi ,\theta ,\psi \right\},$$
(8)

where x, y, and z represent the Cartesian position in the earth-fixed coordinate system, φ is the roll angle, θ is the pitch angle, and ψ is the yaw angle. The state of the robot’s motion in the body-fixed coordinate system is:

$$ v = \left\{ {u,v,w,p,q,r} \right\}, $$
(9)

where u, v, and w are the components of the linear velocity in the surge, sway, and heave directions, respectively. And p, q, and r are the components of the angular velocities in the roll, pitch, and yaw, directions, respectively. Equation (10) is a dynamic model of the robot with 6-DoFs:

$$ \left( {{\varvec{M}}_{{{\text{RB}}}} + {\varvec{M}}_{A} } \right)\dot{\varvec{v}} + \left( {{\varvec{C}}_{{{\text{RB}}}} \left( {\varvec{v}} \right) + {\varvec{C}}_{A} \left( {\varvec{v}} \right)} \right){\varvec{v}} + \left( {{\varvec{D}}_{l} + {\varvec{D}}_{q} \left( {\varvec{v}} \right)} \right){\varvec{v}} + {\varvec{g}}\left( {\varvec{\eta}} \right) = \tau , $$
(10)

where MRB ∈ 6×6 is the matrix representing the mass of the rigid body, MA ∈ 6×6 is the matrix representing the mass added to the robot, CRB(v) ∈ 6×6 is the Coriolis force matrix of the rigid body, CA(v) ∈ 6×6 is the Coriolis force matrix of the added mass, Dl ∈ 6×6 is the linear damping matrix, Dq(v) ∈ 6×6 is the nonlinear damping matrix, g(η) ∈ 6×1 is the gravity and buoyancy vector, and τ ∈ 6×1 is the vector representing the thrust generated by the water-jet motors.

Fig. 11
figure 11

Kinematic model of the amphibious spherical robot in underwater environments. a Kinetic coordinate system and static coordinate system; b the thrust forces induced by the water-jets; c layout of the thrust forces as the robot moves horizontally; and d layout of the thrust forces when the robot moves vertically

As the mechanical structure of the robot is symmetrical and the pitch and yaw movements are passive, MRB and MA are defined as follows:

$$ {\varvec{M}}_{{{\text{RB}}}} = \left[ {\begin{array}{*{20}c} m & 0 & 0 & 0 & {mz_{{\text{G}}} } & 0 \\ 0 & m & 0 & { - mz_{{\text{G}}} } & 0 & {mx_{{\text{G}}} } \\ 0 & 0 & m & 0 & { - mx_{{\text{G}}} } & 0 \\ 0 & { - mz_{{\text{G}}} } & 0 & {I_{x} } & 0 & { - I_{zx} } \\ {mz_{{\text{G}}} } & 0 & { - mx_{{\text{G}}} } & 0 & {I_{y} } & 0 \\ 0 & {mx_{{\text{G}}} } & 0 & { - I_{zx} } & 0 & {I_{z} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {9.408} & 0 & 0 & 0 & {{0}{\text{.0423}}} & 0 \\ 0 & {9.408} & 0 & { - {0}{\text{.0423}}} & 0 & 0 \\ 0 & 0 & {9.408} & 0 & 0 & 0 \\ 0 & { - {0}{\text{.0423}}} & 0 & {0.0664} & 0 & 0 \\ {{0}{\text{.0423}}} & 0 & 0 & 0 & {0.0664} & 0 \\ 0 & 0 & 0 & 0 & 0 & {0.0826} \\ \end{array} } \right], $$
(11)
$$ {\varvec{M}}_{A} = \left[ {\begin{array}{*{20}c} { - X_{{\dot{u}}} } & 0 & 0 & 0 & 0 & 0 \\ 0 & { - Y_{{\dot{v}}} } & 0 & 0 & 0 & { - Y_{{\dot{r}}} } \\ 0 & 0 & { - Z_{{\dot{w}}} } & 0 & { - Z_{{\dot{q}}} } & 0 \\ 0 & 0 & 0 & { - K_{{\dot{p}}} } & 0 & 0 \\ 0 & 0 & { - M_{{\dot{w}}} } & 0 & { - M_{{\dot{q}}} } & 0 \\ 0 & { - N_{{\dot{v}}} } & 0 & 0 & 0 & { - N_{{\dot{r}}} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {10.300} & 0 & 0 & 0 & 0 & 0 \\ 0 & {10.300} & 0 & 0 & 0 & 0 \\ 0 & 0 & {10.300} & 0 & 0 & 0 \\ 0 & 0 & 0 & {0.088} & 0 & 0 \\ 0 & 0 & 0 & 0 & {0.088} & 0 \\ 0 & 0 & 0 & 0 & 0 & {0.065} \\ \end{array} } \right], $$
(12)

where m represents the mass of the robot. The terms of MRB are determined by the mass distribution of the robot and the terms of MA are determined by the geometrical shape of the robot and the density of the fluid. We used finite element analysis tools to calculate the numerical solutions of MA and MRB.

CRB(v) and CA(v) are defined by:

$${{\varvec{C}}}_{\text{RB}}=\left[\begin{array}{cccccc}0& 0& 0& m{z}_{\mathrm{G}}r& -m({x}_{\mathrm{G}}q-w)& -m({x}_{\mathrm{G}}r+v)\\ 0& 0& 0& -mw& m({z}_{\mathrm{G}}r+{x}_{\mathrm{G}}p)& mu\\ 0& 0& 0& m(v-{z}_{\mathrm{G}}p)& -m({z}_{\mathrm{G}}q+u)& m{x}_{\mathrm{G}}p\\ -m{z}_{\mathrm{G}}r& mw& m({z}_{\mathrm{G}}p-v)& 0& -({I}_{zx}p-{I}_{z}r)& -{I}_{y}q\\ m({x}_{\mathrm{G}}q-w)& -m({z}_{\mathrm{G}}r+{x}_{\mathrm{G}}p)& m({z}_{\mathrm{G}}q+u)& {I}_{zx}p-{I}_{z}r& 0& {I}_{x}p-{I}_{zx}r\\ m({x}_{\mathrm{G}}r+v)& -mu& -m{x}_{\mathrm{G}}p& {I}_{y}q& {I}_{zx}r-{I}_{x}p& 0\end{array}\right],$$
(13)
$${{\varvec{C}}}_{A}=\left[\begin{array}{cccccc}0& 0& 0& 0& -({Z}_{\dot{w}}w+{Z}_{\dot{q}}q)& {Y}_{\dot{v}}v+{Y}_{\dot{r}}r\\ 0& 0& 0& {Z}_{\dot{w}}w+{Z}_{\dot{q}}q& 0& -{X}_{\dot{u}}u\\ 0& 0& 0& -({Y}_{\dot{v}}v+{Y}_{\dot{r}}r)& {X}_{\dot{u}}u& 0\\ 0& -({Z}_{\dot{w}}w+{Z}_{\dot{q}}q)& {Y}_{\dot{v}}v+{Y}_{\dot{r}}r& 0& -({N}_{\dot{v}}v+{N}_{\dot{r}}r)& {M}_{\dot{w}}w+{M}_{\dot{q}}q\\ {Z}_{\dot{w}}w+{Z}_{\dot{q}}q& 0& -{X}_{\dot{u}}u& {N}_{\dot{v}}v+{N}_{\dot{r}}r& 0& -{K}_{\dot{p}}p\\ -({Y}_{\dot{v}}v+{Y}_{\dot{r}}r)& {X}_{\dot{u}}u& 0& -({M}_{\dot{w}}w+{M}_{\dot{q}}q)& {K}_{\dot{p}}p& 0\end{array}\right].$$
(14)

The terms of CRB(v) and CA(v) depend on the terms of MA and MRB. As the cruising speed of the robot is relatively low, we were able to use Stokes’ law to calculate Dl:

$$ {\varvec{D}}_{{\text{l}}} {\varvec{v}} = C_{{\text{l}}} \times {\text{diag}}\left\{ {u,v,w,p,q,r} \right\} = 1.01 \times 10^{ - 4} \times {\text{diag}}\left\{ {u,v,w,p,q,r} \right\}, $$
(15)

where \(C_{l} = 1.01 \times 10^{ - 4}\) is the linear viscosity coefficient of liquid at 20 ℃. Dq(v) was calculated from the drag:

$$ D_{{\text{q}}} \left( v \right) = \rho v^{2} C_{{\text{d}}} A/2, $$
(16)

where Cd is the drag coefficient, which is determined by the robot’s geometry and the characteristics of the flow, ρ is the mass density of the fluid, v is the velocity of the flow relative to the robot, and A is the reference area. The numerical solutions of Dq(v) were calculated by analyzing the Reynolds number in Eq. (17).

$$ {\varvec{D}}_{{\text{q}}} \left( v \right)v = \frac{1}{2}C_{{\text{d}}} \rho V_{{\text{r}}}^{2} A = \left[ {\begin{array}{*{20}c} {0.471} & 0 & 0 & 0 & 0 & 0 \\ 0 & {0.471} & 0 & 0 & 0 & 0 \\ 0 & 0 & {0.499} & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} u \\ v \\ w \\ p \\ q \\ r \\ \end{array} } \right]. $$
(17)

g(η), which is relevant to the design of the counterweight, is calculated using Eq. (18):

$$ {\varvec{g}}\left( \Theta \right) = \left[ {\begin{array}{*{20}c} {0^{3 \times 1} } \\ {\left( {z_{{\text{G}}} W - z_{{\text{B}}} B} \right)\cos \theta \sin \phi } \\ {\left( {z_{{\text{G}}} W - z_{{\text{B}}} B} \right)\sin \theta + \left( {x_{{\text{G}}} W - x_{{\text{B}}} B} \right)\cos \theta \cos \phi } \\ { - \left( {x_{{\text{G}}} W - x_{{\text{B}}} B} \right)\cos \theta \sin \phi } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {0^{3 \times 1} } \\ { - 0.9856\cos \theta \sin \phi } \\ { - 0.9856\sin \theta } \\ 0 \\ \end{array} } \right], $$
(18)

where W and B represent the gravity and the buoyancy, respectively.

The thrust vector was determined by analyzing the layout and output force from the water-jet motors as follows:

$$ {\varvec{\tau}} = {\varvec{LU}}, $$
(19)

where L is the layout parameter matrix, and \({\varvec{U}} = \left[ {F_{{{\text{LF}}}} ,F_{{{\text{RF}}}} ,F_{{{\text{RH}}}} ,F_{{{\text{LH}}}} } \right]\) is the thrust vector generated by the water-jet motors. As shown in Fig. 11b, the thrust of a water-jet motor, which is controlled by the supply voltage, is defined by an empirical formula based on data from a force measuring system as per Eq. (20):

$$ F = 0.094U^{2} + 0.249U - 1.167. $$
(20)

Figure 11c, d shows the layouts of the thrusts provided by the water-jet motors. In the horizontal motion mode, the layout parameter matrix is approximately equal to Eq. (21):

$${\varvec{L}}=\left[\begin{array}{cccc}\mathrm{cos}{\alpha }_{\text{LF}}& \mathrm{cos}{\alpha }_{\text{RF}}& \mathrm{cos}{\alpha }_{\text{RH}}& \mathrm{cos}{\alpha }_{\text{LH}}\\ \mathrm{sin}{\alpha }_{\text{LF}}& -\mathrm{sin}{\alpha }_{\text{RF}}& \mathrm{sin}{\alpha }_{\text{RH}}& -\mathrm{sin}{\alpha }_{\text{LH}}\\ 0& 0& 0& 0\\ ({z}_{\mathrm{G}}+{z}_{\mathrm{H}})\mathrm{sin}{\alpha }_{\text{LF}}& -({z}_{\mathrm{G}}+{z}_{\mathrm{H}})\mathrm{sin}{\alpha }_{\text{RF}}& ({z}_{\mathrm{G}}+{z}_{\mathrm{H}})\mathrm{sin}{\alpha }_{\text{RH}}& -({z}_{\mathrm{G}}+{z}_{\mathrm{H}})\mathrm{sin}{\alpha }_{\text{LH}}\\ -({z}_{\mathrm{G}}+{z}_{\mathrm{H}})\mathrm{cos}{\alpha }_{\text{LF}}& -({z}_{\mathrm{G}}+{z}_{\mathrm{H}})\mathrm{cos}{\alpha }_{\text{RF}}& ({z}_{\mathrm{G}}+{z}_{\mathrm{H}})\mathrm{cos}{\alpha }_{\text{RH}}& -({z}_{\mathrm{G}}+{z}_{\mathrm{H}})\mathrm{cos}{\alpha }_{\text{LH}}\\ {x}_{\mathrm{H}}\mathrm{sin}{\alpha }_{\text{LF}}-{y}_{\mathrm{H}}\mathrm{cos}{\alpha }_{\text{LF}}& {x}_{\mathrm{H}}\mathrm{sin}{\alpha }_{\text{RF}}-{y}_{\mathrm{H}}\mathrm{cos}{\alpha }_{\text{RF}}& {y}_{\mathrm{H}}\mathrm{cos}{\alpha }_{\text{RH}}-{x}_{\mathrm{H}}\mathrm{sin}{\alpha }_{\text{RH}}& {y}_{\mathrm{H}}\mathrm{cos}{\alpha }_{\text{LH}}-{x}_{\mathrm{H}}\mathrm{sin}{\alpha }_{\text{LH}}\end{array}\right],$$
(21)

where xH, yH, and zH are the coordinates of the water-jet motors in the body-fixed coordinate system. In the vertical motion mode, the layout parameter matrix is approximately equal to Eq. (22).

$${\varvec{L}}={\left[\begin{array}{cccccc}\mathrm{sin}{\beta }_{\text{LF}}\mathrm{cos}{\alpha }_{\text{LF}}& \mathrm{sin}{\beta }_{\text{LF}}\mathrm{sin}{\alpha }_{\text{LF}}& -\mathrm{cos}{\beta }_{\text{LF}}& -{y}_{v}\mathrm{cos}{\beta }_{\text{LF}}& {x}_{v}\mathrm{cos}{\beta }_{\text{LF}}& {x}_{v}\mathrm{sin}{\beta }_{\text{LF}}\mathrm{sin}{\alpha }_{\text{LF}}-{y}_{v}\mathrm{sin}{\beta }_{\text{LF}}\mathrm{cos}{\alpha }_{\text{LF}}\\ -\mathrm{sin}{\beta }_{\text{RF}}\mathrm{cos}{\alpha }_{\text{RF}}& \mathrm{sin}{\beta }_{\text{RF}}\mathrm{sin}{\alpha }_{\text{RF}}& -\mathrm{cos}{\beta }_{\text{RF}}& -{y}_{v}\mathrm{cos}{\beta }_{\text{RF}}& -{x}_{v}\mathrm{cos}{\beta }_{\text{RF}}& {y}_{v}\mathrm{sin}{\beta }_{\text{RF}}\mathrm{cos}{\alpha }_{\text{RF}}-{x}_{v}\mathrm{sin}{\beta }_{\text{RF}}\mathrm{sin}{\alpha }_{\text{RF}}\\ -\mathrm{sin}{\beta }_{\text{RH}}\mathrm{cos}{\alpha }_{\text{RH}}& -\mathrm{sin}{\beta }_{\text{RH}}\mathrm{sin}{\alpha }_{\text{RH}}& -\mathrm{cos}{\beta }_{\text{RH}}& {y}_{v}\mathrm{cos}{\beta }_{\text{RH}}& -{x}_{v}\mathrm{cos}{\beta }_{\text{RH}}& {x}_{v}\mathrm{sin}{\beta }_{\text{RH}}\mathrm{sin}{\alpha }_{\text{RH}}-{y}_{v}\mathrm{sin}{\beta }_{\text{RH}}\mathrm{cos}{\alpha }_{\text{RH}}\\ \mathrm{sin}{\beta }_{\text{LH}}\mathrm{cos}{\alpha }_{\text{LH}}& -\mathrm{sin}{\beta }_{\text{LH}}\mathrm{sin}{\alpha }_{\text{LH}}& -\mathrm{cos}{\beta }_{\text{LH}}& {y}_{v}\mathrm{cos}{\beta }_{\text{LH}}& {x}_{v}\mathrm{cos}{\beta }_{\text{LH}}& {y}_{v}\mathrm{sin}{\beta }_{\text{LH}}\mathrm{cos}{\alpha }_{\text{LH}}-{x}_{v}\mathrm{sin}{\beta }_{\text{LH}}\mathrm{sin}{\alpha }_{\text{LH}}\end{array}\right]}^{T}.$$
(22)

We can use the dynamic model to determine the system transfer function of the robot. The simplified underwater dynamic model suggests that the system transfer function is second order. The hydraulic resistance and inertia effects mean that the robot is a delay system. In theory, the parameters of the dynamic model can be acquired either numerically or experimentally. However, some key parameters, such as the damping matrix, are determined by the current motion status of the robot and environmental factors that vary continuously. Thus, the parameters of the control system should be adjusted online as the system transfer function changes.

4.2 Generalized Prediction Control Mechanism

From the existing adaptive control algorithms, the generalized prediction control method derives advantages from model predictive control and dynamic matrix control [37]. Moreover, it is robust to unmatched system models and is capable of overcoming system lag [38]. These characteristics are required from the control system of the amphibious spherical robot [39,40,41,42,43,44]. Figure 12 shows the main concepts used in the adaptive generalized prediction control algorithm. This algorithm was adopted to control the course and depth of the robot in underwater environments.

Fig. 12
figure 12

The conceptual basis of the adaptive generalized prediction system for controlling the robot in underwater environments

Let us consider the course control of the robot in the following example. As the robot moves slowly underwater, the parameters of its system transfer function vary slowly. Thus, we implemented online system recognition with the forgetting factor least squares algorithm. We used the underwater dynamic model established in Sect. 4.1 to derive the controlled auto-regressive integrated moving average model (CARIMA) defined by Eq. (23). This model provides us with the following system model of the robot in the underwater horizontal motion mode:

$$ \left( {1 + a_{1} z^{ - 1} + a_{2} z^{ - 2} } \right)y\left( k \right) = z^{ - d} \left( {b_{0} + b_{1} z^{ - 1} } \right)u\left( k \right) + \xi \left( k \right)/\left( {1 - z^{ - 1} } \right), $$
(23)

where y(k) represents the kth system output or the course angle of the robot, u(k) is the kth system input or the controlled water-jet motor variable, and ξ(k) is a random disturbance term from a Gaussian distribution. To simplify the control process, the robot’s four water-jet motors were divided into two sets. The two motors in each set are controlled to output the same force, which is FLF = FRF and FLH = FRH in the scene shown in Fig. 11c. That is to say that u(k) is a 2 by 1 vector, and each of its elements control a set of motors. The kth loop is represented by Eq. (24):

$$ \left\{ {\begin{array}{*{20}l} {\hat{\varvec{\theta }}\left( k \right) = \hat{\varvec{\theta }}\left( {k - 1} \right) + K\left( k \right)\left[ {y\left( k \right) - \varvec{\varphi }^{T} \left( k \right)\hat{\varvec{\theta }}\left( {k - 1} \right)} \right]} \\ {K\left( k \right) = \frac{{{\varvec{P}}\left( {k - 1} \right)\varvec{\varphi }\left( k \right)}}{{\lambda + \varvec{\varphi }^{T} \left( k \right){\varvec{P}}\left( {k - 1} \right)\varvec{\varphi }\left( k \right)}}} \\ {P\left( k \right) = \frac{1}{\lambda }\left[ {I - K\left( k \right)\varvec{\varphi }^{T} \left( k \right)} \right]P\left( {k - 1} \right)} \\ \end{array} } \right., $$
(24)

where λ ∈ [0.9, 1] is the forgetting factor, \(\varvec{\varphi }\left( k \right) = [ - \Delta y\left( {k - 1} \right), - \Delta y\left( {k - 2} \right), - \Delta u\left( {k - 1} \right), - \Delta u\left( {k - 2} \right)]^{T}\) is the past system input and output increment vector, \(\hat{\varvec{\theta }}\left( k \right) = [a_{1} \left( k \right),a_{2} \left( k \right),b_{0} \left( k \right),b_{1} \left( k \right)]^{T}\) is the estimated model parameter vector, and K(k) and P(k) are intermediate results.

The generalized prediction controller uses the calculated system transfer function to predict the robot’s future course angle sequence (\(\left[y(k+1),\cdots ,y(k+N)\right]\)) using past, current, and future control inputs, and past and current course angles. Then, it selects future control inputs (\(\left[u(k),\cdots ,u(k+{N}_{u}-1)\right]\)) to ensure that the course angle will finally reach the expected output w. Suppose that the robot is a dth-order-delay system and is set to follow the predefined course angle w(k + d). We guarantee that the course angle makes smooth transitions by pre-processing the reference trajectory using the first-order smoothing model in Eq. (25):

$$ \left\{ {\begin{array}{*{20}l} {y_{r} \left( k \right) = y\left( k \right)} \hfill \\ {y_{r} \left( {k + j} \right) = \alpha y_{r} \left( {k + j - 1} \right) + \left( {1 - \alpha } \right)w,k = 1,2, \ldots ,N,} \hfill \\ \end{array} } \right. $$
(25)

where α ∈ [0,1) is the softness factor, N is the prediction step, and yr(k) is the future reference trajectory. We used a gradient descent optimization approach to find the future control inputs that minimize the cost function J:

$$ \min J = \min E\left\{ {\mathop \sum \limits_{{j = N_{1} }}^{{N_{2} }} [y\left( {k + j} \right) - y_{{\text{r}}} \left( {k + j} \right)]^{2} + \mathop \sum \limits_{j = 1}^{{N_{u} }} \left[ {\gamma_{i} \Delta u\left( {k + j - 1} \right)} \right]} \right\}, $$
(26)

where N1 and N2 are, respectively, the maximum and minimum prediction lengths, γi is the weighting coefficient, and Δu(k + − 1) is the future control input increment. The search process is equivalent to solving the following Diophantine equation:

$$ \left\{ {\begin{array}{*{20}l} {C\left( {z^{ - 1} } \right)y^{*} (k + j|k) = G_{j} \left( {z^{ - 1} } \right)y\left( k \right) + F_{j} \left( {z^{ - 1} } \right)\Delta u\left( {k + j - 1} \right)} \hfill \\ {C\left( {z^{ - 1} } \right) = \overline{A}\left( {z^{ - 1} } \right)E_{j} \left( {z^{ - 1} } \right) + z^{ - j} G_{j} \left( {z^{ - 1} } \right)} \hfill \\ {F_{j} \left( {z^{ - 1} } \right) = B_{j} \left( {z^{ - 1} } \right)E_{j} \left( {z^{ - 1} } \right),} \hfill \\ \end{array} } \right. $$
(27)

where \(y^{*} (k + j|k)\) represents the values expected to minimize the cost function, and \(\overline{A}\left( {z^{ - 1} } \right)\), \(B_{j} \left( {z^{ - 1} } \right)\), \(C\left( {z^{ - 1} } \right)\), \(E_{j} \left( {z^{ - 1} } \right)\), \(F_{j} \left( {z^{ - 1} } \right)\) and \(G_{j} \left( {z^{ - 1} } \right)\) are determined by the system transfer function. The corresponding control input is defined as follows:

$$ u\left( k \right) = u\left( {k - 1} \right) + \left[ {1,0, \ldots ,0} \right]({\varvec{F}}_{1}^{T} {\varvec{F}}_{1} +{\varvec{\varGamma}})^{ - 1} {\varvec{F}}_{1}^{T} \left[ {{\varvec{Y}}_{r} - {\varvec{F}}_{2} \Delta {\varvec{U}}\left( {k - j} \right) - {\varvec{GY}}\left( k \right)} \right], $$
(28)

where F1, F2, and G are the solutions of the Diophantine equation, Γ = diag(γ1, γ2, γNu) is the weighting coefficient vector, \({\varvec{Y}}_{{\varvec{r}}} = [{\varvec{y}}_{{\varvec{r}}} \left( {{\varvec{k}} + {\varvec{N}}_{1} } \right),{\varvec{y}}_{{\varvec{r}}} \left( {{\varvec{k}} + {\varvec{N}}_{1} + 1} \right), \ldots ,{\varvec{y}}_{{\varvec{r}}} \left( {{\varvec{k}} + {\varvec{N}}_{2} } \right)]^{{\varvec{T}}}\) is the smoothed reference trajectory, and \({\varvec{Y}} = [{\varvec{y}}\left( {{\varvec{k}} + {\varvec{N}}_{1} } \right),{\varvec{y}}\left( {{\varvec{k}} + {\varvec{N}}_{1} + 1} \right), \ldots ,{\varvec{y}}\left( {{\varvec{k}} + {\varvec{N}}_{2} } \right)]^{{\varvec{T}}}\) is the predicted course angle vector.

In our real-world experiments, we set the sample interval of the generalized prediction controller to 100 ms and its parameters to α = 0.8, λ = 0.95, N = 5, N1 = d = 3, N2 = 10, and Nu = 1. The values of K(0) and P(0) were set to 106I and 0.05, respectively. The controller was implemented as a soft-real-time program running in the PS of the SoC.

5 Evaluation and Experimental Results

Figure 13a shows a prototype of our amphibious spherical robot. Only the upper hemisphere of the robot is designed to be waterproof. So, we balanced the robot’s gravity and buoyancy and the robot could be suspended in the water without driving. We evaluated the performance of the robot and the proposed adaptive motion control system by conducting experiments in three phases, both on land and underwater.

  1. (1)

    In the motion performance evaluation phase, the amphibious spherical robot was configured to walk on land and swim in water, as shown in Fig. 13b–e. In the land test, we evaluated three gaits and eleven speed grades. Figure 13f shows the walking speed, which we measured with a ruler and a timer. This shows that the robot is able to walk at speeds up to 8.5 cm/s (0.34 body length per second). The fast walking gait is, on average, 12.1% faster than the standard walking gait and the stable walking gait is an average of 14.3% slower than the standard gait. In the underwater test, the robot was configured to swim in a straight line in a 2.8 × 2.0 × 1.0 m tank. We measured the speed of the robot as it was driven by two or four water-jet motors. Figure 13g shows the underwater speed of the robot, which was again measured with a ruler and timer. The robot is able to swim at speeds of up to 16.1 cm/s (0.64 body length per second) when the water-jet motors work at the maximum speed grade. As shown in Fig. 14, when the robot walks on a relatively flat road, it can reduce the height of the lifting platform, use the omni-directional wheel to support the body, and the legs slide the ground to generate the initial speed. Using the inertial motion of the robot, this process greatly increases the mobile efficiency and endurance of the robot. The robot can glide with an average speed of 16.7 cm/s.

  2. (2)

    In the slope climbing evaluation phase, the robot was configured to climb up a slope with a gradient of five degrees. We installed an NDI Polaris Vicra, a real-time three-dimensional measurement system with a precision of 0.5 mm, at the top of the slope to monitor the displacement of the robot. We fixed three magnetic markers onto the surface of the robot to determine its spatial orientation, as shown in Fig. 15a. The height of the slope did not include in the vertical displacement data. So, we just consider the vibration amplitude and vertical displacement difference between start point and end point. Figure 15b, c show the vertical displacement of the robot as it tries to climb up the slope. Without gait adjustment, the fluctuations of the robot’s body have amplitudes of nearly 20 mm, and the robot slipped frequently, as shown in Fig. 15b. After adding the gait adjustment mechanism, the amplitudes of the fluctuations decreased to less than 10 mm and the robot climbed the slope steadily, as shown in Fig. 15c. This shows that the gait adjustment mechanism meets the stability and mobility requirements.

  3. (3)

    In the underwater course control test phase, the robot was configured to move in a straight line, then make a turn. The heading of the robot was controlled by the generalized prediction controller. We measured the attitude and motion parameters of the robot with a MEMS IMU, which consisted of a gyroscope (ITG-3200), an accelerometer (ADXL345), and an electronic compass (HMC5883L). We used the quaternion algorithm with the Kalman filtering mechanism to calculate the angle of the robot’s course, which acted as the feedback signal to the controller. The angle of the robot’s course was set to 0° in the rectilinear motion test. We used a program to record the control parameters, as shown in Fig. 16. The error between the robot’s heading and the expected value was less than ± 3°, as shown in Fig. 16a. The parameters of the system transfer function change gradually as the robot’s motion status changes, then stabilize as the robot enters a state of uniform motion, as shown in Fig. 16d. This indicates that the generalized prediction control algorithm is suitable for controlling systems that vary slowly with time. In contrast, the classical PID controller, which relies on a static system transfer function, failed to stabilize the robot’s heading. The course error increased gradually and the system did not eventually converge. When the robot moves forward in a straight line, the maximum error of the PID control algorithm is approximately 8.45°, as shown in Fig. 17.

Fig. 13
figure 13figure 13

Results from the evaluation of the robot’s motion performance. a Pictures of the prototype of the amphibious spherical robot; b Pictures of the translational motion test on land; c Pictures of the rotational motion test on land; d Pictures of the translational motion test in water; e Pictures of the rotational motion test in water; f Speed of the amphibious spherical robot as it walks with different gaits on land; and g Speed of the amphibious spherical robot driven by two and four water-jets in water

Fig. 14
figure 14

Passive gliding experiment

Fig. 15
figure 15

Evaluation of the robot’s slope climbing ability. a Principle used to test the slope climbing ability; b vertical displacement of the robot without gait adjustment; and c vertical displacement of the robot with gait adjustment

Fig. 16
figure 16

Results of the underwater rectilinear motion test. a The robot’s course; b course control error c control input to the generalized prediction control system; and d parameters of the calculated system transfer function

Fig. 17
figure 17

The robot’s course by PID controller

In the turning motion test, the angle of the robot’s course was first set to 0°, and then adjusted to 90°. Figure 18 shows the control parameters recorded during the turning motion test. The course error was less than ± 3 degrees and the turning operation lasted for 6 s. This demonstrates that our algorithm can control the robot dynamically, as shown in Fig. 18a. The parameters of the system transfer function change continually during the turning process, as shown in Fig. 18b.

Fig. 18
figure 18

Results of the underwater turning motion test. a The robot’s course; and b parameters of the calculated system transfer function

6 Conclusions

In this study, we designed and built an improved version of our previously reported amphibious spherical robot with the aim of making the robot capable of completing exploration tasks in varied amphibious environments. We then designed an adaptive motion control system with 4-DoFs. First, we developed simplified mechanical and dynamic models so that we could analyze the motions of the robot on land and in water, respectively. We designed a set of walking gaits so that the robot could move flexibly on various terrains. These gaits provided different stabilities and speeds. We then developed an online gait adjustment mechanism to keep the robot stable as it climbs up slopes with small gradients. As the underwater motion of the robot is very susceptible to environmental variations, we implemented an online system recognition with a forgetting factor least squares algorithm. The underwater motion was controlled by a generalized prediction control algorithm. The proposed motion control system was implemented on digital circuits and software. We used a MEMS IMU to measure the status of the robot’s motions and provide feedback signals to the controller. We evaluated the performance of the robot and the proposed motion control system experimentally. The adaptive robotic control system enhanced the stability and mobility of the amphibious spherical robot, such that they meet the requirements for applications in complex amphibious environments.