Project - Position control of mass spring damper system
1.Obtain the transfer function of a mass spring damper system and use it in the model. Add a PID controller to adjust the force on mass so that its position follows a reference signal.
Take m = 3.6; %kg k = 400; %N/m c = 100; %Ns/m

AIM-.Obtain the transfer function of a mass spring damper system and use it in the model. Add a PID controller to adjust the force on mass so that its position follows a reference signal.
Given parameter-
m=3.6
k=400
c=100
Explain-
`mx2dot+cx1dot+kx=F`
now, convert it into s domain or frequency domain
ms^2X(s)+csX(s)+kX(s)=F(s)
finally we arrange the eq to get the transfer function
here x(S)=position
F(S)-external force applied
``m=mass
k=spring constant
c=damping cofficient
so we get the transfer function eq-
`X(s) /F(S)= 1/(ms^2+cs+k)`
`or underdamped system zeta=<1`
so we take zeta=0.707
CODE-
These are the included script file

wn=10.54(calucated value)
Poles-
P =
-7.4524 + 7.4547i
-7.4524 - 7.4547i
kd=-46.34
kp=0
ki=0
first of we have to take pulse generatorfor the give ref signal

now ,take a sum block add the kp and ki with the integrater,dv/dt withkd,and add it to the the transfer function block and connect to the scope,output should subtract to the sum block(feedback signal),now the model is

now the scope out put

now we have adujust or tuned the kp ,ki ,kd to get the stable control
kp=40
kd=400
ki=1
now we get the

again we have to tunned
kp=80
ki=800
kd=1
