Professional Documents
Culture Documents
Munneb Control Open ended
Munneb Control Open ended
Submitted by :
Muneeb Ahmad F2021019011
Resource Person:
Maryam Shakeel
SCHOOL OF ENGINEERING
ELECTRICAL ENGINEERING DEPARTMENT
Introduction
In this report, we analyze and design a PID controller for a mass-spring-damper system. The
objective is to tune the PID gains to achieve the desired performance specifications:
System Model
The mass-spring-damper system is a classic mechanical system described by the following
differential equation:
Where:
The transfer function for the mass-spring-damper system can be derived as:
P(s)=X(s)/F(s)= 1/(ms^2+bs+k)
• m=1
• b=10
• k=20
m = 1;
b = 10
k = 20;
s = tf('s');
P_system = 1 / (m*s^2 + b*s + k);
Kp = 350;
Ki = 300;
Kd = 50;
C = pid(Kp, Ki, Kd);
sys_cl = feedback(C*P_system, 1);
step(sys_cl, 0:0.01:4);
grid on;
title('Step Response with PID Controller');
xlabel('Time (seconds)');
ylabel('Amplitude');
stepinfo(sys_cl)
Running the MATLAB script gives us the step response of the closed loop system. MATLAB
has an inbuilt function called ‘stepinfo ‘which gives the various characteristics of the step
response like rise time, settling time, overshoot, steady state error etc.
• Kp=350
• Ki=300
• Kd=50
A properly functioning PID controller for the mass-spring-damper system. Through MATLAB
simulations the step response characteristics are analyzed and proved that the controller is able to
satisfy time requirement (settling time < 2 seconds, overshoot < 5%) along with its ability to
keep the steady state error less than 1%.
Further research can be pursued with implementation of advanced control strategies and
robustness analysis to further improve system response under changing environments and
disturbances.