This paper describes the use of particle swarm algorithm and k-nearest neighbor method to optimize the process of radial basis function (RBF) network and we use the Denavit-Hartenberg (DH) method to research PUMA560 robotics, the results of the forward kinematics is derived as the RBF network training samples. We use six identical RBF network of twelve-input, single output, to achieve a PUMA560 inverse kinematics calculation. Simulation results show that the results obtained with this method has high accuracy and fast convergence.