DCS Lab 6 Report (Zain, Umer, Abdullah)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

DIGITAL CONTROL SYSTEMS (EE-372)

Lab #6 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 6: Digital Control of DC Servomotor

1. Objectives
The objective of this lab is to introduce to the students the design and implementation of digital
control. The digital control is implemented on a lab-scale DC Servomotor in the control systems
laboratory. The performance of the resulted digital control system is compared with the
continuous-time control system performance. The effect of sampling period Ts (or sampling
frequency fs = 1/Ts) is studied.
When doing the lab, the software packages MATLAB with Control Systems Toolbox, and the
Simulink are used for the analysis and design of control systems.

2. Introduction
An important approach to digital controller (filter) design is to start with a well-designed
analogue controller. The digital controller C(z) is then implemented by discretizing the
continuous time controller C(s). This design method is also called design by emulation, which is
widely used by control engineers in practice. It is known that for a properly chosen sampling
period, this method can provide a useful digital controller with satisfactory performance. In this
lab, students are asked to implement the digital controllers, obtained by discretizing a pre-
specified analog controller using some common discretization methods. The effect of sampling
frequency is also studied by comparing different system responses with respect to fs.
In the last part of the experiment, the students are asked to implement a digital controller
designed directly for the discrete-time dc-motor model, and the system response is obtained for
comparison purpose.

3. Preparation
Before the lab begins, students are required to read and understand the Control System
Laboratory Manual for the hardware and software description. In addition, it is recommended
that the students complete the following pre-lab work.
The Quanser dc-servomotor in the control systems laboratory has the following model (with a
low gear ratio and in the load free case): P(s) = 20020/s(s+42).
The analogue control system can be implemented by using a continuous-time controller C(s):

Analog Control System for a DC-Motor

In this lab, the analogue controller is given as a lead compensator C(s) = (0.08s+0.08)/s+3, which
can generate a satisfactory transient and steady-state performance of the system step response.
By discretizing C(s), one can implement a digital control system:

Digital Control System for a DC-Motor

With the sampling interval chosen as Ts = 0.001, and Ts = 0.01, use the Bilinear transformation
(Tustin’s method) to obtain the discrete-time models of C(s), denoted by C1(z) and C2(z),
respectively. This can be done by using c2d command in MATLAB. Record down C(s), C1(z),
and C2(z), and they will be used in the following experiment procedure.
Lab Tasks:

1. Design Linear PID controller for the given system.

Controller Design:
MATLAB Code:
%Task 1

G = tf(20020,[1 42 0])
C = tf([0.0264 0.08],[1 0])
H = feedback(G*C,1)
step(H)

MATLAB Output:
G =
20020
----------
s^2 + 42 s
Continuous-time transfer function.

C =
0.0264 s + 0.08
---------------
s
Continuous-time transfer function.

H =
528.5 s + 1602
-----------------------------
s^3 + 42 s^2 + 528.5 s + 1602
Continuous-time transfer function.
2. Design Digital controller for the given system.

MATLAB Code:
%% Task 2

servomotor = tf(20020,[1 42 0]);


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

Kp = 0.02932;
Ki = 0.08518;
Kd = 0;
% Kp, Ki, and Kd values found using the command: "pidTuner(G)"
s = tf('s');
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)
title('Root Locus of Compensated System')

MATLAB Output:
motor_tf =
13.874 (z+0.5075)
-----------------
(z-1) (z-0.1225)

Sample time: 0.05 seconds


Discrete-time zero/pole/gain model.
3. Compare the results.

Comparison:
The digital controller tries to follow the behaviour of the analogue controller. However, it can be
seen that the digital controller has greater overshoot and longer settling time as compared to the
analogue controller. Steady state value remains the same for both the controllers. The accuracy
with which the digital controller represents the values of the analogue controller depends on the
sampling time as well as the method used for analogue to digital conversion.

Conclusion:
In this lab, we learned about digital control of a DC servomotor. We were able to design a linear
PID controller and a digital controller in MATLAB and then compare the behaviour of the two
controllers.

You might also like