Project - Position control of mass spring damper system
project10
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.
Variables m (mass), k (spring constant), and c (damping constant) used in the transfer function are defined through this Matlab script.
m = 3.6; % Mass [kg]
k = 400; % Spring constant [N/m]
c = 100; % Damping constant [Ns/m]
kp=7300.15
kd=169.73
ki=64100.7

The mass-spring-damper model consists of discrete mass nodes distributed throughout an object and interconnected via a network of springs and dampers. This model is well-suited for modeling objects.
The spring-mass-damper system consists of a mass with weight (m), a spring with stiffness (k), and a shock absorber with a damping coefficient of (c). This system works based on Newton’s second law, which states that Force is equal to the rate of change of momentum. For a constant mass, force equals mass times acceleration.
PULSE GENERATOR
The Pulse Generator block generates square wave pulses at regular intervals. The block waveform parameters, Amplitude, Pulse Width, Period, and Phase delay, determine the shape of the output waveform. The following diagram shows how each parameter affects the waveform.
PID
This block implements continuous- and discrete-time PID control algorithms and includes advanced features such as anti-windup, external reset, and signal tracking. You can tune the PID gains automatically using the 'Tune...' button (requires Simulink Control Design).
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.
after taking the pid values as kp,ki,kd , using these values we can control the stability of dynamic system
finally i got the output of spring mass damper system
