summaryrefslogtreecommitdiffstats
path: root/uav.m
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--uav.m36
1 files changed, 28 insertions, 8 deletions
diff --git a/uav.m b/uav.m
index c646de2..ec84682 100644
--- a/uav.m
+++ b/uav.m
@@ -8,16 +8,36 @@
clear; clc; close all; s = tf('s');
-fprintf('Generating system parameters...\n')
-params = uav_params();
-ctrl = struct();
-
% Flags to speed up running for debugging
do_plots = true;
do_lqr = false; % unused
-do_hinf = false; % midterm
+do_hinf = true; % midterm
do_musyn = true; % endterm
+fprintf('Controller synthesis for ducted fan VTOL micro-UAV\n')
+fprintf('Will do:\n')
+if do_plots
+ fprintf(' - Produce plots\n')
+end
+if do_lqr
+ fprintf(' - LQR synthesis\n')
+end
+if do_hinf
+ fprintf(' - H-infinity synthesis\n')
+end
+if do_musyn
+ fprintf(' - Mu synthesis\n')
+end
+
+% Synthesized controllers will be stored here
+ctrl = struct();
+
+% ------------------------------------------------------------------------
+%% Define system parameters
+
+fprintf('Generating system parameters...\n')
+params = uav_params();
+
% ------------------------------------------------------------------------
%% Define performance requirements
@@ -59,10 +79,10 @@ if do_hinf
% Get nominal system without uncertainty (for lower LFT)
P_nom = minreal(P([idx.OutputError; idx.OutputNominal], ...
- [idx.InputExogenous; idx.InputNominal]));
+ [idx.InputExogenous; idx.InputNominal]), [], false);
- nmeas = max(size(idx.OutputNominal)); % size of y
- nctrl = max(size(idx.InputNominal)); % size of u
+ nmeas = model.uncertain.Ny;
+ nctrl = model.uncertain.Nu;
hinfopt = hinfsynOptions('Display', 'on', 'Method', 'RIC', ...
'AutoScale', 'off', 'RelTol', 1e-3);