From 5b84855ceca34d280337ab009f7e7ef676b59c1d Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 31 May 2024 14:25:54 +0200 Subject: Update weights --- uav_performance_musyn.m | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'uav_performance_musyn.m') diff --git a/uav_performance_musyn.m b/uav_performance_musyn.m index 5ad5fa5..a521f81 100644 --- a/uav_performance_musyn.m +++ b/uav_performance_musyn.m @@ -22,28 +22,30 @@ s = tf('s'); T_alpha = params.actuators.ServoSecondsTo60Deg; T_omega = 0.1; -T_xy = 8; -T_z = 10; +T_xy = 6; +T_z = 9; % Inverse performance functions +W_Palpha = tf(.2); +W_Pomega = tf(.2); -W_Palpha = make_weight(1/T_alpha, 10, 4); -W_Pomega = make_weight(1/T_omega, 10, 2); +W_Ralpha = 1 / ((s * T_alpha)^2 + 2 * T_alpha * s + 1); +W_Romega = 1 / ((s * T_omega)^2 + 2 * T_omega * s + 1); W_Rxy = 1 / ((s * T_xy)^2 + 2 * T_xy * .8 * s + 1); -W_Rz = 1 / (s * T_z + 1); +W_Rz = 1 / ((s * T_z)^2 + 2 * T_z * s + 1); -W_Pxy = tf(5); +W_Pxy = tf(1); W_Pz = tf(1); W_Pxydot = tf(.01); W_Pzdot = tf(.1); -W_Pphitheta = .001 / (s * T_xy + 1); -W_Ppsi = tf(.1); +W_Pphitheta = tf(.005); +W_Ppsi = tf(.2); % Construct performance vector by combining xy and z -W_ref = blkdiag(W_Rxy * eye(2), W_Rz); +W_Rref = blkdiag(W_Rxy * eye(2), W_Rz); W_PP = blkdiag(W_Pxy * eye(2), W_Pz); W_PPdot = blkdiag(W_Pxydot * eye(2), W_Pzdot); @@ -52,7 +54,9 @@ W_PTheta = blkdiag(W_Pphitheta * eye(2), W_Ppsi); perf = struct(... 'FlapAngle', W_Palpha * eye(4), ... 'Thrust', W_Pomega, ... - 'ReferenceFilter', W_ref, ... + 'ReferenceFilter', W_Rref, ... + 'FlapAngleFilter', W_Ralpha * eye(4), ... + 'ThrusterFilter', W_Romega, ... 'Position', W_PP, ... 'Velocity', W_PPdot, ... 'Angles', W_PTheta); @@ -61,14 +65,14 @@ if do_plots % Bode plots of performance requirements figure; hold on; - bodemag(1/W_Palpha); - bodemag(1/W_Pomega); - bodemag(1/W_Pxy); - bodemag(1/W_Pz); - bodemag(1/W_Pxydot); - bodemag(1/W_Pzdot); - bodemag(1/W_Pphitheta); - bodemag(1/W_Ppsi); + bodemag(W_Palpha); + bodemag(W_Pomega); + bodemag(W_Pxy); + bodemag(W_Pz); + bodemag(W_Pxydot); + bodemag(W_Pzdot); + bodemag(W_Pphitheta); + bodemag(W_Ppsi); grid on; legend('$W_{P,\alpha}$', '$W_{P,\omega}$', ... -- cgit v1.2.1