Aiming at the problems that the fluctuation of field road affects header height of a combine harvester, it further results in the difficulty of measuring the header height and the fluctuation of feed quantity during the operation of a combine harvester, a real-time method for measuring the header height based on double inertial sensors and a method for controlling the header’s height based on linear quadratic regulator (LQR) were proposed. The header height was obtained in real time by measuring the inclination angles of the combine body and the inclined conveyor with two inertial sensors. Mathematical model of the header system was established based on the kinematics and the structural analysis of the header. The optimal solution of the header height control was obtained by selecting the performance function to solve the linear quadratic optimal control problem. According to the obtained optimal solution, the hydraulic cylinder was controlled to adjust the header height, so that the header height was stable in the preset range. The simulation results showed that the root mean square error of traditional PID controller was 0. 226° when tracking the step signal with random noise, while the root mean square error of the LQR controller was 0. 133° when tracking the step signal with random noise. Therefore, the dynamic performance of the LQR controller is better than that of the traditional PID, confirming that the proposed method can improve the control quality of header height of a combine harvester.