Hardware-In-The-Loop Simulation of Aircraft Actuator
Total Page:16
File Type:pdf, Size:1020Kb
Hardware-in-the-Loop Simulation of Aircraft Actuator Robert Braun Fluid and Mechanical Engineering Systems Degree Project Department of Management and Engineering LIU-IEI-TEK-A{08/00674{SE Master Thesis LinkÄoping,September 3, 2009 Department of Management and Engineering Division of Fluid and Mechanical Engineering Systems Supervisor: Professor Petter Krus Front page picture: http://www.flickr.com/photos/thomasbecker/2747758112 Abstract Advanced computer simulations will play a more and more important role in future aircraft development and aeronautic research. Hardware-in-the-loop simulations enable examination of single components without the need of a full-scale model of the system. This project investigates the possibility of conducting hardware-in-the-loop simulations using a hydraulic test rig utilizing modern computer equipment. Controllers and models have been built in Simulink and Hopsan. Most hydraulic and mechanical components used in Hopsan have also been translated from Fortran to C and compiled into shared libraries (.dll). This provides an easy way of importing Hopsan models in LabVIEW, which is used to control the test rig. The results have been compared between Hopsan and LabVIEW, and no major di®erences in the results could be found. Importing Hopsan components to LabVIEW can potentially enable powerful features not available in Hopsan, such as hardware-in-the-loop simulations, multi-core processing and advanced plot- ting tools. It does however require fast computer systems to achieve real- time speed. The results of this project can provide interesting starting points in the development of the next generation of Hopsan. Preface This thesis work has been written at the Division of Fluid and Mechanical Engineering Systems (FluMeS), part of the Department of Management and Engineering (IEI) at LinkÄopingUniversity (LiU). I would like to express my gratitude to LiU for making this project possible and for giving me the opportunity to complete my studies in an interesting and rewarding way. During this project I have acquired much experience and greatly increased my knowledge in my ¯eld of specialization. I would like to thank the sta® at IEI who have helped me out through the project, especially my supervisor Professor Petter Krus. August 2009 LinkÄoping,Sweden Robert Braun Contents 1 Introduction 9 1.1 Purpose . 9 1.2 Background . 9 1.3 Delimitations . 11 2 System Description 13 2.1 Hydraulic Supply System . 15 2.2 Aircraft Control Hydraulic System . 15 2.3 Load Hydraulic System . 16 2.4 Measurement Equipment . 17 2.5 Control System . 18 2.6 Electronic Hardware . 19 2.7 Software . 19 2.7.1 HOPSAN . 19 2.7.2 Mathematica . 19 2.7.3 LabVIEW . 20 2.7.4 Matlab and Simulink . 20 2.7.5 Microsoft Visual C++ 2008 Express Edition . 20 3 Work Progress 21 3.1 Gathering Knowledge About the System . 21 3.2 Creating a Simulation Model in HOPSAN . 21 3.3 Building a Rudder Block for HOPSAN . 21 3.4 Exporting Matlab Models to LabVIEW . 23 3.5 Exporting HOPSAN Models to LabVIEW . 23 3.5.1 Requirements on the Code Syntax . 23 3.5.2 Translation of Hopsan Libraries to C . 24 3.5.3 Importing Models to LabVIEW with Code Interface Nodes . 25 3.5.4 Importing Models to LabVIEW from Shared Libraries 25 3.5.5 Optimizing the Shared Libraries . 26 3.5.6 Setting up the LabVIEW Block Diagram . 26 4 Results 29 4.1 Rudder Block for Hopsan and LabVIEW . 29 4.2 Translated Code Structure . 31 4.3 Code Structure in Shared Libraries . 33 5 5 Analysis 35 5.1 Analysis of the Rudder Block . 35 5.2 Comparison Between Hopsan and LabVIEW . 38 5.3 Examination of Simulation Performance . 41 6 Discussion 43 6.1 Problems . 43 6.2 Sources of Error . 44 6.3 Di®erences Between Hopsan and LabVIEW . 45 6.4 Recommendation for Next Version of Hopsan . 46 6.5 Recommendations for Continued Work . 47 6.6 Conclusions . 47 A List of Parameters A-1 B List of Components A-4 C Derivations for Hopsan model A-10 D Complete Hopsan Model A-14 E Importing External C-Code to LabVIEW A-15 F Importing Shared Libraries to LabVIEW A-18 G List of DLL Function Calls A-20 6 Nomenclature Abbreviations HWiL Hardware-in-the-Loop AC Aircraft Control LS Load Simulation DV Directional Valve Denotations 2 Ap;e AC Elevator Cylinders Piston Area [m ] 2 Ap;e;L LS Elevator Cylinders Piston Area [m ] 2 Ap;r AC Rudder Cylinders Piston Area [m ] 2 Ap;r;L LS Rudder Cylinder Piston Area [m ] Bp;e AC Elevator Cylinders Viscous Damping [Ns/m] Bp;e;L LS Elevator Cylinders Viscous Damping [Ns/m] Bp;r AC Rudder Cylinders Viscous Damping [Ns/m] 3 Cip;e AC Elevator Cylinders Internal Leakage Coe®. [m /sPa] 3 Cip;r AC Rudder Cylinders Internal Leakage Coe®. [m /sPa] 3 Cip;r;L LS Rudder Cylinder Internal Leakage Coe®. [m /sPa] 3 Cq AC DV Flow Gain [m /Vs] 3 Cq;L LS DV Flow Gain [m /Vs] Dv AC DV Slide Diameter [m] Dv;L LS DV Slide Diameter [m] 2 Je Elevator Moment of Inertia of Elevator [kgm ] 2 Jr Moment of Inertia of Rudder [kgm ] K AC DV Ori¯ce to Circumference Ratio [%] 3 Kce;L LS DV E®ective Pressure-to-Flow Coe±cient [m /sPa] Ki;L LS Integrating Gain [Vs/m] Kp AC Proportional Gain [V/m] Kp;L LS Proportional Gain [V/m] LA;e LA from Elevator Axis to Airplane Cylinders [m] LA;r LA from Rudder Axis to Airplane Cylinders [m] LL;e LA from Elevator Axis to Load Cylinders [m] LL;r LA from Rudder Axis to Load Cylinder [m] LM;e LA from Elevator Axis to Center of Mass [m] Me Mass of Elevator [kg] Mr Mass of Rudder [kg] pl0 AC Work Point System Pressure [bar] pl0;L LS Work Point System Pressure [bar] ps AC Maximum System Pressure [bar] ps;L LS Maximum System Pressure [bar] 7 Sp;e AC Elevator Cylinders Maximum Stroke [m] Sp;r AC Rudder Cylinders Maximum Stroke [m] Sp;r;L LS Rudder Cylinder Maximum Stroke [m] Sv AC DV Saturation [?] 3 Vt;L LS Elevator Cylinders Oil Volume [m ] w AC DV Area Gradient [m] wL LS DV Area Gradient [m] xv;0;e AC DV Working Point Spool Stroke (elevators) [m] xv;0;r AC DV Working Point Spool Stroke (rudder) [m] xv;max;e AC DV Maximum Spool Stroke (elevators) [m] xv;max;r AC DV Maximum Spool Stroke (rudder) [m] ¯e AC System Oil Bulk Modulus [Pa] ¯e;L LS System Oil Bulk Modulus [Pa] ½ AC System Oil Density [kg/m2] 2 ½L LS System Oil Density [kg/m ] !1 AC Filter Cuto® Frequency [Hz] !2 AC System Cuto® Frequency [Hz] !3 AC Valve Cuto® Frequency [Hz] !v;L LS DV Bandwidth [Hz] 8 1 Introduction The future aircraft market will put higher demands on more advanced and complex systems, but also on faster and more cost e±cient development. In order to achieve this, advanced simulation tools will play a signi¯cant, if not to say crucial, role. This thesis work deals with the possibility of using an already existing hydraulic test rig in future aeronautic development and research. 1.1 Purpose The purpose of this thesis work is to investigate the possibilities of using a hydraulic aircraft test rig for hardware-in-the-loop simulations in aeronau- tics research. The primary focus is on how to make use of modern computer systems for this purpose in the most satisfactory way. Software and hard- ware must be chosen and investigated. One of the most important demands is the possibility of importing already existing models and controllers. The results are supposed to be examined by comparing the hardware-in-the-loop simulation results with a conventional computer simulation. 1.2 Background The demand for this project emerged from a large international research ini- tiative from 59 European aeronautics organizations called Crescendo, mean- ing "Collaborative & Robust Engineering using Simulation Capability En- abling Next Design Optimization". The purpose of this project is to fa- cilitate for European aircraft manufacturers to develop complex systems in more cost e®ective ways and with shorter lead times, by using more ad- vanced and thoroughgoing simulation systems. The test rig in the university laboratory has the potential to become a powerful tool in this context. Saab Aerospace ceased production of the Saab 2000 in 1999. Parts of the hardware-in-the-loop test rig (called Ironbird), namely the tail control surfaces and their actuators, were then donated to LiTH from Saab in 2000. In a student project in 2001 the aircraft hydraulics and the load hydraulics were mathematically decoupled by a computer based control system, to avoid undesirable interference between the rudder control and the simulated external load forces. This feature has not been con¯rmed by practical test- ings in a satisfactory way, due to defects in the hydraulic supply system. (Avellan-Hultman et al., 2001) 9 Figure 1: The Ironbird testrig was donated to LiTH from Saab in 2000. A hardware-in-the-loop simulation (HWiL) is a real-time simulation method. It di®ers from conventional computer simulations in the way that one or more of the components in the simulated system are represented by phys- ical hardware. These components are fed with simulated signals from the computer model so that they are made to "believe" that they are part of a real physical system. This facilitates cheaper and more practicable testings than a full-size test model, while it still provides more accurate and realistic results than a regular computer simulation.