In this paper a controller is designed for a hybrid power system using a soft computing technique, the power system consists of PV system, fuel cell, aqua electrolysers, diesel engine generator and a battery energy storage system and frequency of the system is controlled by proportional plus integral (PI) controller and proportional plus integral and derivative (PID) controller. A powerful optimization technique named as Gorilla Troops optimizer technique is used for optimization of controller gains of the proposed hybrid power system. The system responses with GTO optimization-based controllers are compared with the Particle swarm optimization technique. Finally, from the frequency responses GTO based controller is better to mitigate the frequency responses in the system.