This document presents a method for automatically tuning PID controllers using particle swarm optimization (PSO) algorithm. It describes PID controllers and common tuning methods like Ziegler-Nichols. It then provides an overview of PSO algorithm and how it can be applied to optimize PID parameters to minimize a performance index for a DC motor model. Simulation results show the PSO-tuned PID controller provides improved rise time, settling time and overshoot compared to Ziegler-Nichols tuning.