summaryrefslogtreecommitdiffstats
path: root/uav.m
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-05-14 01:05:15 +0200
committerNao Pross <np@0hm.ch>2024-05-14 01:05:15 +0200
commit868d27134a48f3de23139e873b867dba46b0d5ec (patch)
tree0d5c98573a2c95cc225e149c106335d640c11c2c /uav.m
parentPrepare structure for endterm (diff)
downloaduav-868d27134a48f3de23139e873b867dba46b0d5ec.tar.gz
uav-868d27134a48f3de23139e873b867dba46b0d5ec.zip
Improve console output
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);