Project - Position control of mass spring damper system
Solution of Question-
We have to design a PID controller using simulink which control the mass spring damper system in any direction.
Simulink model-

Simulink model blocks-
Pulse Genrator- This block is used for generating a pulse of magnitude 1 with the time period of 10

Transfer Function- This block is used for define the mass, stiffness constant and damping constant

Kp(Proportional gain),Kd(Derivative gain) & Ki(Integral gain) are simply gain block.
For Controlling the PID-

Command Windows Command-


matlab Program-
- Add Ki manually with gain and integrator block and tune different values of Ki and check the impact of it on results.



As when the Ki is zero the output has a lag. As the Ki is 1000 the output will track the input.
A PID controller is designed through simulink to adjust the force on mass so that its position follows a reference signal to using matlab and simulink wave from plot.