DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME...

11
DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1 , Siraj Anis 1 , Arsalan Khan 1 and Ali Raza Jafri 2 1 Department of Avionics Engineering, PAF Karachi Institute of Economics and Technology, Pakistan, Karachi, 2 University of Hertfordshire, Hatfield, School of Engineering and Technology.

Transcript of DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME...

Page 1: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL

Dr. Adil Loya1, Siraj Anis1, Arsalan Khan1 and Ali Raza Jafri2

1Department of Avionics Engineering, PAF Karachi Institute of Economics and Technology, Pakistan, Karachi,

2University of Hertfordshire, Hatfield, School of Engineering and Technology.

Page 2: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

Content

➢Background Study

➢Introduction

➢Simulink and Flight gear integration

➢Methodology

➢Short simulation video

➢Conclusion

Page 3: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

Background study

Simulation and modelling of an UAV or aircraft can be conducted on flightgear, however, visualization is notalways enough to quantify the performance and characteristics of flight. For this we require digitizing orgraphically plotting the flight path variables to attain flight information in details.

Figure1. Flightgear Aircraft Visualization

Page 4: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

Introduction

➢Importance of flight control simulations

➢What is flight gear

➢Who uses flight gear

➢Communication with flight gear

Page 5: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

scenarios :

• In the similar manner M. Moness et al. worked on creating and demonstrating with optimizationsusing PID, feedback design and root locus. the connectivity of flightgear to MATLAB/Simulink usingUDP protocol, however, they visualized it on the flightgear rather than perceiving data in Simulink.By help of this they successfully tested C310 aircraft model with autopilot control.

• M Reid and S Manso designed autopiloting system over MATLAB/Simulink for unmannedhelicopter with flightgear integration using mex based s-function. However, they used it forsending signal over the UDP protocol.

Introduction Cont’d

Page 6: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

Methodology - Simulink and Flight Gear integration

Socket programming for dataquantization

Two methods adopted:

A. Level 2 S-function block designed tosend and receive data having input andoutput ports. As shown in figure2.

For UDP communication Judp matlabscript available on mathworks was used.

Before socket programming:

.xml language protocol file was writtento collect data from flight-gear in achronological order.

Figure2. Level 2 S-Function settings before running Simulink →

Page 7: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

Simulation video- Method A

Video1. Level 2 S-function real-time simulation

Page 8: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

Methodology - Simulink and Flight Gear integration

Socket programming for data quantization

Two methods adopted:

B. Receiving data from flightgear to Simulink usingUDP protocol block of DSP toolbox from MATLAB/SimulinkLibrary. Generic settings are shown on Figure3.

Before socket programming:

.xml language protocol file was written to collect data fromflight-gear in a chronological order.

Figure3. UDP block settings before running Simulink →

Page 9: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

Simulation video- Method B

Video2. UDP port used for flightgear real-time simulation

Page 10: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

Conclusion

• This research enables users to utilize two distinctive promising methods to acquire required property of interest from flightgear.

1. The DSP toolbox used to fetch the data where (ASCII) data type used.2. Simultaneous sending and receiving of the data using level-2 based S-function on Simulink.

• Simulink and MATLAB are highly considered in the aerospace systems research due to its vast and convenientworkspace environment.

• Previously parameters regarding control were only acquirable using C, C++, Java etc.

• This interface program will help the aerospace community to easily fetch and stream data from flightgear usingSimulink which can further be used for integration with any system or process.

Page 11: DATA COMMUNICATION FROM FLIGHTGEAR …DATA COMMUNICATION FROM FLIGHTGEAR USING SIMULINK IN REAL TIME THROUGH A UDP PROTOCOL Dr. Adil Loya 1, Siraj Anis , Arsalan Khan and Ali Raza

1. G. Aschauer, A. Schirrer, and M. Kozek, "Co-simulation of MATLAB and flightgear for identificationand control of aircraft," IFAC-PapersOnLine, vol. 48, no. 1, pp. 67-72, 2015.

2. M. Moness, A. M. Mostafa, M. A. Abdel-Fadeel, A. I. Aly, and A. Al-Shamandy, "Automatic controleducation using FlightGear and MATLAB based virtual lab," in 8th International Conference onElectrical Engineering, 2012, pp. 1157-1160.

3. J. Ye, H. Guo, S. Tang, and Q. Wang, "The research on visual flight simulation for unmannedhelicopter," in AsiaSim 2012: Springer, 2012, pp. 332-341.

4. D. Ondriš and R. Andoga, "Aircraft modeling using MATLAB/flight gear interface," Acta Avionica, vol.15, no. 27, 2013.

5. M. Reid and S. Manso, "Development of a Rotary Wing Unmanned Aerial Vehicle (UAV) SimulationModel," DEFENCE SCIENCE AND TECHNOLOGY ORGANISATION VICTORIA (AUSTRALIA)2014.

6. O. Arslan, B. Armagan, and G. Inalhan, "Development of a Mission Simulator for design and testingof C2 Algorithms and HMI Concepts across Real and Virtual Manned-Unmanned Fleets," inOptimization and Cooperative Control Strategies: Springer, 2009, pp. 431-458.

7. M. Metalli, "Sviluppo di un modello di drone di tipo flying wings in ambiente FlightGearinterfacciato con autopiloti di Arduino implementati in Simulink.

References