36
Development of a Helicopter Flight Simulator Prototype by Ambalangoda Guruge Tharindu Dulan Perera A thesis submitted in partial fulfillment of the requirements for the degree of Master of Engineering in Mechatronics Examination Committee: Dr. Manukid Parnichkun (Chairperson) Dr. Mongkol Ekpanyapong Assoc. Prof. Erik L.J. Bohez Nationality: Srilankan Previous Degree: Bachelor of Science in Engineering in Mechatronics Engineering Asian Institute of Technology Thailand Scholarship Donor: AIT Fellowship Asian Institute of Technology School of Engineering and Technology Thailand July 2015

Development of a Helicopter Flight Simulator Prototype

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Development of a Helicopter Flight Simulator Prototype

Development of a Helicopter Flight Simulator Prototype

by

Ambalangoda Guruge Tharindu Dulan Perera

A thesis submitted in partial fulfillment of the requirements for the

degree of Master of Engineering in

Mechatronics

Examination Committee: Dr. Manukid Parnichkun (Chairperson)

Dr. Mongkol Ekpanyapong

Assoc. Prof. Erik L.J. Bohez

Nationality: Srilankan

Previous Degree: Bachelor of Science in Engineering in

Mechatronics Engineering

Asian Institute of Technology

Thailand

Scholarship Donor: AIT Fellowship

Asian Institute of Technology

School of Engineering and Technology

Thailand

July 2015

Page 2: Development of a Helicopter Flight Simulator Prototype

ii

ACKNOWLEDGEMENTS

I would like to thank Dr. Manukid Parnichkun, my adviser for his immense support

throughout this thesis. Without his supervision and the guidance finishing this thesis would

not be possible. Secondly I would like to thank Dr. Mongkol Ekpanyapong and Assoc.

Prof. Erik L.J. Bohez for their guidance and the valuable inputs to this thesis.

Furthermore I would like to thank ISE staffs and the doctoral students for helping me with

my thesis. Finally I would like to thank my parents and my friends for helping me

throughout my thesis.

Page 3: Development of a Helicopter Flight Simulator Prototype

iii

ABSTRACT

Helicopter flight simulators can be used to train the helicopter pilots and entertainment

device. This report presents a research on a helicopter flight simulator, which includes the

hard ware modeling, implementation and the about the virtual environment modeling and

designing.

Finally this report contains about the analysis of the flight simulators relationship between

the input of the joystick and the output of the mechanical model.

Keywords: Flight simulator, Open GL , Joystick Input , 3ds max

Page 4: Development of a Helicopter Flight Simulator Prototype

iv

TABLE OF CONTENTS

CHAPTER TITLE PAGE

TITLE PAGE i

ACKNOWLEDGEMENTS ii

ABSTRACT iii

TABLE OF CONTENTS iv

LIST OF FIGURES vi

LIST OF TABLES vii

LIST OF ABBREVIATIONS viii

1 INTRODUCTION

1

1.1 Background 1

1.2 Statement of the problem

1.3 Objectives

1

2

1.4 Scope and limitation 2

2 LITERATURE REVIEW

3

2.1 OpenGL

2.2 Microsoft visual C++

2.3 3ds Max

2.4 Stewart platform

2.5 Microcontroller

2.6 Moment of inertia

2.7 Center of gravity

2.8 Spring equations

2.9 DC Motor and motor drivers

2.10 PID controller

2.11 Encoder

2.12 Joystick

2.13 Common cockpit training helicopter

2.14 Motion systems

3

3

4

4

4

6

7

7

8

9

10

11

11

12

3 METHODOLOGY 13

3.1 Helicopter Flight Simulator

3.2 Hardware Implementation 13

13

3.3 Software Implementation

3.4 Flow Chart of the System 17

19

4 RESULTS AND DISCUSSION

20

4.1 3ds Max and OpenGL

4.2 Visual C++ Joystick input and serial communication

4.3 Step response of the flight simulator

20

21

22

Page 5: Development of a Helicopter Flight Simulator Prototype

v

4.4 Relationship between the joystick and the flight simulator 23

5 CONCLUSION AND RECOMMENDATIONS

25

5.1 Conclusion

5.2 Recommendations

25

25

REFERENCES 26

APPENDIXES 27

Page 6: Development of a Helicopter Flight Simulator Prototype

vi

LIST OF FIGURES

FIGURE TITLE PAGE

Figure 2.1 Stewart Platform 4

Figure 2.2 Moment of inertia for simple parts 6

Figure 2.3 Center of gravity of a human 7

Figure 2.4

Figure 2.5

Figure 3.1

Figure 3.2

Figure 3.3

Figure 3.4

Figure 4.1

Figure 4.2

Figure 4.3

Figure 4.4

Figure 4.5

Figure 4.6

Figure 4.7

Figure 4.8

Encoder readings

Motion Platform drawing

Flight simulator model

Steal bending deformation analysis

Data flow between entities

Flow chart of system

AIT map bird eye view

Virtual environment

Joystick Input and serial communication

Step response of the pitch axis

Step response of the roll axis

Relationship between the joystick input and the roll axis

Relationship between the joystick input and the pitch axis

joystick input and the hardware modal axis

10

12

14

14

17

19

20

21

21

22

22

23

23

24

Page 7: Development of a Helicopter Flight Simulator Prototype

vii

LIST OF TABLES

TABLE TITLE PAGE

Table 2.1 Summary of Arduino mega specification 5

Table 3.2 Summary of hardware components 16

Page 8: Development of a Helicopter Flight Simulator Prototype

viii

LIST OF ABBREVIATIONS

AIT Asian Institute of Technology

LC Language Center

Page 9: Development of a Helicopter Flight Simulator Prototype

1

CHAPTER 1

INTRODUCTION

1.1 Background

Helicopters are one of a main kind of air crafts which uses its rotors to apply trust and lift.

Because of the rotors it has the ability to move in vertical direction. That is one of the main

differences between the other air crafts and the helicopters.

Due to the characteristics of the helicopter like taking off and landing vertically and the

ability to stay in one place helicopters are used in tasks where no other aircraft can handle.

Today helicopters are used in passenger and cargo transport, military use, firefighting,

construction, search and rescue and areal observation and etc.

In present training a helicopter pilot is expensive due to the fact that it has to be done in the

actual helicopter. Since fuel, maintenance of an actual helicopter is more expensive,

Training a pilot has become expansive. Thus the flight simulators have been invented.

Flight simulators are the devices which artificially recreates aircraft and its environment.

These flight simulators can be used to train the pilots, train the maintenance engineers in

the aircraft system as well as improve the design of the air craft. Depending on the

requirement there are flight simulators designs starting from PC Laptop based one to the

highly realistic replica of the cockpits. These flight simulators are used to train the

commercial pilots to the highly skilled military pilots. In the international FFS level D

slandered platform of the flight simulator should be able to move in 6 degree of freedom

and the display should give an 150X40 view to the pilot.

1.2 Statement of the problem

Normally when pilots are trained, they were trained in an actual helicopter. Due to the fact

that helicopter maintenance and the fuel is expensive training a pilot has become

expensive. Since it is impossible to change the weather conditions, most of the pilots are

not trained all the conditions. Not only that but also it is hard to implement the emergency

situations in an actual helicopter without destroying it. So pilots are not trained in those

situations. Researchers can use this flight simulator to develop the helicopters and also it

can be used to train the maintenance of a helicopter. Not only that but also simulator can be

used as gaming device.

Page 10: Development of a Helicopter Flight Simulator Prototype

2

1.3 Objectives

Main objective is to design and build a prototype of a helicopter flight simulator which can

imitate the actual helicopter motion. So that it can be used in training a helicopter pilot or

as a gaming device.

Helicopter flight simulator will use a joystick to get the human input to imitate the

helicopter motion.

Helicopter flight simulator will be able to achieve the motion of a helicopter taking

off and landing vertically.

Helicopter flight simulator will be able to achieve the motion of helicopter going

forward backward.

Helicopter flight simulator will be able to achieve the motion of helicopter moving

sideways.

Helicopter flight simulator will be able to achieve the motion of helicopter rotating

around the axis.

1.4 Scope and limitation

Main purpose of this thesis is to build a prototype of a helicopter flying simulator which

can imitate the actual helicopter motion. So that it can be used to train a helicopter pilot

basic of flying. For that the fallowing tasks should be achieved.

Helicopter flight simulator will use a joystick to get the human input to imitate the

helicopter motion.

Helicopter flight simulator will be able to imitate the motion of a helicopter taking

off and landing vertically.

Helicopter flight simulator will be able to imitate the motion of helicopter going

forward backward.

Helicopter flight simulator will be able to imitate the motion of helicopter moving

sideways.

Helicopter flight simulator will be able to imitate the motion of helicopter rotating

around the axis.

This thesis doesn’t consider about implementation of the weather conditions and the

emergency situations.

In this thesis hardware part will only imitate the roll and pitch motion of the helicopter and

the yaw will be implemented in the virtual environment.

Page 11: Development of a Helicopter Flight Simulator Prototype

3

CHAPTER 2

LITERATURE REVIEW

2.1 OpenGL

OpenGL (Open Graphics Library) is a software interface to graphic hardware. OpenGL

can be used in rendering 2D and 3D vector graphics. Normally this API interacts with the

graphics processing unit to achieve hardware accelerated rendering.

Open GL is designed as a streamlined, hardware –independent interface to be implemented

on many different hardware platforms. Open GL doesn’t provide high level commands for

describing models of three dimensional objects. So in order to build the desired model,

points, lines and polygons are used.

2.2 Microsoft visual C++

Microsoft visual C++ is an Integrated Developing Environment (IDE) which is

commercially available for debugging the C++ codes. Especially when the code is written

in windows environment visual C++ can be used for debugging. Not only that but also if

the application is needed to run in windows environment it is better to use visual C++.

Header files and library files can be added depending on the requirement of the project.

Microsoft visual C++ will be used in this thesis to run the OpenGL API. Microsoft visual

C++ can be used as a development tools to develop flight simulation interface.

2.2.1 SFML Library

SFML (Simple Fast Multimedia Library) provides the interfaces to connect various

devices to the computer. These libraries can be used to access the input devices of

the computer. This library is composed with five main modules

o Window

o System

o Graphics

o Audio

o Network

SFML window can be used to access joystick input and modify the joystick input

in visual C++.

2.2.2 GLUT Library

GLUT is an open GL tool kit which can be used to

o Write the open GL programs

o Graphic rendering

o Call back driven event processing

o Generate solid and wire frames of objects

o Upload the objects to open GL interface

Page 12: Development of a Helicopter Flight Simulator Prototype

4

2.3 3ds Max

3D max is a 3D modeling software which can be used to model the 3D objects. Not only

that but also it can be used to render the objects, animate the objects.

In this thesis 3D max will be used to model the virtual environment.

2.4 Stewart platform

A Stewart platform is a parallel robot with six prismatic actuators mounted on a fixed base

plane. These six prismatic actuators gives the ability to control the roll, pitch and yow of

the platform as well as the linear motions along x, y and z directions. That is the Top

mobile plane has the ability to move in six degrees of freedom and can be controlled. In

most cases these linear actuators are hydraulic jacks and they are mounted in pairs in the

mechanism base. Even though hydraulic jacks are used to control the orientation and the

position of the platform, fixed DC motors can also be used to control the platform.

For this thesis three degree of freedom is enough to manipulate the basic motions of the

helicopter. That motion can be achieved by using two DC motors and one spring in the

middle of the platform as shown figure 2.1

Figure 2.1: Stewart Platform

2.5 Microcontroller

Microcontroller can be defined as a small computer with a processor core with a

programmable memory, inputs and outputs. In this thesis project an Arduino platform with

an Atmel microcontroller is used. Arduino is an open source physical platform where

software can be developed to execute on the underlying Arduino platform. It can be

programmed to sense the physical world through sensors and respond accordingly by

controlling an output such as motors and lights. Hardware and software parts are two main

fragments in this Arduino platform.

Page 13: Development of a Helicopter Flight Simulator Prototype

5

Software part

The Arduino board is programmed using IDE (Integrated Development

Environment) which is used to write the program, compile it and upload it to the

Arduino. Using the IDE program installed in a computer, the required program can

be written in simple object oriented language. Furthermore complexity of

programming reduces with the ability to import and use necessary library files.

When the program is uploaded to the board, avr –gcc compiler converts the

program into an understandable language to the microcontroller.

Hardware part

Arduino microcontrollers vary from the simplest platform with few I/O ports to

more sophisticated complex platforms with more capabilities. Depending on the

required number of inputs and outputs, clock-speed and required basic

functionalities a suitable microcontroller is selected.

Arduino Microcontroller: the ATmega1280

The Arduino Mega is a microcontroller board based on the ATmega1280.It has 54

digital input/output pins (of which 14 can be used as PWM outputs), 16 analog

inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB

connection, a power jack, an ICSP header, and a reset button. It contains everything

needed to support the microcontroller. Arduino can simply connect to a computer

with a USB cable or power to the board can be given from an AC-to-DC adapter or

battery.

Table 2.1 Summary of Arduino mega specification

Input Voltaage (Limits) 6-20V

Digital I/O pins 54

Analog Input Pins 16

DC current per I/O Pin 40 mA

DC current per 3.3V Pin 50 mA

Flashy Memory 128KB

SRAM 8KB

EEPROM 4KB

ClockSpeed 16MHz

Page 14: Development of a Helicopter Flight Simulator Prototype

6

2.6 Moment of inertia

Moment of inertia is denoted by (I), which normally denotes the resistance to angular

acceleration around an given axis. Given bellow table shows equations to calculate the

moment of inertia of some simple objects.

Figure 2.2: Moment of inertia for simple parts

Page 15: Development of a Helicopter Flight Simulator Prototype

7

2.7 Center of gravity

Center of gravity is the location where the average of the entire weight applies. Depending

on the structure of the object center of gravity is changed. Not only that but also this is the

point where resultant forces nullified due to the gravity force.

Center of gravity of a human

Figure 2.3: Center of gravity of a human

Normally center of gravity of a human is lies above the hip joints and between the

feet. When the human sits the center of gravity moves up towards the chest.

2.8 Spring equations

Spring is an elastic device, usually a metal helix where you can store mechanical energy.

When a spring is stretched or compressed it can store mechanical energy and when it is

released it will leash out a force proportional to the change of spring’s length. Springs can

be classified depending on the applied force.

Tension/Extension spring

Compression spring

Constant spring

Variable spring

Hooke’s law

Hooke’s law states that Force that pushes back the spring is linearly proportional from the

equilibrium distance. Spring will obey the Hooke’s law as long as it is not stretched

beyond the elastic limit

Where,

f –force vector, k-spring constant and x –displacement vector

Page 16: Development of a Helicopter Flight Simulator Prototype

8

When a force is applied to a spring simple harmonic motion can occur. Simple harmonic

motion can be calculated by using the fallowing equation

Where A and B constants can be found using velocity of the mass and the initial

displacement .

Force can be calculated by using the below equation

Where

E-Young’s modulus, d-spring wire diameter, L-free length of the spring , n- Number of

active winding , v – Poisson ratio , D –spring outer diameter

2.9 DC motors and motor drivers

DC motor

Since the flight simulator is proposed to control using a DC motors, DC motor

control becomes a vital part of this thesis. In motor controlling there are three main

parameters related to this thesis.

Speed

Direction

Position

The speed of the motor can be controlled using the varying the input voltage to the

motor. One of the most efficient ways to control the input voltage is by generating a

pulse width modulated signal using a microcontroller.

The most popular way to control the direction of the motor is by using an H bridge

implementation.

Position can be calculated by using the RPM value. Since the RPM of a motor

depends on voltage supplied to the motor by increasing or decreasing it position

can be controlled.

Since all the above mathematical relations are nonlinear P, PID, PD controller

might have to use to control the error.

When choosing a suitable motor, power of the motor should be calculated

according to the situation. Given below are some of the motor torque calculation

equations

.

Power into motor can be calculated using the below equation

Where is the input power to the motor, I =current and V = voltage applied

Power out of the motor can be calculated using the below equation

Page 17: Development of a Helicopter Flight Simulator Prototype

9

Where P= power, M= required torque, = angular velocity

Angular velocity is commonly used in RPM (revolutions per min) units and it can

be converted in to rad/sec using the below equation

Efficiency of the motor can be calculated using the below equation. Normally

maximum efficiency of a motor is around 30%-40%

Motor drivers

Motor drivers are used to govern the rotation of motors. Basically there are two

types of motor drivers. One type of motor controllers is manually controlled

whereas the other type is controlled automatically. By controlling the digital inputs

to the motor controller starting, stopping, fast stopping and the direction of rotation

of the motor can be controlled.

2.10 PID controller

PID controller will compare the command signal and the measured signal to find the error.

If the command signal is changed or the measured signal is changed due to the load

conditions PID controller will produce an error signal, which will try to automatically

control the input to gain the desired output. The difference between the command signal

and the measured signal or the set point value is calculated as the error values. Normally

PID algorithm consists of three separate constant terms: the proportional, the integral and

derivative values which are denoted as P, D and I. These values can be interpreted in terms

of time where p depends on the present error I on the past error and the D is the predicted

future error. Relationship between Kp, Ki and Kd is important response characteristics

Proportional term refer to the rise time, of which these three parameters are most useful.

– To decrease the rise time

– To reduce the overshoot and settling time

– To eliminate the steady state error

Given bellow is a complete PID equation

Where

- Proportional gain

– Integral gain

– Derivative gain

– Error

- Time

– Variable of integration

Page 18: Development of a Helicopter Flight Simulator Prototype

10

is the control input to the system which consists of three terms. is the term

proportional to the error. is proportional to the integral of the error. Where as

is proportional to the derivative of the error.

When implementing a PID controller in a microcontroller, the above continuous time

model is approximated to a discrete time model in a mathematical point of view where

Where is the sampling interval.

Then the discrete time PID controlling equation changes to

Then the computed discrete signal is transformed into a continuous time signal

using pulse width modulation. The resulting signal is then fed to the system.

2.11 Encoder

Encoders are usually used to determine the speed or the angular position of a rotating shaft.

However quadrature encoders can be used to determine the direction of rotation as well as

speed and angular position. Usually in a quadrature encoder, there are two sets of signals

generated by two sets of tracks on the encoder disk which are 90 degrees out of phase. By

comparing these two output signals read by the software using interrupts on any edge, the

direction of rotation can be determined.

If the motor rotates clockwise, voltage level of channel A will be low when the rising edge

of the channel B appears. If the motor rotate counter clockwise, the voltage level of

channel A will be high when the rising edge occurs in channel B.

Figure 2.4: Encoder readings

Page 19: Development of a Helicopter Flight Simulator Prototype

11

2.12 Joystick

Joystick is a control column where the stick is pivots on a base. Also it sends the signals to

the controlling device regarding the movement of the stick. Joystick is the most common

control device in many cockpits. Not only that but also joystick is used to play video

games, controlling the cranes, trucks unmanned vehicles, surveillance cameras and etc.

Normally using a joystick x and y output signals can be obtained.

In this thesis Logitech EXTREME 3D PRO joystick will be used. Logitech EXTREME 3D

PRO joystick has 4 control axis, 11 buttons and 8 way hat switch. It is a plug and play

joystick where the data can be access using visual C++ or any other suitable programming

language.

2.13 Common cockpit helicopter training simulator

This is similar project that has done by Stottler Henke Associates,Inc (SHAI).Common

cockpit helicopter training simulator have being developed to assist crewmembers learn the

US Navy’s new common cockpit MH-60R and MH-60S helicopters. The Operator

Machine Interface Assistant (OMIA) system is being used by the US Navy to assist

operators learn the new common-cockpit MH-60R and MH-60S helicopters in an

increasingly broad variety of mission tasks and analyses, using the wide assortment of

sensor, navigation, and computational resources available. The OMIA system consists of

proprietary software to reproduce the mission display portion and other aspects of the

helicopters. Flight Simulator is being integrated with the present OMIA system to provide

the flight display, and other capabilities built into flight simulator. An interface has been

established between the programs so changes made by one system are propagated to the

other system.

Page 20: Development of a Helicopter Flight Simulator Prototype

12

2.14 Motion systems

MotionSystems is a company started in 1997 where they develop the motion simulators for

the professional and entertainment purposes. Most commonly those platforms are used

driving schools. Given bellow is one of the motion platforms which is used in SC -07 flight

simulator.

Figure 2.5: Motion Platform drawing

Page 21: Development of a Helicopter Flight Simulator Prototype

13

CHAPTER 3

METHODOLOGY

3.1 Helicopter Flight Simulator

Main purpose of this flight simulator is to imitate the basic movement of a helicopter so

that it can be used to train helicopter pilot. Thus this flight simulator should be able to

imitate the motion of taking off, landing, moving forward, moving backward and rotating.

In this project two motors are used to imitate the motion of the helicopter. One motor

imitate the movement of helicopter moving forward and the backwards. Other motor is

used to imitate the helicopter moving sideways. Thus pitch and roll angles will be

controlled by these two motors. Motion of the helicopter rotation, taking off and the

landing is implemented only in the virtual environment.

Inputs to the motors are given using a joystick. According to the joystick input the platform

will move along the pitch or roll axis. Not only have that but also in virtual environment

helicopter move forwarded, backward and sideways according to the joystick input. Taking

off and landing is only be implemented in the virtual environment.

Objects for the virtual environment is developed using 3Dmax and using open GL virtual

environment is developed. Video glasses will be used to present the virtual environment to

the person who is using flight simulator.

3.2 Hardware Implementation

Flight simulator hardware design has two degree of freedom. Two planes are there to

imitate the roll and pitch motions. Thus to move these planes two motors are used.

Dimension of the outer plane is 100cmX150cm, inner plane is 75cmX120cm and the

height of these two planes are 125 cm. Chair is mounted 35cm bellow from the motor

mounting position ,So that when a person sits on the chair center of gravity will be placed

along the motor axis. Thus required motor torque will be less. Inner plane is mounted in a

way that flight simulator can have 360° motion around the pitch axis. Not only that but

also outer plane can have a 360° motion around the roll axis.

Page 22: Development of a Helicopter Flight Simulator Prototype

14

Figure 3.1: Flight simulator model

Figure 3.2 is the stress analysis using solid work for steel. Since there is no deformation

when the force of 1500N applied to the inner plane. Hollow steel tubes were chosen to use

to build the flight simulator

Figure 3.2: Steal bending deformation analysis

Page 23: Development of a Helicopter Flight Simulator Prototype

15

3.2.1 DC Motor calculations

Moment of inertia of a hollow tube can be calculated using the below

equation.

Torque for the motor can be calculated using the below equation

Where = torque, I = moment of inertia, = angular acceleration

Angular acceleration can be calculated using the bellow equation

Where = final angular velocity, = initial angular velocity, = angular

acceleration, t = time

Required power can be calculated using bellow equation

o Motor power calculations for Inner plane

Moment of inertia of the 120 cm hollow bar

Moment of inertia of the 75 cm hollow bar

Middle plane mass (only mechanical part) = 22kg; volume = 0.02

Center of gravity

Total inertia of the middle plane at center of mass

Inertia at the motor mounting point because of the mechanical design

Inertia at the motor mounting point because the human

a

b

Page 24: Development of a Helicopter Flight Simulator Prototype

16

Total Inertia for the motor at the middle plane

Required angular acceleration = 2 , so the torque required,

Thus the required for the inner plane motor (p) = 202.35 w

o Motor power calculations for outer plane

Outer plane mass (only mechanical parts) = 28kg; volume = 0.03 ;

surface area =3.64

Center of gravity

Total inertia of the Outer plane at center of mass

Inertia at the motor mounting point because of the mechanical design

Required angular acceleration = 3 , so the torque required,

Thus the required for the inner plane motor (p) = 303.525 w

So for the inner plane 24V, 24A 450W DC motor is selected and for the

outer plane 24V, 24A, 500W DC motor is selected.

Table 3.1 Summary of hardware components

Hardware components Specifications

Pitch motor 24V,24A ,450 W

Roll motor 24V,24A,500W

Encoder Optimal Encoder with 1024 resolution

Micro Controller Arduino Mega

Joystick Logitech EXTREME 3D PRO

Power supply 24V,24A

Page 25: Development of a Helicopter Flight Simulator Prototype

17

3.3 Software Implementation

To imitate the real helicopter, flight simulator platform should move according to

the joystick input. So the joystick input is captured using visual C++ and send to

the Arduino board using serial communication.

Figure 3.3: Data flow between entities

3.3.1 Joystick Input and Serial Communication

Even though Logitech EXTREME 3D PRO joystick has 26 inputs only

three inputs will be used in this thesis. Thus the x, y and rotational axis

inputs from the joystick were captured using visual C++.x, y and rotational

value will vary from -1000 to 1000. x, y axis and rotational axis values are

send to open GL program and only x and y axis values send to the serial

communication port. While serial communication with the Arduino some

data can be loss. If there is a data loss Arduino might not be able to

differentiate the x and y value. So data is send as a data string. This data

string will have a starting character ($) and an ending character (*).

3.3.2 Virtual environment

Virtual environment for the flight simulator will be the map of Asian

Institute of Technology (AIT). Objects for the virtual environment will be

designed separately using 3ds max. Almost every building in AIT such as

ISE, SOM, SET, CSIM, Energy, SODEXO, Administration, AIT CC and

etc were modeled using 3ds max and converted in to an object file so that it

can be used import to Open GL.

3.3.3 Open GL

Object files of the buildings were imported to open GL. These object files

were placed in the open GL in a way that look like Asian Institute of

Technology. Thus the virtual environment looks like Asian Institute of

Technology glut, glm, texture are some of the main libraries used to create

the virtual environment.

admin = glmReadOBJ("models/admin/admin.obj"); if (!admin) exit(0); glmUnitize(admin);

Page 26: Development of a Helicopter Flight Simulator Prototype

18

glmFacetNormals(admin); glmVertexNormals(admin, 90.0);

Initializing the models to open GL can be done using the above code. After

initializing model and setting the color and the light effects. Models should

play so that it will be visible in the open GL environment. In here texture of

the model color of the model and the scale of the model can be changed glPushMatrix(); glTranslatef(0,0,0); glScalef(150,200,150); glmDraw(admin, GLM_SMOOTH| GLM_TEXTURE| GLM_COLOR); glPopMatrix();

After that using glutDisplayFunc(); model can be draw in the open GL

environment. Since the glut function is used to draw the model, using glut

main loop it is redrawn repeatedly. Because of that open GL environment

can be animated.

Captured joystick inputs were used to move the Open GL camera.

According to the joystick input of x and y camera view will move forward,

backward or sideways. Not only had that but also according to the rotational

axis input camera will rotate around its axis.

Movement of the camera is done by using gluLookAt();and

glRotatef();functions. gluLookAt( ) function to move the camera forward

backward ,sideways, up and down. glRotatef( ) function to rotate the

camera around an axis.

3.3.4 Arduino Programing

Joystick input is send to Arduino board via the serial communication. Data

string which is send by visual C++ to the serial communication port will be

read by the Arduino board. Arduino board will check for the starting

character and the ending character of the data string and if only and only if

both starting character and the ending character are satisfy data string will

be used. Arduino will extract x and y value from the data string. Since flight

simulator platform is only needed to move 360° those extracted values will

be mapped from -360 to 360.

PID controller is designed to control the pitch axis and roll axis motors. So

the input values will be sending to the pitch and roll control PID so that

according to the joystick input inner and the outer planes can be moved.

Encoders are used to positions of the planes. Encoders which were used

here have 1024 pulses per resolution. Since both the encoder input pins are

connected to interrupt pins in Arduino board one resolution will give 4096

pulses.

Page 27: Development of a Helicopter Flight Simulator Prototype

19

3.4 Flow cart of the System

Figure 3.4: Flow chart of system

NO YES

YES

START

TAKE OFF

MOVE THE

PLATFORM

AND THE

GRAPHICS ON

THE SCREEN

CHECK

THE

JOYSTICK

INPUT

CURRENT

JOYSTICK INPUT

IS SIMMILAR TO

THE OLD INPUT FINISH LANDIN

G

NO

Page 28: Development of a Helicopter Flight Simulator Prototype

20

CHAPTER 4

RESULTS AND DISCUSSION

4.1 3ds max and OpenGL

Figure 4.1 shows the bird eye view of the AIT map which was created using 3ds max.

Each and every building there is model separately convert it to object file. Those buildings

were imported to open GL and place that in the virtual environment.

Figure 4.1: AIT map bird eye view

Figure 4.2 shows the view of the virtual environment as how the person who is sitting in

the flight simulator can see. As it is visible camera has been moved in positive direction of

the y axis to imitate the midair motion of a flight simulator.

Page 29: Development of a Helicopter Flight Simulator Prototype

21

Figure 4.2: Virtual environment

4.2 Visual C++ joystick input and serial Communication

Figure 4.3 shows the recognition of the joystick and checking the axis’s of the joystick and

sending the data to the serial communication port.

Figure 4.3: Joystick Input and serial communication

Page 30: Development of a Helicopter Flight Simulator Prototype

22

4.3 Step response of the flight simulator

One radiant input is given to the flight simulator to check the step response. Outer plane

response is shown in the Figure 4.5 and the inner plane response to the step input is shown

in Figure 4.4.

Figure 4.4: Step response of the pitch axis

Figure 4.5: Step response of the roll axis

Page 31: Development of a Helicopter Flight Simulator Prototype

23

4.4 Relationship between the joystick input and the flight simulator

Relationship between the joystick input and the flight simulator output analyzed in the

Figure 4.6 and Figure 4.7. If the joystick moves forward and backwards flight simulator

will start moving around the pitch axis. Relationship between the joystick input and the

pitch axis movement is shown in the Figure 4.6. If the joystick moves sideways flight

simulator will start moving around the roll axis. Relationship between the joystick input

and the roll axis movement is shown in the Figure 4.7.

Figure 4.6: Relationship between the joystick input and the roll axis

Figure 4.7: Relationship between the joystick input and the pitch axis

Page 32: Development of a Helicopter Flight Simulator Prototype

24

Figure 4.8 shows the movement of the hardware model when the joystick is moved in x

and y axis. As it is showed in the Figure 4.8 middle plane is moved alone the pitch axis and

the outer plane is moved alone the roll axis.

Figure 4.8: Joystick input and the hardware model axis

Page 33: Development of a Helicopter Flight Simulator Prototype

25

CHAPTER 5

CONCLUSION AND RECOMMNDATIONS

5.1 Conclusion

The joystick input is captured using visual C++ and Open GL is used to import complex

models of AIT buildings and create a virtual AIT model. This model is animated according

to the joystick input. Not only that but also hardware model also fallow the joystick inputs.

This will help the flight simulator to imitate the actual helicopter movements. Arduino

micro controller is used. PID controller is used to control the roll and pitch axis motors.

To keep the center of gravity at the middle and for the safety seat belts in the flight

simulator should be fastening up enough so that the person who is using the flight

simulator cannot move freely.

5.2 Recommendations

Implementing the barriers in the virtual environment. So that when the flight simulator is

going to colloid in the virtual environment there will be and warning.

If the flight simulator colloids with an object in the virtual environment, try to implement

that in the prototype.

Implementing different weather conditions and scenarios so that it could be used to train a

pilot.

Page 34: Development of a Helicopter Flight Simulator Prototype

26

REFERENCES

[1] Open GL Programming Guide ,Fifth Edition By Dave Shreiner ,

Masson Woo ,Jackie Neider, Tom Davis

[2] Computer Graphics Through OpenGL By Samanta Guha

[3] http://www.columbia.edu/~njr2121/1-s2.0-004579069190035X-

main.pdf

[4] https://www.opengl.org/discussion_boards/showthread.php/132295-

JoyStick-implementation-with-GLUT

[5] http://msdn.microsoft.com/en-us/library/fx6bk1f4(v=vs.90).aspx

[6] http://arduino.cc/en/Main/arduinoBoardMega

[7] http://www.motionsystems.eu/implementations/professionals/sc-07-flight-

simulator/

[8] Common Cockpit Helicopter Training SimulatorBy Robot A. Rechards

[9] http://pages.videotron.com/iscience/index.html [10] http://cnx.org/contents/031da8d3-b525-429c-

[email protected]:63/College_Physics

Page 35: Development of a Helicopter Flight Simulator Prototype

27

APPENDICES

APPENDIX A: Drawings of the flight simulator parts

Page 36: Development of a Helicopter Flight Simulator Prototype

28

APPENDIX B: Mechanical Model