clear
deg2rad=%pi/180;
rad2deg=180/%pi;
tt=0:0.001:2;
thref=ones(tt)*60*deg2rad;
Kp=0.2;
Kd=0.025;
J=0.001;
s=poly(0,'s');
G1=syslin('c',1,J*s);
G2=syslin('c',1,s);
Dcont=syslin('c',Kd,1);
Pcont=syslin('c',Kp,1);
Vclosed=G1/.Dcont;
Xclosed=(Pcont*Vclosed*G2)/.syslin('c',1,1)
[th,XX]=csim(thref,tt,Xclosed);
plot(tt,th*rad2deg,tt,thref*rad2deg);
legend('th[deg]','thref[deg]');
xgrid;
a=gca();
a.data_bounds=[0 0;1.5 80];
xtitle('','time[s]','th[deg]');