This paper describes the design of a PI controller for a Unified Power Quality Conditioner (UPQC) aimed at improving power quality in distribution systems. It presents a mathematical model and compares two controller design techniques: Sequential Loop Closure with Bode Diagram and Genetic Algorithms, demonstrating their effectiveness through MATLAB simulations. The study concludes that the proposed controller design enhances power quality by addressing issues such as harmonics and voltage fluctuations in the system.