Beruflich Dokumente
Kultur Dokumente
BIBLIOGRAPHY
BIBLIOGRAPHY
69
V. Utkin.
Sliding Modes in Control and Optimization.
Communications and Control Engineering Series. Springer-Verlag, 1992.
ISBN 9783540535164.
URL http://books.google.no/books?id=
uzNmQgAACAAJ.
R. Walpole. Probability and statistics for engineers and scientists. Prentice
Hall, 2002. ISBN 9780130415295. URL http://books.google.no/
books?id=CgNEAQAAIAAJ.
Wikipedia - PID. Pid controller wikipedia, the free encyclopedia, 2012. URL http://en.wikipedia.org/w/index.php?title=PID_
controller&oldid=490210451. [Online; accessed 3-May-2012].
X-Plane 9. X-plane 9 flight simulator, 2012. URL http://www.x-plane.
com/desktop/landing/.
Appendix A
as
71
Appendix B
Attachment Description
Attached to this thesis is a folder named Matlab, where all the Matlab code
and Simulink models are included, and a folder named X-plane plugin,
where the plugin for simulation with X-Plane is included. Some of the
Matlab code can be found in Appendix B.2. To set up your computer for
X-Plane simulation, follow the small guide in Appendix C.
The code is structured as in Figure B.1 and organized as:
.m-files
SimGNCSystem.m - The main run file, simulates the different case
studies.
initGNC.m - Initializes the aircraft and the GNC system.
x plane interface.m - Initializes the X-Plane communication block.
systemIdentification.m - System identification for finding a model to
use in sliding mode control.
ordlsq.m - Ordinary least square system identification function.
73
B.2
B.2.1
1
2
3
4
5
6
7
8
9
10
11
Matlab Code
Simulation of GNC System
12
13
14
15
clc;
clear all;
close all;
16
17
18
19
20
21
22
23
24
25
26
%% Initialize
%
Set waypoints [North East Altitude]
%
The Waypoints are selected for take
%
at Vaernes (ENVA), Norway.
%
Way points = [0 0 0;
0 8000 500;
10000 8000 500;
10000 32000 500];
27
28
29
30
% Without payload
payload = 0; % [kg]
31
32
33
% With payload
% payload = 378; % [kg]
34
35
36
37
% Speed
takeoff speed = 80; %[kt]
cruise speed = 48; %[kt]
38
39
% If wind, +30 kt
75
40
41
% System Identification
systemIdentification
poler = [0 .00006 0.00003];
42
43
44
45
46
Initialize
47
initGNC
48
49
50
51
%% Simulation
52
53
54
55
56
57
58
%
%
Simulation with Sliding Mode Control
%
for pitch and altitude
% sim('GNCSystem SM pitch')
59
60
%% Plot
61
plots
62
B.2.2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
%% Info
%
%
Initialization file for the Guidance,
%
Navigation and Control System (GNC)
%
%
%
Aircraft used in simulation is the Cessna 172SP
%
Length:
27 ft 2 in
(8.28 m)
%
Height:
8 ft 11 in
(2.72 m)
%
Wingspan:
36 ft 1 in
(11.00 m)
%
Wing area: 174 sq ft
(16.20 m2)
%
Weight:
1,717 lb
(779 kg)
%
%
Max Takeoff Weight: 2,550 lb
(1 157 kg)
%
Max Payload Weight:
833 lb
(378 kg)
%
17
18
19
20
21
22
23
24
25
26
27
%
%
%
%
%
%
%
%
%%
%
%
Initialize simulation
28
29
30
31
32
33
34
35
36
37
38
% Physics
39
40
41
42
43
44
45
46
% Payload
init payload = [payload 0 0 0 0 0;
0 payload 0 0 0 0;
0 0 payload 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0 0];
47
48
49
50
51
52
53
54
physics.g = 9.81;
mass = [743.44 0 0 0 0 0;
0 743.44 0 0 0 996.21;
0 0 743.44 0 996.21 0;
0 0 0 2008.76 0 0;
0 0 996.21 0 3827.04 0;
0 996.21 0 0 0 5408.32]+ init payload;
55
56
57
58
%% Xplane Interface
59
60
61
x plane interface
77
62
63
64
%% Reference Model
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
% Commanded Altitude
reference.commandedHeight.time = [0 10 10 sim stop];
reference.commandedHeight.signals.values=[Way points(1,3);
Way points(1,3);
Way points(2,3);
Way points(2,3)];
reference.commandedHeight.signals.dimension = 1;
82
83
reference.lp.height.omega = 0.05;
84
85
86
%% Guidance
87
88
89
90
91
92
93
% LOS Guidance
% Calculate waypoint matrix for NorthEast
94
95
96
97
98
99
100
101
102
103
% Kp = 1 / Lookahead Distance
guidance.los.Kp = 1/600;
104
105
106