Project - Position control of mass spring damper system
Aim : To design the position control of mass spring damper system using a PID controller to adjust the force on the mass in the simulink model.
Objective : In this model, we'll try to adjust the forces on the mass by changing the PID controller values and see the generator wave forms of two different controller values.
Given parameters and some formulas :
m = 3.6kg , k = 400N/m , c = 100Ns/m.

for transfer function we'll be using the above formula in the simulink model.
If we look into mathwork scrip then they're as follows :
%parameters for position control of mass spring damper system
m = 3.6; %mass in terms of kg
k = 400; %N/m
c = 100; %Ns/m
%pole placement design
fn = 1.0; %1Hz natural frequency
wn = 2*pi*fn; %natural frequency in rad/s
%matrix value
A = [0 1;-k/m -c/m];
B = [0; 1/m];
zeta = 0.707; %under-damped system
�sired poles values
p1 = -zeta*wn + wn*sqrt(zeta^2 - 1);
p2 = -zeta*wn - wn*sqrt(zeta^2 - 1);
p = [p1;p2];
K = place(A,B,p);
Ki = 0;
Kp = 100, Kd = 50;
%End

now if we look int the simulink model:

To generate waveform a pulse generator is been used with an integrator and derivative for an under-damped system with the value of zeta as 0.707.
A PID controller (Kp,Kd,Ki) is been placed where the values of Kp and Kd is derived from the script itself and the value of Ki is been taken as zero.
all the blocks are connected with sum block and the sum is connected with the transfer function which includes a spring mass equation in terms of (ms^2 +cs +k).
To know the outcome results a scope is been used which displays the results in the form of waves.
The model is run for 10.0 seconds with runge-kutta solver with fixed step variable.
The output results on the basis of simulink model and the parameter is been shwn below.

if we'll have a look on the results then it shows that the curves are been drastically decreasing and moving towards the more negative side.
if we make a tuning in the PID controller then , lets change the values of Kp and Kd with 100 and 50.
then the result outcome is bit different.

the curves are moving towards the positive side and then after reaching to three the curves decline slowly.
Conclusion : The position control of mass spring damper mostly depends on the PID controller and their values. we can get a suitable output by tuning or adjusting the PID controller.