0% found this document useful (0 votes)
27 views61 pages

Lab Manual Control IT-4406

The lab manual outlines a series of experiments focused on control systems using MATLAB, covering topics such as basic operations, polynomials, block diagram reduction, and control design. Each section includes objectives, tasks, and commands to familiarize students with MATLAB's functionality for control systems engineering. The manual emphasizes practical applications, including system modeling, simulation, and data analysis.

Uploaded by

ullahatif018
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)
27 views61 pages

Lab Manual Control IT-4406

The lab manual outlines a series of experiments focused on control systems using MATLAB, covering topics such as basic operations, polynomials, block diagram reduction, and control design. Each section includes objectives, tasks, and commands to familiarize students with MATLAB's functionality for control systems engineering. The manual emphasizes practical applications, including system modeling, simulation, and data analysis.

Uploaded by

ullahatif018
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/ 61

Lab Manual

Control System

Instructor: Engr. Sakhi Rehman


List of experiments
1. Basics of Matlab for control system.
2. Polynomials in MATLAB
3. Block Diagram Reduction
4. State-Space Modelling
5. Routh-Hurwitz Criterion in Matlab
6. Controllers Design (P,PI,PD,PID)
7. Tuning of PWM Driver and Characteristics of PWM driver and Motor Dead Band
8. Tuning and calibration of Rotational Sensor Interface, Characteristics of PWM driver and
Motor Dead Band and Open Loop Control of the Motor
9. Closed Loop Proportional Control of the Motor
10. Closed Loop Proportional-Integral-Derivative Control of the Motor
11. Open Loop Control of the Light
12. Closed Loop Proportional Control of the Light
13. Closed Loop Proportional-Integral-Derivative Control of the Light
14. Calibration of Temperature Sensor Interface and Closed Loop Proportional-Integral-
Derivative Control of the Temperature
LAB No. 01
Matlab Basics
Objective:
The objective of this session is to learn how to perform the Basic Operations in Matlab
used in Control Systems Engineering. It includes working in three windows of matlab, basic
operations of vectors matrices and plotting techniques.
What is Matlab???
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where problems and
solutions are expressed in familiar mathematical notation. Typical uses include:
a) Math and computation
b) Algorithm development
c) Modelling, simulation, and prototyping
d) Data analysis, exploration, and visualization
e) Scientific and engineering graphics
f) Application development, including graphical user interface building.
Display Windows
Three basic windows:
1. Graphic (Figure) Window: It displays plots and graphs, created in response to graphics
commands.
2. M-file editor/debugger window: Create and edit scripts of commands called M-files.
3. Command window: In command window we type commands, view program
variables; we can clear all the variables by typing Clear in the command Window.

HELP COMMAND in a Command Window


help – lists all the help topic
help topic – provides help for the specified topic
help command – provides help for the specified command
help help – provides information on use of the help command
helpwin – opens a separate help window for navigation
lookfor keyword – Search all M-files for keyword
LESSON No. 01
Variables
 Must start with a letter
 May contain only letters, digits, and the underscore “_”
 Matlab is case sensitive, i.e. one & OnE are different variables.
 Matlab only recognizes the first 31 characters in a variable name.
Assignment statement
Matlab is a case sensitive that is ‘a’ is not the same as ‘A’.
Matlab has a built in variables like ‘pi’,’ans’ and ‘eps’.The
variable ‘ans’ will keep the track of the last output which was not assigned to another variable.
Special variables
ans : default variable name for the result
pi: = 3.1415926…………
eps: = 2.2204e-016, smallest amount by which 2 numbers can differ.
Inf or inf : , infinity
NaN or nan: not-a-number

Variable = number;
Variable = expression;
The equality sign is used to assign values to the variables.
Task 1.1 (a):
Assign any constant value and an expression to two different variables, say ‘x’ and ‘y’.
NOTE: when a semi-colon ”;” is placed at the end of each command, the result is not displayed.

Task 1.1 (b):


Assign two same values to a variable such that the result is displayed for 1st assignment and
does not display for 2nd one.
Variable Arithmetic’s
Operators Precedence:
The following is the operator precedence in Matlab:
“^, * or /, + or -.”
Task 1.2:
Solve the given expression yourself and compare the result with the matlab output.
2+3*4^2.
Commands involving variables
 who: lists the names of defined variables
 whos: lists the names and sizes of defined variables
 clear: clears all variables, reset the default values of special variables.
 clear name: clears the variable name
 clc: clears the command window
 clf: clears the current figure and the graph window.
Built in Matlab Functions
Table 1.1:Basic Built in Matlab Functions

Function Meaning

Sin Sine

Cos Cosine

Tang Tangent

Exp Exponential

Log Natural log

Task 1.3:
Make practice on the above built in functions in matlab.
LESSON No. 02
Vectors
 A row vector in MATLAB can be created by an explicit list, starting with a left bracket,
entering the values separated by spaces (or commas) and closing the vector with a right
bracket.
 A column vector can be created the same way, and the rows are separated by semicolons.
Task 1.4(a):
Create a row vector and a column vector and assign these to two different variables

Vector Addressing:

A vector element is addressed in MATLAB with an integer index enclosed in


parentheses.

The colon notation may be used to address a block of elements.


(start : increment : end)
‘start’ is the starting index, ‘increment’ is the amount to add to each successive index, and ‘end’
is the ending index. A shortened format (start : end) may be used if increment is 1.

Task 1.4(b):

Address the 3rd element of vector ‘x’

Task 1.4(c):
Address 1st to 3rd elements of vector ‘x’

Table 1.2: Some Useful Commands


x = start:end create row vector x starting with start, counting by one, ending at end
create row vector x starting with start, counting by increment, ending at
x = start:increment:end
or before end
create row vector x starting with start, ending at end, having number
linspace(start,end,number)
elements
length(x) returns the length of vector x
y = x’ transpose of vector x
dot (x, y) returns the scalar dot product of the vector x and y.

Task 1.5:
Make practice on the above functions in matlab.
LESSON No. 03
Matrices
A Matrix array is two-dimensional, having both multiple rows and multiple columns,
similar to vector arrays:
it begins with [, and end with ]
spaces or commas are used to separate elements in a row
semicolon or enter is used to separate rows.
Task 1.6:
Create Matrices in matlab using the above techniques.

Matrix Addressing:

 matrixname(row, column)
 colon may be used in place of a row or column
reference to select the entire row or column.
Some useful commands:
zeros(n) returns a n x n matrix of zeros
zeros(m,n) returns a m x n matrix of zeros
ones(n) returns a n x n matrix of ones
ones(m,n) returns a m x n matrix of ones
rand(n) returns a n x n matrix of random number
rand(m,n) returns a m x n matrix of random number
size (A) for a m x n matrix A, returns the row vector [m,n] containing the
number of rows and columns in matrix.
Length(A) returns the larger of the number of rows or columns in A.
eye(n) returns an n x n identity matrix
eye(m,n) returns an m x n matrix with ones on the main diagonal and zeros
elsewhere.
B=A’ returns matrix B as Transpose of matrix A.
Table 1. 3: Matrix Operations:
LESSON No. 04
Scalar-Array Mathematics
For addition, subtraction, multiplication and division of an array by a scalar simply
apply the operations to all elements of the array.

Task 1.7 (a):


Perform the multiplication by a scalar to 2x2 matrix.

Element-by-Element Array-Array Mathematics:

Task 1.7 (b):


Perform Element-by-Element
Array-Array multiplication
Table 1. 4: Arithmatic
Operations:

Solutions to Systems of Linear Equations:


A system of 3 linear equations with 3 unknowns (x1, x2, x3):
3x1 + 2x2 – x3 = 10
-x1 + 3x2 + 2x3 = 5
x1 – x2 – x3 = -1
in matrix form
3 2 −1 x1 10
𝐴 = [ −1 3 2] 𝑥 = [𝑥2] 𝑏=[ 5 ]
1 −1 −1 𝑥3 −1
Then, the system can be described as:

Ax = b;
Task 1.7(c):
Find the unknowns (x1, x2, x3):

NOTE: left division: A\b b÷ A right division: x/y x÷ y

Table 1.5: Relational and Logical Operators


LESSON No. 05
Plotting Curves
For more information on 2-D plotting, type help graph2d

Table 1.6: Matlab Built in Plotting Functions


Command Description
axis ([xmin xmax ymin ymax]) Define minimum and maximum values of the axes
plot (x,y) Generates a linear plot of the values of x (horizontal axis)
and y (vertical axis).
plot (x, y, w, z) Multiple curves can be plotted on the same graph by using
multiple arguments in a plot command. The variables x, y,
w, and z are vectors. Two curves will be plotted: y vs. x,
and z vs. w.
X-label(‘x axis label’) Add x-axis label
Y-label(‘y axis label’) Add y-axis label
Title(‘title of plot’) Title of the plot
grid on Adds dashed grids lines at the tick marks
grid off removes grid lines (default)
legend (‘string1’, ‘string2’,…) Used to distinguish between plots on the same graph
Hold Hold current graph in the figure
Pause Wait for user response
figure (n) Used in creation of multiple plot windows. Place this
command before the plot() command, and the
corresponding figure will be labeled as “figure n”
subplot (m, n, p) m by n grid of windows, with p specifying the current plot
as the pth window
Close Closes the figure n window
close all Closes all the figure windows
Table 1.7: Graph Formatting Tools

Task 1.8:
Plot the functions i) a = 2x, ii) b = x2 iii) c = 2 x3 iv) d = √x in the interval (-3,3)
in editor window.
LAB No. 02

Section: A Polynomials in MATLAB


Objective:
The objective of this session is to learn how to represent polynomials in
MATLAB, find roots of polynomials, create polynomials when roots are known,
convolution (multiplication of polynomials), de-convolution (division of polynomials)
and obtain partial fractions.
Polynomial Overview
MATLAB provides functions for standard polynomial operations, such as
polynomial roots, evaluation and partial fraction expansion.
Table 2.1: Polynomial Functions

Representing Polynomials

MATLAB represents polynomials as row vectors containing coefficients ordered by


descending powers. For example, consider the equation.

To enter this polynomial into MATLAB, use the coefficients of the variable in descending
order enclosed by braces.

Task 2.1(a):

Plot the polynomial

Polynomial Roots (Factorization)

The roots function calculates the roots of a polynomial:

Syntax: roots(p)
Task 2.1(b):

Find the roots of the given polynomial in matlab.

The function ‘poly’ returns to the polynomial coefficients:

Syntax: poly(roots) ; where roots is the variable to which the roots of the polynomial has been
assigned.

Task 2.1(c):

Find the polynomial from the roots as in part (b).

Partial Fraction Expansion

‘residue’ finds the partial fraction expansion of the ratio of two polynomials. This is particularly
useful for applications that represent systems in transfer function form.

Task 2.2:

Use matlab command to find the partial fraction of the given algebraic expression:

Multiplication and Division (Convolution and Deconvolution)

The function ‘conv’ is used for multiplication and ‘deconv’ for division of polynomials,
particularly useful for Transfer Function handling.

Consider the polynomials: a(s) = s2 + 2s + 3 and b(s) = 4s2 +5s + 6.

Task 2.3:

Multiply and divide the given polynomials in matlab.


Section: B

Laplace Transform, Transfer Function and Zero-Pole-Gain Models in MATLAB

Objective: The objectives of this lab include:

 How to find Laplace and inverse Laplace transforms in MATLAB.


 How to represent transfer functions (or models) in MATLAB.
 How to create Zero-Pole-Gain Models in MATLAB.
 Conversion between transfer function and Zero-Pole-Gain Models in MATLAB.
 Plotting poles and zeros of a system in MATLAB.
 Simulation of Linear systems to Impulse and Step inputs in MATLAB/SIMULINK.

Laplace and Inverse Laplace Transforms in MATLAB

Laplace transform is an important tool that is very useful while working with differential
equations. Steps to calculate the Laplace transform in MATLAB are:
i. Define a symbolic variable for time using the keyword sym
ii. Define the time domain function
iii. Find the Laplace transform by using the function laplace(function)
iv. The inverse Laplace transform can be found using the function ilaplace()
Task 2.4:
a) Find the laplace transform of the function, f= 5te-5t.
b) find the inverse Laplace transform of the function as in part (a)

Transfer function & pole-zero-gain representation in Matlab

Mathematical modeling of LTI systems in Matlab would be represented in terms of


transfer function or pole-zero-gain. We will also learn how to make preliminary analysis of such
systems using plots of poles and zeros locations as well as time response due to impulse, step and
arbitrary inputs.
All LTI models are represented as a ratio of polynomial functions.
Transfer functions (TF):

We can create transfer function (TF) models by specifying numerator and denominator
coefficients.
Syntax: tf(numerator polynomial, denominator polynomial)
Task 2.5(a):
(𝒔+𝟐)
Find the transfer function of the given function. P(s)= (𝑠2 + 𝑠 + 10

A useful trick is to create the Laplace variable, ‘s’. That way, we can specify polynomials
using‘s’ as the polynomial variable.

Task 2.5(b):

Write a matlab code to enter the given polynomial in variable‘s’.

Creating Zero-Pole-Gain Models

To create zero-pole-gain (ZPK) models, you must specify each of the three components
in vector format.
Syntax: system=zpk([zeros],[poles],[gain])
Task 2.6:
Create zero, pole, gain model in matlab using the above command.

Model Conversion (tf = zpk)

Model conversions are performed by tf and zpk. Given any TF and ZPK model sys, the
syntax for conversion to another model type is given by:
sys = tf(sys) % Conversion to TF
sys = zpk(sys) % Conversion to ZPK
Task 2.7:
Write a matlab code for conversion between transfer function and zpk model

Plotting poles and zeros of a system

pzmap : Compute pole-zero map of LTI models


pzmap(sys) plots the pole-zero map of the continuous- or discrete-time LTI model sys. For SISO
systems, pzmap plots the transfer function poles and zeros. The poles are plotted as x's and the
zeros are plotted as o's.
[p,z] = pzmap(sys) returns the system poles and zeros in the column vectors p and z. No plot is
drawn on the screen. You can use the functions sgrid or zgrid to plot lines of constant damping
ratio and natural frequency in the s- or z- plane.
Task 2.8:
(𝒔+𝟐)
Plot the poles and zeros of the continuous-time system. P(s) = (𝑠2 + 𝑠 + 10

Response of Linear systems to Impulse, Step and Ramp inputs

You can simulate the LTI systems to inputs like impulse, step and other standard inputs
and see the plot of the response in the figure window. MATLAB command ‘impulse’ calculates
the unit impulse response of the system, ‘step’ calculates the unit step response of the system and
‘lsim’ simulates the (time) response of continuous or discrete linear systems to arbitrary inputs.
When invoked without left-hand arguments, all three commands plot the response on the screen.
Task 2.9:
(𝒔+𝟑)
Find the impulse and step responses of the system: G(s) = (3𝑠2 + 5𝑠 + 7

Step Response using Simulink

Procedure:
1. Click on the Simulink Library block in Home tool bar OR type “simulink” in Matlab
command prompt “Simulink Library Browser” window will appear.
2. Create a new file by selecting “model” from the file option(file->New->Model)
3. Drag the step function (from Sources block) from the simulink library browser to the new
file created followed by transfer function (from Continuous block) and scope (from Sinks
block). Scope is used to see the result (resulting waveform).
4. Give values to the transfer function according to the given system.
5. After saving followed by simulation, click on the scope in the figure to see the resulting
waveform (graph).
6. A window showing the step response will appear.
Impulse Response using Simulink

Procedure:
Repeat the same process as above, just insert differential (derivative) block after Step
block as derivative of Step function results in Impulse function.
Task 2.10:
(𝒔+𝟑)
Plot the impulse and step responses using Simulink of the system: G(s) = (3𝑠2 + 5𝑠 + 7
LAB No. 03

Block Diagram Reduction

Objective:

The purpose of this lab is to learn about the implementation of different blocks and to
reduce it to a single block using the built in commands.

General Description:
Block diagram consist of Uni-directional operational block that represent the transfer
function of the variable of the interest. The block diagram of representation of a given system
often can be reduced to a simplified block diagram with fewer blocks than original blocks.
Useful Commands for block-reduction:

i) conv
Convolution and polynomial multiplication:
Syntax:
w = conv(u,v)

ii) tf
Create or convert to transfer function model.

sys = tf(num,den)
sys = tf(num,den,Ts)
sys = tf(M)
sys = tf(num,den,ltisys)
tfsys = tf(sys)

iii) Feedback
Syntax:
sys = feedback(sys1,sys2)

Task 3.1:
Find the Close-loop gain of a given system in Matlab using feedback.
Task 3.2:
Find the Close loop Transfer function of a given system using Matlab.
LAB No. 04

State-Space Modelling
Objective:
State Space modeling is a modern tool of analysis and design. The objective of this lab is
to able the students to perform operations in time domain analysis using matlab as compared to
manual work which is a cumbersome task.
General Description:
In control engineering, a state-space representation is a mathematical model of a
physical system as a set of input, output and state variables related by first-order differential
equations.
"State space" refers to the space whose axes are the state variables. The state of the
system can be represented as a vector within that space.
Useful Commands: ss
‘ss’ is used to create real- or complex-valued, state-space models (SS objects) or to convert
transfer function or zero-pole-gain models to state space.
Specify state-space models or convert LTI model to state space
Syntax
ss
sys = ss(a,b,c,d)
sys = ss(a,b,c,d,Ts)
sys = ss(d)
sys = ss(a,b,c,d,ltisys)
sys_ss = ss(sys)

Creation of State-Space Models


sys = ss(a,b,c,d) creates a SS object representing the continuous-time state-space model
For a model with Nx states, Ny outputs, and Nu inputs:
a is an Nx-by-Nx real- or complex-valued matrix.
b is an Nx-by-Nu real- or complex-valued matrix.
c is an Ny-by-Nx real- or complex-valued matrix.
d is an Ny-by-Nu real- or complex-valued matrix.
To set D = 0 , set d to the scalar 0 (zero), regardless of the dimension.
sys = ss(a,b,c,d,Ts) creates the discrete-time model with sample time Ts (in seconds). Set Ts = -1
or Ts = [] to leave the sample time unspecified.

sys = ss(d) specifies a static gain matrix D and is equivalent to


sys = ss([],[],[],d)
sys = ss(a,b,c,d,ltisys) creates a state-space model with generic LTI properties inherited from the
LTI model ltisys (including the sample time).
Matlab Practice

The state-space representation consists of specifying the A, B, C, and D matrices followed by the
creation of an LTI state-space object using the MATLAB command, ss(A,B,C,D).

Task 4.1:

Let;

0 1 0 0
A=[ 0 0 1 ]; B=[0] ; C=[1 1 0]; D=0;
−4 − 5 − 8 4

As 𝑋̇ = 𝐴𝑋 + 𝐵𝑈

Y=CX+DU

Write a Matlab Source Code for the Problem.

Task 4.2:

For illustration of state space representation, consider the following simple model of an
electric motor.
Where θ is the angular displacement of the rotor and I is the driving current. The relation
between the input current u = I and the angular velocity y is described by the state-space
equations.

Implement this model in matlab.

Task 4.3:

Given the control system;

i) Determine the state variable representation of Controller.


ii) Repeat above for Plant
iii) Use series and feedback systems to find impulse response.
LAB No. 05
Section:A Routh-Hurwitz Criterion in Matlab
Objective:
Purpose of the lab is to analyze the behavior of the system using Routh-Hurwitz Criterion
implemented in matlab. The stability of the can best be analyzed using matlab in a much faster
and accurate way.
General Description:
This is a very useful method which gives us the information about the stability of a
system without the need to solve the system and find the closed loop system poles. Using this
method we can tell how many closed loop system-poles are located in right half plane, in the left
half plane and on the jw axis.
The Routh Hurwitz criterion declares that the number of roots of polynomial that are in
right half plane is equal to the number of sign changes in first column.
Task 5.1:
If Transfer function of a system is given as:

i) K=[1:1:20]
ii) For what value of K system will be stable.
Section:B Root Locus in Matlab:
Objective:
The students may become able to draw root locus and analyze the behavior of the system
from the root locus drawn.
General Description:
In control theory and stability theory, root locus analysis is a graphical method for
examining how the roots of a system change with variation of a certain system parameter,
commonly a gain within a feedback system.
The root locus technique can be used to analyze and design the effect of loop gain upon
the system's transient response and stability. This technique provides very useful information
about system parameters. As one says if you can measure it , you can control it so this technique
is very useful in this regard.
Root Locus in Matlab:
Syntax
rlocus
rlocus(sys)
rlocus(sys1,sys2,...)
Description:
rlocus computes the Evans root locus of a SISO open-loop model. The root locus gives
the closed-loop pole trajectories as a function of the feedback gain (assuming negative feedback).
Root loci are used to study the effects of varying feedback gains on closed-loop pole locations.
In turn, these locations provide indirect information on the time and frequency responses.
‘rlocus(sys)’ calculates and plots the root locus of the open-loop SISO model sys.
Task 5.2:

i) Plot the root locus


ii) Find the Value where damping ratio is 0.707.
LAB No. 06

Controllers Design (P,PI,PD,PID)

Objective:

The students may be able to get the desired performance of the system by reducing steady
state error and improving transient response of the system.

INTRODUCTION:

In control system we always deal with system and their performance by finding
mathematical models. Sometimes we don’t meet with desire system performance. Every system
has some parameters to analyze the behavior of the system.

These parameters include rise time, settling time, steady state error , phase margin, gain
crossover frequency and phase crossover frequency.

If the designed system does not satisfy desire performance (i.e rise time, settling time,
steady state error , phase margin, gain crossover frequency and phase crossover frequency), then
controllers are designed to achieve desired response.

DIFFERENT TYPES OF CONTROLLER:

Basic Modes:

1. Proportional (P) Control


2. Integral (I) Control
3. Derivative (D) Control

Combined Modes:

1. Proportional + Integral (PI) Controller


2. Proportional + Derivative (PD) Controller
3. Proportional + Integral + Derivative (PID) Controller
1. Proportional (P) Controller:
 Proportional controller is simply an amplifier.
 It’s transfer is Gc(s) = Kp. It does not add any new pole or zero to the system.
 With P-Controller, response of closed loop system becomes faster. But maximum
overshoot also increase. The large value of Kp can make system unstable.
 P-Controller cannot handle steady state error.
 It provides offset error too.

eo (t) = Kp ei(t)

𝐸𝑂
GC (S)= = KP
𝐸𝐼

Open loop system:

5
G(s) = (𝑠+1)(𝑠+2)(𝑠+3)

P-Controller

Gc (s) = 3.04

Feedback Gain: H(s) =1

Step response of closed loop system without controller: ______

Step response of close loop system with controller: __________


Fig. 6.1: Comparison between Output of System with and without P-Control
2. Integral (I) controller:
𝐾𝑖
 It’s transfer function is GC (s) = . it adds a pole and hence increase the order of the
𝑆

system by 1.
 With I-Controller, Offset error of P-Controller is removed.
 Steady state error in step response is also eliminated.
 However, system’s response becomes slightly slower.
 Oscillation in system’s response increases. Maximum overshoot increases. This can make
system unstable.

Open loop system:

5
G(s) = (𝑠+1)𝑠+2)𝑠+3)

I-Controller

𝐾𝑖 0.369
Gc (s) = =
𝑆 𝑆

Feedback Gain: H(s) =1

3. Derivative (D) Controller:


 It’s transfer function is GC (s) = Kd S. it adds a zero to the system.
 D-Controller give faster action when input changes rapidly. However, D-
Controller are not used alone.
 Because, if error ei(t) is constant then its output is zero and hence actuator’s
output will also be zero.
 Also, if error ei(t) changes suddenly (step) then output of D-Controller will be
impulsive.
 This impulsive output can cause sudden (step) act of actuator and hence can cause
breakdown to system’s component.

PROPORTIONAL + INTEGRAL (PI) CONTROLLER:

1
 It’s transfer function is GC (s) = Kp( 1+ 𝑇 𝑆 )
𝑖
 Kp is called ‘proportional Gain ‘ and Ti is called as ‘integral Time ’. 1/ Ti is known as ‘
Reset Time ‘.
 Ti affects integral control action while Kp affects both proportional and integral control
action.
 Advantage of both P-Controller and I-Controller are clubbed together in PI-Controller.
 Due to P-Controller, response becomes faster while duo to I-Control, steady state error
becomes zero.
 When Ti is increased, damping factor ζ also increase therefore, large oscillation duo to
P-Control can be made smaller.

Open loop system:

5
G(s) = (𝑠+1)𝑠+2)𝑠+3)

PI-Controller

1.01
Gc (s) = (1.52+ )
𝑆

Feedback Gain: H(s) =1

Step response of closed loop system without controller: ______

Step response of close loop system with controller: __________


Fig. 6.2: Comparison between Output of System with and without PI-Control

Task 6.1:

Write a matlab code for a unity feedback system with PI-Control to get the desired step response.

Proportional + Derivative (PD) Controller:

 It’s transfer function is GC (s) = Kp( 1+ Td S).

 Kp is called ‘ proportional Gain ‘ and Td is called as ‘ Derivative time’.


 Advantage of both P-Controller and D-Controller are clubbed together in PD-Controller.
 PD controller produces fast response. It cannot handle steady state error and produces
offset too.
 PD controller increase damping ζ that improve transient and reduces oscillations of
response oscillation of response. It makes system more stable.
 PD-Controller amplifies the noise signal and may cause saturation effect in actuator.

Open loop system:

5
G(s) = (𝑠+1)𝑠+2)𝑠+3)

PD-Controller

Gc (s) = (5.98 + 2.97S )


Feedback Gain: H(s) =1

Step response of closed loop system without controller: ______

Step response of close loop system with controller: __________


Fig. 6.3: Comparison between Output of System with and without PD-Control

Task 6.2:

Write a matlab code for a unity feedback system with PD-Control to get the desired step
response.
PROPORTIONAL + INTEGRAL + DERIVATIVE (PID) CONTROLLER:

1
 It’s transfer function is Gc(s) = Kp ( 1+ TdS + 𝑇i S )

 Kp is called ‘ proportional Gain ‘ and Td is called as ’ Derivative time’ and Ti is called as


‘integral Time’.
 Advantage of all three P,I and D controller are clubbed together in PID-Controller.
 It gives faster response due to P- controller and D-controller actions, zero steady state
error duo to I-controller action and higher stability due to D-controller action. Thus
making PID controller as best among these.
 Also to achieve, desired response, PID controller must be fine tuned (i.e finding optimal
value of Kp , Td , and Ti ).

Open loop system:

5
G(s) = (
𝑠+1)𝑠+2)𝑠+3)

PID-Controller

1.82
Gc (s) = (2.54 + 0.86S + )
𝑆

Feedback Gain: H(s) =1

Step response of closed loop system without controller: ______


Step response of close loop system with controller: __________

Fig. 6.4: Comparison between Output of System with and without PID-Control
PID CONTROLLER STRUCTURE:

Task 6.3:

Write a matlab code for a unity feedback system with PID-Control to get the desired step
response.
STEP RESPONSE OF PID CONTROLLER

Fig. 6.5: Comparison among all Output of System with and without PI, PD andPID-
Control
LAB No. 7

Objective
 Tuning of PWM Driver
 Characteristics of PWM driver and Motor Dead Band

Requirements
1. IT-4406 Trainer Board
2. 2mm Patch Cords
3. CRO

Experimental Setup
Refer to the following diagram to configure setup for the present experiment.

Fig 1.1

Procedure
1. Press the main switch (ON).
2. Connect the tip of the probe of channel CH1 of the oscilloscope to V6 TP34 of the
PWM DRIVER.
3. Regulate, on the oscilloscope screen, the width of the image, by selecting 5 V/DIV
through the relevant knob.
4. Adjust the knob TIME/DIV.
5. Move the three position selector (AC - GND - DC) to DC.
6. Regulate the trimmer ADJ1, turning it clockwise, to obtain a triangular wave equal to
10Vpp as shown in Fig 1.2.
Fig 1.2

7. Regulate the trimmer ADJ2, turning it counter-clockwise, until the maximum of the
triangular wave is at 0V as shown in Fig 1.2.
8. Move the probe of the oscilloscope to V7 TP35.
9. Insert a terminal of the digital voltmeter, set to dc, at TP36 and the other one at TP37.
10. Now connect the Setpoint 1 TP51 to the input of PWM driver TP33.
11. Set the voltage between 0 and 10V and observe, on the oscilloscope screen, that the
duty cycle of the square wave signal is variable although its period is constant. The
luminosity variation of the LED and the voltage read on the multimeter, which
between 0 and 12V, show that the average value of the voltage is regulated.
12. Connect the +VE TP36 and –VE TP37 of PWM Driver to the +VE and -VE of the
Motor as shown in Fig 1.1.
13. Insert a terminal of the digital voltmeter, set to dc, at the output of Setpoint 1.
14. Slowly increase the voltage on Setpoint 1 and write down the voltage value which
allows the start of the motor.
15. Slowly decrease the voltage on Setpoint 1 and write down the value which allows the
stop of the motor.
16. Repeat the procedure from step No. 14 and verify that the results are the same: it has
now been determined the dead zone of the motor.
17. Put OFF the main switch.
18. Remove all the connections.
LAB No. 8

Objective
 Tuning and calibration of Rotational Sensor Interface
 Characteristics of PWM driver and Motor Dead Band
 Open Loop Control of the Motor

Requirements
1. IT-4406 Trainer Board
2. 2mm Patch Cords
3. CRO

Experimental Setup
Refer to the following diagram to configure setup for the present experiment.

Fig 2.1

Procedure
1. Connect the oscilloscope probe to the Test frequency output TP22. It should be
around 500 Hz
2. Now connect output of Test block TP22 and TP23 to the input of F/V converter at
TP26 and TP25 respectively as shown in Fig 2.1.
3. Connect the output VOUT3 TP27 to the voltmeter and note the reading. It should be
approximately 10V. If not so, adjust the Gain pot to obtain the required reading.
4. Remove the connections and again note the reading at VOUT3. It should be
approximately 0V. If not so, adjust the Offset pot to obtain the required reading.
5. Repeat step 3 and again check the required result. These steps must be performed
until the required result is obtained.
6. Now connect the IR Out TP20 and TP21 to the input of F/V TP26 and TP25
respectively as shown in Fig 2.2.
Fig 2.2

7. Connect the Setpoint 1 output TP51 to the input of PWM driver TP33.
8. Connect the output of PWM Driver with the Motor as shown in Fig 2.3.

Fig 2.3

9. Turn the potentiometer Setpoint 1 until the motor starts to rotate.


10. Connect the oscilloscope to the IR Out and verify the frequency.
11. Connect the voltmeter at the output of Rotational Sensor Interface TP27. There should
be some DC volts.
12. Remember as the F/V is calibrated earlier so it should give:
13. 50 Hz = 1 V (approx.)
14. Increase the voltage by turning the potentiometer clockwise thus increases the Motor
RPM and the increase in voltages can be observed. Also measure frequency at IR out
by using oscilloscope and vary it by changing voltages at SETPOINT 1.

15. Measure output voltage VOUT3 (TP 27) by using multimeter at different frequencies
and write down in table 2.1.

Frequency 50 100 150 200 250 300 350 400 450 500
(Hz)
Voltage
(V)

Table 2.1
LAB No. 9

Objective
 Closed Loop Proportional Control of the Motor

Requirements
1. IT-4406 Trainer Board
2. 2mm Patch Cords
3. CRO

Experimental Setup
Refer to the following diagram to configure setup for the present experiment.

Fig 3.1
Procedure
1. Make all connections as shown in fig 3.1.
2. Connect the oscilloscope channel 1 probe to the Set point 1 TP51 and Channel 2
probe to the output of PID block TP49.
3. Set the voltage of about 4V at the output of Set point 1 TP51.
4. DC motor will start to rotate. If not so, turn the proportional pot to about 25%.
5. Observe the wave form of PID block on oscilloscope.

Fig 3.2
6. There will be some oscillations in the wave. Try to remove these ripples from the
wave by adjusting proportional pot.

Fig 3.3
7. When the system is balanced it will give you straight line. Try to unstable the system
by interrupting the motor with something. It will destabilize the system for some time
but the PID controller will again stabilize it as shown in Fig 3.4.
Fig 3.4
8. Note the time taken by the system to stabilize by oscilloscope.
9. Now set the voltage of about 5V at the output of Set point 1 TP51.
10. Repeat the above steps and note the readings.
LAB No. 10

Objective
 Closed Loop Proportional-Integral-Derivative Control of the Motor

Requirements
1. IT-4406 Trainer Board
2. 2mm Patch Cords
3. CRO

Experimental Setup
Refer to the following diagram to configure setup for the present experiment.

Fig 4.1
Procedure
1. Make all connections as shown in fig 4.1.
2. Connect the oscilloscope channel 1 probe to the Set point 1 TP51 and Channel 2
probe to the output of PID block TP49.
3. Set the voltage of about 4V at the output of Set point 1 TP51.
4. DC motor will start to rotate. If not so, turn the proportional pot to about 25%.
5. Turn the Integral and Derivative pot to about 25%.
6. Press the RESET button given on the trainer.
7. Observe the wave form of PID block on oscilloscope.

Fig 4.2
8. There will be some oscillations in the wave. Try to remove these ripples from the
wave by adjusting proportional and derivative pot.

Fig 4.3
9. When the system is balanced it will give you straight line. Try to unstable the system
by interrupting the motor with something. It will destabilize the system for some time
but the PID controller will again stabilize it as shown in fig 4.3.

Fig 4.4
10. Note the time taken by the system to stabilize.
11. Now set the voltage of about 5V at the output of Set point 1 TP51.
12. Repeat the above steps and note the readings.
LAB No. 11

Objective
Open Loop Control of the Light

Requirements
1. IT-4406 Trainer Board
2. 2mm Patch Cords
3. CRO

Experimental Setup
Refer to the following diagram to configure setup for the present experiment

Fig 5.1

Procedure
1. Connect the Dark and Full Light Test circuit TP3 and TP4 to the input of Lx/V
converter TP5 and TP6 respectively as shown in fig 5.1.
2. Connect the voltmeter to the output of Photo Sensor Interface TP7.
3. Move Knob to fully counter clockwise direction. There should be 0V at the output. If
not so, then adjust the OFFSET pot to make it 0V.
4. Now move the knob to fully clockwise direction. At VOUT-1 TP7, it should be
around 10V. If not so, adjust the gain pot so that the output is 10V.
5. Repeat step 3 and again check the required result. These steps must be performed
until the required result is obtained.
Fig 5.2

6. Now connect the Photo Sensor output TP1 and TP2 to the input of Lx/V converter
TP5 and TP6 respectively.
7. Connect the Set point 1 output TP51 to the input of PWM driver TP33.
8. Connect the output of PWM Driver with the Lamp 1 as shown in Fig 5.3.

Fig 5.3

9. Turn the potentiometer Setpoint 1 until the lamp glows.


10. Connect the voltmeter at the output of Photo Sensor Interface TP30. There should be
some DC volts.
11. Turn the Setpoint 1 pot fully counter clockwise and note the reading at VOUT1 TP7.
12. Increase the voltage by turning the potentiometer clockwise thus increases the Light
Lux and the increase in voltage can be observed.
LAB No. 12

Objective
 Closed Loop Proportional Control of the Light

Requirements
1. IT-4406 Trainer Board
2. 2mm Patch Cords
3. CRO

Experimental Setup
Refer to the following diagram to configure setup for the present experiment.

Fig 6.1
Procedure
1. Make all connections as shown in fig 6.1.
2. Connect the oscilloscope channel 1 probe to the Set point 1 TP51 and Channel 2
probe to the output of PID block TP49.
3. Set the voltage of about 5V at the output of Setpoint 1 TP51.
4. Lamp will be enlightened. If not so, turn the proportional pot to about 25%.
5. Observe the wave form of PID block on oscilloscope.

Fig 6.2
6. There will be some oscillations in the wave. Try to remove these ripples from the
wave by adjusting proportional pot.

Fig 6.3
7. When the system is balanced it will give you straight line. Try to unstable the system
by interrupting the light with the disturbance given on the trainer. It will destabilize
the system for some time but the PID controller will again stabilize it as shown in fig
6.4.
Fig 6.4
8. Note the time taken by the system to stabilize.
9. Now set the voltage of about 5.5V at the output of Setpoint 1 TP51.
10. Repeat the above steps and note the readings.
LAB No. 13

Objective
 Closed Loop Proportional-Integral-Derivative Control of the Light

Requirements
1. IT-4406 Trainer Board
2. 2mm Patch Cords
3. CRO

Experimental Setup
Refer to the following diagram to configure setup for the present experiment.

Fig 7.1
Procedure
1. Make all connections as shown in fig 7.1.
2. Connect the oscilloscope channel 1 probe to the Set point 1 TP51 and Channel 2
probe to the output of PID block TP49.
3. Set the voltage of about 5V at the output of Setpoint 1 TP51.
4. Lamp will start to illuminate. If not so, turn the proportional pot to about 25%.
5. Turn the Integral and Derivative pot to about 25%.
6. Press the RESET button given on the trainer.
7. Observe the wave form of PID block on oscilloscope.

Fig 7.2
8. There will be some oscillations in the wave. Try to remove these ripples from the
wave by adjusting proportional and derivative knob.

Fig 7.3
9. Turn integral knob to fully clock wise and press reset button.
10. When the system is balanced it will give you straight line. Try to unstable the system
by interrupting the light with the disturbance given on the trainer. It will destabilize
the system for some time but the PID controller will again stabilize it as shown in Fig
7.4.

Fig 7.4
11. Note the time taken by the system to stabilize.
12. Now set the voltage of about 5.5V at the output of Setpoint 1 TP51.
13. Repeat the above steps and note the readings.
LAB No. 14

Objective
 Calibration of Temperature Sensor Interface
 Closed Loop Proportional-Integral-Derivative Control of the Temperature

Requirements
1. IT-4406 Trainer Board
2. 2mm Patch Cords
3. CRO

Experimental Setup
Refer to the following diagram to configure setup for the present experiment.

Fig 8.1
Procedure
1. Make connections as shown in fig 8.1.
2. Connect Voltmeter to TP18 (VOUT2). Set 0V at VOUT2 by adjusting OFFSET knob.
3. Now make connections according to fig 8.2.

Fig 8.2
4. Set 10V at VOUT2 by adjusting GAIN knob. After adjusting 10V, repeat above steps
and adjust voltages if there is any variation.

Fig 8.3

5. Now make all connections as shown in fig 8.3.


6. Connect oscilloscope probe to the output of PID Block TP49.
7. Set voltages of about 5V at the output of Setpoint 1 TP51.
8. Temperature starts to increase slowly as PWM indicator LED starts illuminate. If not
so, turn the proportional pot to about 25%.
9. Turn the Integral and Derivative pot to about 25%.
10. Press the RESET button given on the trainer.
11. Observe the wave form of PID block on oscilloscope.
12. There will be some oscillations in the wave. Try to remove these ripples from the
wave by adjusting proportional pot.
13. Note the time taken by the system to stabilize.
14. Now set the voltage of about 5.5V at the output of Setpoint 1 TP51.
15. Repeat the above steps and note the readings.

You might also like