Co-Simulation of Matlab and Flightgear for Identification And
Total Page:16
File Type:pdf, Size:1020Kb
Guilherme Aschauer et al. / IFAC-PapersOnLine 48-1 (2015) 067–072 8th Vienna International Conference on Mathematical Modelling February8th Vienna 18 International - 20, 2015. Vienna Conference University on Mathematical of Technology, Modelling Vienna, 8th Vienna International Conference on Mathematical Modelling AustriaFebruary 18 - 20, 2015. Vienna UniversityAvailable of Technology, online at Vienna,www.sciencedirect.com AustriaFebruary 18 - 20, 2015. Vienna University of Technology, Vienna, Austria ScienceDirect IFAC-PapersOnLine 48-1 (2015) 067–072 Co-Simulation of Matlab and FlightGear Co-Simulation of Matlab and FlightGear for Identification and Control of Aircraft for Identification and Control of Aircraft Guilherme Aschauer ∗ Alexander Schirrer ∗ Martin Kozek ∗ Guilherme Aschauer ∗ Alexander Schirrer ∗ Martin Kozek ∗ Guilherme Aschauer ∗ Alexander Schirrer ∗ Martin Kozek ∗ Inst. of Mechanics & Mechatronics, Vienna University of Technology, ∗ Inst. of Mechanics & Mechatronics, Vienna University of Technology, ∗ Austria ∗ Inst. of Mechanics & Mechatronics,Austria Vienna University of Technology, e-mail: [email protected] e-mail: [email protected] e-mail: [email protected] Abstract: The paper outlines the development of a co-simulation solution of Matlab and Flight- Abstract: The paper outlines the development of a co-simulation solution of Matlab and Flight- Gear in which the communication between these programs is done via UDP without needing GearAbstract: in whichThe the paper communication outlines the development between these of a programs co-simulation is done solution via UDP of Matlab without and needing Flight- further toolsets. The simulation and rendering is done by FlightGear. Flight measurement signals furtherGear in toolsets. which the The communication simulation and between rendering these is done programs by FlightGear. is done Flight via UDP measurement without needing signals are sent to Matlab, which in turn sends back actuator input values computed by a flight control arefurther sent toolsets. to Matlab, The which simulation in turn and sends rendering back actuator is done by input FlightGear. values computed Flight measurement by a flight control signals system. First, gray-box models of the aircraft dynamics are identified for different altitudes for system.are sent First,to Matlab, gray-box which models in turn of sends the aircraft back actuator dynamics input are valuesidentified computed for different by a flight altitudes control for longitudinal and lateral dynamics so that gain-scheduled controllers can be used. The output longitudinalsystem. First, and gray-box lateral models dynamics of the so that aircraft gain-scheduled dynamics are controllers identified can for different be used. altitudes The output for quantities to be controlled are altitude and heading and three state-space controllers (MPC, quantitieslongitudinal to and be controlled lateral dynamics are altitude so that and gain-scheduled heading and controllers three state-space can be controllers used. The (MPC,output LQR and a gain-scheduled LQR) are designed and compared by tracking two reference signals LQRquantities and a to gain-scheduled be controlled LQR) are altitude are designed and heading and compared and three by state-space tracking two controllers reference (MPC,signals including steps and ramps. At the end the robustness of the controllers are verified by flying in includingLQR and steps a gain-scheduled and ramps. LQR)At the are end designed the robustness and compared of the controllers by tracking are two verified reference by flying signals in turbulent weather conditions. turbulentincluding steps weather and conditions. ramps. At the end the robustness of the controllers are verified by flying in turbulent 2015, IFAC weather (International conditions. Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved. Keywords:© Aerospace computer control, Automated guided vehicles, Co-Simulation, Parameter Keywords: Aerospace computer control, Automated guided vehicles, Co-Simulation, Parameter estimation, LQR control method, LQG control method, Predictive control estimation,Keywords: Aerospace LQR control computer method, control, LQG control Automated method, guided Predictive vehicles, control Co-Simulation, Parameter estimation, LQR control method, LQG control method, Predictive control 1. INTRODUCTION sufficiently well and still the results have to be taken with 1. INTRODUCTION sufficiently well and still the results have to be taken with caution. 1. INTRODUCTION caution.sufficiently well and still the results have to be taken with Considerable progress has been made in the past few years Thiscaution. study will show how it is possible to run FlightGear Considerable progress has1 been made in the past few years2 This study will show how it is possible to run FlightGear Considerablein affordable (X-Plane progress has1 ) or been freely made available in the (FlightGear past few years2 ) Thisor X-Plane study will in co-simulation show how it iswith possible Matlab to usingrun FlightGear the UDP in affordable (X-Plane 1 ) or freely available (FlightGear 2 ) orThis X-Plane study will in co-simulation show how it iswith possible Matlab to usingrun FlightGear the UDP inrealistic affordable flight (X-Plane simulation1 ) software. or freely available Both programs (FlightGear promise2 ) communication protocol. This approach allows to run both realistic flight simulation software. Both programs promise communicationor X-Plane in co-simulation protocol. This with approach Matlab allows using to the run UDP both realistica largedegree flight simulation of realism software. and are Both even programs used in trainingpromise programs on different platforms as long as they are in a large degree of realism and are even used in training programscommunication on different protocol. platforms This approach as long allows as they to run are both in acockpits large degree for pilots. of realism FlightGear and are offers even the used choice in betweentraining the same local network. In order to obtain high flexibility, cockpits for pilots. FlightGear offers the choice between theprograms same local on different network. platforms In order to as obtain long ashigh they flexibility, are in cockpitsseveral well-established for pilots. FlightGear flight dynamics offers the models choice (FDM) between on Simulink and especially the Aerospace Toolbox have not several well-established flight dynamics models (FDM) on Simulinkthe same localand especially network. In the order Aerospace to obtain Toolbox high flexibility, have not severalthe basis well-established of mostly nonlinear flight dynamics equations models of motion (FDM) like on been used since the latter one is so far only working with the basis of mostly nonlinear equations of motion like beenSimulink used and since especially the latter the one Aerospace is so far only Toolbox working have with not theJSBSim basis (Berndt of mostly (2004)) nonlinear or the equations usage of of a user-defined motion like FlightGear and is not a standard package of Matlab. If JSBSim (Berndt (2004)) or the usage of a user-defined FlightGearbeen used since and the is not latter a standard one is so package far only ofworking Matlab. with If JSBSimmodel. This (Berndt is helpful (2004)) where or the highly usage specialized of a user-defined aircraft Matlab is not available, the main functionality of the script model. This is helpful where highly specialized aircraft MatlabFlightGear is not and available, is not thea standard main functionality package of of Matlab. the script If model.like lighter-than-air This is helpful aircraft where are highly used, specialized or a custom aircraft set can easily be implemented in C++ or any other high-level like lighter-than-air aircraft are used, or a custom set canMatlab easily is not be implemented available, the in main C++ functionality or any other of high-levelthe script likeof equations lighter-than-air is available, aircraft and are where used, FlightGear or a custom is just set programming language. of equations is available, and where FlightGear is just programmingcan easily be implemented language. in C++ or any other high-level ofused equations for visualization is available, purposes and and where for FlightGear providing realistic is just used for visualization purposes and for providing realistic Theprogramming flight simulator language. sends flight attitude data and receives usedenvironmental for visualization conditions. purposes The drawback and for providing of this approach realistic The flight simulator sends flight attitude data and receives environmental conditions. The drawback of this approach actuator input values (throttle, elevator, aileron, and rud- environmentalis that the user conditions. has to provide The drawback all the coefficients of this approach used in actuatorThe flight input simulator values sends (throttle, flight elevator, attitude data aileron, and and receives rud- is that the user has to provide all the coefficients used in der). After establishing a working connection between the isthe that FDM, the including user hasa to parametrization provide all the overcoefficients different used flight in der).actuator After input establishing values (throttle, a working elevator, connection aileron, between and rud- the the FDM, including a parametrization over different flight two programs, identification runs are made for longitudinal theparameters FDM, including to increase a parametrization the degree