How can i reconfigure my Fault detection Isolation and recovery system to enable the Closed-Loop Operation to continue in the presence of sensor and rudder actuator faults.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
fault_time = 30; % Time at which the stepwise fault occurs
fault_value = 10 * pi/180; % Fault value to be added
%fault_time = 20; % Time at which the driftwise fault occursfault_value = 0.2 * pi/180; % Fault value to be added
%fault_value = 0.5 * pi/180; % Fault value to be added to the measurement
% Initial Conditions of all inputs, states, and state derivatives
u = [0, 0.08725]'; % Define Initial Simulation Input
x = [0, 0, 0, 0, 0]'; % Define Initial Model States
xdot = [0, 0, 0, 0, 0]'; % Define Initial Model State Derivatives
% Limit the control input within the maximum rudder deflection
if u(2) > delta_r_max
u(2) = delta_r_max;
elseif u(2) < -delta_r_max
u(2) = -delta_r_max;
end
% Apply stepwise fault to the sensor measurement
if time == fault_time
x(5) = x(5) + fault_value;
end
% Apply driftwise fault to the sensor measurement
%if time >= fault_time
%x(5) = x(5) + fault_value;
%end
% Apply stepwise fault to the rudder measurement
%if time == fault_time
%u(2) = u(2) + fault_value;
%end
% Apply driftwise fault to the rudder measurement
%if time >= fault_time
%u(2) = u(2) + fault_value;
%end
% Calculate control input using PID controller
error = desired_heading - x(5); % Heading error
u(2) = Kp * error + Ki * stepsize; + Kd * (error - int_error) / stepsize;
int_error = error; % Update initial error
Réponses (0)
Voir également
Catégories
En savoir plus sur Electromechanical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!