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

DCS Lab 5 Report (Zain, Umer, Abdullah)

This document describes Lab 5 on digital controller design for speed control of a DC motor. [1] The objectives are to model the DC motor transfer function and design a digital controller in MATLAB. [2] The theory section describes the DC motor model and derivation of its transfer function. [3] The lab tasks involve determining the transfer function in MATLAB and designing a PID digital controller to improve the step response.

Uploaded by

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

DCS Lab 5 Report (Zain, Umer, Abdullah)

This document describes Lab 5 on digital controller design for speed control of a DC motor. [1] The objectives are to model the DC motor transfer function and design a digital controller in MATLAB. [2] The theory section describes the DC motor model and derivation of its transfer function. [3] The lab tasks involve determining the transfer function in MATLAB and designing a PID digital controller to improve the step response.

Uploaded by

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

DIGITAL CONTROL SYSTEMS (EE-372)

Lab #5 Report

Course Instructor: Lt Col Dr Atif Qayyum


Lab Engineer: Haris Ataullah

Group Members Registration Number


Zain Rehan 301822
Muhammad Umer Siddiq 296908
Syed Muhammad Abdullah Shah 286767
Degree 41 Syndicate B
LAB 5: Digital Controller Design for the Speed Control of DC
Motor

Objectives:

• Model and analyze the transfer function of DC motor


• Design a digital controller for DC motor in MATLAB

Theory:
A common actuator in control systems is the DC motor. It directly provides rotary motion and,
coupled with wheels or drums and cables, can provide translational motion. The electric
equivalent circuit of the armature and the free-body diagram of the rotor are shown in the
following figure.

We will assume that the input of the system is the voltage source ( ) applied to the motor's
armature, while the output is the rotational speed of the shaft . The rotor and shaft are assumed
to be rigid. We further assume a viscous friction model, that is, the friction torque is proportional
to shaft angular velocity.

The physical parameters for our example are:


(J) moment of inertia of the rotor 0.01 kg.m^2
(b) motor viscous friction constant 0.1 N.m.s
(Ke) electromotive force constant 0.01 V/rad/sec
(Kt) motor torque constant 0.01 N.m/Amp
(R) electric resistance 1 Ohm
(L) electric inductance 0.5 H

System equations
In general, the torque generated by a DC motor is proportional to the armature current and the
strength of the magnetic field. In this example we will assume that the magnetic field is constant
and, therefore, that the motor torque is proportional to only the armature current by a constant
factor . This is referred to as an armature-controlled motor.
From the figure above, we can derive the following governing equations based on Newton's 2nd
law and Kirchhoff's voltage law.

Applying the Laplace transform, the above modeling equations can be expressed in terms of the
Laplace variable s.

We arrive at the following open-loop transfer function by eliminating between the two above
equations, where the rotational speed is considered the output and the armature voltage is
considered the input.
Lab Tasks:
1. Write MATLAB script file and determine the transfer function of the given system using the
following parameters.

J = 0.01;
b = 0.1;
K = 0.01;
R = 1;
L = 0.5;

MATLAB Code:
% Task 1

J = 0.01;
b = 0.1;
K = 0.01;
R = 1;
L = 0.5;
s = tf('s');
P_motor = K/((J*s+b)*(L*s+R)+K^2)
zpk(P_motor)

Ts = 0.05;
dP_motor = c2d(P_motor,Ts,'zoh');
zpk(dP_motor)

sys_cl = feedback(dP_motor,1);
[y,t] = step(sys_cl,12);
stairs(t,y);
xlabel('Time (s)')
ylabel('Velocity (rad/s)')
title('Stairstep Response: Original')

MATLAB Output:
P_motor =
0.01
---------------------------
0.005 s^2 + 0.06 s + 0.1001

Continuous-time transfer function.


ans =
2
-------------------
(s+9.997) (s+2.003)

Continuous-time zero/pole/gain model.

ans =
0.0020586 (z+0.8189)
---------------------
(z-0.9047) (z-0.6066)

Sample time: 0.05 seconds


Discrete-time zero/pole/gain model.
2. Using the transfer function, write MATLAB code to design a digital controller for the speed
control of DC motor.

MATLAB Code:
%% Task 2

Kp = 100;
Ki = 150;
Kd = 10;

C = Kp + Ki/s + Kd*s;
dC = c2d(C,Ts,'tustin')

sys_cl = feedback(dC*dP_motor,1);
[x2,t] = step(sys_cl,8);
stairs(t,x2)
xlabel('Time (seconds)')
ylabel('Velocity (rad/s)')
title('Stairstep Response: with PID controller')

rlocus(dC*dP_motor)
axis([-1.5 1.5 -1 1])
title('Root Locus of Compensated System')

z = tf('z',Ts);
dC = dC/(z+0.819);
rlocus(dC*dP_motor);
axis([-1.5 1.5 -1 1])
title('Root Locus of Modified Compensated System');

sys_cl = feedback(0.8*dC*dP_motor,1);
[x3,t] = step(sys_cl,8);
stairs(t,x3)
axis([0 8 0 1.5])
xlabel('Time (seconds)')
ylabel('Velocity (rad/s)')
title('Stairstep Response: with Modified PID controller')

MATLAB Output:
C =

10 s^2 + 100 s + 150

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

Continuous-time transfer function.


dC =

503.8 z^2 - 792.5 z + 303.8

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

z^2 - 1

Sample time: 0.05 seconds

Discrete-time transfer function.

sys_cl =

1.037 z^3 - 0.7822 z^2 - 0.7107 z + 0.512

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

z^4 - 0.4743 z^3 - 1.233 z^2 + 0.8007 z - 0.03676

Sample time: 0.05 seconds

Discrete-time transfer function.


Conclusion:
In this lab, we learned how to find the open-loop transfer function of a DC motor and implement
it in MATLAB. Additionally, we learned how to convert a continuous-time transfer function to a
discrete-time transfer function. We were then able to use the discrete-time transfer function to
design a digital controller for the speed control of a DC motor.

You might also like