Commit 03356dae authored by mmroma's avatar mmroma
Browse files

rc_pilot is working in the full simulation!

parent 13f167b3
...@@ -10,23 +10,23 @@ function [vehicle_params] = setPIDgains(vehicle_params) ...@@ -10,23 +10,23 @@ function [vehicle_params] = setPIDgains(vehicle_params)
% z % z
vehicle_params.PIDctrl.z.kP = 8; vehicle_params.PIDctrl.z.kP = 8;
vehicle_params.PIDctrl.z.kI = 0; vehicle_params.PIDctrl.z.kI = 0.1;
vehicle_params.PIDctrl.z.kD = 1; vehicle_params.PIDctrl.z.kD = 1;
%% Velocity -> Acceleration %% Velocity -> Acceleration
% x-dot % x-dot
vehicle_params.PIDctrl.x_dot.kP = 5; vehicle_params.PIDctrl.x_dot.kP = 5;
vehicle_params.PIDctrl.x_dot.kI = 0; vehicle_params.PIDctrl.x_dot.kI = 0.1;
vehicle_params.PIDctrl.x_dot.kD = 0; vehicle_params.PIDctrl.x_dot.kD = 0;
% y-dot % y-dot
vehicle_params.PIDctrl.y_dot.kP = 5; vehicle_params.PIDctrl.y_dot.kP = 5;
vehicle_params.PIDctrl.y_dot.kI = 0; vehicle_params.PIDctrl.y_dot.kI = 0.1;
vehicle_params.PIDctrl.y_dot.kD = 0; vehicle_params.PIDctrl.y_dot.kD = 0;
% z-dot % z-dot
vehicle_params.PIDctrl.z_dot.kP = 5; vehicle_params.PIDctrl.z_dot.kP = 5;
vehicle_params.PIDctrl.z_dot.kI = 0; vehicle_params.PIDctrl.z_dot.kI = 0.1;
vehicle_params.PIDctrl.z_dot.kD = 0; vehicle_params.PIDctrl.z_dot.kD = 0;
%% Attitude -> Attitude Rate %% Attitude -> Attitude Rate
......
...@@ -25,6 +25,7 @@ function [params] = parameters_Quad(global_params) ...@@ -25,6 +25,7 @@ function [params] = parameters_Quad(global_params)
% Thrust Value needed to maintain hover and fight gravity (N) % Thrust Value needed to maintain hover and fight gravity (N)
params.hoverThrust = (params.m * params.g); params.hoverThrust = (params.m * params.g);
params.hoverThrust = params.hoverThrust .* 1.26; % eps*m*g
%% Disturbances %% Disturbances
params.dist_F_power = 0.1 .* [1; 1; 1]; % 0-mean Band-limited, White Gaussian Dist (Ext Force) params.dist_F_power = 0.1 .* [1; 1; 1]; % 0-mean Band-limited, White Gaussian Dist (Ext Force)
...@@ -44,6 +45,9 @@ function [params] = parameters_Quad(global_params) ...@@ -44,6 +45,9 @@ function [params] = parameters_Quad(global_params)
% Controller Rate (s) % Controller Rate (s)
params.ctlDt = 0.01; params.ctlDt = 0.01;
% rc_pilot cascaded PID controller (specify gains)
params = setPIDgains(params);
%% Initial Conditions %% Initial Conditions
params.x0 = [0;... % x position [m] params.x0 = [0;... % x position [m]
0;... % y position [m] 0;... % y position [m]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment