After analyzing the disadvantages of the original penalty function algorithm, a smoothing parameter is introduced into constructing the continuous and differential penalty function with parameter for the constraint optimal control problem, and a smoothing penalty function algorithm is proposed, then the constrained optimal control problem is converted into the unconstrained optimal control problem. According to continuous dependence on parameter for the solution of differential equation, an approximate minimum principle is obtained under non-constrained condition. With this approach, the fault of the conventional penalty function, i.e. the non-differentiable, is overcome and this approach is simple, feasible and easy to come true. Finally, the numerical simulation example shows the effectiveness of the algorithm.