This document describes a project to tune a DC motor using particle swarm optimization (PSO) and proportional-integral-derivative (PID) control. It includes chapters on PSO, PID control, tuning PID controllers, and applying PSO and PID control to an automatic voltage regulator (AVR) system for a DC motor. PSO is proposed as an optimization method to determine optimal PID gains (Kp, Ki, Kd) for controlling the nonlinear and high-order dynamics of the AVR system. The performance of the PID controller with PSO-tuned gains is found to be better than the classic Ziegler-Nichols tuning method based on analysis of the system's transient response, stability, and frequency