Project - Position control of mass spring damper system
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.
Take
m = 3.6; %kg k = 400; %N/m c = 100; %Ns/m
The reference signal is shown in the following figure.
Transfer function of mass spring damper system
Matlab program for finding controller gains are shown below:

SIMULATION:

Block used:Pulse generator,sum,integrator,derivative,Transfer function and scope
- Blocks are connected as shown here we substract the output signal from reference signal and we got error signal we gave the error signal to a PID controller to improve the output value
Procedure:
Pulse generator output set as given in the question shown below which is used as input signal
Result:
to solve the transfer function of a mass spring damper system
scope
case:1
Kp=-1.5348e-13 Ki=650 Kd=-31.6948
case:2
Kp=-1.5348e-13 Ki=750 Kd=-31.6948

case:3
Kp=-1.5348e-13 Ki=800 Kd=-31.6948

case:4
Kp=-1.5348e-13 Ki=1150 Kd= -31.6948

CONCLUSION:
Obtained the transfer function of a mass spring damper system with m = 3.6kg k = 400 N/m c = 100 Ns/m using matlab programming and Created a transferfunction model and added PID controller and adjusted the force on mass so its position follows a reference signal when Kp=-1.5348e-13 Ki=1150 Kd= -31.6948