System identification is a crucial first step in controller design. It involves selecting an appropriate identification model and estimating the model's parameters. This paper proposes a PSO algorithm that balances global exploration and local exploitation to overcome these issues. PSO incorporates the differences between particles and takes feedback from particle memories to accurately reflect the search process. The paper also discusses the use of PSO for PID controller design, specifically for tuning the proportional gain (Kp), integral gain (Ki), and derivative gain (Kd) parameters. This paper aims to utilize PSO for both parameter identification and control of nonlinear systems. The effectiveness of the proposed method has been investigated on two nonlinear systems. The PID parameters obtained based on the proposed method and the genetic algorithm are compared, showing that the PSO-based method is superior in faster convergence, higher accuracy, improved dynamic characteristics, and optimization time.