Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Matlab Simulator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Guidance Navigation and Control
Matlab Simulator
Commits
fe4d40e3
Commit
fe4d40e3
authored
4 years ago
by
Emilio Corigliano
Browse files
Options
Downloads
Patches
Plain Diff
[outcomes] fixed printed outcomes
parent
2dff1429
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ControlSimulator/start_simulation.m
+29
-13
29 additions, 13 deletions
ControlSimulator/start_simulation.m
ControlSimulator/std_run_HIL.m
+17
-6
17 additions, 6 deletions
ControlSimulator/std_run_HIL.m
with
46 additions
and
19 deletions
ControlSimulator/start_simulation.m
+
29
−
13
View file @
fe4d40e3
...
...
@@ -60,23 +60,43 @@ abs_V = vecnorm(Va');
[
max_dist
,
imax_dist
]
=
max
(
abs_X
);
[
max_v
,
imax_v
]
=
max
(
abs_V
);
% closing the serial connection
if
settings
.
electronics
serialbridge
(
"Close"
)
end
% DATA RECORD (display)
fprintf
(
'OUTCOMES:\n\n'
)
fprintf
(
'OUTCOMES:
(times dt from liftoff)
\n\n'
)
fprintf
(
'total computational Time: %.3f [s]: \n'
,
sum
(
cpuTimes
))
fprintf
(
'mean step computational Time: %.3f [s]: \n'
,
mean
(
cpuTimes
))
fprintf
(
'max step omputational Time: %.3f [s]: \n\n'
,
max
(
cpuTimes
))
fprintf
(
'apogee: %.1f [m] \n'
,
max_z
);
fprintf
(
'@time: %g [sec] \n\n'
,
T_apo
)
fprintf
(
'max step computational Time: %.3f [s]: \n\n'
,
max
(
cpuTimes
))
fprintf
(
'max speed reached: %g [m/s] \n'
,
max_v
)
fprintf
(
'max speed reached: \n'
)
fprintf
(
'@time: %g [sec] \n'
,
Tf
(
imax_v
)
-
otherData
.
tLaunch
)
fprintf
(
'@altitude: %g [m] \n'
,
za
(
imax_v
))
fprintf
(
'@time
: %g [
sec
] \n\n
'
,
Tf
(
i
max_v
)
)
fprintf
(
"@velocity
: %g [
m/s
] \n\n
"
,
max_v
)
;
fprintf
(
'activation airbrakes (end burning phase):\n'
);
fprintf
(
"@altitude: %g [m] \n"
,
otherData
.
z_aerobrakeOn
);
fprintf
(
"@velocity: %g [m/s] \n"
,
otherData
.
vz_aerobrakeOn
);
fprintf
(
'@time: %g [sec] \n'
,
otherData
.
t_aerobrakes
-
otherData
.
tLaunch
)
fprintf
(
"@altitude: %g [m] \n"
,
otherData
.
z_aerobrakes
);
fprintf
(
"@velocity: %g [m/s] \n\n"
,
otherData
.
vz_aerobrakes
);
fprintf
(
'apogee:\n'
);
fprintf
(
'@time: %g [sec] \n'
,
T_apo
-
otherData
.
tLaunch
)
fprintf
(
'@altitude: %.1f [m] \n\n'
,
max_z
)
if
(
not
(
settings
.
ballisticFligth
))
fprintf
(
'parachute 1:\n'
);
fprintf
(
'@time: %g [sec] \n'
,
otherData
.
t_para1
-
otherData
.
tLaunch
)
fprintf
(
"@altitude: %g [m] \n"
,
otherData
.
z_para1
);
fprintf
(
"@velocity: %g [m/s] \n\n"
,
otherData
.
vz_para1
);
fprintf
(
'parachute 2:\n'
);
fprintf
(
'@time: %g [sec] \n'
,
otherData
.
t_para2
-
otherData
.
tLaunch
)
fprintf
(
"@altitude: %g [m] \n"
,
otherData
.
z_para2
);
fprintf
(
"@velocity: %g [m/s] \n\n"
,
otherData
.
vz_para2
);
end
if
not
(
settings
.
electronics
)
M
=
data_flight
.
interp
.
M
;
...
...
@@ -141,8 +161,4 @@ if settings.plots && not(settings.electronics)
end
if
settings
.
electronics
serialbridge
(
"Close"
)
end
clearvars
-
except
Yf
data_flight
settings
This diff is collapsed.
Click to expand it.
ControlSimulator/std_run_HIL.m
+
17
−
6
View file @
fe4d40e3
...
...
@@ -104,7 +104,6 @@ magneticFieldApprox = @(zSlm) XYZ0 + (XYZh-XYZ0)./hmax.*zSlm;
%% INTEGRATION
% setting initial condition before control phase
otherData
.
z_aerobrakeOn
=
0
;
dt
=
1
/
settings
.
frequencies
.
controlFrequency
;
t0
=
0
;
t1
=
t0
+
dt
;
...
...
@@ -158,6 +157,7 @@ while flagStopIntegration || n_old < nmax
lastFlagAscent
=
flagAscent
;
if
not
(
lastLaunchflag
)
&&
launchFlag
tLaunch
=
t0
;
otherData
.
tLaunch
=
t0
;
end
if
launchFlag
&&
(
t0
-
tLaunch
)
<=
settings
.
tb
...
...
@@ -167,6 +167,11 @@ while flagStopIntegration || n_old < nmax
end
if
flagAscent
&&
not
(
flagBurning
)
&&
mach
<=
0.7
if
not
(
flagAeroBrakes
)
otherData
.
t_aerobrakes
=
t0
;
otherData
.
z_aerobrakes
=
z
;
otherData
.
vz_aerobrakes
=
vz
;
end
flagAeroBrakes
=
true
;
else
flagAeroBrakes
=
false
;
...
...
@@ -186,9 +191,19 @@ while flagStopIntegration || n_old < nmax
if
not
(
flagAscent
)
&&
launchFlag
if
z
>=
settings
.
para
(
1
)
.
z_cut
if
not
(
flagPara1
)
otherData
.
t_para1
=
t0
;
otherData
.
z_para1
=
z
;
otherData
.
vz_para1
=
vz
;
end
flagPara1
=
true
;
flagPara2
=
false
;
else
if
not
(
flagPara2
)
otherData
.
t_para2
=
t0
;
otherData
.
z_para2
=
z
;
otherData
.
vz_para2
=
vz
;
end
flagPara1
=
false
;
flagPara2
=
true
;
end
...
...
@@ -267,7 +282,7 @@ while flagStopIntegration || n_old < nmax
% if the obsw sends an opening of -1 while the flag isLaunch is still
% false, triggers the liftoff and the opening of aerobrake is set to 0
if
(
alpha_degree
<
0
&&
not
(
isLaunch
))
if
(
alpha_degree
==
-
1
&&
not
(
isLaunch
))
alpha_degree
=
0
;
isLaunch
=
true
;
disp
(
"Liftoff (obsw signal)!"
);
...
...
@@ -276,10 +291,6 @@ while flagStopIntegration || n_old < nmax
x
=
get_extension_from_angle
(
alpha_degree
);
if
flagAeroBrakes
if
otherData
.
z_aerobrakeOn
==
0
otherData
.
z_aerobrakeOn
=
z
;
otherData
.
vz_aerobrakeOn
=
vz
;
end
plot_control_variable
(
index_plot
)
=
alpha_degree
;
index_plot
=
index_plot
+
1
;
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment