It was difficult to design a simple and effective learning algorithm based on gradient for PID neural networks because their neurons have discontinuous transfer functions. A new on-line algorithm was proposed according to the signal flow graph (SFG) theory in this paper. All gradients could be calculated directly from the SFGs of PID neural networks by this method. Moreover, an adaptive teaming rate was designed to guarantee the convergence of the algorithm by Lyapunov's stability theory. Simulation results show the algorithm is an effective on-line learning algorithm for PID neural networks in nonlinear dynamic system identification.