Project - Position control of mass spring damper system
We known the Differential equation of the spring mass damper system in time domain form
f(t)= m d^2x/dt^2 + c dx/dt+ kx -------------1
Apply the LaPlace transform to equation 1
L(f(t)) = L (m d^2x/dt^2 + c dx/dt+ kx)
F(s) = m s^2 X(s) +c s X(s) + k X(s)
F(s)= [m s^2 + c s + k] X(s)
X(s)/F(s)= 1/[m s^2 + cs + k] ---------------2
Equation 2 is the transfer function of the spring mass damper system
To add PID controller to Spring Mass damper system
Find PID control gain values using Pole placement method
For that I have design a MATLAB model
%Mass_spring_damper system%
M=3.6; %mass of the body (kg)%
k=400; % spring constant (N/m)
c=100; %dampers (Ns/m)
% we have a transfer function of Mass_spring_damper system is X(s)/F(s) = 1/ms^2+cs+k %
%Finding PID gain using Pole Placement method%
%By representing the state space Equation, we have A and B Matrices
A=[0 1 ; -k/M -c/M];
B= [0 ; 1/M];
fn=1.0; %frequency in Hz%
Wn=sqrt(k/M); %frequency in Rad/sec%
zeta=0.85; % damping ratio (under damped case)
%Finding poles%
p1= -zeta*Wn+Wn*sqrt(zeta^2-1)
p2= -zeta*Wn-Wn*sqrt(zeta^2-1)
P=[p1,p2]
%gain value can find by using place command%
K=place(A,B,P)
Kp=K(1)
Kd=K(2)
Ki=1250
OUTPUT:

Simulink Model:

OUTPUT:

Conclusion:
The transfer function of the spring mass damper system is obtained. And which is included in the Simulink model.
The force( pulse generator) is applied to the system and system state is controlled by using PID controller. Shown in above results.
Here system reaches to its equilibrium position with a one overshoot(6.1%) and rise time (~0.38 sec)
Settling time(~0.5sec) and steady state error reaches to zero at ~1.8sec(system reaches to equilibrium position)
Which gives the best performance at integral gain value(1250).