Hardware-in-the-Loop Optimization of Cascaded PI Controllers with Evolutionary Algorithms
Determining suitable PI controller coefficients remains a labor-intensive process that often relies on trial-and-error or analytical methods requiring detailed system models. This paper presents a hardware-in-the-loop approach that optimizes PI coefficients directly on a physical machine, eliminating the need for transfer function identification and simulation. The machine operates as a black box, with candidate solutions evaluated through measured step responses via a remote procedure call interface. Three evolutionary algorithms, Differential Evolution (DE), Particle Swarm Optimization (PSO), and Covariance Matrix Adaptation Evolution Strategy (CMA-ES), were compared under strict real-world constraints: one-minute evaluation times and a total optimization budget of one hour. Initial experiments optimizing only the velocity controller achieved up to 90% improvement but introduced oscillation artifacts caused by an inverse dependency between the cascaded velocity and torque controllers. Simultaneous optimization of both controllers resolved these side effects, yielding a 48% reduction in overshoot and 43% in undershoot compared to the manufacturer's default parameters. All algorithms converged within approximately ten minutes. DE and PSO are recommended as the most effective choices for this optimization scenario.