Challenge

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

To design the project of position control of a mass spring damper system using Simulink model of 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.

PID controller:

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).

Matlab Code for position control of spring mass damper system

Initial Conditions
m =3.6; %mass of spring
k = 400; %spring constant
c = 100 ; %Damping coefficient

A = [0 1; -k/m -c/m];
B = [0;1/m];

%pole placement
fn=1.0;
wn = sqrt(k/m);
zeta =0.5; %for underdamped
%zeta =0.9; % critically damped
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);
Ki = 100;

Simulink Model of spring mass damper system:

TRANSFER FUNCTION :

The numerator coefficient can be a vector or matrix expression. The denominator coefficient must be a vector. The output width equals the number of rows in the numerator coefficient. You should specify the coefficients in descending order of powers of s.

  • The PID gains such as Kp,Kd values are calculated and updated in the system.
  • By running the place command the poles are calculated.
  • The input of Ki is given through the integrator block and reference signal output and initial reference was set to 0;

Output:

when the Ki value is 0

Now changing the ki values Ki = 50, we can observe that settling time and rise time is decreasing.

Now increasing the values of Ki to 500

Result:

The output follows the reference signal.with the help of PID controller we have positioned spring mass damper system.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.