Flight Control System Onboard Embedded Software for Small Unmanned Aerial Vehicles

Applied Mechanics and Materials Vols. 20-23 (2010) pp 1528-1533 Online available since 2010/Jan/12 at www.scientific.net © (2010) Trans Tech Publicati...
Author: Eileen Reynolds
2 downloads 0 Views 288KB Size
Applied Mechanics and Materials Vols. 20-23 (2010) pp 1528-1533 Online available since 2010/Jan/12 at www.scientific.net © (2010) Trans Tech Publications, Switzerland doi:10.4028/www.scientific.net/AMM.20-23.1528

Flight Control System Onboard Embedded Software for Small Unmanned Aerial Vehicles RAO Jin Juna, GAO Tong Yueb, JIANG Zhenc and GONG Zhen Bangd Department of Precision Mechanical Engineering, Shanghai University No.149, Yanchang Rd., 200072 Shanghai, China a

[email protected], [email protected], [email protected], [email protected]

Keywords: Flight control system, software, small unmanned aerial vehicles.

Abstract. The onboard software of the flight control system (FCS) plays important role for small unmanned aerial vehicles’ performance. In this paper, the characteristics difficulties of the FCS software are analyzed firstly, then the compositions of the software are introduced using HIPO method. A genetic architecture of onboard software is presented to coordinate and organize the software and function modules, and an unique task scheduling strategy is designed and applied to realize multi-task processing. Finally, on the basis of the elementary operation procedure of the software, the flight experiment is implemented, and the feasibility and reliability of the onboard software is validated. 1 Introduction Small fixed-wing Unmanned Aerial Vehicles (SUAV) are aerial vehicles with wingspan of 80~200cm. SUAVs outperform UAVs (generally with wingspan >3m) in low cost, portability and flight ground for taking off and landing. Besides, SUAVs have remarkable higher promotions in payload and wind-resistance than micro aerial vehicles (MAVs). Obviously, SUAVs will play important role in military and civil application, especially application in low altitude, for example, under 150m, where the operations of manned air vehicles are more dangerous [1]. Autonomous SUAVs working in this space are expected to gather close view, sound, toxic gas information and other sensing data by using measuring equipment. We are engaged in studying a SUAV. And our goal is to develop a robotic SUAV with significant level of autonomy, especially in cruise and mission phases of its operation for disaster information gathering. However, the onboard software of SUAVs is very complex. In order to overcome this obstacle, the composition, architecture, task scheduling and the operation procedure of the flight control system (FCS) onboard embedded software of the autonomous SUAV are studied and developed. 2 Flight Control System Onboard Hardware The onboard hardware is the basis of the onboard FCS software of the SUAV. Small, light and low power consuming hardware is required for SUAV. The onboard hardware consists of a set of sensors, processor and data link. 1) Sensors. A GPS receiver capable of providing 4Hz positioning data is used. An Attitude and Heading Reference System (AHRS), that provides the SUAV’s heading (yaw), pitch and roll angles, is opted. The angle rates of these three Euler angle can be output by option. Besides, an altimeter and a speedometer, both based on silicon piezoresistive pressure sensors, are used for helpful environment information. For safety consideration, the battery status information is detected, too. 2) Processor. We opted for a mixed-signal System-on-a-Chip processor, featured in high speed (up to 100 MIPS) and integrated with plenty of the necessary communication ports. This processor processes flight control and navigation. And the embedded software is stored and run in this processor. For safety reasons, and to enable a mixed manual/automatic control, another processor for

All rights reserved. No part of contents of this paper may be reproduced or transmitted in any form or by any means without the written permission of TTP, www.ttp.net. (ID: 130.203.136.75, Pennsylvania State University, University Park, United States of America-05/06/14,02:18:55)

Applied Mechanics and Materials Vols. 20-23

1529

servos control is used, and it works in coordination with an analog switch to switch between remote control and autonomous control. Two processors communicate via SPI bus. 3) Data link. The digital data link is used to transmit flight data and commands data between the ground and onboard stations. The above hardware is necessary for autonomous flight control and navigation. To recover the limitation of bandwidth of the data link and avoid possible loss of flight data, a nonvolatile SRAM (NVSRAM) is equipped in the onboard system to record all interested data in a high frequency. The onboard hardware architecture is sketched in Fig. 1, where the various formats of information exchanges between the instruments are shown, also. AHRS

A/D

Battery status

Onboard Hardware of SUAV

I/O

PWM

Speedometer

Nonvolatile SRAM

GPS

RS-232

Altimeter

Flight Processor

SPI

Analog switch

Servo Processor

Aileron servo Elevator servo PWM

PWM

RS-232 Data link (communication with ground station)

Throttle servo Rudder servo

RC receiver (remote control signal from operator)

Fig.1. The hardware structure of onboard flight control system of SUAV 3 Flight Control System Onboard Embedded Software 3.1 Features of Onboard Software. The FCS onboard software of SUAV is featured in following aspects: 1) Couple with Hardware. The onboard software couple with hardware tightly embody not only in speed and performance, but also in software design, including initiation of hardware, pins and function parts configuration, computation resource distribution, size of software code and RAM. 2) Multi-task Parallel Processing. Possible multiple tasks including: a) multiple sensors data collecting and sensors fault diagnosis, b) ground commands response, c) flight control law computation. Obviously, the processor of the onboard system is often in multi-task occurring status. So the software should be capable of high efficient multi-task processing, task scheduling, synchronization, mutually exclusion and communication. 3) Strong Real-time Processing. Besides performance of processor, the response time of the onboard system is dependent on the approach of interrupt priority arrangement and interrupt service routines (ISR) scheduling. Evidently, timing design of the software is as the same important as functional design. The response of the software should be not only right but also timely. 4) Plentiful Codes and Complicated Structure. In order to realize the required functions, the code size of the onboard system software will be up to tens or even hundreds of thousands lines. Besides, the interfaces between processor and peripheral equipment are diversity. It’s very hard to scheme out a structure to organize plenty of function modules. 5) High Reliability. Probability of system breakdown increases due to the complication of the software and hardware of onboard system. And heavy loss will be caused in case of the software fault, because the flight control and navigation system, the platform and the task payload are always costly. But generally it’s impossible to modify software in flight. These facts demand high reliability of the onboard system software. These featured indicate that it is very difficult to realize stable, reliable and efficient onboard software.

1530

Information Technology for Manufacturing Systems

3.2 Composition of Onboard Software. Using Hierarchy/ Input/Process/Output (HIPO) [2], one of the graphics tool methods of software engineering, the FCS onboard embedded software of SUAV can be divided into nine parts roughly as shown in Fig.2. Part A consists of ISRs for Universal Asynchronous Receiver Transmitter (UART), PWM, ADC and Timers, these signals need be processed quickly. Onboard Embedded Software of SUAV

Strong Real-time I/O Signal Processing A

NVSRAM Reading and Writing E

Common Real-time I/O Signal Preocessing B

Flight Control Mode Switch F

Flight ControlG

Digital Filter and Data Fusion C

Navigation Strategy H

Test and Fault Diagnosis D

Management and Scheduling I

Fig.2. The composition of the onboard embedded software of SUAV Part B consists of routines that check the integrality of data frames from UARTs firstly, then analyze and comprehend data frames, finally get the information from the frames and implement subsequent processing. In Part C, high accuracy attitude and position of SUAV are obtained from the sensors information using a data fusion algorithm basing Kalman Filter. In Part D, the sensors, servos and some special circuit can be tested, and the reasons of fault can be analyzed. In maintain status of SUAV, all modules in this part work. But in flight only GPS is test, since it might fail to fix when in bad weather or in the palace sheltered from signal of GPS satellite. The functions relevant to NVSRAM operation are in Part E. Much information, including flight data, control parameters, waypoints, point of taking off and the initial information of sensors, are all can be read from and written to NVSRAM. The flight mode is monitoring in Part F. Once the SUAV is switched from remote control mode to autonomous control mode, the flight status will be transited smoothly avoiding impact of flight attitude. Part G is one of the kernel parts of the onboard software. In this part, the flight attitude, velocity, altitude, trajectory tracking, etc., are controlled via the servos of aileron, elevator, throttle and rudder of SUAV. In Part H the navigation strategy is determined according current flight status and flight task. The navigation data, including error of yaw angle, distance to task waypoint, lateral distance to the task trajectory, etc., are figured out in this part. In Part I, the complex software parts and modules are organized and coordinated in a suitable method. 3.3 Architecture of Onboard Software. In order to describe and comprehend the FCS onboard software, a generic architecture of the onboard software is presented, as shown in Fig. 3. This architecture organizes all software modules, it includes 4 levels from bottom to up: 1) Processor support Level. This level consists of routines for high speed response to strong real-time signal, and these routines always are related to hardware, for example, ISR, processor I/O pin operation. 2) Function Level. This level consists of function modules about input/output. In other word, this level apperceives the status of SUAV and transports feedback control to servos. The modules in this level are of good encapsulation and portability, because they are independence on hardware. 3) Execution Control Level. In this level flight fault are tested and diagnosed, and the control strategy and algorithms are implement.

Applied Mechanics and Materials Vols. 20-23

1531

4) Decision Level. Based on perception of flight status, the flight mode is judged and switched in this level, and the navigation strategy is determined, and navigation computation is implemented. This software architecture of onboard system is of good performance in extensibility, maintainability and portability [3]. Through this architecture, both efficiency and quality of software of SUAV are promoted remarkably. Decision Level

Flight Mode, Navigation Strategy

Execution Control Level

Flight Control, Test, Diagnosis

Status

Dicision

Perception

Control

Servos

RC receiver

Altimeter

Speedometer

AHRS

voltmeter

ISR, Direct Hardware Operation

Temperature

Processor Support Level

Data link

Function Level

GPS

Sensors and Effectors Interface

Module

Logical sytem

Physical System

Fig.3. The generic architecture of the onboard software of SUAV 3.4 Task Scheduling of Onboard Software. Multi-tasks are processed for onboard software. The nature of task scheduling is to arrange computation resource, and the computing time restriction is the key factor for real-time FCS. Business real-time operation system, such as VxWorks, PSOS and QNX, are developed and used for real-time multi-task processing. But these system are expensive and hard to expand and transplant to object system [4]. The open resource systems, such as RTLinux and μC OS-II, have small core and easy to transplant, so more and more systems opt these system. Though much coding workload of task scheduling can be saved using μC OS-II, however some adverseness is also obvious [5]: 1) It’s time consuming to copy the hardware stack to simulation stack when task switching, and the time consuming will be aggravated when tasks switch in high frequency; 2) The time and content of stack are stochastic, so consumed time for stacking are different and the real-time performance are affected. For these reasons, μC OS-II is not used in our system, and an unique task scheduling strategy is developed for FCS of SUAV. As shown in Fig. 4, this task scheduling strategy combines priority level base scheduling, timer driving scheduling and polling based scheduling. Priority Level Based Scheduling PCA0: UART0:

CEX0 CEX1 RX0 TX0

Timer3:scheduling timer

Polling Based Scheduling Timer Driving Scheduling Control Data Output trigger ADC0 trigger

ADC0:

8 Channel

ADC2 trigger

ADC2:

3 Channel

UART1:

RX1

Filter, Control and Navigation trigger Flight Data Recording trigger

TX1

GPS Data Processing and Analyzing Ground Station Command Processing Remote Control Signal Processing and Flight Mode Switching Filter, Control and Navigation computing Flight Data Recording Compass Data Processing and Analyzing Measurement Data Output trigger

Fig.4. The task scheduling strategy of the onboard software of SUAV

1532

Information Technology for Manufacturing Systems

Priority level base scheduling is based on the interrupt level system of the processor. The flight control processor of onboard hardware support 20 interrupt source with different priority level. When the interrupt flag is set, the corresponding ISR is called. Priority level base scheduling is high real-time and resource saving because it’s based on the core of the processor. Timer driving scheduling is implemented in ISR of Timer3. Different tasks are triggered in turn and timely in given frequencies. Because the trigger instruction is reduced, timer driving scheduling has almost the same real-time performance as priority level base scheduling. So timer driving scheduling can be viewed as expander of priority level base scheduling. Polling based scheduling triggers tasks according states of corresponding flags. Actually the task scheduling strategy is based on disassembling of whole the software tasks. In priority level based scheduling and timer driving scheduling frames, reduced instructions are used to process high real-time tasks and set flags for low real-time tasks. And these flags are polled in polling based scheduling frame, and corresponding tasks are called and processed if the flags are set. This task disassembling method reduces ISR processing time, and real-time performance and schedulability of the FCS tasks are ensured.

Main cycle

Wait for valid position of GPS

Keep Online with user

Data Initialization

Hardware Initialization

Power on

3.5 Elementary Operation Procedure of Onboard Software. The elementary operation procedure of the FCS onboard software is shown in Fig. 5.

Fig.5. The task scheduling strategy of the onboard software of SUAV Firstly, the system is power on and the software begins operation. Then the processor hardware, including system clock, UART, PCA, Timer and ADC, is initialized to work. Thirdly, the globe variables are initialized, always clear to 0, in order to prevent possible error. After initialization, the software will wait to communication with user. When keep online with user, the user can inquiry and update control parameters and waypoints (these data can also be updated in main cycle), and read flight data of previous flight. If no proper commands are received in 20 seconds, the system will skip online loop and begin to wait for valid GPS 3D positioning. The taking-off position is stored as the base point of navigation. If GPS 3D position obtained, the elevator of the SUAV will turn up and down for 3times to let the user know the statue of GPS positioning, then the software run into main cycle, and the FCS can control and navigate the SUAV, and communicate with ground station. 4 Validation and Flight Experiment The FCS onboard embedded software is implemented in Keil C with tens of thousands lines of codes. Plenty of table test are carried through in order to valid the software function and reliability. On the basis of table tests, the flight experiments are implemented. A ground station is developed for flight experiment. The SUAV can be launched on the top of the vehicle through a launch shelf (Fig.6 (a)), and the ground station software is developed to interface with user (Fig.6 (b)). A small square mission path, consisting of four waypoints, (100E, 0N), (0E, 100N), (-100E, 0N) and (0E, -100N), is chosen (Fig.6 (c).). This path is a challenge to the control and navigation system, because the mission path is so short and the yawing angle is so big that it’s hard for the SUAV to adjust attitude and navigate in short time. In this case, the trim airspeed is about 65km/hr. In the flight, the radius of waypoint is all set as 5m. In other word, if the distance between SUAV and waypoint is less than 5m, it’s regarded that the SUAV has arrived in the waypoint, and the next waypoint is take as the target waypoint. The wind speed tested near ground is ranged from 3 to 5m/s, blowing mainly from southeast.

Applied Mechanics and Materials Vols. 20-23

1533

As shown in Fig.6(c), the SUAV flight trajectory passed all waypoints rightly and path tracking following error is very small in the segments along the wind and against wind. Fig.6 also shows that there are some of lateral departures from mission path due to wind and some of overshoot when turning in corners, however these errors are acceptable in large scale cruising. Through the flight experiments, we think the FCS onboard software is successful.

a) The ground station

b) The ground station inner view c) The human-machine interface

Fig.6. The task scheduling strategy of the onboard software of SUAV 5 Summary Focus on the FCS onboard embedded software of SUAV, this paper presents hardware basis of the SUAV’s software, then analyses the features and difficulties of the FCS software, and introduced the compositions of the software using HIPO method. A genetic architecture of onboard software is presented to coordinate and organize the software and function modules, and an unique task scheduling strategy is designed and applied to realize multi-task processing. The elementary operation procedure of the SUAV software is presented. Finally, the flight experiment is implemented, the results validate the feasibility and reliability of the onboard software. Acknowledgment This research is/was jointly sponsored by State Leading Academic Discipline, and Shanghai Leading Academic Discipline, and National Natural Science Foundation of China under Grant 50905103 and 69889501, and The National High-tech Research and Development Program under Grant 2007AA404260 and 2007AA041503, and the Research Program of Shanghai Science and Technology Committee under Grant 07dz05813, and Shanghai Special Fund for Excellent Yong Teacher, and Innovation Fund of Shanghai University. References [1] S. Tadokoro, F. Matsuno, M. Onosato and H. Asama, “Japan National Special Project for Earthquake Disaster Mitigation in Urban Areas”, 1st Int.Workshop on Synthetic Simulation and Robotics to Mitigate Earthquake Disaster. Padova, Italy. July, 2003. [2] H. Zhang. Introduction of Software Engineering(3rd Edition). Tsinghua Univeristy Press (1998), pp57-66. [3] F. Ingrand, R. Chatila, R.Alami. An architecture for dependable autonomous robots. in Proc. 8th IEEE International Conference on Emerging Technologies and Factory Automation. Vol.2, (2001), pp657 - 658. [4] H. Liu and J. Hu. Multitask Scheduling for Real-time Systems. Computer Engineering. Vol.28 no.3 (2002), pp43-44. [5] C. Xie, J. Ma and H. Hunag. Research on Task Scheduling Policies Based on μC-OS2II. Computer Engineering &Science. Vol. 26 no.8 (2004), pp70-73.

Information Technology for Manufacturing Systems 10.4028/www.scientific.net/AMM.20-23

Flight Control System Onboard Embedded Software for Small Unmanned Aerial Vehicles 10.4028/www.scientific.net/AMM.20-23.1528

Suggest Documents