Longitudinal Autopilot Controllers Test Platform Hardware in the Loop Sérgio Ronaldo Barros dos Santos
Neusa Maria F. de Oliveira
Department of Applied Electronics Aeronautical Institute of Technology São José dos Campos, Brazil
[email protected]
Department of Applied Electronics Aeronautical Institute of Technology São José dos Campos, Brazil
[email protected]
Abstract—This paper presents the design, simulation and realtime implementation of an aircraft longitudinal control system using a test platform constituted of a dedicated microprocessor and the X-Plane flight simulator. Initially, the concepts of longitudinal motion of a rigid body are studied. The dynamic equations of aircraft were determined using the aerodynamic stability coefficients and the longitudinal derivates. With the aircraft dynamic equation, the altitude and vertical speed continuous controllers were designed using the inner loop pitch attitude and pitch rate feedback and the forward speed controller was designed using an engine throttle model. The continuous controllers designed were discretized. Then, the digital controllers were implemented in the microprocessor. Using the X-Plane flight simulator and the algorithm implemented in the dedicated microprocessor, the digital controllers were tested and validated into the model similar to real aircraft, minimizing risks and increasing flexibility for design changes. Basically, this experimental framework employs the microprocessor running the digital flight controllers to be tested, and a PC running the XPlane flight simulator contained the aircraft to be commanded. These resources are interconnected through data buses in order to exchange information. The interconnection between autopilot hardware and the X-Plane host is made through data communication bus based on network protocol, Uniform Datagram Protocol (UDP) available in both systems. The X-Plane has the built-in capability of transmitting flight parameters and receiving command for aircraft flight control surfaces over Ethernet using UDP. The results show that the developed system structure is appropriate to test the longitudinal controllers. Matlab environment was used to visualize the values of the updates pitch attitude, altitude, vertical and forward speed in graphics plotted in real time. It permites to observe that the designed controllers implemented in experimental framework reaches the specified requirements successfully. Keywords-component; Autopilot Controllers; Longitudinal Dynamics; Hardware in the Loop; X-Plane Flight Simulator.
I.
INTRODUCTION
The development of automatic control systems has played an important role in growth of civil and military aviation. Modern aircraft include a variety of automatic control systems that aid the flight crew in navigation, flight management, and augmenting the stability characteristics of the airplane. Generally, an autopilot system carries out all the control functions that are boring to the pilots like manually maintain
978-1-4244-9493-4/11/$26.00 ©2011 IEEE
the route, heading or altitude, for this reason autopilot are used; it’s only necessary to set the target value of the parameter that pilot wants to maintain and check the flight parameter indicators to verify that everything is going well [1]. Nowadays, more and more automatic control systems are being studied and explored due to the possibility of this system to be used in an Unmanned Aerial Vehicle (UAV). For this reason, an experimental framework was developed to evaluate this type of system [2]. The system presented here differs from traditional autopilot control design method because this system permits to automate the process of aircraft controller design, evaluation, verification and validation through the use of X-Plane Flight Simulator. In this manner the controllers implemented in the hardware can be rapidly reconfigured and optimized before the hardware to be embedded on the vehicle, becoming the development and test of aircraft autopilot controllers easier. This framework will allow researchers to study multiaircraft control algorithms using realistic unmanned and manned aircraft models in real-world modeled environments. From science and academic point of view, aircraft control research and development has the potentials of integrating several science and engineering area such as Embedded System, Real Time System, Sensor Fusion and Integration, Networking (for information dissemination to remote audience from ground control station), Control System (for automatic airframe stabilization and waypoint navigation), etc [3]. In this paper, we present the design and construction of test platform for digital autopilots, as well as a reference design and implementation of a 3-axis autopilot for use with this platform. The test platform consists of a microcontroller board, which hosts the digital autopilot and a PC running the commercial XPlane flight simulator. The two components are interfaced via Ethernet, using UDP. With this set-up, autopilot prototypes can be tested with X-Plane’s sophisticated flight and atmospheric models. II.
PRINCIPLES OF THE FLIGHT
All aircraft are governed by the same basic principles of flight control, whether the vehicle is the most sophisticated high-performance fighter or the simplest model aircraft. The motion of an aircraft is defined by translational motion and
rotational motion around a fixed set of pre-determined axes [4]. Translational motion is the one by which a vehicle travels from one point to another in space. For an orthodox aircraft there is only one direction in which translational motion occurs, that is the direction in which the aircraft is flying which is also the direction in which it is pointing. The rotational motion relates to the motion of the aircraft around three defined axes, pitch, roll and yaw [4].
− Zu − Mu
Δu Δw Δθ + (s − Z w ) − u0 s = Zδ Δδ Δδ Δδ
(
)
Δu Δw Δθ − (M w s + M w ) + s s − Mq = Mδ Δδ Δδ Δδ
(6) (7)
It is important to note that Δδ represents the elevator deflection or throttle setting. These equations can be solved by means of Crammer’s rule to find Δu / Δδ , Δθ / Δδ and Δw / Δδ , as follows [1, 4, 5]. s − Xu − Zu − Mu Δθ = Δδ e s − Xu − Zu − Mu
Figure 1. Body axis coordinate system [5].
Fig. 1 shows the direction of aircraft velocity vector in relation to the pitch, roll and yaw axes. For most of the flight an aircraft will be flying straight and level and velocity vector will be parallel with the surface of earth and proceeding upon a heading that the pilot has chosen. III.
LONGITUDINAL DYNAMICS
The longitudinal equations of motion were described by a set of linear differential equations. A very useful concept in analysis and design of control system is the transfer function. In the case of dynamics it specifies the relationship between the motion variables and the control input [1, 5]. The longitudinal transfer functions can be obtained from the equation of motion in the following manner. First, we simplify the equations of motion by assuming that: θ 0 = 0 → cos θ 0 = 1 and sin θ 0 = 0
(1)
Incorporating these assumptions yields the following set of longitudinal differential equations [1, 4, 5]: ⎞ ⎛d ⎜ − X u ⎟Δu − X wΔw + gΔθ = X δ Δδ ⎠ ⎝ dt
(2)
d ⎞ ⎛d − Zu Δu + ⎜ − Z w ⎟Δw − u0 Δθ = Zδ Δδ dt dt ⎠ ⎝
(3)
d d ⎛d ⎞ ⎞ ⎛ − M u Δu − ⎜ M w + M w ⎟Δw + ⎜ − M q ⎟Δθ = M δ Δδ dt dt ⎝ dt ⎠ ⎠ ⎝
(4)
If we take the Laplace transformation of the equations and then divide by the control deflection we can find the transfer functions Δu / Δδ , Δθ / Δδ and Δw / Δδ .
(s − X u ) Δu Δδ
− Xw
Δw Δθ +g = Xδ Δδ Δδ
(5)
−X w s − Zw
Xδ Zδ
(M w s + M w )
Mδ
− Xw
g
s − Zw
− u0 s
(
− (M w s + M w ) s s − M q
(8)
)
Expressions for Δu / ΔδT and Δw / Δδ e can be found in a similar way. Equations (9) , (10) and (11) represents the pitch angle to elevator deflection, the forward speed to throttle setting and the vertical speed to elevator deflection linearized transfer function of a Boeing 747 – 400. − 1.69144 s 2 − 0.84341s − 0.0099096 Δθ = (9) Δδ e s 4 + 1.17103s 3 + 1.55405s 2 + 0.012538s + 0.0072771
− 25.2981s 3 − 1117.851s 2 − 7.3424 s − 6.0159 Δw = (10) 4 Δδ e s + 1.17103s 3 + 1.55405s 2 + 0.012538s + 0.0072771
0.0033s 3 + 0.0030 s 2 + 0.0016 s − 0.0002 Δu = ΔδT 228.5 s 4 + 217.2 s 3 + 141.96 s 2 + 6.043s + 3.815
(11)
Altitude hold is an important mode in longitudinal autopilot systems. To control altitude is the same as controlling rate of climb (or rate of descent). By commanding zero climb rate, altitude will be kept constant. In most airplanes altitude is controlled with the elevator [5]. To examine the altitude hold control system we need to find the transfer function Δh / Δδ e . We can obtain the desired transfer function using the Equation (12). Δh Δw / u0 ⎤ u ⎡ Δθ = 0⎢ − ⎥ s ⎢⎣ Δδ e Δδ e Δδ e ⎥⎦
(12)
With a steady state speed of 673 ft/s, the altitude transfer function was obtained as shows the Equation (13). 25.2981s 3 − 20.4054 s 2 − 560.2052s − 0.6557 Δh = (13) Δδ e s 5 + 1.17103s4 + 1.55405s 3 + 0.012538s 2 + 0.0072771s
Typical for this type of aircraft, Boeing 747-400, the elevator and throttle servo transfer function can be represented
as a first-order lag. The used elevator and thorttle servo tranfer function are respectively [5]: δe
10 s + 10
(14)
20 = e s + 20
(15)
e
=
δT
To model the engine, it was assumed a 0.5 radian throttle movement from the approach thrust setting, the engine-tothrottle gain is equal the KT = 234.85 lbs/rad. Also it will be assumed that the engines have a spool–up time constant of 5 seconds. This gives the first order lag model for engine a break frequency of 0.2 rad/s [5]. Therefore, the engine model is given in Equation (16). ΔT 0.2 = 234.85 δT s + 0.2
IV.
(16)
altitude. The pilot must therefore make sure that the throttle setting is adequate at all times in order to prevent the airplane from becoming too slow during elevator-only altitude changes [6]. The altitude of an airplane can be maintained by an altitude hold autopilot. Basically the autopilot is constructed to minimize the deviation between the actual altitude and the desired altitude. The actual altitude is obtained from the airplane’s altimeter [3]. To calculate the altitude controller was necessary to modify the altitude transfer function Δh / Δδ e , Eq.(12), shown previous to Δh / Δθ , using the Equation (17). h( s )
θ( s )
=
Δh Δδ e Δδ e Δθ
(17)
A simplified altitude hold autopilot is shown in Fig. 3.
AUTOPILOT CONTROLLERS DESIGN
Basically, the longitudinal control consists of four control loops; pitch attitude, altitude, vertical speed and forward speed. In a pitch attitude autopilot, the pitch angle is compared with the desired pitch angle to create an error angle. The difference or error in pitch attitude is used by a proportional controller to produce a control signal for the elevator servo, so that the error signal is reduced [4]. Fig. 2 shows the block diagram of pitch attitude control with pitch rate feedback [3]. Figure 3. Boeing 747-400 altitude control system
The vertical speed controller’s input is the difference between the desired vertical speed and the actual current vertical speed of the aircraft. The actual vertical speed of the aircraft is obtained by differentiating the altitude reading and then performing a proper scaling. As the altitude control loop, the vertical speed transfer function Δw / Δδ e should be modified to Δw / Δθ [3], using the Equation (18). w( s )
θ( s ) Figure 2. Boeing 747-400 pitch attitude control system
=
Δw Δδ e Δδ e Δθ
Fig. 4 shows the vertical speed autopilot.
In the inner loop the pitch rate is measured by a rate gyro and feedback to be added with the error signal generated by the difference in pitch attitude. Altitude and vertical speed control both involve controlling the airplane’s longitudinal motion. The airplane’s vertical movement is controlled mainly by the engine throttle. Increasing the throttle setting will generally cause the airplane to climb, while decreasing the throttle setting will cause it to descend. It is also possible that, given an adequate throttle setting, the pitch angle due to an elevator moviment be used to cause a change in the vertical movement. A simple elevatoronly change may also be used without a change in throttle setting for small altitude changes. Using only the elevator for altitude control results in a fast response, trading airspeed for
Figure 4. Boeing 747-400 vertical speed control system
(18)
The forward speed of an airplane can be controlled by changing the trust produced by the propulsion system. The function of the control system is to maintain some desired flight speed [4, 5]. The forward speed autopilot is shown in Fig. 5.
actuator modeling while communicating in real time with the longitudinal autopilot hardware. HIL simulation can be used to test the longitudinal autopilot hardware reliability, test the closed loop performance of the overall system and tuning the control parameter. By rigorous testing in the HIL simulator, the risk in the field trial can be minimized [3, 7]. The HIL simulator consists of four parts; sensors, actuators, process and embedded system. The sensors simulate the sensor's output data in the airframe. This data will be processed by the longitudinal autopilot hardware as input. The sensor output data that should be produced by X-Plane Flight Simulator are position data (speeds and altitude) and attitude data (pitch). This can be accomplished by reading data from the simulator [3].
Figure 5. Boeing 747-400 forward speed control system
In order to implement the continuous controllers discussed in software, they must be converted to approximate digital systems applying some discrete technique [6]. Then the digital controllers implemented in the test platform were tested and validated using the software and hardware architecture proposed. The Bilinear transform was chosen for our autopilot since it is easier to calculate [6]. The transformation simply involves making the substitution shown in Equation (19) in the controller transfer function. The sample period used was 50ms. s=
2 1 − z −1 T 1 + z −1
(19)
After making this substitution, the difference equation describing each controller can be read off from the discrete transfer function in z. It should be noted that due to the dependence on T, a change in the sample period requires recalculating the coefficients of the difference equation. V.
HARDWARE IN THE LOOP SIMULATOR
Hardware in the loop (HIL) simulator simulates a process such that the input and output signals show the same timedependent values as the real dynamically operating components. This makes it possible to test the final embedded system under real working conditions, with different working loads and in critical or dangerous situations.
Figure 6. Experimental framework block diagram
The Hardware in the loop system developed has the ability to simulate aircraft flight characteristic, sensor modeling and
Figure 7. Hardware in the Loop Simulator
The actuators simulate how the longitudinal autopilot hardware can change the surface control of the airframe (elevator and throttle setting). In real world application this will be done by controlling the servos put in the corresponding control surface or throttle engine. In HIL simulator this is done by writing data to the X-Plane Flight Simulator that will affect the control surface of the simulated airframe [3]. The process simulates how the airframe will react to the input (elevator and throttle command) given by the longitudinal autopilot hardware. So basically this part is where we should put the system dynamic model (transfer function). Generally this is the most complex part of the Flight Simulator, but fortunately this part is already provided by the X-Plane (using its blade element approach) [3]. Finally, the embedded system running the digital autopilot controllers used to control the aircraft. Longitudinal control is used to hold the aircraft stable along the longitudinal axis. The digital controllers of forward and vertical speed and altitude hold are implemented in digital processor as the longitudinal control. The speed control uses the current forward speed from the sensor and a PID digital controller to form the control command which is sent to the throttle servo of virtual aircraft. In addition, the altitude hold and vertical speed uses the current altitude and vertical speed from the sensor and two PID digital controllers, respectively. So the outputs are used in the pitch attitude loop to form the control command which is sent to the elevator servo [3]. VI.
X-PLANE FLGHT SIMULATOR
The chosen simulation software for HIL simulator development is X-Plane, given its realistic flight and
atmospheric model and its built-in capability to exchange flight parameters with external applications, via a variety of protocols available for personal computers. In addition, X-Plane includes an easy-to-use program for creating one’s own aircraft model. This provides builders of autonomous aircraft the ability to quickly create an X-Plane model of their aircraft for use with the platform. The physics model is based on a process called Blade Element Theory, which involves breaking the aircraft down into many small elements (areas) and then finding the forces on each little element many times per second. These forces are converted into accelerations which are then integrated to velocities and positions. Factors such as drag coefficients are then calculated at each one of these areas to ensure the entire plane is being affected in some way by external forces. It also results in extremely precise physical properties that can be computed very quickly during flight, ultimately resulting in a much more realistic flight model. The X-Plane accuracy of the flight model is already approved by Federal Aviation Administration (FAA), for full motion simulator to train commercial airline pilot [3]. Boeing 747-400 is a well known aircraft with a lot of references on its performances, which is the default aircraft on the X-Plane Fight simulator. Based on those natures, this aircraft is chosen to be subject on this work.
While for accessing the data output there are four different ways, to write an input data there is just one way that is already provided by X-Plane flight Simulator, through the internet connection by UDP protocol. Besides of the mentioned method, the X-Plane also use defined plug-in to access more deeply inside the simulator. The plug-in method would not be discussed on this paper. X-Plane is able to send or receive up to 99.9 data packets per second via UDP. Each data package may be configured to carry aircraft parameters data that are selected on X-Plane Data Input and Output window [8]. The X-Plane input or output data package follows a pattern shown on Fig. 10.
Figure 10. X-Plane data package.
Basically, it is composed by a sequence of bytes that need to be properly interpreted. X-Plane uses single precision floating point format data. This means that each valid value transmitted or received utilize four bytes. The first four bytes of the packet shown on Fig. 10 represents the characters “DATA” used to indicate that this is a data packet. The fifth byte is an internal code (I). The next four bytes represent the parameter label (L1,L2,L3,L4). Following there are 5 sets of 4 bytes (B11,B12,B13,B14 to B51,B52,B53,B54) representing the data itself in single precision floating point. Taking each set of 4 bytes, the first bit is the sign bit. It tells whether the number is positive or negative. The next 8 bits are the biased exponent. The remaining 23 bits represents the mantissa [8]. VII. IMPLEMENTATION
Figure 8. Boeing 747-400
The X-Plane Flight Simulator has four methods to obtain the flight data, which are by screen visualization on simulator during the flight, by graphic display in “Data See” tab on simulator, by generating a text file saved in X-Plane directory and by send the data through internet via UDP [8]. There are a total of 124 flight data, accessible by choosing one of four methods on the “Setting / Data Input & Output” window on simulator. In Fig. 3 this window is illustrated.
Figure 9. Data Input and Output
In the case of aircraft autopilot system development, a HIL simulator can be developed to simulate the flight characteristic of the airframe including the sensor output and the control input signal. The aircraft autopilot system can be installed with the HIL simulator to see how the overall system works as a closed loop system. Here we can tune the PID gain parameter as well as the other system parameter and watch the effect to the airframe in the HIL simulator [3]. The first goal was to create a platform on which digital autopilots can be implemented, tested, evaluated and validated [3], as illustrated in Fig. 11.
Figure 11. Hardware in the loop Architecture.
The second goal was to design an autopilot for Boeing 747400, and then implement and test it on the platform. We chose to create a 3-axis autopilot consisting of an altitude hold, vertical and forward speed and pitch attitude controllers. The purpose of the altitude and vertical speed controllers is to cause the airplane to climb or descend at a desired vertical speed until a desired target altitude is reached and then keep the airplane at this altitude until a new command is issued. The forward speed controller is used to maintain desired flight speed [3]. This is accomplished by changing the engine throttle setting to increasing and decrease the thrust produced by the propulsion system. Fig. 12 shows the architecture of developed system.
UDP packets from X-Plane, extracts flight parameters from it, and passes these on to the autopilot routine, which calculates the control inputs for the next time step. It then assembles control inputs from the autopilot into a UDP packet and sends that to X-Plane. This process then repeats with the arrival of the next packet [3, 8]. Fig. 13 shows the experimental framework developed to test, to verify and to validate the digital autopilot controllers.
Figure 13. Autopilot test platform developed. Figure 12. Longitudinal Autopilot Controllers Architecture.
The microcontroller chosen should be programmable in the standard C language. So, we initially proposed using a Cypress Semiconductor CY8C29466 PSoC family because of our past experience with this architecture and its solid C compiler. However, it was lacking the digital Input/Output capabilities to allow a timely implementation of the connection to X-Plane. Instead, we chose the Rabbit 2000 TCP/IP development kit CProgrammable Microcontroller Module. The mainly components of the hardware Rabbit 2000 TCP/IP development kit are: Microprocessor Rabbit 2000 operating in 18.4 Mhz, flash memory of 256 kbytes, SRAM data memory of 128 kbytes, Ethernet port 10BaseT, serial port RS - 232 and RS 485, real time clock, 4 digital input, 4 digital output, 7 timers of 8 bits, watchdog and size of 11 cm x 12 cm. The microprocessor Rabbit 2000 has two options of the Integrated Development Environment (IDE), the dynamic C tool distributed by Rabbit and the WinIDE tool of Softools. These tools use C language and a debugger to the program verification, however these tools does not emulate the programs. The availability of onboard Ethernet makes it possible to communicate with X-Plane Flight Simulator using the UDP (Uniform Datagram Protocol) [3, 7]. The interconnection between dedicated hardware and the X-Plane flight simulator is made through data communication bus based on network protocol, Ethernet communication module (TCP/IP) and Uniform Datagram Protocol (UDP) available in both systems. The X-Plane has the built-in capability of transmitting flight parameters at a set interval over Ethernet using UDP (Uniform Datagram Protocol). UDP is well suited for our purpose because it has low overhead. Similarly, X-Plane accepts UDP packets sent to it for modifying X-Plane flight parameters, or any other exportable variable. The interface algorithm on the test platform receives
The HIL simulator also can be utilized to: •
Develop the Ground Control Station Software for Unmanned Aerial Vehicle (UAV).
•
Refine the algorithm implementation simulated closed loop tests.
•
Refine the hardware implementation through autopilot controller’s long run reliability test.
•
PID gain tunning, and
•
This test platform can be easier modified to implement, to test and to validate Lateral autopilot controllers.
through
The use of this platform in UAVs development is very appropriate since; in general, we do not have the mathematical model of the UAV (airframe transfer function). The visualization and data evaluation of digital controllers implemented in test platform are provided via a graphical user interface in the Matlab environment. The altitude, vertical speed, forward speed and pitch angle response to desired change of X-Plane’s aircraft controlled by digital autopilot designed is compared with the same parameters responses obtained from the MATLAB/SIMULINK simulation. VIII. RESULTS In this section, we present the results obtained using the structure proposed in Fig. 12. First of all, some conditions were established: the Boeing 747-400 in straight and level flight condition, with vertical speed and pitch angle nearly zero and forward speed of 398 knot, is commanded to change its altitude to a desired altitude, assuming that hdesired > hactual. In an ideal world, with system responding instantaneously and with perfect controllers, the expected response of the
aircraft altitude (h) would be like in Fig. 14. It represents graphically the behavior of this parameter, showing the condition of vertical speed (Vs), forward speed (Fs) and pitch attitude angle (θ) during the simulation of control system.
Figure 17. Forward speed of Boeing 747-400 dynamic model.
Figure 14. Aircraft altitude changes in ideal world.
Figure 18. Vertical speed of Boeing 747-400 dynamic model.
Fig. 15 shows the MATLAB/SIMULINK model of the longitudinal autopilot developed to Boeing 747-400.
Figure 19. Altitude of Boeing 747-400 dynamic model.
Figure 15. Longitudinal control loop for Boeing 747-400.
The switches shown are used to switch between the vertical speed and altitude controllers. The switch from the vertical speed to altitude controller occurs 50 feet from the target altitude. Saturation blocks were added to limit the commanded pitch to +/- 5 degrees, and commanded elevator deflection to +/- 10 degrees for safety. The commanded throttle setting was saturated between 30 and 80 percent of value maximum. To altitude control was used a PID controller. The vertical speed controller is similar in structure. There is a switch to prevent the integrator from saturating before the altitude controller is switched. Figures 16, 17, 18 and 19 show the response of longitudinal autopilot for MATLAB/SIMULINK model.
Figure 16. Pitch attitude angle of Boeing 747-400 dynamic model.
The autopilot makes changes to vertical speed and altitude by changing the pitch angle after the engine thrust to be controlled. Thus, we have at the heart of the longitudinal control the pitch controller. It controls the elevator angle to achieve a desired reference pitch angle. The user/pilot doesn’t have the ability to command pitch directly using the pitch controller. It is merely used as an inner loop for the vertical speed and altitude controllers. During a climb or descent, the vertical speed controller will switch over to the altitude controller when the actual altitude gets close to the target altitude. There is considerable flexibility in defining the specifications for an autopilot. The specifications were set by considering practicality, airplane vertical separation practices, and aircraft performance. The average vertical speed tolerance listed assumes a desired vertical speed of 1000 feet per minute, the standard rate for most aircraft. Figures 20, 21, 22 and 23 show the response of digital autopilot for the Boeing 747-400 available in X-Plane Flight simulator.
Figure 20. Pitch attitude angle of X-Plane’s Boeing 747-400.
The forward speed was adjusted to 398 knot in both cases. In SIMULINK model was obtained a good response, and for digital autopilot using the X-Plane’s Boeing 747-400 was obtained an oscillatory response. However, this response remains around the desired value.
Figure 21. Forward speed of X-Plane’s Boeing 747-400.
(a)
(b)
Figure 24. Climb rate and straight and level flight. Figure 22. Vertical speed of X-Plane’s Boeing 747-400.
Fig.24 (a) shows the Boeing 747-400 during the climbing and in (b) shows the straight and level flight after the aircraft has reached the desired altitude. IX.
Figure 23. Altitude of X-Plane’s Boeing 747-400.
The autopilot was tested by comparing the altitude of the X-Plane’s aircraft controlled by the digital autopilot to the desired altitude. It is also compared to the expected theoretical response obtained from the MATLAB/SIMULINK simulation using the linearized model. Other variables were also compared. These include vertical velocity, forward velocity and pitch angle. The altitude profile for a climb from 1000 feet to 5000 feet is obtained. The responses from X-Plane and SIMULINK are compared. The two responses look very similar, and it is clear that the autopilot is functional. There are some small differences; however, the most prominent difference is the presence of some slight oscillations in the X-Plane response. Overall, the altitude profile is not affected much by the pitch and vertical speed during the climb of aircraft. The additional parameters response such as pitch, Fig. 20, forward speed, Fig. 21 and vertical speed, Fig. 22, are showed. It’s quite obvious that the pitch and, as a result, the vertical speed from X-Plane has relatively large oscillations compared to the SIMULINK results. These oscillations can be caused due to inadequate damping of the discrete pitch controller. In order to get an adequately damped response using the discrete approximation of the continuous controller, the sample rate should be at least 20 times as large as the bandwidth. The difference equations can be easily updated to reflect the new sample rate, and the oscillatory behavior is expected to disappear.
CONCLUSION
The utilization of HIL simulator in the longitudinal controllers design is proved to be very valuable. It enables the developer to test many aspects of the aircraft autopilot hardware, finding the problem, refine the firmware, test the reliability, fine tune system parameter, and many others. Also it is demonstrated that it is possible to design an autopilot system using Matlab/SIMULINK, implement it on the platform in the standard C language, and find that it performs using XPlane’s aircraft as expected. The small size and large number of connectivity options of the Rabbit makes it possible to remove it from the platform and use it in an actual aircraft without having to rewrite the autopilot code. X. [1] [2]
[3]
[4] [5] [6]
[7]
[8]
REFERENCES
Nelson, R. C., “Flight Stability and Automatic Control,” 2nd ed., McGraw-Hill, 1998. Turkoglu, K.,” PID Parameter Optimization of an UAV Longitudinal Flight Control System,” Engineering and Technology Volume 35, Istanbul - Turkey, november 2008. Santos S. R. B., “Arquitetura de um Piloto Automático Longitudinal “ Hardware in the Loop” com o simulador de vôo X-Plane,” Tese de Mestrado, Instituto Tecnologico de Aeronautica, SJC, 2009. Blakelock, J. H., “ Automatic control of Aircraft and Missiles,” 2nd ed., John Wiley & Sons ,1991. Roskam, J., “Airplane Flight Dynamics and Automatic Flight Controls,” Design, Analysis and Research Corporation, 2001. Frutiger, M., Kim C., “Digital Autopilot Test Platform with Reference Design and Implementation of a 2-Axis Autopilot for Small Airplanes,” Departament of Electrical and Computer Enginnering, University of illinois, 2003. Santos, S.R.B., Oliveira, N.M.F., ”Testbed for Controllers of Longitudinal Movements of aircraft,” 20th International Congress of Mechanical Engineering, Gramdo, RS, 2009. Ribeiro, L.R., Oliveira, N.M.F., “UAV Autopilot Controllers Test Platform using MATLAB/SIMUlLINk and X-Plane,” 40th ASEE/IEEE Frontiers in Education Conference, DC, USA, 2010.