Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Assignment 1 - part II
- clear all, clc, close all
- M = 14; % Mass of the system.
- Km = 5.4; % Transfer from control command u to motor Force Fm (pure gain).
- d = 506; % Damping.
- Cs = 35300; % SE spring.
- Ctot = Cs; % Total stiffness equal to spring stiffness because Cb = 0.
- x3 = 0; % Position on outside of SE element.
- H = tf([Ctot Ctot*(d/M) 0],[1 d/M Ctot/M]);
- set(cstprefs.tbxprefs,'FrequencyUnits','Hz')
- bode(H)
- %% Run Simulink first
- close all
- freq = linspace(1,1000,1000);
- figure
- plot(freq,abs(fft(yout(:,2))))
- title('Frequency content of the output.')
- xlabel('Freq (Hz)')
- xlim([0 500])
- fundat = iddata(yout(:,2),yout(:,1),0.001);
- g = spafdr(fundat)
- figure
- tfestimate(yout(:,1),yout(:,2),190,[],[],0.001)
- figure
- plot(g)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement