summaryrefslogtreecommitdiffstats
path: root/uav_params.m
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-05-23 00:22:59 +0200
committerNao Pross <np@0hm.ch>2024-05-23 01:15:06 +0200
commit9c1c729b88f89d5d0672aa48e1afb87b99fe2350 (patch)
tree304f9930942948f7465f806040b8e1a68ff48389 /uav_params.m
parentImprove code for DK-iteration (diff)
downloaduav-9c1c729b88f89d5d0672aa48e1afb87b99fe2350.tar.gz
uav-9c1c729b88f89d5d0672aa48e1afb87b99fe2350.zip
Update DK-iteration and clean up
Diffstat (limited to '')
-rw-r--r--uav_params.m66
1 files changed, 15 insertions, 51 deletions
diff --git a/uav_params.m b/uav_params.m
index a1c0e4a..e87e4fd 100644
--- a/uav_params.m
+++ b/uav_params.m
@@ -65,7 +65,7 @@ params.actuators = struct(...
% IMU runs in NDOF mode
params.measurements = struct(...
- 'SensorFusionDelay', 20e-3, ... % in s
+ 'SensorFusionDelay', 50e-3, ... % in s
'LIDARAccuracy', 10e-3, ... % in m
'LIDARMaxDistance', 40, ... % inm
'LIDARBandwidth', 100, ... % in Hz for z position
@@ -82,6 +82,11 @@ omega_max = params.actuators.PropellerMaxAngularVelocity;
F_max = 38.637; % in N (measured)
k_T = F_max / omega_max^2;
+% Lift coefficient from data
+% flap_stair = readtable('meas/Flap_Force_Stair.csv');
+% [~, istart] = min(abs(flap.Force));
+% [~, iend] = min(abs(flap.Force - 3));
+
% FIXME: LiftCoefficient comes from
% https://scienceworld.wolfram.com/physics/LiftCoefficient.html
params.aerodynamics = struct(...
@@ -120,56 +125,15 @@ params.linearization = struct(...
% ------------------------------------------------------------------------
% Performance requirements
-params.performance = struct(...
- 'ReferencePosMaxDistance', 1, ... % m
- 'HorizontalPosMaxError', 2, ... % m
- 'HorizontalMaxSpeed', 2, ... % m / s
- 'HorizontalSettleTime', 6, ... % s
- 'VerticalPosMaxError', 2, ... % m
- 'VerticalMaxSpeed', 2, ... % m / s
- 'VerticalSettleTime', 4, ... % s
- 'AngleMaxPitchRoll', 10 * pi / 180, ... % in rad
- 'AngleMaxYaw', pi, ... % rad
- 'AngleMaxAngularRate', 20 * pi / 180 ... % rad / s
+params.normalization = struct(...
+ 'HPosition', 1, ... % m
+ 'VPosition', 1, ...% m
+ 'HSpeed', 2, ... % m / s
+ 'VSpeed', 2, ... % m / s
+ 'PitchRollAngle', 10 * pi / 180, ... % rad
+ 'YawAngle', 5 * pi / 180, ... % rad
+ 'AngularRate', 2 * pi / 180, ... % rad / s
+ 'WindSpeed', 2 ... % m / s
);
-
-% Scaling matrices (because signals are normalized wrt parameter performance)
-p = params.performance;
-
-params.ErrorScalingMatrix = blkdiag(...
- eye(4) * params.actuators.ServoAbsMaxAngle, ...
- params.actuators.PropellerMaxAngularVelocity ...
- - params.linearization.Inputs(5), ...
- eye(2) * p.HorizontalPosMaxError, ...
- p.VerticalPosMaxError, ...
- eye(2) * p.HorizontalMaxSpeed, ...
- p.VerticalMaxSpeed, ...
- eye(2) * p.AngleMaxPitchRoll, ...
- p.AngleMaxYaw);
-
-params.OutputScalingMatrix = blkdiag(...
- eye(2) * p.HorizontalPosMaxError, ...
- p.VerticalPosMaxError, ...
- eye(2) * p.HorizontalMaxSpeed, ...
- p.VerticalMaxSpeed, ...
- eye(2) * p.AngleMaxPitchRoll, ...
- p.AngleMaxYaw, ...
- eye(3) * p.AngleMaxAngularRate);
-
-
-horiz_settle_speed = (1 - exp(-1)) / params.performance.HorizontalSettleTime;
-if horiz_settle_speed > params.performance.HorizontalMaxSpeed
- fprintf(['Contradictory performance requirements: ' ...
- 'velocity needed to attain horizontal settle time is ' ...
- 'higher than HorizontalMaxSpeed']);
-end
-
-vert_settle_speed = (1 - exp(-1)) / params.performance.VerticalSettleTime;
-if vert_settle_speed > params.performance.VerticalMaxSpeed
- fprintf(['Contradictory performance requirements: ' ...
- 'velocity needed to attain vertical settle time is ' ...
- 'higher than VerticalMaxSpeed']);
-end
-
end
% vim: ts=2 sw=2 et: