Project - Position control of mass spring damper system
m=3.6;
c=100;
k=400;
case 1; automatic method
here we use transfer function and pid controller is auto tuned for Kp Ki and Kd values


case 02_ manual method
here kp ki and kd values are defined manually accourding to the requirement to generate the desired output
A=[0 1;-k/m c/m];
B=[0;1/m];
fn=1.0;
wn=sqrt(k/m);
zeta=0.9;
p1=-zeta*wn+wn*sqrt(zeta^2-1);
p2=-zeta*wn-wn*sqrt(zeta^2-1);
p=[p1,p2];
K=place(A,B,p)
Kp=K(1);
Kd=K(2);

