Pyrolysis is an effective mechanism for transforming biomass into bioenergy in an eco-friendly and cost-effective manner. Energy yield was used as an index to coordinate the yield and calorific value for optimization of the pyrolysis carbonization process in a rotating bed reactor. Corn stalks were divided into four parts (cob, leaf, stem, and root), and pyrolysis was carried out at temperatures of 400, 450, and 500°C. The initial study revealed that the stem was the best part of the stalk for maximization of energy yield at different pyrolysis temperatures. Analysis of several common factors (particle size, heating rate, holding time, pyrolysis temperature, flow rate of carrier gas, and rotation speed) affecting energy yield was performed with a Plackett-Burman design and response surface methodology based on central composite design. The results of the Plackett-Burman design indicated that heating rate, holding time, pyrolysis temperature, and rotation speed had statistically significant effects on energy yield. Central composite design was performed to evaluate the interaction between the selected variables. The established optimal conditions consisted of a heating rate of 5.96°C/min, holding time of 1.54 h, pyrolysis temperature of 424.87°C, and rotation speed of 11.05 r/min. The maximum energy yield under these optimal conditions was 75.72%, which is close to the predicted maximum energy yield of 76.66%. The R2 value was 0.9675, indicating a good fit for the empirical model of pyrolysis carbonization energy yield.