0% found this document useful (0 votes)
74 views

Name: Zulfiqar Ali.: Department of Electronic Engineering University of Engineering and Technology Abbottabad Campus

The document describes a lab report on modeling and controlling the speed of a DC motor. It includes: 1) Modeling the DC motor transfer function and representing it in MATLAB. 2) Creating a state-space model of the DC motor in MATLAB. 3) Designing a PID controller in MATLAB to control the speed of the DC motor and meet design criteria of settling time less than 2 seconds and overshoot less than 5%. 4) Modeling the DC motor and PID controller in Simulink.

Uploaded by

Zulfiqar Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Name: Zulfiqar Ali.: Department of Electronic Engineering University of Engineering and Technology Abbottabad Campus

The document describes a lab report on modeling and controlling the speed of a DC motor. It includes: 1) Modeling the DC motor transfer function and representing it in MATLAB. 2) Creating a state-space model of the DC motor in MATLAB. 3) Designing a PID controller in MATLAB to control the speed of the DC motor and meet design criteria of settling time less than 2 seconds and overshoot less than 5%. 4) Modeling the DC motor and PID controller in Simulink.

Uploaded by

Zulfiqar Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Name: Zulfiqar Ali.

DEPARTMENT OF ELECTRONIC ENGINEERING


UNIVERSITY OF ENGINEERING AND TECHNOLOGY
ABBOTTABAD CAMPUS

Registration No: 17ABELT0736.


Subject: “Control System”
Date of Conduction:
Date of Submission:
Particulars Max. Marks Marks Obtained
Pre-Lab
Lab Performance
Post-Lab
Lab Report
Total

REPORT VERIFICATION

Date:

Instructor Name:

Signature:

LAB REPORT NO.03


Modeling of DC Motor, Speed Control and Analysis in MATLAB/Simulink

1- Aim:

Upon completion of this lab, one will be able to understand:


 DC motor
 Modeling of DC motor
 Physical setup
 System equations
Design requirements  MATLAB representation

-1.2. In lab Tasks


MATLAB representation: 3-

1. Transfer Function:

We can represent the above open-loop transfer function of the motor in MATLAB by defining
the parameters and transfer function as follows. Running this code in the command window
produces the output shown below.
TASK 1:
J=0.01;
b=0.1;
K=0.01;
R=1;
L=0.5;
s=tf('s')
pmotor=K/((J*s+b)*(L*s+R)+K^2)
RESULT:

pmotor =

0.01

---------------------------

0.005 s^2 + 0.06 s + 0.1001

Continuous-time transfer function.

TASK 2:
3-2. State Space:
A=[-b/J k/J

-K/L -R/L];
B=[0
1/L];
C=[1 0];
D=0;
motor_ss=ss(A,B,C,D)

RESULT:
motor_ss

= A =

x1 x2

x1 -10 1

x2 -0.02

-2 B =

u1

x1 0

x2

2 C

x1 x2

y1 1 0

D =

u1

y1 0

Continuous-time state-space model.


The above state-space model can also be generated by converting your existing transfer function
model into state-space form. This is again accomplished with the ss command as shown below.
TASK:
motor_ss=ss(P_motor);

s=tf('s');

I=eye(2);

m1=C*inv(s*I-A)*B

t=0:0.01:10;

step(m1,t)

The above state-space model can also be generated by converting your existing transfer function
model into state-space form. This is again accomplished with the ss command as shown below.

3-3. DC Motor Speed Control using PID Controller:

From the main problem, the dynamic equations in the Laplace domain and the open-loop
transfer function of the DC Motor are the following.

For the original problem setup and the derivation of the above equations, please refer to the DC
Motor Speed: System Modeling page.

For a 1-rad/sec step reference, the design criteria are the following.

• Settling time less than 2 seconds


• Overshoot less than 5%
• Steady-state error less than 1%
Control of DC Motor:
kp=50;
ki=200;
kd=10,
c=pid(kp,ki,kd);
sys1 =feedback(c*m1,1);
step(sys1,[0:0.1:10])

title('PID control with small ki and small kd')


RESULT:

PID control with small ki and small kd


1.001

0.999
Amplitude

0.998

0.997

0.996

0.995

0.994
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)

%now increase the value of kp


kp=100;
ki=200;
kd=10,
c=pid(kp,ki,kd);
sys1 =feedback(c*m1,1);
step(sys1,[0:0.01:10])

title('PID control with small ki and small kp')


RSEULT:
PID control with small ki and small kp
1.0005

0.9995

0.999
Amplitude

0.9985

0.998

0.9975

0.997

0.9965

0.996
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)

TASK:
kp=100;
ctr=pid(kp);
f=feedback(ctr*intf,1)
step(f,t)
grid on
title('pid controll with bsmall kp')
RESULT:
TASK:
kp=100;
ki=200;
kd=10,
ctr=pid(kp,ki,kd);
f=feedback(ctr*intf,1)
step(f,t)
grid on
title('pid controll with bsmall kp'

Conclusion:

As the kp is increase the peak amplitude ,percent overshoot,and settling time are reduced.

3-4. Modeling and control in Simulink: 3-


4.1. DC motor model

TASK:
RESULT:

You might also like