Lab 1 Plt341
Lab 1 Plt341
LABORATORY MODULE
PLT 341 / 3
DIGITAL CONTROL SYSTEMS
EXPERIMENT 1
Modeling and Identification in Discrete System
Disigned by: Dr Mohd Saifizi Saidon and Edited by: Mr. Sofi Bin Yahya @TM
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
1.0 Introduction
Mathematical models are needed for the analysis and design of digital
control systems.The configuration includes a digital-to-analogconverter
(DAC), an analog subsystem, and an analog-to-digital converter
(ADC).The transfer function for the ADC, analog subsystem, and DAC
combination can be easily obtained using MATLAB.
MATLAB Coding
MATLAB a powerful package with numerous useful commands. For the
student’s convenience, this manual list some MATLAB commands after
covering the relevant lab problem.
MATLAB typically handles coefficients as vectors with the coefficients
listed in descending order. The function ( ) with numerator 5( + 13) and
denominator + 0.1 + 0.4z is represented as the numerator polynomial
>>num= 5*[1,3]
where p represents the poles, r their residues, and k the coefficients of the
polynomial resulting from dividing the numerator by the denominator. If
the highest power in the numerator is smaller than the highest power in
the denominator, k is zero. This is the usual case encountered in digital
control problems.
MATLAB allows the user to sample a function and z-transform it with the
2
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
commands
>> g= tf(num,den)
>>gd=c2d(g, 0.1, ‘imp’)
>>num= [2, 4, 3]
The term “method” specifies the method used to obtain the digital
transfer function. For a system with a zero-order hold and sampler (DAC
and ADC)
>>gd= c2d(g, 0.1, ‘zoh’)
Other options of Matlab commands are available but are not relevant to
be material presented in this lab manual.
For a system with a time delay, the discrete transfer function can be
obtained using the commands
3
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
MATLAB SIMULINK
Simulink is a MATLAB toolbox that provides a graphical language for
simulating dynamic systems. The vocabulary of the language is a set of
block operations that the user can combine to create a dynamic system.
The block operations include continuous and discrete-time, linear and
nonlinear, as well as user-defined blocks containing MATLAB functions.
Additional blocks called sources provide a wide variety of inputs. Sink
blocks provide a means of recording the system response, and the
response can then be sent to MATLAB for processing or plotting.
This section provides a brief introduction to Simulink and its simulation of
discrete-time systems that we hope will motivate the reader to experiment
with this powerful simulation tool. In our view, this is the only way to
become proficient in the use of Simulink. To start Simulink, start MATLAB
then type
>>Simulink
4
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
Running the simulation gives the results in Figure 4. The simulation duration
is selected in the model window next to the run icon. The scale of the plot
is selected by right-clicking on the scope plot.
Now discuss simulating an analog system with digital control. The analog
transfer function is obtained by clicking on Continuous in the Simulink
Library Browser and then dragging the block to the model window.
Although it is not required to implement the zero-order hold, the zero-order
5
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
hold block is available under Discrete, but MATLAB does not have a
sampler. The block does not change the simulation results. However, the
block allows the user to obtain a plot of the input to the analog system.
6
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
Set the sampling period for the first scope to 0.05 s and select decimation
and a value of 1 for the second scope to obtain the analog output on the
second scope, as shown in Figure 6. The sampled and analog outputs are
shown in Figures 7 and Figure 8, respectively.
7
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
8
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
Problem 1:
Find the steady-state response of the systems resulting from the sinusoidal
input ( ) = 0.5 sin(0.4 ) using simulink.
(a) ( )=
.
(b) ( )=
. .
Problem 2:
For the analog system with a sampling period of 0.05 s
10( + 2)
( )=
( + 5)
9
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
(a) Obtain the transfer function for the system with sampled input and
output.
(b) Obtain the transfer function for the system with DAC and ADC.
(c) Obtain the unit step response of the system with sampled output and
analog input.
(d) Obtain the poles of the systems in (a) and (b), and the output of (c),
and comment on the differences between them.
Problem 3:
For the unity feedback system shown in above, given the
analogsubsystem.
0.35
( )=
−1
(a) Obtain the transfer function for the analog subsystem with DAC
and ADC.
(b) Obtain the step response of the open-loop analog system and the
closed-loop digital control system and comment on the effect of
the controller on the time response.
(c) Obtain the frequency response of the digital control system and
verify that 0.02 s is an acceptable choice of sampling period.
Explain briefly why the sampling period is chosen based on the
closed-loop rather than the open-loop dynamics.
10
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
Problem 4:
For an internal combustion engine, the transfer function with injected fuel
flow rate as input and fuel flow rate into the cylinder as output is given by
+1
( )=
+1
Assume that for the operational conditions of interest, the time constant τ
is approximately 1.2 s, whereas the parameter can vary in the range 0.4
to 0.6. The digital cascade controller
0.02
( )=
−1
was selected to improve the time response of the system with unity
feedback. Simulate the digital control system with = 0.4, 0.5, 0.6, and
discuss the behaviour of the controller in each case.
11
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Module
12
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Assessment
EXPERIMENTAL RESULTS
LABORATORY ASSESSMENT AND RESULT ANALYSIS
Problem 1:
______________________________
______________________________
Problem 2:
13
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Assessment
Problem 3:
b) Comment:________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
c) Explain
briefly:___________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
Problem 4:
14
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Assessment
c) Show the step response to instructor for approval the results is obtained.
Approve:____________
DISCUSSION (5 Marks)
15
PLT341 DIGITAL CONTROL SYSTEMS Laboratory Assessment
CONCLUSION (5 Marks)
16
[DIGITAL CONTROL SYSTEMS - SEMESTER 2 2017/2018 ACADEMIC SESSION : LABORATORY RUBRICS (TOTAL
PLT 341 LAB MARKS PLO2/PLO4/PL05)
PANEL SIGNATURE : ∕ 35
17