This paper solves the controller gains uncertainty problem, which may lead to undesirable responses and an unstable system when implemented. A non‐fragile or resilient controller can overcome this problem. The paper suggests a new method to design a non‐fragile proportional‐integral‐derivative (PID) controller for voltage regulation. This method is carried out by applying a constrained genetic algorithm (GA) as a powerful optimization technique to determine the optimal gains of the PID controller. In addition, new developed conditions from the Routh– Kharitonov theorem are taken into account during the optimization operation to ensure system stability and system response. A new time domain objective function is proposed to establish the optimal permissible limits of controller gains to ensure a constraint of good response. The results of the proposed non‐fragile PID controller are compared with the non‐constrained GA‐based PID controller, artificial bee colony (ABC) algorithm‐based PID controller, and Ziegler Nichols (ZN)‐based PID controller. This achieves better results compared with different methods. The controller gains uncertainties test is applied to ensure the non‐fragility of the proposed controller. Furthermore, the system parameters variation test is applied to check the robustness of the controller based on the suggested method. The designed PID controller by this method is more resilient and less design time is required. The proposed controller and the system are carried out and studied by utilizing MATLAB/Simulink.