Control System Lab Experiment Manual for Diploma Student(Part-2)
Hello firends,
List of Experiments-
- To study basic open loop and close loop control systems.
- To study the MATLAB package for simulation of control system design.
- To obtain a transient response of first order system with unit step input.
- To obtain a transient response of second order system with unit step input.
- To observe the output waveform of a underdamped system with unit step input.
- To observe the output waveform of a over damped system with unit step input.
- To observe the output waveform of a undamped system with unit step input.
- To observe the output waveform of a Critically damped system with unit step input.
- To observe the output waveform of a plant controlled by P controller.
- To observe the output waveform of a plant controlled by PI controller.
- To observe the output waveform of a plant controlled by PID controller.
EXPERIMENT NO:-2
Object: To study the MATLAB package for simulation of control system design.
APPARATUS REQUIRED: Matlab Software
THEORY:
To start MATLAB click on the MATLAB icon or type in MATLAB, followed by pressing the enter or return key at the system prompt. The screen will produce the MATLAB prompt >> (or EDU >>), which indicates that MATLAB is waiting for a command to be entered. In order to quit MATLAB, type quit or exit after the prompt, followed by pressing the enter or return key.
Display Windows
MATLAB has three display windows. They are
- A Command Window which is used to enter commands and data to display plots and graphs.
- A Graphics Window which is used to display plots and graphs
- An Edit Window which is used to create and modify M-files. M-files are files that contain a program or script of MATLAB commands.
Entering Commands
Every command has to be followed by a carriage return <cr> (enter key) in order that the command can be executed. MATLAB commands are case sensitive and lower case letters are used throughout.To execute an M-file (such as Project_1.m), simply enter the name of the file without its extension (as in Project_1).
In order to see some of the MATLAB capabilities, enter the demo command. This will initiate the MATLAB EXPO. MATLAB Expo is a graphical demonstration environment that shows some of the different types of operations which can be conducted with MATLAB.
Abort
In order to abort a command in MATLAB, hold down the control key and press c to generate a local abort with MATLAB.
The Semicolon (;)
If a semicolon (;) is typed at the end of a command the output of the command is not displayed.
Typing %
When percent symbol (%) is typed in the beginning of a line, the line is designated as a comment. When the enter key is pressed the line is not executed.
The clc Command
Typing clc command and pressing enter cleans the command window. Once the
clc command is executed a clear window is displayed.
Help
MATLAB has a host of built-in functions. For a complete list, refer to MATLAB user’s guide or refer to the on line Help. To obtain help on a particular topic in the list, e.g., inverse, type help inv.
MATLAB has an excellent collection of commands and functions that are useful for solving control engineering problems. Plotting root loci, Bode diagrams, polar plots, Nyquist plot, Nichols plot, and state space method are obtained using MATLAB.Transient responses include the step response, impulse response, and ramp response. They are often used to investigate the time-domain characteristics of control systems. Transient response characteristics including the rise time, peak time, maximum overshoot, settling time, and steady state error can be obtained from the step response. When the numerator and denominator of a closed-loop transfer function are known, the commands
step (num, den), step (num, den, t) in MATLAB can be used to generate plots of unit- step responses. Here, t is the user specified time.
The MATLAB command ‘‘bode’’ obtains the magnitudes and phase angles of the frequency response of continuous – time, linear, time – invariant systems. The MATLAB bode commands commonly used are:
Bode(num, den) bode(num, den, W) bode(A, B, C, D) (3.36)
bode(A, B, C, D, W)
bode(sys)
where w is the frequency vector.
MATLAB bode commands with left hand arguments commonly used are: [mag, phase, w] = bode (num, den)
[mag, phase, w] = bode (num, den, w)
[mag, phase, w] = bode (A, B, C, D)
[mag, phase, w] = bode (A, B, C,D, w)
[mag, phase, w] = bode (A, B, C, D, iu, w) [mag, phase, w] = bode (sys)
The MATLAB commands given returns the frequency response of the system in matrices mag, phase, and w. The plot is not drawn on the screen. The matrices mag,phase provide the magnitudes and phase angles of frequency response of the system, computed at the specified frequency points.
The magnitude may be converted into decibles using the MATLAB statement magdB = 20 * log 10 (mag)
In MATLAB , the following command logspace (d1, d2 )
or logspace(d1, d2, n). logspace(d1, d2) are used to specify the frequency range
that will generate a vector of 50 points logarithmically equally speed between decades 10d1 and 10d2
The MATLAB command
w = logspace (– 1, 2)
may be used to generate 50 points between 0.1 and 100 rad/sec. Similarly, the MATLAB command
logspace (d1, d2, n)
generates n points logarthimatically equally spaced between 10d1 and 10d2 where by the n points include both the endpoints. The MATLAB command
nyquist (num, den)
Draw the Nyquist plot of the transfer function
G(s) = num(s)/den(s)
where num and den contain the polynomial coefficients in descending powers of s. The other MATLAB command uses for drawing Nyquist plots are:
nyquist (num, den, w) nyquist (A, B, C, D)
nyquist (A, B, C, D, w)
nyquist (A, B, C, D, iu, w) (3.48) nyquist (sys)
where w is the frequency vector.
The MATLAB command involving the user – specified vector w in computes the frequency response at the specified frequency points. The following MATLAB commands
[re, im, w] = nyquist (num, den) [re, im, w] = nyquist (num, den, w) [re, im, w] = nyquist (A, B, C, D)
[re, im, w] = nyquist (A, B, C, D, w)
[re, im, w] = nyquist (A, B, C, D, iu, w) [re, im, w] = nyquist (sys)
are used to obtain the frequency response of the system in the matrices Re, im, and
w. The plot is not drawn on the screen. The matrices Re and im contain the real and imaginary parts of the frequency response of the system, computed at the frequency points specified in the vector w.
Result:- We have studied the MATLAB package for simulation of control system design.