This paper studies the volatility control of a renewable energy-based PEM electrolysis hydrogen production system coupled with the power grid. First, the characteristics and sources of volatility in the coupled system are analyzed, and a renewable energy output volatility coefficient model, a PEM electrolyzer dynamic response model, and a system power balance model are constructed. Then, a hierarchical-composite control strategy covering medium-to-long-term, short-term, and real-time timescales is designed. A multi-constraint optimization model is constructed with the core objectives of maximizing renewable energy absorption, minimizing grid volatility, and maximizing hydrogen production efficiency. The optimal control parameters are solved using a particle swarm optimization algorithm. Finally, a simulation platform is built based on MATLAB/Simulink to verify the effectiveness of the strategy under different volatility intensities. The study shows that the proposed control strategy can significantly reduce the voltage/frequency volatility of the power grid, decrease volatility transmission efficiency by 40%-70%, increase renewable energy absorption by 6%-15%, and stabilize hydrogen production efficiency at 78%-82%, effectively ensuring the stable operation of the coupled system and providing technical support for the efficient coupling of renewable energy and the power grid.