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

1.TRANSFER FUNCTION:

F = m*a

F = forces

m = Mass

a = Acceleration

Mass Spring Damper System

k = the spring stiffness

d = damping coefficient

Spring Force :

Fs = k*x

Damping Force:

Fd = d*(dx/dt)

F = m*a

ΣF = m*(d^2x/dt^2)

− Fs − Fd + F = m*(d^2x/dt^2)

F = m*(d^2x/dt^2) + Fd + Fs

substitute Fs and Fd values:

F = m*(d^2x/dt^2) + d*(dx/dt) + k*x

Laplace Transform to the above equation :

F(s) = m*(s^2*x(s)) + d*(s*x(s)) + k*x(s)

F(s) = (m*s^2 + d*s + k)*x(s)

TRANSFER FUCNTION:

x(s)/F(s) = 1/(m*s^2 + d*s + k)

2. TO FIND KP AND KD VALUES:

MATLAB CODE :

m=3.6;
k=400;
c=100;
A=[0 1;-k/m -c/m];
B=[0 1/m]';
zeta=0.5;
fn=1;
wn=2*pi*fn;
p1=-zeta*wn+wn*sqrt(zeta^2-1);
p2=-zeta*wn-wn*sqrt(zeta^2-1);
P=[p1;p2];
K=place(A,B,P);

RESULTS:

A =

[0 1.0000
-111.1111 -27.7778]

B =

[0
0.2778]

K =

-257.8777 -77.3805

HERE

kp=-257.8777

kd=-77.3805

2. TO BUILD SIMULINK MODEL

BASIC PARAMETERS USED IN BLOCKS:

BEFORE PID TUNING :

AFTER PID AUTOMATIC TUNING :

AFTER PID TUNING PARAMETERS CHANGED

KP=715.87

KD=15.83

KI=4765.42

RESULTS:

TRANSFER FUNCTION OBTAINED

PID CONTROLLER TUNED AND THE OUTPUT SIGNAL FOLLOWS THE REFERENCE SIGNAL

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.