Renewable energy sources have been viewed as an important approach to solve the energy crisis and are carbon neutral. Compared with other storage mediums, green ammonia has the highest total energy efficiency and is an important raw material in the chemical industry. The fluctuation of renewable energy is a huge challenge for green ammonia production; thus, a high-precision prediction model is required to enable the building of an advanced control system for green ammonia production. In this study, a transformer-based multivariable multistep time-series prediction model that includes the temporal scales feature of renewable energy, called MSPTST, is proposed as the first step to solve the problem of unstable green ammonia production. The model outperformed other state-of-theart models, and its R 2 values were 0.986, 0.9998, and 0.990 under a high load condition, low renewable energy condition, and natural condition, respectively. Stable operation and swift load transitions are facilitated through a model predictive control based on the MSPTST framework. The impact of energy fluctuations on green ammonia synthesis is addressed by further integrating control theory and algorithms.