# Untitled - k1*k2]; %G2 is the transfer function assuming...

This preview shows page 1. Sign up to view the full content.

%Set initial conditions m1=2500; m2=320; k1 = 80000; k2 = 500000; b1 = 350; b2 = 15020; %Set initial gains %The gains are multiplied by different values to tune the controller KD=4*208025; KP=4*832100; KI=4*624075; %Setting the transfer functions from the mathematical model nump=[(m1+m2) b2 k2]; denp=[(m1*m2) (m1*(b1+b2))+(m2*b1) (m1*(k1+k2))+(m2*k1)+(b1*b2) (b1*k2)+(b2*k1) k1*k2]; %G1 is the transfer function assuming the force from the road is 0 G1=tf(nump,denp); num1=[-(m1*b2) -(m1*k2) 0 0]; den1=[(m1*m2) (m1*(b1+b2))+(m2*b1) (m1*(k1+k2))+(m2*k1)+(b1*b2) (b1*k2)+(b2*k1)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: k1*k2]; %G2 is the transfer function assuming the force from the bus is 0 G2=tf(num1,den1); numf=num1; denf=nump; %F is the combined force that comes from the road and from the bus F=tf(numf,denf); %Create the controller implementing all three gains into the transfer %function contrPID=tf([KD KP KI],[1 0]); %incorporate the feedback into the controller sys_clPID=F*feedback(F*G1,contrPID); %set time step t=0:.05:5; %Create a step imput into the function step(0.2*sys_clPID,t) title('0.2m high step w/ pid controller') axis([0 5 -.005 .005])...
View Full Document

## This note was uploaded on 03/22/2012 for the course ENGINEERIM 1000 taught by Professor Ee during the Spring '12 term at Vermont Tech.

Ask a homework question - tutors are online