## 1 Introduction
A nonlinear description and implementation of TECS and a Lyapunov-based update law to estimate the aerodynamic drag coefficient of a UAV, assuming that the structure of the aerodynamic drag is known, were presented in [14]. Moreover, a longitudinal flight control system for UAVs based on TECS using 1 adaptive control theory was proposed in [13]. The fuel efficiency of UAVs is a significant issue that will limit their applications in wide area and long range. A popular solution is to adopt new propulsion systems, such as fuel cell or solar power, but these new systems are expensive and unstable due to the weight and space constraints of UAVs. Therefore, we decided to provide an approach based on flight control theory and flight dynamics. The proposed approach has the ability of the optimization of the fuel consumption and will not increase the cost and weight of UAVs. The goal of this study is to provide an optimal flight control system based TECS for fixed-wing UAVs. We propose an optimal energy control system (OECS) by integrating TECS and LQG regulator [18] to improve the fuel efficiency of UAVs. The successful flight demonstration of a UAV, named Spoonbill, proved that the LQG regulator can be effectively used in the flight control of small UAVs [19]. However, the longitudinal flight controller used previously on Spoonbill UAV for controlling the flight altitude was an altitude-hold controller. As such, it is unable to maintain a required climb/descent rate of the Spoonbill UAV. To overcome this problem, this study presents the development of an energy-based flight control system, in conjunction with optimal control technique, LQG regulator. Finally, the developed control scheme is verified in the hard-in-the-loop (HIL) simulation of Spoonbill UAV. The design steps of the proposed OECS are as follows. First, the energy equations of the model of an aircraft are derived to obtain the total specific energy rate, driven by throttle, and the specific energy distribution rate, driven by elevator. Then, the energy distribution state-space model is obtained by using small-disturbance theory and Taylor's series expansion. Second, the system identification process is executed to identify the unknown system parameters of the discrete time state-space model by using a set of experimental input and output data. Third, the proposed OECS is designed to form the aircraft longitudinal flight control system and to control the airspeed and altitude of an aircraft. The control scheme of inner and outer loops is used. In inner loop, the energy distribution loop is designed based on LQG regulator and responsible to regulate specific energy distribution rate to zero. In the outer loop, total energy loop, a gain scheduling method is adopted and it is responsible for driving the error of total specific energy rate to zero. Gain scheduling approach is applied in this study since it has had great success in a variety of commercial as well as military applications [20]. Finally, the implementation of OECS is validated in the HIL simulation of the target UAV. The remainder of this paper is organized as follows. Section 2 derives the energy equations and state-space model for an aircraft. Section 3 presents the process of determining adequate mathematical model by using the system identification method. Section 4 presents the design and implementation of the proposed OECS. Section 5 shows the simulation results using the HIL system of Spoonbill UAV. Finally, Section 6 gives the conclusions of this study.