Project - Position control of mass spring damper system
Aim:
To design a project for position control of a mass-spring-damper system using a MATLAB Simulink model. This involves creating the transfer function of the mass-spring-damper system and incorporating it into the model. A PID controller will be added to adjust the force on the mass so that its position follows a reference signal.
Objective:
To develop a MATLAB Simulink model of a mass-spring-damper system, including its transfer function. The project will integrate a PID controller to regulate the force applied to the mass, ensuring that its position accurately tracks a reference signal. The MATLAB model will include the PID control, transfer function, and a pulse waveform generator.
MATLAB codes:
% Initial Parameters.
m= 3.6;
k= 400;
c= 100;
% State-space matrices;
A = [0 1; -k/m -c/m]; %
B = [0; 1/m]; %
C = [1 0];
B= B(:); % Converting into a column vector.
% Requirements on closed-loop response.
fn= 1; % Hz, Natural frequency
wn= 2*pi*fn % Rad/s, Natural frequency.
z= 0.5; % Zeta, For an under-damped behaviour.
p1= -z*wn+1j*wn*sqrt(1-z^2)
p2= -z*wn-1j*wn*sqrt(1-z^2)
P= [p1;p2]
K= place(A,B,P)
k_p= 257.8777;
k_d= 77.3805;
% Direct nonlinear control using feedback linearization.
Kp= m*wn^2
Kd= 2*z*wn*m
Ki= 0.1*257.87
%
Conclusion:
Signal Behaviour:
a. Initial response at the beginning of each step change in the reference signal, the blue signal exhibits an initial overshoot. The system then oscillates before settling near the reference signal. This indicates the system's underdamped nature, where the damping is not sufficient to quickly bring the system to rest.
b. In Steady-state behaviour, after the initial oscillations, the blue signal settles and closely follows the yellow reference signal.
c. Step Changes in the reference signal, the blue signal again shows overshoot and oscillations before settling. This behaviour is consistent across all step changes, suggesting that the PID controller parameters remain constant throughout the simulation.
