You are on page 1of 13

FEEDBACK CONTROL SYSTEMS

Complex Engineering Problem

Muhammad Salman EE-126


Ali Raza Zaidi EE-248
Kashaf Zain EE-113
Usama Khalid EE-129
Section-C

NED University of Engineering and Technology


Department of Electrical Engineering
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

Complex Engineering Problem


ee-126,113,129,248 Section-C

AIM
To model the feedback control system of a DC motor.

OBJECTIVES
1. Identify physical parameters.
2. Find the transfer function of the system.
3. Plot different responses using a control parameter.
4. Apply Routh criteria and find the range of stability for motor speed control.
5. Plot root locus.

Background
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.

Figure 1: Electromechanical system (motor)

We will assume that the input of the system is the voltage source (V) 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 kg.m^2


(B) motor viscous friction constant N.m.s
(Ke) electromotive force constant V/rad/sec
Page | 1
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

(Kt) motor torque constant N.m/Amp


(R) electric resistance Ohm
(L) electric inductance H

Transfer Function:
Applying the Laplace transform, the modeling equations can be expressed in terms of the
Laplace variable s. We then arrive at our transfer function where the rotational speed is
considered the output and the armature voltage is considered the input
.

Figure 2: Transfer Function of dc motor

METHODOLOGY
First we have designed a hardware to measure the dc motor rpm and print it directly onto
the computer.
 Then we upload the rpm readings into MS excel then import to MATLAB to begin our
system modelling and analysis.
Components:
 Arduino UNO.
 DC motor 9V and disc.
 9V battery.
 Encoder (FC-03): IR speed sensor module with the comparator LM393. We can
calculate the speed of rotation of the motor if we place a ring gear that rotates attached to
our wheel.
The basic operation of this sensor is as follows; If anything is passed between the sensor
slot, it creates a digital pulse on the D0 pin. This pulse goes from 0V to 5V and is a
digital TTL signal. Then with Arduino we can read this pulse.

Figure 3:IR sensor

Page | 2
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

Circuit Diagram:

Page | 3
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

Arduino Code:

The Rpm is output is shown below:


Rpm

1 120 18 2280
2 480
19 2400
3 600
4 720 20 2220
5 800 21 2820
6 1380 22 2820
7 1620 23 3180
8 1740
9 2160
10 2220
11 2240
12 2700
13 2820
14 2820
15 2820
16 2820
17 1680

Page | 4
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

RESULTS:

Figure 4: Simulink model used

Parameter estimation:
The values of parameters were obtained are shown in the figure below:

Page | 5
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

Figure 5: transfer function of dc motor

Figure 6: Plot of step response

Transfer Function:

Page | 6
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

The following Transfer function was obtained:

Pole Zero Map:

MATLAB command:

pzmap(P_motor);

 The Pole Zero Map obtained shows us that there are no zeroes present in our transfer
functions.
 The values of poles are also plotted: poles lie respectively at s = -2.43 and -0.162.

Page | 7
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

Routh-Hurwitz stability criteria:


The following code was used:
clear ; close all; clc

% Taking coefficients vector and organizing the first two rows


coeffVector = input('input vector of your system coefficients: \n i.e. [an
an-1 an-2 ... a0] = ');
ceoffLength = length(coeffVector);
rhTableColumn = round(ceoffLength/2);
% Initialize Routh-Hurwitz table with empty zero array
rhTable = zeros(ceoffLength,rhTableColumn);
% Compute first row of the table
rhTable(1,:) = coeffVector(1,1:2:ceoffLength);
% Check if length of coefficients vector is even or odd
if (rem(ceoffLength,2) ~= 0)
% if odd, second row of table will be
rhTable(2,1:rhTableColumn - 1) = coeffVector(1,2:2:ceoffLength);
else
% if even, second row of table will be
rhTable(2,:) = coeffVector(1,2:2:ceoffLength);
end
%% Calculate Routh-Hurwitz table's rows
% Set epss as a small value
epss = 0.01;
% Calculate other elements of the table
for i = 3:ceoffLength

% special case: row of all zeros


if rhTable(i-1,:) == 0
order = (ceoffLength - i);
cnt1 = 0;
cnt2 = 1;
for j = 1:rhTableColumn - 1
rhTable(i-1,j) = (order - cnt1) * rhTable(i-2,cnt2);
cnt2 = cnt2 + 1;
cnt1 = cnt1 + 2;
end
end

for j = 1:rhTableColumn - 1
% first element of upper row
firstElemUpperRow = rhTable(i-1,1);

% compute each element of the table


rhTable(i,j) = ((rhTable(i-1,1) * rhTable(i-2,j+1)) - ....
(rhTable(i-2,1) * rhTable(i-1,j+1))) / firstElemUpperRow;
end

% special case: zero in the first column


if rhTable(i,1) == 0
rhTable(i,1) = epss;
end end
%% Compute number of right hand side poles(unstable poles)

Page | 8
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

% Initialize unstable poles with zero


unstablePoles = 0;
% Check change in signs
for i = 1:ceoffLength - 1
if sign(rhTable(i,1)) * sign(rhTable(i+1,1)) == -1
unstablePoles = unstablePoles + 1;
end end
% Print calculated data on screen
fprintf('\n Routh-Hurwitz Table:\n')
rhTable
% Print the stability result on screen
if unstablePoles == 0
fprintf('~~~~~> it is a stable system! <~~~~~\n')
else
fprintf('~~~~~> it is an unstable system! <~~~~~\n')
end
fprintf('\n Number of right hand side poles =%2.0f\n',unstablePoles)
reply = input('Do you want roots of system be shown? Y/N ', 's');
if reply == 'y' || reply == 'Y'
sysRoots = roots(coeffVector);
fprintf('\n Given polynomial coefficients roots :\n')
sysRoots end

Figure 7: Routh Table obtained.

Page | 9
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

Root Locus Plot:


The following code was used to plot the root locus plot:

 Root Locus plots are a very useful way to predict the behavior of a closed loop system as
some parameter of the system (typically a gain) is changed.
 As you can see, the locus is symmetric about the real axis.
 The open loop transfer function, G(s)H(s), has 2 poles, therefore the locus has 2 branches.
Each branch is displayed in a different color.

Page | 10
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

Bode Plot:

The Bode plot or the Bode diagram consists of two plots:

 Magnitude plot
 Phase plot

In both the plots, x-axis represents angular frequency (logarithmic scale). Whereas, yaxis
represents the magnitude (linear scale) of open loop transfer function in the magnitude plot and
the phase angle (linear scale) of the open loop transfer function in the phase plot.

Page | 11
Feedback Control Systems Complex Engineering Problem
NED University of Engineering and Technology Department of Electrical Engineering

PID Controller:

PID controller consists of three terms, namely proportional, integral and derivative control. The
combined operation of these three controllers gives control strategy for process control. PID
controller manipulates the process variables like pressure, speed, temperature, flow, etc.
 As a feedback controller, it delivers the control output at desired levels.
 PID controller maintains the output such that there is zero error between process variable
and set point/ desired output by closed loop operations.

Response after Tuning PID controller:

Page | 12

You might also like