Functional electrical stimulation (FES), a rehabilitation technique, typically relies on physiotherapists using trial-and-error tests to determine effective stimulation patterns. Therefore, this study proposed a kind of pedal hill modeling to establish an optimal stimulus mode with the maximum torque efficiency optimization objective. This study also proposed a new model based on the particle swarm optimization (PSO) algorithm, the back propagation (BP) neural network algorithm, and the proportional integral derivative (PID) control composite algorithm. Six participants were recruited for the experiment. Using the proposed modeling method, we found an appropriate stimulation mode for each of the six subjects, and then each subject performed three sets of experiments for cycling without electrical stimulation, cycling with fixed pulse width, and cycling with adaptive adjustment of pulse width by the fabricated controller. The results of the study showed that root mean square error (RMSE), average (AVE), training time and number of stops all performed well compared to the no control and fixed control conditions and the adaptive pulse width control system of the fabricated controller allows subjects to train at a longer continuous running time and a more stable cycling training speed.