% PENDULUM TERBALIK
% Plant Parameters
M = 0.5; % Massa Kereta [kg]
m = 1; % Massa Pendulum [kg]
l = 0.8; % Panjang lengan [m]
g = 9.8; % Percepatan Gravitasi [m/sec2]
Xmax = 20; % Posisi Kereta maximum [cm]
TETA = 45; % Sudut Pendulum maximum [derajat]
% Control Parameters STATE VARIABLE FEEDBACK
% Gain Matrix
K1 = 0;
K2 = 0;
K3 = 0;
K4 = 0;
%
sim('Project_3_2019.slx')
subplot(151), plot(gangguan,time), grid on, ylabel('time[sec]'), xlabel('F [Newton]')
subplot(152), plot(posisi,time), grid on, ylabel('time[sec]'), xlabel('X [cm]')
subplot(153), plot(kecepatan,time), grid on, ylabel('time[sec]'), xlabel('dX/dt [cm/sec]')
subplot(154), plot(teta,time), grid on, ylabel('time[sec]'), xlabel('Teta [deg]')
subplot(155), plot(dteta,time), grid on, ylabel('time[sec]'), xlabel('dTeta [RPM]')
