In order to improve the flight quality of UAV, study the hardware-in-the-loop simulation application of UAV control, form a set of universal UAV flight control law design and hardware-in-the-loop simulation method, the Z-shaped aircraft with complex aerodynamic characteristics is studied. According to the shape parameters of Z-shaped aircraft, the aerodynamic data are obtained. On this basis, the longitudinal linear model is established by using the principle of small disturbance linearization. The longitudinal static stability of the model is studied by adding disturbance pulses. The transfer function of each link is selected, the pitch control loop is established, the PID parameters are adjusted, the longitudinal control law is designed, and use Simulink and hardware-in-the-loop simulator for simulation. The simulation results show that UAV has good static stability, reasonable selection of PID control parameters, small system overshoot and short adjustment time, which can improve the flight quality of UAV. Hardware-in-the-loop simulation can more truly and intuitively reflect the advantages of UAV attitude. The modeling and simulation methods used can be applied to other solid systems. Fixed-wing UAV has certain versatility.