clear
% K = 0.423624244355123;
K = 10;
Ki = 0;
Kd = 0;
Kp = 2.66561754430033;
% Ki = 2.739663529403798;
% Kd = 4.135669086967992;
% Kp = 5.024740183063027;
p=2.75;
q=1;
clc
    sim('DC_Motor_Simulation');
    n = length(J);
    J_K = J(n)
    U_K = U(n)
    E_K = E(n)
clf
subplot(411), plot(time,load),grid on, xlabel('time [sec]'), ylabel('LOAD[Nmsec2/rad]')
subplot(412), plot(time,omega),grid on, xlabel('time [sec]'), ylabel('SPEED[RPM]')
subplot(413), plot(time,error),grid on, xlabel('time [sec]'), ylabel('e(t)[Volt]')
subplot(414), plot(time,effort),grid on, xlabel('time [sec]'), ylabel('u(t)[Volt]')