Successfully reported this slideshow.
Upcoming SlideShare
×

# Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos

1,228 views

Published on

The increasing demand in the aerospace industry for safety and performance has been requiring even more resourceful flight control laws in all market segments, since the airliners until the newest flying cars. The ​de facto​ standard for flight control laws design makes extensive use of tools supporting numerical computing and dynamic systems visual modeling, such that Scilab and XCos can nicely suit this kind of development.

Published in: Engineering
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

### Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos

2. 2. 2www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Agenda The flight control laws problem;1 The control design process;2 Building a 6-DoF flight mechanics model;3 Building the model using Scilab scripts;4 Building the model using Xcos diagrams;5 Model-based design vs. Scilab scripts;6 Pitch rate controller design example;7 How close are we from industry?8
6. 6. 6www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. The control design process 6 DoF Aircraft Model Open-Loop Linear model Linear Controller Design 6 DoF Aircraft Model Closed-Loop ● Study the plant; ● Define requirements for closing the loop; ● Study the plant dynamics; ● Refine requirements for closing the loop; ● Choose a controller architecture; ● Calculate the gains; ● Linear analysis (margins and performance); ● Non-linear controller design; ● Controller discretization; ● Handling qualities assessment; ● To be used by other clients (loads);
7. 7. 7www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Aircraft flight mechanics model (6 DoF) Roughly speaking: • Rotational: roll, pitch and yaw; • Translational: upwards, forwards, sidewards; Detailed mathematical description requires: • Fixed-body reference frame; • Earth-fixed inertial frame;
8. 8. 8www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Aircraft flight mechanics model (6 DoF) • Position in the inertial frame: x, y, z; • Aircraft attitude: 𝛙, 𝛟, 𝛉; • Aerodynamic variables: 𝛂, 𝛃, airspeed, Mach; Inputs (at least): Outputs (at least): • Aerodynamic surfaces deflection or stick/column/wheel command; • Throttle command; • Aerodynamic configuration change command (flaps, slats, landing gear);
9. 9. 9www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Aircraft flight mechanics model (6 DoF) • Atmosphere: implementation of International Standard Atmosphere model; • Aerodata: aerodynamic data; • Engine: engine dynamics model; • Params: geometric and mass properties of the aircraft; • EQM: equations of motion;
10. 10. 10www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Scilab script implementation • Implementation based on data for F16 model presented at Steven & Lewis (2003, 2nd edition); • Unit test for each module comparing outputs with data from the book (trim conditions, etc.); • Modularization following the presented component diagram; • Simulator, linearizer and trimmer make use of Scilab functions for solving ordinary differential equations, for linearizing, etc;
11. 11. 11www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Atmosphere example (Scilab script) function [T_K, p_Pa, rho_kgpm3]=atmosphere(h_m, deltaIsa) ● International Standard Atmosphere (1976); ● Physical model for temperature, pressure and density calculations with many tabulated values; ● Tables extracted from the official document to a CSV and used for unit test;
12. 12. 12www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Flight simulation example 1. Trim the aircraft (find an equilibrium condition); S = fminsearch(costf16, S0); 1. Apply an input (surface deflection); controls.elev_deg = elev_step; 1. Solve the system of the ordinary differential equations; y = ode(X0, t(1), t, f16_model); 1. Check the time history of the outputs;
13. 13. 13www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Model-based design approach: Xcos • Visual modeling to improve readability; • Solver embedded in the framework; • Makes componentization straightforward; • Standard approach in the aerospace industry.
14. 14. 14www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Atmosphere example (Xcos) • Two inputs: altitude and deltaISA; • Three outputs: temperature, pressure and density; • Unit test using a comparison between the output of the block and the literature data;
15. 15. 15www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Xcos Full Model Implementation • A diagram block for each component shown previously; • Unit test for each block based on data in the reference book and in other sources of data; • No trimmer yet; • No linearizer yet.
16. 16. 16www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Flight simulation example 1. Trim the aircraft using the scilab script version; 1. Run a script to initialize the variables context; 1. Start the Xcos simulation; 1. Check the outputs.
17. 17. 17www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Xcos implementation vs Script implementation • Xcos readability is mostly straightforward (not always for equations); • Xcos makes possible to have continuous and discrete time implementations in the same simulation; • Xcos is easier to be translated automatically to another programming language (like C, for example); • Xcos full aircraft model is very slow to change (2.5-GHz Intel Core i5-7200U); • Script version can take much more advantage of version control system (including merge features); • Script version is easily adaptable to find an equilibrium condition (trimming);
18. 18. 18www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Pitch rate controller design example • What is pitch? • And pitch rate? • Why control pitch rate?
19. 19. 19www.esi-group.com Copyright © ESI Group, 2019. All rights reserved. Pitch rate controller design example 1. Linearize the 6-DoF aircraft model around an equilibrium condition; [A, B, C, D] = lin(sim_f16, X0_lin, U0); 1. Use the state-space representation to design the controller (in this example, using root locus); ss_pi = syslin("c", 0, 3, 1, 1); //PI = (s+3)/s ss_cl_alpha_pi = ss_cl_alpha*ss_pi; //evans(ss_cl_alpha_pi(2,1),10);