Project - Position control of mass spring damper system
Position control of mass spring damper system parameter is given by:
Take m = 3.6; %kg k = 400; %N/m c = 100; %Ns/m is parameter value we can use inthe matlab

Scope:Display time domain signals
To workspace:The To Workspace block logs the data connected to its input port to a workspace from a Simulink® model
Clock:The Clock block outputs the current simulation time at each simulation step. This block is useful for other blocks that need the simulation time
Gain:The Gain block multiplies the input by a constant value (gain). The input and the gain can each be a scalar, vector, or matrix
Sum:The sum block allows addition/subtraction operation on multiple signals
Transfer function:The Transfer Fcn block models a linear system by a transfer function of the Laplace-domain variable s. The block can model single-input single-output (SISO) and single-input multiple-output (SIMO) systems.
The transfer function of a mass spring damper system and use it in the model add PID control kp,kd,ki:
We create gain block PID control :kp,kd,ki

Where,Add summing block and integrator gain ki connect with integrator:

So,our Ref output is pulse output so we use in pulse generator

Where, the transfer function of a mass spring damper system and use it in the model:

The feedback control gain use in the model so kd derivative gain connectd to negative sign in summing block and 1/Ms^2+Cs+K this formula apply for the transfer function
parameters of transfer function :Numerator coefficients is 1,Denominator coefficient is M=3.6 C=100 K=400
Pulse Generator parameters :Amplitude is 1 ,period 10 (secs),pulse with 50(period),phase delay 0(sec)

From the output reponse its observe at the rise time is 0.2sec and overshoot is less then 5% and the settling time is less then 0.5 sec thus meeting the control objectives.
where,when i reduce Zeta to 0.7 underdamped behaviour peakovershoot and settling timeis reduceing on same time
Control response: Ki integrator value is manually increased at the same time rise time and settling time is increasing
From the above script we can determine the controller gain parameters Kp,Kd, from the location of poles p1 and p2 using 'place' command in Matlab the Ki is tuned manually now use Ki=800

So, transfer function of a mass spring damper system use on the model its obtained and PID controller add to adjust the force on mass