Project - Position control of mass spring damper system
Given Parameters :
m = 3.6; %kg k = 400; %N/m c = 100; %Ns/m

Considering the initial parameters values m,k,c.
Angular frequency of the mass spring damper system using the values K and m.
wn = sqrt(k/m);
Jacobian matrices A and B are derived
% A & B Jacobian matrix value
A = [0 1; -k/m -c/m];
B = [0; 1/m];
Consider zeta=0.5 % for an under-damped behavior
Pole placement values are derived using
p1 = -zeta*wn+wn*sqrt(zeta^2-1);
p2 = -zeta*wn-wn*sqrt(zeta^2-1);
p= [p1;p2];
K = place(A,B,p);
Kp = K(1);
Kd = K(2);
proportional gain Kp and derivative gain kd values are derived.
Create the simulink model for mass spring damper system :
Transfer function of the mass spring damper system = 1/(ms^2+cs+K)
Create PID controller using the values Kp and Kd. Intregal gain Ki can be tuned to control the reference signal.
Pulse waveform is considered as reference signal.

To obtain the required signal as given, the parameters should be given as below:



Reference signal is sent to the PID controller considering the Kp and Kd values from the initial conditions, which is sent to the
transfer function of the spring mass damper system. Output of the transfer function is sent back to the controller to optimise
the result. Scope block is added to view the performance of the PID controller. Integral gain (Ki) can be tuned to achieve the
desired.
For this model Ki values is considered as 700.

Desired waveform is obtained with a slight overshoot and undershoot.