Project - Position control of mass spring damper system
1.


Program:
clc;
close all;
% initial conditions Position control of mass spring damper system
m = 3.6; % kg
k = 400; % N/m
c = 100; % Ns/m
% Pole placement design
fn = 1.0; % 1Hz natural frequency design
wn = 2*pi*fn; % Natural frequency in rad/s
% A & B matrix value
A = [0 1; -k/m -c/m]; % A is using matrix of c ans k dived value of mass
B = [0; 1/m]; % B is the 1 ovear mass value
% Design values
zeta = 0.5; % for an under-damped behavior
% Desied poles value
p1 = -zeta*wn+wn*sqrt(zeta^2-1);
p2 = -zeta*wn-wn*sqrt(zeta^2-1);
p= [p1;p2];
% place comment is the Kp and Kd value
K = place(A,B,p); % Kp = K(1), Kd = K1(2)
% End
To design a closed loop control scheme for a DC motor the following changes need to be done in the model in the previously created model.
- Speed is the controllable parameter, so we will set the reference speed in step block as 10,20, 40 whichever you want.
- Subtract the actual speed from the reference speed to generate the error signal e(t)
- Add Kp as K(1) and Kd as K(2) parameter determined from place command (K=place(A,B,P)). (use gain block to mention values of Kp, Kd, and Ki)
- The feedback for Kd is provided from the output current of the plant/model (figure 1). OR we can take feedback (error speed signal as input to Kd shown by figure 2)
- Add Ki manually with gain and integrator block and tune different values of Ki and check the impact of it on results.
To check the location of poles on the s-plane from MATLAB the following command (‘pzmap ’-pole zero placement or mapping) can be used in continuation to the above script. We can see two crosses in red indicate complex poles lying on the left hand of the plane which indicate it is a stable system.
Program script:



conclusion:
To complte the project of Position control of mass spring damper system 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 to using matlab and simulink wave from plot.