SHARE
TWEET

Untitled

a guest Jun 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. kp = 10;
  2. kd = 1.3;
  3. kp1 = 5;
  4. pi = 3.14;
  5. 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)
  6. x = -1:1/15000:40
  7. sys = tf([0.7274*kd 0.7274*kp],[0.00072 0.07206 0.44244+0.7274*kd 0.7274*kp]);%designed PD control
  8. lsim(sys,y(x),x)%plot of Actual Trajectory with designed control
  9.      
  10. pi = 3.14
  11. syms s
  12. tf  = ((0.00072*s^3+0.07206*s^2+0.44244*S)/(0.7274))*__Theta(s)__;
  13. h = ilaplace(tf)
  14. t = linspace(0,20,50000);   %500 is number of samples to plot
  15. hfun = matlabFunction(h);
  16. plot(t, hfun(t));
  17. hold on;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top