Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kp = 10;
- kd = 1.3;
- kp1 = 5;
- pi = 3.14;
- y = @(x) (50*pi*x) .* (0<x & x<1/150) + (pi/3) .* ((1/150<=x) & (x<=3001/150)) + ((3002*pi/3-50*pi*x) .* ((3001/150 <= x) & (x < 1501/75)));%r(t)
- x = -1:1/15000:40
- sys = tf([0.7274*kd 0.7274*kp],[0.00072 0.07206 0.44244+0.7274*kd 0.7274*kp]);%designed PD control
- lsim(sys,y(x),x)%plot of Actual Trajectory with designed control
- pi = 3.14
- syms s
- tf = ((0.00072*s^3+0.07206*s^2+0.44244*S)/(0.7274))*__Theta(s)__;
- h = ilaplace(tf)
- t = linspace(0,20,50000); %500 is number of samples to plot
- hfun = matlabFunction(h);
- plot(t, hfun(t));
- hold on;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement