Internal variations and external disturbances often adversely influence normal operation of plant factories and their production stability. In this research, a salad-cultivating plant factory (abbreviated as SPF) was considered as a dissipative system, its highly valid kinetic model was developed using system dynamics and experimental data. Optimal closed-loop control law of light intensity, temperature and aerating rate was then obtained based on the gradient of stored-energy (Lyapunov) function of the SPF derived from Hamilton-Jacobi-Isaacs equation. Both digital and real-time simulation results showed that the SPF closed-loop control system with optimal control law could continuously dissipate the stored energy, namely internal variation and external disturbances resulting from insect and microbial damage and other environmental fluctuations with different strengths to stabilize the SPF at an operating point and maintaining the good yield of salad with desired dynamic response characteristics to control actions. This research will lay a theoretical and method foundation for construction and operation of facility agricultural systems and closed artificial ecosystems.