Project - Position control of mass spring damper system
Solution-
We know that F(t)=mX2+cX1+KX where X2=X_dot_dot, X1=X_dot
we know that transfer function is form of laplace function and it is output/input
for this we change the given equestion change in laplace equestion so for that
F(s)=ms^2X(s)+csX(s)+kX(s)
F(S)=X(s)[ms^2+cs+k] % take X(s) commen
we know that laplace function is output/input where output is X(s) and input is F(s)
For this X(s)/F(s)=1/ms^2+cs+k--(1)
The equestion (1) is laplace transfer.where
m is mass, k=stiffness constant and c=damping cofficent
given m = 3.6; kg k = 400; N/m c = 100; Ns/m the given value put in equestion and get the laplace equestion.
X(s)/F(s)=1/3.6s^2+100s+400
now we found the place pole to find the Kp and Kd valuue.
first we know
fn=1.0;
A=[0 1;-k/m -c/m]; % matrix A
B=[0;1/m]; %matrix B
we know that
wn=sqrt(k/m);
zeta=0.5;
p1=-zeta*wn+wn*sqrt((zeta)^2-1);
p2=-zeta*wn-wn*sqrt((zeta)^2-1);
P=[p1;p2]; % matrix P (p1 and p2 is poles)
K=place(A,B,P) % it is give the value of Kp & Kd value
For this we found out the value of matrix A matrix B, polse p1 and p2 and with the help of PLACE COMMEND we found out the value of K. they give two value -0.0000 -62.0527 first value is Kp and other is Kd
Ki value we asume 500.
know we creat the simulink model
first take pulse genretor set aplitude is 1 sec, period=10sec,and pulse width=50% is all given in question
pulse subtrect with transfer function with the help of sum block and then take three gain and lable them (Kp,Kd and Ki).
intigration block attech with Ki. Ki and Kp attech with output of pulse genretor subtract
transfer function. Kd gain multiply for transfer function And output of Ki,Kp,Kd add with the help of sum block(++-)
All output is connect with transfer function. take mux block to add the the output of two signel such as pulse genretar and output of transfer function.And mux connect with scope to show the result.

run the simulink and we get the out put is

in this we saw that first half pulse rise graph then over shot approx 1.7sec and it is set aprox 3.2 sec and then constent. And other half it is dicress and under shot aprrox 6.6 sec and it is settel approx 8.1 sec and then constent.the over shot and under shot is deped of Ki value