4.1.2 Second layer

This layer consists of three subsystems that are: (1) communication subsystem manages the connection with the first layer using sockets and reads the flat file with the information of the roll, pitch and yaw of the plane; (2) kinematic control subsystem—obtains the information corresponding to the roll, pitch and yaw of the airplane to be able to reproduce its movements in the Stewart platform with three degrees of freedom using servo motors; and (3) graphical user interface subsystem—manages the LabView components to view in real time the roll, pitch, and yaw values of the aircraft to operate the Stewart platform.

#### 4.2 Flight simulator dynamic system

In this research, we propose a model of the dynamic flight system, which is based on the models proposed by [6, 19, 20]. Figure 3 shows the interaction between the pilot, the airplane and the Stewart platform with three degrees of freedom. The pilot operates the flight simulator with a joystick, where it controls

#### Figure 3.

Proposed flight simulator dynamic system.

the following components: (1) rise and fall of the airplane (range: [45, 45]); (2) tilt and turn of the airplane (range: [30 to 30°]); (3) power of the airplane (range: [1, 1]); (4) pedals of the airplane; and (5) activation and deactivation of the airplane's cruising speed. The Stewart platform reproduces the roll, pitch and yaw movements generated by the flight simulator which is programmed with mathematical models of the flight physics.

For the operation of the Stewart platform with three degrees of freedom, we used a Multifunction DAQ Tested to Data Acquisition Card with pulse-width modulation (PWM) of Texas Instruments brand, which was programmed with LabVIEW to operate the kinematics and dynamics of the system considering the triangular geometry of the platform. This card manages: (1) the performance characteristics, such as control of the power and acceleration of the airplane; (2) handling qualities, such as the control of the speed of advance and rotation of the airplane; and (3) flight characteristics, such as airplane short take-off and landing functions, altitude limit alarm, ground proximity alarm, and landing gear control alarm.

> the movements of the flight simulator to be reproduced. In Figure 5, you can see the data flow as described below: (1) programming a pulse-width modulation (PWM) channel; (2) programming functions of downloading and uploading roll, pitch and yaw data that come from the flight simulator; (3) programming conversion of roll, pitch and yaw values into pulse width modulation (PWM) signals to be able to move the servo motors; (4) programming the generation of the square signal by assigning a constant value to the period corresponding to 50 Hz; (5) programming the connection between the processed data with the data acquisition card with pulse-width modulation (PWM) signals to control the servo motors 1 and 3; (6) programming the connection between the processed data with the data acquisition card with pulse-width modulation (PWM) signals to control the servo motor 2. Figure 6 shows the flow of information from computer 1 (where the flight simulator is installed) to computer 2 (where LabVIEW is installed). The flight simulator saves the data referring to the roll, pitch and yaw in a text file. Then computer 2 accesses this text file through a point-to-point connection using the TCP/IP protocol. Computer 2 receives the data from the text file and operates the control software that works with a data acquisition card with pulse-width modulation (PWM) signals, connected through a USB port to the computer and drives the servo motors of the Stewart platform with three degrees of freedom. Finally, there is a 5 V power supply that powers the servo motors. The mathematical model of the

A New Real-Time Flight Simulator for Military Training Using Mechatronics and Cyber…

Figure 4.

Figure 5.

81

Application of the V-Model for the flight simulator development.

DOI: http://dx.doi.org/10.5772/intechopen.86586

Block diagram source code for controlling the Stewart platform in LabView.

#### 4.3 Design and development of the mechatronic system

The design and construction of the mechatronic product as a complex system was carried out based on Model V, as shown in Figure 4. The following tasks have been accomplished according to different areas of knowledge: (1) Mechanical Engineering—This area was applied to adapt and build the mechanical elements of the Stewart platform with three translational degrees of freedom, considering that the proposed dynamic model has no friction and that the kinematic chains are symmetrical and thin; (2) Electrical and Electronic Engineering—This area was applied to control the Stewart platform using servo motors to simplify the inertia and flexibility of the kinematic chains; and (3) Information Technologies—This area was applied to program the data acquisition card with pulse-width modulation (PWM) using LabVIEW and to be able to operate the kinematics and the dynamics of the system with triangular geometry, which reproduces the roll, pitch and yaw movements of the flight simulator.

The code of the control program was based on the block diagrams generated by LabVIEW, for which the data referring to the roll, pitch, and yaw that the flight simulator outputs is read from a flat file. This data is interpreted numerically and processed to be sent to the servo motors that operate the Stewart platform and allow A New Real-Time Flight Simulator for Military Training Using Mechatronics and Cyber… DOI: http://dx.doi.org/10.5772/intechopen.86586

#### Figure 4.

the following components: (1) rise and fall of the airplane (range: [45, 45]); (2) tilt and turn of the airplane (range: [30 to 30°]); (3) power of the airplane (range: [1, 1]); (4) pedals of the airplane; and (5) activation and deactivation of the airplane's cruising speed. The Stewart platform reproduces the roll, pitch and yaw movements generated by the flight simulator which is programmed with mathe-

For the operation of the Stewart platform with three degrees of freedom, we used a Multifunction DAQ Tested to Data Acquisition Card with pulse-width modulation (PWM) of Texas Instruments brand, which was programmed with LabVIEW to operate the kinematics and dynamics of the system considering the triangular geometry of the platform. This card manages: (1) the performance characteristics, such as control of the power and acceleration of the airplane; (2) handling qualities, such as the control of the speed of advance and rotation of the airplane; and (3) flight characteristics, such as airplane short take-off and landing functions, altitude limit alarm, ground proximity alarm, and landing gear control

The design and construction of the mechatronic product as a complex system was carried out based on Model V, as shown in Figure 4. The following tasks have been accomplished according to different areas of knowledge: (1) Mechanical Engineering—This area was applied to adapt and build the mechanical elements of the Stewart platform with three translational degrees of freedom, considering that the proposed dynamic model has no friction and that the kinematic chains are symmetrical and thin; (2) Electrical and Electronic Engineering—This area was applied to control the Stewart platform using servo motors to simplify the inertia and flexibility of the kinematic chains; and (3) Information Technologies—This area was applied to program the data acquisition card with pulse-width modulation (PWM) using LabVIEW and to be able to operate the kinematics and the dynamics of the system with triangular geometry, which reproduces the roll, pitch and yaw

The code of the control program was based on the block diagrams generated by LabVIEW, for which the data referring to the roll, pitch, and yaw that the flight simulator outputs is read from a flat file. This data is interpreted numerically and processed to be sent to the servo motors that operate the Stewart platform and allow

matical models of the flight physics.

Proposed flight simulator dynamic system.

movements of the flight simulator.

4.3 Design and development of the mechatronic system

alarm.

80

Figure 3.

Military Engineering

Application of the V-Model for the flight simulator development.

#### Figure 5.

the movements of the flight simulator to be reproduced. In Figure 5, you can see the data flow as described below: (1) programming a pulse-width modulation (PWM) channel; (2) programming functions of downloading and uploading roll, pitch and yaw data that come from the flight simulator; (3) programming conversion of roll, pitch and yaw values into pulse width modulation (PWM) signals to be able to move the servo motors; (4) programming the generation of the square signal by assigning a constant value to the period corresponding to 50 Hz; (5) programming the connection between the processed data with the data acquisition card with pulse-width modulation (PWM) signals to control the servo motors 1 and 3; (6) programming the connection between the processed data with the data acquisition card with pulse-width modulation (PWM) signals to control the servo motor 2.

Figure 6 shows the flow of information from computer 1 (where the flight simulator is installed) to computer 2 (where LabVIEW is installed). The flight simulator saves the data referring to the roll, pitch and yaw in a text file. Then computer 2 accesses this text file through a point-to-point connection using the TCP/IP protocol. Computer 2 receives the data from the text file and operates the control software that works with a data acquisition card with pulse-width modulation (PWM) signals, connected through a USB port to the computer and drives the servo motors of the Stewart platform with three degrees of freedom. Finally, there is a 5 V power supply that powers the servo motors. The mathematical model of the

Block diagram source code for controlling the Stewart platform in LabView.

ð8Þ

ð9Þ

where Vv is the vertical velocity of an airplane; Vvi is the initial vertical velocity of an airplane; Vix is the initial velocity of the airplane; Ve is the engine velocity of the airplane; kh is the trust constant; ma is the mass of an airplane; t is the flight time; Sw is the wing surface; CL is the coefficient of lift; α<sup>t</sup> is the angle of rotation;

A New Real-Time Flight Simulator for Military Training Using Mechatronics and Cyber…

According to [21–23], the resultant force Ly of the sinusoidal component of the lift is responsible for generating the speed of lateral displacement of the aircraft.

where VL is the lateral velocity of an airplane; Viy is the initial velocity on the y-axis of an airplane; Vix is the initial velocity on the x-axis of the airplane; Ve is the engine velocity of an airplane; kh is the trust constant; ma is the mass of an airplane; t is the flight time; Sw is the wing surface; CL is the lift coefficient; and α<sup>t</sup> is

The CPS complied with a development process for the flight simulator based on the XP cycle that performs iterative and incremental tasks [24, 25]. According to the XP methodology, the work team completed incremental delivery of the software products, based on the following iterations: (1) computational iteration—in this iteration, mathematical models were developed, aerodynamics in physics, management of threads and the design of delegates instance to control the airplane of the virtual world; (2) communication iteration—in this iteration, the processing and transfer of data referring to roll, pitch, and yaw was performed using text files, sockets and a local network; and (3) control iteration—in this iteration, the control system of the Stewart platform was programmed to reproduce the movements of the flight simulator. A multidisciplinary approach supported by the system design engineering allowed the integration of all the modules of the complex dynamic system for its correct operation. Figure 7 shows the iterations of the CPS based on

the XP methodology, applying the model proposed by Drake et al. [26].

Unitary tests were performed on the cyber-physical system that included the computational, communication and control subsystems, both at the software level and at the hardware level. Acceptance tests were also carried out with a group of 40 aircraft pilots, to evaluate the proper functioning of the software application at the end of each iterations. Figure 8 shows the graphical user interface of the flight simulator developed with the Unity 3D framework, where it is possible to observe the cockpit of a Cessna 172 aircraft operated by a joystick, where the plane is flying over the city of Manta in Ecuador, where the main military aviation schools of the

and Wa is the weight of an airplane.

The following equation is obtained:

the angle of rotation.

country are located.

83

4.5 Implementation and testing

4.4.3 Mathematical model of lateral velocity

DOI: http://dx.doi.org/10.5772/intechopen.86586

Figure 6.

Infographic of the electric and mechanical diagram of Stewart platform.

flight simulator was programmed with the UNITY 3D framework in computer 1, where the frontal velocity, vertical velocity and lateral velocity are considered allowing the airplane to move in the virtual world as it would be in the real world.
