This document presents a numerical optimization approach for designing robust PI and PID controllers for time-delay systems. The approach models processes using first-order plus dead time and second-order plus dead time transfer functions. It formulates the controller design as an optimization problem that maximizes stability margins while satisfying constraints related to transient response. The approach is demonstrated by deriving the characteristic equations for PI and PID control of a first-order process and setting up the optimization problems to design the controllers.