Kinematics dynamics modeling of the refueling boom system is established for aerial boom refueling, and then automatic alignment control law is designed for three-channel model of the system. The tracking control of the boom's attitude, including pitch angle, roll angle and expansion amount is studied for the aerial boom refueling hardware-in-the-loop simulation test platform. In order to realize the goal that the boom can track the receptacle autonomously, a realtime tracking algorithm is designed. Results from the digital simulation and the hardware-in-the-loop demonstration are presented which show that the automatic alignment control law of the boom system designed in this paper is feasible and effective.