summaryrefslogtreecommitdiffstats
path: root/uav_sim_step.m
diff options
context:
space:
mode:
Diffstat (limited to 'uav_sim_step.m')
-rw-r--r--uav_sim_step.m16
1 files changed, 13 insertions, 3 deletions
diff --git a/uav_sim_step.m b/uav_sim_step.m
index 973a928..82c05e9 100644
--- a/uav_sim_step.m
+++ b/uav_sim_step.m
@@ -22,6 +22,16 @@ P_nom_clp = minreal(usys_clp(...
model.uncertain.index.OutputPlots], ...
model.uncertain.index.InputExogenous), [], false);
+% Check that closed loop is actually stable
+eigvals = eig(P_nom_clp.A);
+nx = size(P_nom_clp.A, 1);
+
+for i = 1:nx
+ if real(eigvals(i)) >= 0
+ error('Closed loop is not stable!');
+ end
+end
+
% Indices for exogenous inputs
Iwwind = (1:3)';
Iwalpha = (4:7)';
@@ -236,10 +246,10 @@ if do_plots
hold on;
step(P_nom_clp(Iomega, Ir(3)) * to_rpm, T);
- plot([0, T], [1, 1] * omega_min_rpm, 'r--');
- plot([0, T], [1, 1] * omega_max_rpm, 'r--');
+ % plot([0, T], [1, 1] * omega_min_rpm, 'r--');
+ % plot([0, T], [1, 1] * omega_max_rpm, 'r--');
grid on;
- ylim([omega_min_rpm - 1, omega_max_rpm + 1]);
+ % ylim([omega_min_rpm - 1, omega_max_rpm + 1]);
title('Vertical $z$ to Thruster $\omega$', 'Interpreter', 'latex');
ylabel('Angular Velocity (RPM)', 'Interpreter', 'latex');
xlabel('Time (seconds)', 'Interpreter', 'latex');