A self-tuning proportional-integral (PI) controller in which the controller gains are adapted using the particle swarm optimization (PSO) technique is proposed for a static synchronous compensator (STATCOM). An efficient formula for the estimation of system load impedance using real-time measurements is derived. Based on the estimated system load, a PSO algorithm, which takes the best particle gains, the best global gains, and previous change of gains into account, is employed to reach the desired controller gains. To demonstrate the effectiveness of the proposed PSO self-tuning PI controller for a STATCOM, experimental results for a system under different loading conditions are presented. Results from the self-tuning PI controller are compared with those from the fixed-gain PI controllers.Index Terms-Particle swarm optimization (PSO), reactive power compensation, self-tuning proportional-integral (PI) controller, static synchronous compensator (STATCOM), voltage regulation.