In response to the limitation of cable power supply on the movement range of mobile welding robots and the difficulty in achieving automatic welding of large equipment, a fuel cell hybrid power system is applied to the electric drive system of welding robots. State machines are used to determine the energy distribution state of hybrid power systems, while fuzzy algorithms are used to control the energy distribution of hybrid power in some states. In order to reduce the fluctuation of fuel cell power output and improve the economy of the energy supply system, a guidance head optimization algorithm is adopted to adjust the fuzzy membership function. Taking hydrogen consumption and fuel cell power output fluctuations as optimization objectives, and the SoC and fuzzy load deviation adjustment function of lithium-ion batteries as input variables, optimize the output power distribution of fuel cells and lithium-ion batteries. Compared with the optimization results of traditional guidance head optimization algorithms, particle swarm optimization algorithms, and fuzzy algorithms, the improved guidance head optimization algorithm can converge with fewer iterations while satisfying the dynamic response of robots, and can effectively improve the output power characteristics of fuel cells. Therefore, the control strategy studied in this article can effectively improve the output power characteristics of fuel cells, reduce output current ripple, and shorten response time. At the same time, it reduces the equivalent hydrogen consumption of the hybrid system and improves fuel economy.