summaryrefslogtreecommitdiffstats
path: root/uav_sim_step.m
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--uav_sim_step.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/uav_sim_step.m b/uav_sim_step.m
index 65fb36f..2130a3d 100644
--- a/uav_sim_step.m
+++ b/uav_sim_step.m
@@ -104,7 +104,7 @@ ref_step = ones(1, nsamp); % 1d step function
in_step_x = [ noise; step_size_h * ref_step; zeros(2, nsamp) ];
in_step_y = [ noise; zeros(1, nsamp); step_size_h * ref_step; zeros(1, nsamp) ];
-in_step_z = [ noise; zeros(2, nsamp); step_size_v * ref_step ];
+in_step_z = [ noise; zeros(2, nsamp); -step_size_v * ref_step ]; % z points down
% Simulation time
t = linspace(0, T, nsamp);
@@ -152,7 +152,7 @@ if do_plots
% Plot limits
alpha_max_deg = params.actuators.ServoAbsMaxAngle * to_deg;
- euler_lim_deg = 1.5;
+ euler_lim_deg = .5;
omega_max_rpm = (params.actuators.PropellerMaxAngularVelocity ...
- params.linearization.Inputs(5)) * to_rpm;
omega_min_rpm = -params.linearization.Inputs(5) * to_rpm;
@@ -298,6 +298,7 @@ if do_plots
% Plot step response from vertical reference to vertical position
subplot(2, 2, 3); hold on;
plot(t, out_step_z(:, idx.PlotPosition(3)));
+ plot(t, out_step_z(:, idx.PlotReference(3)), '--');
grid on;
title('Vertical Position', 'Interpreter', 'latex');
ylabel('Distance (meters)', 'Interpreter', 'latex');