Challenge

Project - Position control of mass spring damper system

ANSWERS;--------

objective:-

1." Signal Generator''

2.'' Pulse generator''


Exercise 1 :

with signal generator:
the parameters settings are :
waveform: square
time: use simulation time
Amplitude: 1
frequency: 0.1 hertz,

we have to create the model by connecting this signal with the workspace & scope blocks :gh
Accordingly model was created as below;-

We know the general equation for mass spring damper system s given by;-


x_dot = Ax + Bu
So the state representation of our spring mass system can be given by
x1_dot = x2 ------------------(1)
x2_dot = -(k/m) + (1/m)u ---------------(2)
We are using PID controller. So it has three gains Kp,Kd and Ki
So u = [Kp(x_ref – x1) – Kdx2 + Ki inte(x_ref – x1)]
Then the equation (2) becomes
x2_dot = -(k/m) + (1/m) [Kp(x_ref – x1) – Kdx2 + Ki inte(x_ref – x1)] ---------(3)
We have to design the model for equation(3)
Where
Kp – is proportional gain
Kd – is integral gain
Ki – is integral gain
m – is mass of the spring mass system
k – is a stiffness or spring constant
x2_dot – is accelaration
x1_dot = x2 – is a velocity

x1 – is displacement

The input to the model is given by the following MATLAB script


Script codes:.m.file

%c=2*zeta*wn

%for zeta=0.5, c=2*(0.5)*(6.2832),c=6.2832
%c=100 given on the question
m=3.6; % mass of the system
k=400.0; % spring constant
wn=sqrt(k/m);%Find out the wn value by using formula
% Angular frequency m=3.6; % mass of the system
k=400.0; % spring constant in rad/sec
fn=1; % fn=wn/(2*pi), Natural frequency in Hz
zeta=0.5; %Defining Zeta to 0.5 damping ratio
p1=-zeta*wn+wn*sqrt(zeta^2-1); % first pole of characteristic equation
p2=-zeta*wn-wn*sqrt(zeta^2-1); % second pole of the characteristic equation.
P=[p1;p2]; % P vector stores the two poles
% A and B matrices from state space representation
c=100;
A=[0 1;-k/m -c/m];
B=[0;1/m];
% Pole placement design using 'place' Command
K=place(A,B,P);
Kp = K(1); % Kp is a proportional gain
Kd = K(2); % Kd is a derivative gain
Ki=1000;

MODEL;-

Ki=1000;

Ki=1200;

Ki=1300;

Ki=1400;-

Ki=1500;-

Conclusion: based on the patterns we may conclude that the value of ki=1400 is optimal.

------------------------------------------------------------------------------end----------------------------------------------------------------------------------

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.