From 868d27134a48f3de23139e873b867dba46b0d5ec Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 14 May 2024 01:05:15 +0200 Subject: Improve console output --- uav.m | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'uav.m') 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); -- cgit v1.2.1