Advertisement
Guest User

BM_Marty

a guest
May 6th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. %% Assignment 1 - part II
  2. clear all, clc, close all
  3.  
  4. M = 14; % Mass of the system.
  5. Km = 5.4; % Transfer from control command u to motor Force Fm (pure gain).
  6. d = 506; % Damping.
  7.  
  8. Cs = 35300; % SE spring.
  9. Ctot = Cs; % Total stiffness equal to spring stiffness because Cb = 0.
  10.  
  11. x3 = 0; % Position on outside of SE element.
  12.  
  13. H = tf([Ctot Ctot*(d/M) 0],[1 d/M Ctot/M]);
  14.  
  15. set(cstprefs.tbxprefs,'FrequencyUnits','Hz')
  16. bode(H)
  17.  
  18. %% Run Simulink first
  19. close all
  20.  
  21. freq = linspace(1,1000,1000);
  22.  
  23. figure
  24. plot(freq,abs(fft(yout(:,2))))
  25. title('Frequency content of the output.')
  26. xlabel('Freq (Hz)')
  27. xlim([0 500])
  28.  
  29. fundat = iddata(yout(:,2),yout(:,1),0.001);
  30.  
  31. g = spafdr(fundat)
  32.  
  33. figure
  34. tfestimate(yout(:,1),yout(:,2),190,[],[],0.001)
  35.  
  36. figure
  37. plot(g)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement