summaryrefslogtreecommitdiffstats
path: root/uav_ctrl_nominal.m
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-04-05 01:30:24 +0200
committerNao Pross <np@0hm.ch>2024-04-05 01:30:24 +0200
commit4cafd296724faa1023b289029f0fcf7ba92cce95 (patch)
tree2154211f48e525940735495ba06291a30eeb60be /uav_ctrl_nominal.m
parentMove uncertain model design into uav_model and add more design parameter (diff)
downloaduav-4cafd296724faa1023b289029f0fcf7ba92cce95.tar.gz
uav-4cafd296724faa1023b289029f0fcf7ba92cce95.zip
Replace LQR with H-infinity design
Diffstat (limited to 'uav_ctrl_nominal.m')
-rw-r--r--uav_ctrl_nominal.m38
1 files changed, 0 insertions, 38 deletions
diff --git a/uav_ctrl_nominal.m b/uav_ctrl_nominal.m
deleted file mode 100644
index 1030233..0000000
--- a/uav_ctrl_nominal.m
+++ /dev/null
@@ -1,38 +0,0 @@
-% Copyright (C) 2024, Naoki Sean Pross, ETH Zürich
-%
-% Design a nominal controller for UAV.
-
-function [ctrl] = uav_ctrl_nominal(params, model)
-
-% ------------------------------------------------------------------------
-% Design a nominal LQR controller
-
-% Define penalties according to following priorities
-
-q_pos = 1; % penalty on position
-q_vel = 10; % penalty on linear velocity
-q_ang = 100; % high penalty on angles
-q_rate = 100; % very high penalty on angular velocities
-
-r_ang = 1; % flap movement is cheap
-r_thrust = 100; % thrust is more expensive on the battery
-
-nx = model.linear.Nx;
-nu = model.linear.Nu;
-
-% LQR design matrices
-Q = kron(diag([q_pos, q_vel, q_ang, q_rate]), eye(3));
-R = diag([r_ang, r_ang, r_ang, r_ang, r_thrust]);
-N = zeros(nx, nu); % no cross terms
-
-% Compute controller
-[K, S, poles] = lqr(model.linear.StateSpace, Q, R, N);
-
-% ------------------------------------------------------------------------
-% Save controller
-
-ctrl = struct();
-ctrl.K = K;
-
-end
-% vim: ts=2 sw=2 et: