FLIGHT TESTING FOR SUAV USING LOG ANALYSIS OF LOW COST AUTOPILOT M. Y. Zakaria*, M.A.Hammad†, Moatassem M. Abdallah‡ ABSTRACT: In this paper, we discuss the process of integrating an Autopilot with small Unmanned Aerial Vehicle to perform full Autonomous mission. Unmanned aerial vehicles (UAVs) play an important role in the current military operations in the recent years with its great advantages for autonomous flying capability that provides much less manpower, cost and less risk to human lives. In addition, there are many potential applications for UAVs in civilian environment like photography, agriculture planning and many others. To gain a precise autonomous flying requires many flight-testing and evaluations to decide to use your airframe integrated with the autopilot in your application. Using a low cost Autopilot requires massive analysis in order to analyze recorded data for every flight test in different SUAV modes (Manual, Stabilize and Guided). In this paper, we demonstrate the evaluation for the accuracy and uncertainty of a UAV flight route with respect to the desired mission and the potential accuracy of the UAV performance after tuning PID control gains. Keywords: UAV, Autopilot, PID control Nomenclature: W/S T PWM
Wing loading Thrust Pulse width modulation
Vc a e
Cruise speed Aileron deflection angle Elevator deflection angle
1. Introduction Design and development of UAV system is an awkward and difficult challenge. Today UAVs are finding civilian uses such as environmental monitoring, wildlife population tracking, Wildfire monitoring, border patrol, and even shark spotting (in Australia) [1]. Another important potential use for UAVs includes search and rescue operations. Small UAVs could be rapidly deployed without the need for an airstrip and could quickly begin searching an area for a missing person. Using small UAVs as opposed to full-scale human operated aircraft significantly reduces operating costs and can significantly reduce the time taken to begin search and rescue operations. Depending on the specific UAV being used, the mission endurance can also be far greater. This activity requires pre-flight and post-flight checks to enhance the UAV system performance. Autopilots are systems to guide the UAVs in flight with no assistance from human operators. Autopilots were firstly developed for missiles and later extended to aircrafts and ships since 1910s [4]. Due to the high nonlinearities of the UAV dynamics, many intelligent control * Assistant Lecturer, Aerospace Department, Military Technical College,
[email protected], † PhD candidate, Electrical Engineering, Alazhar University,
[email protected] ‡ PhD, Computer Department, MTC,
[email protected]
1/14
techniques have been used in autopilot systems to guarantee smooth desirable trajectory navigation, such as PID control, neural network (NN), fuzzy logic (FL), sliding mode, and H∞ control. Nowadays, technological advances in wireless networks and micro electromechanical systems (MEMS) make it possible to use the inexpensive micro autopilots on small UAVs [2]. Autopilot hardware system integration on any UAV needs a hard work in selecting a suitable sensors and tuning those sensor outputs to control the UAV with an acceptable error. S. E. Watkins examined the integration of avionics for a search and rescue UAV in 2008, using the Kestrel autopilot manufactured by PROCERUS Technologies [3]. In 2009, Justice Amahah used a controller is based on an ARDUPILOT board which is a custom PCB with an embedded processor (ATMega168) combined with circuitry to switch control between the RC control and the autopilot control [4]. In 2010,YangQuan Chen el al, demonstrates several typical off-the-shelf autopilot packages are compared in terms of sensor packages, observation approaches and controller strengths. Afterwards some open source autopilot systems are compared from physical point of view and introduced as shown in Table 1[5]. Table 1 comparison of physical specifications between small Autopilots
As any Aircraft maintenance group working on any civilian or military aircraft, pre-flight checks must be done before taking a decision to make a required mission. Consequently, Post flight analysis and evaluation for the UAV performance during the flight must be done. Therefore, a huge quantity of data must be monitored and analyzed such as, servo-controlled loops, speed, altitude, battery power consumption and GPS fix. This activity requires precise tools and evaluation methods to analyze the UAV flight parameters. In this paper, we develop a set of data evaluations procedures using MATLAB and C# to give a good insight for the overall sensor performance based on the available information and then assess the performance of flight. The paper organized as follows: Section 2 gives an overview for the tested SUAV platform, autopilot structure and onboard sensors. In section 3, we discuss the preflight checks. Section 4 presents the performance evaluation for our SUAV system. Finally, Section 5 concludes the paper and gives direction for the future work.
2. Small UAS Case study Design steps is performed based on the imposed specifications, the components, including all the subsystems were chosen. Analysis work was fulfilled determining the vehicle weight and size and aerodynamic and stability analysis would enhance the initial layout. The flight tests outcome would be used for further modifications to make the design iteration go on. 2.1 SUAV platform The design and construction of the SUAV was completed in early march 2011[6]. The design constraints based on the required mission legs shown in . 2/14
Figure 1 SUAS Case Study Platform mission legs The selection of the design point is based on several design constraints such as, maximum load in turn, endurance, cruise speed, takeoff distance and stall speed. A matching curve is constructed between wing loading (W/S) and power loading (hp/S) to obtain a feasible design region as shown in
Figure 2 SUAS Design curve A compromise between hp/W and W/S should be found to better matches and optimizes the required mission of the aircraft. The design point gives the matched design values for wing loading and power loading as shown in eq. (8, 9). After selecting the design point, the aerodynamic shape decision is obtained with the propulsion power needed for completing the detail design. The decision was taken for the SUAV to be a back man Tailless flying wing design, powered by a single electric engine, with Pusher arrangement and hand launched as shown in Figure 3.
W 62 N / m2 S hp 0.018hp / N w
3/14
(1) (2)
SUAV Specification Span:120 cm Length: 75 cm Height: 32 cm MTOW: 2.6 kg Range:10 km Endurance:25 min Propeller: 12x6 pusher Battery: LIPO 5000 mAh
Figure 3 SUAS Case Study Platform Specifications 2.2 Low cost Autopilot (Ardupilot-Mega) The autonomous control of the aircraft by the ArduPilot is based on simple displacement type autopilot (Nelson. 1998) shown in Figure 4. Conceptually, the desired roll angle (φdesired) is compared with the measured roll angle (φmeasured). The error (φdiff) is fed into a PID controller to yield a roll command (φcommand) to reduce the error.
Figure 4 Block diagram for autonomous roll and pitch control The microcontroller is the central component, which reads in inputs from pilot’s control, navigation and telemetry. It also holds the autopilot code that executes the control laws and computes the commands. The navigation system will require appropriate instruments that can tell its position and measure its attitude. By tracking the aircraft’s position and maintaining a stable attitude (orientation in roll, pitch and yaw angles), the aircraft can navigate safely from point to point. While tracking these parameters, a telemetry system has to incorporate so that the data is recorded for further analysis. Together with a ground monitoring station (Laptop), a telemetry system allows remote monitoring or measurement. Ardupilot-Mega, is an open source autopilot platform created by DIY Drones. The hardware consists of the core autopilot board and various sensors and accessories that can be added for extra functionality. The board is displayed in Figure 6 after soldering of pins and a few connection cables and the complete flight test system consists of several electronics and sensors components. The hardware consists of two main boards, the ATMega processor board displayed on the left and the sensor shield board displayed in the middle and the two boards assembled to the right as shown in Figure 5.
4/14
Figure 5 Ardupilot-Mega board and sensor shield For our purposes, the flight test system consisted of the microcontroller, the navigation subsystem and the telemetry subsystem shown in Figure 5 [7].
Figure 6 The ArduPilot-Mega board Flight Test System 2.3 Mission Operation Console The Mission Operation Console (MOC) is the central component of the ground control station and serves as the UAV’s sole link to the ground. The MOC performs a number of tasks, including relaying information and commands to and from the UAV, controlling waypoint navigation, and providing the operators with situational awareness. The map display on the MOC shows satellite imagery of the mission area with a number of overlays to increase situational awareness. These overlays include a UAV location and heading marker, UAV ground track, flight plan waypoints, and the no-fly zone. The MOC has the capability of retasking the UAV during the mission by UT Austin UAV Group allowing the operator to add, remove, and modify individual waypoints. A picture of the Mission Planner is shown in Figure 7
5/14
Figure 7 GUI (Mission Planner) for Ardupilot-mega Autopilot
2.4 Fixing Autopilot and sensors onboard UAV In order to get a better understanding of the implemented algorithm, we proceed by describing the control structure implemented in the routine. The control structure considered for stabilizing and navigating the plane is a cascaded structure [8].
Figure 8 Ardupilot-Mega Hardware control structure The autopilot hardware is fixed in the middle bay of the central part of the aircraft. The main board is located in the C.G. in order to get the desired orientation angles precisely as shown in Figure 9.
6/14
Figure 9 Autopilot system fixation on SUAV platform
3. UAV Pre-flight check The following pre-flight check routine is conducted prior to each flight: Check all wire connections for the Autopilot ,GPS , Receiver ,camera and data logger Leveling the airframe with the autopilot Check home position and altitude. Check Altitude accuracy from GPS and Barometric pressure sensor. Calibrate Radio channels (Ch. 1-2 (Elevon), Ch. 3 (Throttle), Ch. 5 (Autopilot control)). Switching form Manual to stabilize and Auto mode and verifying status on GUI display. GPS gives a 3D fix with enough No. of Satellites. Check the change in control surfaces between manual and auto mode. Check the roll, pitch and yaw by rotating the UAV and verify the ailerons and elevator move in the correct direction to compensate for this movement. This is done from the MOC status tab as shown in Figure 10.
Figure 10 Ardupilot-Mega GUI Consol's status check
7/14
4. UAV Post-Flight data evaluations The recorded data are composed of many attributes. The following table details the most important ones. The data samples from the aircraft are packed together and sent in frames via Mavlink communication protocol [9]. MAVLink was first released early 2009 by Lorenz Meier under GPL license. This protocol is extensively tested on the PX4, PIXHAWK, APM and Parrot platforms and serves there as communication backbone for the MCU/IMU communication as well as for Linux processor and ground link communication. 4.1 Communication Data Fields There are two kinds of frames namely the attitude frame and the position frame. The table 1 below shows the data packet sent from the SUAV to the ground station via telemetry before analysis. Table 1 Ardupilot-Mega MAVLINK data attributes UAV Data Types Attitude Global position RC channels Scaled pressure Raw IMU VFR HUD Servo Output PID Gains
Attributes roll , pitch , yaw , roll speed , pitch speed , yaw speed latitude , longitude , alt , relative altitude , velocity in x dir , velocity in y dir, velocity in z dir, heading chan1_raw, chan2_raw, chan3_raw, chan5_raw pressure absolute , difference , temperature xacc , yacc, zacc , xgyro ,ygyro , zgyro , xmag , ymag , zmag airspeed , groundspeed , climb , throttle servo1_raw , servo2_raw , servo3_raw Servo roll, pitch and yaw PID ,Nav roll, pitch and yaw PID ,throttle percentage ,RC trims , RC min and max angle of attack , alt mixture
4.2 UAV Route Tracking Evaluations This first step in the data exploration is very important since it validates the dataset’s integrity by reviewing the SUAV recorded trail is conform to the actual UAV positions, the location of each waypoints is also visually checked as shown in Figure 5 which shows a top view (latitude and longitude) of the recorded positions [10]. The straight line indicates the desired route for the UAV, which can track in a calm weather (Wind < 10 km/h). We have conduct two flight tests with the same airframe, it is clear in Figure 11(a) (Flight-1) shows too much deviation from that planned route lines specially at the loiter waypoints and turns which indicates that a PID gains refinement must be applied to the airframe. After tuning PID while flying at cruse phase in stabilize mode. In Figure 11(b), it is clear that the trail follow the planned route.
8/14
(a)
(b)
Figure 11 Waypoint tracking error evaluation Figure 12, shows SUAV flying from point A to point B and how we can change P, I, and D parameters based on route pattern from UAV attitude during cruise phase in stabilized mode.
Figure 12 PID tuning during flight testing at cruse from point to point To evaluate how much the aircraft follow the desired route for each flight we compute the cross track error, which is the shortest distance between the aircraft's present position and the desired track. Cross track deviation is left when the present position is left of the desired track and right when present position is right of the desired track as shown in Figure 13.
Figure 13 Cross Track Error 9/14
We calculate the cross track error for each flight to evaluate the flight performance for each flight as shown in Figure 14. The average cross track error for flight-1 is 10 meter while for flight-2 is 45 meter, which shows that there is a problem in the aircraft airframe of flight-2. After making a statistical overview for 15 flight made by five different airframes we conclude that the average cross track error for a good airframe with maintained PIDs is 11 meter
Figure 14 Cross Track Error for both flights 4.3 UAV Altitude Evaluation Altitude is a very import parameter in flight planning procedure for flight evaluation. Therefore, the time series of the altitude values over time for both flight one and two displays some artifacts. Figure 15 shows the time series of the recorded altitudes and exhibits strong variation at every WP. This phenomenon is related to the UAV change in direction and the decreasing of its lift. This graph also shows the strong altitude correction, which produces oscillations. In addition, this visualization confirms that too strong actions were performed on the elevator that produces altitude oscillations on flight-2 more than flight-1.Figure 16, shows an altitude average error of 3.5 meter for flight-1 and 16 meter for flight-2.
10/14
Figure 15 Altitude Performance tracing over time for both flights
Figure 16 Altitude Error tracing over time for both flights 4.5 Analysis of turning radius How fast the UAV can change its course at a sustained bank angle was estimated, assuming a steady, level, co-ordinate turn at bank angle 45°. The theoretical turning radius can be calculated based on constant cruise speed, Vc.As shown in Figure 17, To make a 180° change in course in a co-ordinate turn, the distance traversed by the aircraft is half the circumference (πr). The time taken to change its course is approximately the time taken to cover the distance.
11/14
Figure 17 Calculating of theoretical turning radius t
r Vc
r
180 6 30
(3)
6Vc
(4)
In both cases, the aircraft was unable to completely subscribe to a perfect circle or meet the theoretical turning radius. One reason is that, the radius and GPS co-ordinates define launch location. GPS co-ordinates are not precise and as discussed before as the GPS co-ordinates drift in the order of several meters. However, the error of several meters should not result in a turning radius more than two or three times the expected as shown in Figure 18. During flight, the aircraft has to constantly adjust its speed to compensate for change in direction and altitude. Therefore, as the speed changes, the expected flight path will be affected. In addition, the actual velocity of the aircraft is greatly affected by the wind as well. During the test flight, wind speed was about 10 meters per second. This is significant compared to the aircraft speed. The consequence is that the wind direction can cause the aircraft to sideslip, thus changing the instantaneous velocity vector. With significant sideslip, the aircraft will need a longer time and travel a longer distance as illustrated in Figure 18.
Figure 18 Flight path change due to sideslip 4.5 SUAV Control Inputs Evaluation PID controllers are important tools widely used in automation. A simple PID controller attempts to minimize error between the process variable and the set point by adjusting the process control inputs. The proportional (P) gain determines the ratio of output response to error signal. The 12/14
integral (I) gain sums the error over time, while the derivative (D) gain is proportional to the rate of change of the process variable. The common compromise for controllers is the dilemma between speed and stability. Fast control usually leads to oscillations while a stable control is sluggish. Thus, the most common compromise is to adjust the controller so that the response curve has a quarter decay (Tan, Wang & Hang, 1999). Figure 19 and Figure 20 illustrates the control structures for stabilizing and navigation concerning pitch and banking dynamics, respectively.
Figure 19 A block diagram of the pitch angle control structure
Figure 20A block diagram of the banking control structure The control inputs are given in the form of PWM commands that is forward directly to the servos and throttle [11]. The PWM commands need to be converted to a deflection angles, but the mapping between the control input and the deflection angle is not necessary linear ,the following equations (5),(6), describes the relation between them, Aileron Deflection Angle (rad),
a (9.1945 10( 7) )u 2 0.0048u 5.2353 Where, 𝜕𝑎 is the deflection angle in radians and u is the aiteron input
(5)
Elevator Deflection Angle (rad), (6) e (9.1945 10( 7) )u 2 0.0048u 5.2353 Where, 𝜕𝑒 is the deflection angle in radians and u is the elevator input Integrating an autopilot boards with aircraft airframe is not an easy job, for that we have use our flight data analysis tools to check how much the airframe can be stabilized automatically by the autopilot. Figure 21 shows the error difference between the navigation bearing and the target bearing.
13/14
Figure 21 Plotting of the navigation and target bearing 4.6 SUAV Thrust Evaluation The throttle command is also a PWM signal and need to be converted to Newtons .The relation between the PWM and the thrust value is shown in equation (7) T (6.2628 10( 6) pwm 2 ) (0.0287 pwm) 22.6335 (7) By plotting the throttle percentage during various flight modes as shown in Figure 22, the auto pilot controls the throttle value depend on the flight plan.
Figure 22 Throttle percentage during manual and auto flight mode
5. Conclusion and Future work The designed SUAV provided a good platform for the development of a UAV system. Its flight characteristics and physical dimensions meet needed criteria with reasonable constraints. Autopilot and onboard subsystems are key elements in the design. The autopilot promotes UAV usage and provides appropriate communication with the ground station. After the tuning of the control loops is completed, the overall flight performance of the autopilot and aircraft was reasonable and sufficient for the initial testing phase of this SUAS. Several areas still need improvement, primarily the altitude and airspeed tracking control loops in order to engage a parachute flight system for safe recovery. Some of the navigation parameters could benefit from more fine-tuning. With more testing and tuning of the existing configuration, a significant improvement in performance is expected. Overall, the process outlined in this paper, of integrating the Ardupilot-Mega autopilot into the selected airframe, was a success and this systems integration will allow the further development of the SUAV platform to be 14/14
used. Power consumption is another issue worthy to be consided, presently the power rating of the SUAV will last only for several minutes without recharging, especially in transition from mode to mode. It would be great if the power rating of the SUAV could be reasonably increased. The actual turning radius is affected by many factors such as wind speed, wind direction and GPS accuracy, consequently the throttle control gain. Our recommendations for future work would be to include a more sensitive sensor for measuring altitude. For example, barometer and long range ultra-sound sensors can give more precise altitude measurements for landing phase. With improved altitude sensor, the aircraft can conduct a better level turn. A better GPS sensor will also improve location tracking and autonomous navigation performance.
References [1] L. David, “UAVs Seen as Ideal Civilian Research Tools,” Aviation.com, Imaginova, (6 November 2007). Available: http://www.aviation.com/technology/071106-specenewscivilian-usesof- uavs.html. [2] Autopilots for Small Fixed-Wing Unmanned Air Vehicles: A Survey , Chen, Cao, Chao, International Conference on Mechatronics and Automation, August 5 - 8, 2007, Harbin, China [3] UAV Autopilot Integration and Testing, David Erdos, and Steve E. Watkins, Electrical and Computer Engineering, Missouri University of Science and Technology, Rolla, MO 65409-0040. [4] Justice Amahah , The Design of an Unmanned Aerial Vehicle Based on the ArduPilot, [5]Autopilots for Small Unmanned Aerial Vehicles: A Survey, YangQuan Chen, International Journal of Control, Automation, and Systems (2010) 8(1):36-44, DOI 10.1007/s12555010-0105-z [6] “Design and Production of small Tailless Unmanned Aerial Vehicle”, M. Y. Zakaria, Moatassem M. Abdallah, M Adnan Elshafie, 15th International Conference On Applied Mechanics and Mechanical Engineering, May, 29 - 31, 2012. [7] http://www.diydrones.com DIY Drones [8] "The Design of an Unmanned Aerial Vehicle Based on the ArduPilot", Justice Amahah, Georgian Electronic Scientific Journal: Computer Science and Telecommunications 2009, No.5(22) [9] https://pixhawk.ethz.ch/mavlink/ [10] "UAV Autopilot Integration and Testing", David Erdos, and Steve E. Watkins, Electrical and Computer Engineering, Missouri University of Science and Technology, Rolla, 2008. [11] "Hardware-in-the-loop Simulation Design for Evaluation of Unmanned Aerial Vehicle Control Systems", Eric R. Mueller, AIAA Modeling and Simulation Technologies Conference and Exhibit, 20 - 23 August 2007, Hilton Head, South Carolina.
15/14