Biomimetic robotic fish has potential applications in underwater tasks. To control its swimming, Center Pattern Generator (CPG) models are widely used in its locomotion controllers. The CPG model can generate multiple swimming patterns with the same CPG network. However, there are many parameters to be tuned in a CPG model. In this paper, a parameter optimization method based on particle swarm optimization algorithm (PSO) has been proposed. Its goals are to output more smoothly waves and to gain more high swimming speed. The simulation showed that each joint input signal for a robotic fish is more smoothly. The experimental results showed that the robotic fish gained more high speed with more smoothly waves. It verified the feasibility of the PSO-based CPG model parameter optimization method.