% Cart Transfer Function s = tf('s'); G = 1.5531/(s^2+10.0938*s); G.u = 'V'; %input (voltage) G.y = 'X'; % ouput (x position) % PID Controller Transfer Function H = pid(120,10,40); H.u = 'e'; % input (error) H.y = 'V'; % output (voltage) % Combined Transfer Function for R to X (X/R) Sum = sumblk('e = R - X'); % solve for error in terms of R and X XR = connect(H,G,Sum,'R','X'); % Solve for step response [x1, t1] = step(XR,1.5);
My attempted solution was as follows:
% Combined Transfer Function for R to V (V/R) VR = connect(H,G,Sum,'R','V'); % [V, t2] = step(VR,1.5); % Commented out because it throws error: % Error using DynamicSystem/step % Cannot simulate the time response of improper (non-casual) models.
s = tf('s'); G = 1.5531/(s^2+10.0938*s); G.u = 'V'; %input (voltage) G.y = 'X'; % ouput (x position) % PID Controller Transfer Function H = pid(120,10,40,1e-3)
H = 1 s Kp + Ki * --- + Kd * -------- s Tf*s+1 with Kp = 120, Ki = 10, Kd = 40, Tf = 0.001 Continuous-time PIDF controller in parallel form.
H.u = 'e'; % input (error) H.y = 'V'; % output (voltage) % Combined Transfer Function for R to X (X/R) Sum = sumblk('e = R - X'); % solve for e,rror in terms of R and X %XR = connect(H,G,Sum,'R','X'); % Solve for step response %[x1, t1] = step(XR,1.5); % Combined Transfer Function for R to V and X clsys = connect(H,G,Sum,'R',{'V' 'X'}); zpk(clsys)
ans = From input "R" to output... 40120 s (s+0.08579) (s+2.905) (s+10.09) V: ----------------------------------------- (s+0.08621) (s+2.584) (s+74.75) (s+932.7) 62310 (s+2.905) (s+0.08579) X: ----------------------------------------- (s+0.08621) (s+2.584) (s+74.75) (s+932.7) Continuous-time zero/pole/gain model.
% call step twice because the X repsonse takes longer than the V response figure step(clsys('X','R'))
figure step(clsys('V','R'))
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.