close all
clear all

m1=load('degrauM1nocontrol_volt_posEff_kt0.txt');
m24=load('degrauM24nocontrol_volt_posEff_kt0.txt');
step=ones(length(m1),1)*45;

axes('fontsize',14)
plot(m1(1:70,1),step(1:70),'b',m1(1:70,1),m1(1:70,3),'m',m24(1:70,1),m24(1:70,3),'r','linewidth',2);
grid on
xlabel('time (s)','fontsize',14);
ylabel('Position (degrees)','fontsize',14)
legend('Step requested','Load mass: 258g','Load mass: 1129g','location','SouthEast');

figure;
mo=load('degrauM24nocontrol_volt_posEff_kt0.txt');
mc=load('degrauM24_volt_posEff_controlReq.txt');
step=ones(length(m1),1)*45;

axes('fontsize',14)
plot(mo(1:70,1),step(1:70),'b',mo(1:70,1),mo(1:70,3),'m',mc(1:70,1),mc(1:70,3),'r','linewidth',2);
grid on
xlabel('time (s)','fontsize',14);
ylabel('Position (degrees)','fontsize',14)
legend('Step requested','Open loop response','Closed loop response','location','SouthEast');


figure;
array=load('degrauM1nocontrol_volt_posEff_kt0.txt');
t=array(1:floor(end*22/72),1);
pos=array(1:floor(end*22/72),3);

step=ones(length(t),1)*(45);

axes('fontsize',14)
plot(t,step,'k',t,pos,'b','linewidth',2);
grid on
xlabel('time (s)','fontsize',14);
ylabel('Position (degrees)','fontsize',14)
legend('Step requested','Open loop response','location','SouthEast');



figure;
array=load('degrauM14nocontrol_volt_posEff_kt0#+45;-45.txt');
t=array(1:floor(end*22/72),1);
pos=array(1:floor(end*22/72),3);

step=ones(length(t),1)*(-45);

axes('fontsize',14)
plot(t,step,'k',t,pos,'b','linewidth',2);
grid on
xlabel('time (s)','fontsize',14);
ylabel('Position (degrees)','fontsize',14)
legend('Step requested','Open loop response','location','SouthEast');

figure;
array=load('degrauM14nocontrol_volt_posEff_kt0#-45;+45.txt');
t=array(1:ceil(end/2),1);
pos=array(1:ceil(end/2),3);

step=ones(length(t),1)*(45);

axes('fontsize',14)
plot(t,step,'k',t,pos,'b','linewidth',2);
grid on
xlabel('time (s)','fontsize',14);
ylabel('Position (degrees)','fontsize',14)
legend('Step requested','Open loop response','location','SouthEast');
