Swimming Under Constraints: A Safe Reinforcement Learning Framework for Quadrupedal Bio-Inspired Propulsion
Authors: Xinyu Cui, Fei Han, Hang Xu, Yongcheng Zeng, Luoyang Sun, Ruizhi Zhang, Jian Zhao, Haifeng Zhang, Weikun Li, Hao Chen, Jun Wang, Dixia Fan
Organizations: FSI lab, Westlake University, Hangzhou, 310030, China. · Institute of Automation, Chinese Academy of Sciences, Beijing, 100190, China. · School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing 100049, China · Zhejiang University, Hangzhou, 310027, China. · Zhongguancun Academy, Beijing, 100094, China · Department of Computer Science, University College London, London WC1E 6BT, United Kingdom
Bio-inspired aquatic propulsion offers high thrust and maneuverability but is prone to destabilizing forces such as lift fluctuations, which are further amplified by six-degree-of-freedom (6-DoF) fluid coupling. We formulate quadrupedal swimming as a constrained optimization problem that maximizes forward thrust while minimizing destabilizing fluctuations. Our proposed framework, Accelerated Constrained Proximal Policy Optimization with a PID-regulated Lagrange multiplier (ACPPO-PID), enforces constraints with a PID-regulated Lagrange multiplier, accelerates learning via conditional asymmetric clipping, and stabilizes updates through cycle-wise geometric aggregation. Initialized with imitation learning and refined through on-hardware towing-tank experiments, ACPPO-PID produces control policies that transfer effectively to quadrupedal free-swimming trials. Results demonstrate improved thrust efficiency, reduced destabilizing forces, and faster convergence compared with state-of-the-art baselines, underscoring the importance of constraint-aware safe RL for robust and generalizable bio-inspired locomotion in complex fluid environments.
Figures & tables
Fig. 1: Proposed framework: imitation learning initializes a periodic gait from predefined motions while sensor feedback is Kalman‑filtered; safe RL fine‑tuning accelerates on‑hardware convergence under stability constraints; and the resulting one‑cycle paddle is transferred to diagonal limb pairs with a half‑cycle phase offset to enable smooth and stable free‑swimming.
Parameter
AθH(rad)
AθK(rad)
f(Hz)
ϕ
θ0H/θ0K
Range
[π/6,π/3]
[π/12,π/4]
[0.3,0.6]
[0,π]
[π/4,5π/4]
TABLE I: Experimental Parameter Ranges
Fig. 2: The training curves (reward and average cost) of the baselines over 400 episodes, each method is trained in three random seeds. The gray line marks the cost limit.
Fig. 3: Ablations removing the cycle‑level objective, conditional high clipping, or imitation learning quantify each component’s contribution to stability and data efficiency. Each ablation is trained in three random seeds. The gray line marks the cost limit.
Algorithm
Episode Reward
Average Cost
CPPO-PID
39.58±±3.93
0.249±±0.021
CPPO-PID-H
37.10±±10.84
0.261±±0.023
PPO-Penalty
43.46±±3.91
0.314±±0.021
PPO (w/o Cost)
48.58±±5.15
0.391±±0.039
Ours (ACPPO-PID)
45.19±±3.83
0.235±±0.019
Ours (w/o Cycle Loss)
43.35±±5.92
0.271±±0.027
TABLE II: Single limb evaluated in a tow tank
Fig. 4: Forward swimming performance under two representative gaits per algorithm, averaged over three trials. ACPPO-PID achieves the highest scores with lower variance, while CPPO-PID, PPO, and BF show reduced thrust and greater sensitivity to gait differences.
Fig. 5: Comparison of Fxmean , Fzmean , and Fzvar across algorithms, showing ACPPO-PID achieves strong thrust with reduced lift fluctuations.The right panel illustrates the maximum displacement achieved in this experiment under parameterized motion, standard PPO training, and our proposed ACPPO-PID.
Fig. 6: Comparison of limb motion patterns between our constrained method (ACPPO-PID, top) and unconstrained PPO (bottom) during one locomotion cycle. Key differences are highlighted: calf movement during pre-paddle phase (red) and hip movement during paddle phase (yellow).
1Engineering Sciences Department, Swiss Federal Laboratories for Materials Science and Technology, Switzerland · Institute for NeuroInformatics, University of Zurich, Switzerland · Department of Electronic Engineering, University of Rome Tor Vergata, Italy