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 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Electromechanical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!