Search for a command to run...
Proportional–integral–derivative (PID) controllers are always a preferred choice of control strategy in industrial and biomedical systems due to their simplicity, reliability, and easy implementation. However, the systematic tuning of PID parameters for nonlinear, constrained, and safety-critical systems remains challenging, particularly in the presence of disturbances and actuator limitations. This paper presents a unified surrogate-based optimization framework for tuning PID controllers for linear and nonlinear dynamical systems. The tuning problem is formulated as a constrained optimization task, where performance objectives and safety requirements are explicitly incorporated into the cost function. A surrogate-based optimization via clustering (SBOC) approach is employed to efficiently explore the PID parameter space while reducing the number of expensive closed-loop simulations. The proposed framework is first applied to the first- and second-order linear time-invariant systems to check its feasibility and then to the nonlinear systems to demonstrate its robustness under nonlinearity and saturation. The approach is further applied to safety-critical systems considering the case of glucose regulation in type 1 diabetes under realistic meal disturbances and insulin delivery constraints. The simulation results show that the surrogate-optimized PID controller achieves stable regulation with improved tracking performance while strictly satisfying safety requirements, including control effort penalties to limit actuator wear and the avoidance of hypoglycemia and hyperglycemia in glucose regulation problems.