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 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
Respuestas (0)
Ver también
Categorías
Más información sobre Electromechanical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!