In this paper, we propose a motion planning algorithm based on the five-fold B-spline curve for multi-axis motion control systems with non-smooth trajectories, acceleration, plus acceleration over the limit, etc. We construct a smooth transition model for the micro-line segment G3 of the continuous five-fold B-spline curve. A derivation of the corresponding theoretical equation is given. Using the transition model, we propose an optimization method for dynamic adjustment of motion trajectory errors based on the velocity forward planning constraints by smoothing the transition after the trajectory of the micro-line segment for the forward planning velocity. Finally, the design flow for the forward planning of the velocity is given. Finally, the above algorithm is used to perform simulation experiments for the optimization algorithm. Experimental results show that the proposed optimization improves the accuracy of fitting motion trajectories under the constraints of acceleration and deceleration addition, which validates the proposed algorithm.