Project - Position control of mass spring damper system
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.

Give data value:
m = 3.6; % value of mass.
c = 100; % Damping coefficient (ks/m).
k = 400; % stiffness constant (N/m).
fn = 1.0;% Hz in frequency.
wn = sqrt(k/m); % red/sec.
zeta = 0.9; % underdamping system.
To find a pole value:
A = [0 1; (-k/m) (-c/m)];
B = [0; (1/m)];
p1 = -zeta*wn+wn*sqrt(zeta^2-1);
p2 = -zeta*wn-wn*sqrt(zeta^2-1);
P = [p1,p2];
K = place(A,B,P);
kd = K(2);
kp = K(1);
ki = 500.0;
PID control output simulation and graph;
