Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
METR4201 Introduction to control systems
Practical 1
Principles of proportionality and superposition
and the convolution integral
Section 1 Practical/Table:
Week 2:
o P01 – Monday 12:00
o P02 – Tuesday 14:00
o P03 – Wednesday 08:00
o P04 – Wednesday 10:00
o P05 – Wednesday 12:00
o P06 – Thursday 12:00
o P07 – Thursday 14:00
o P08 – Friday 10:00
o P09 – Friday 14:00
Week 3:
o P10– Tuesday 14:00
o P11 – Wednesday 08:00
o P12 – Wednesday 10:00
o P13 – Wednesday 12:00
o P14 – Thursday 12:00
o P15 – Thursday 14:00
o P16– Friday 10:00
o P17 – Friday 14:00
o Make-up
o 8 o 9 o 10
- - -
o 5 o 6 o 7
- o 4 -
o 1 o 2 o 3
Entrance
Section 2: identifying details
# Name Student number
1
2
3
4
5
METR4201 Introduction to control systems
Practical 1
Principles of proportionality and superposition
and the convolution integral
Aim
This practical covers the important concepts of proportionality, superposition, and
convolution. A mechanical oscillator will be shown to superimpose the response from
sequential impulsive inputs to constructively and destructively affect the output
amplitude and phase. You will then demonstrate that by the principles of proportionality
and superposition, the output of a linear system is the convolution of the inputs over
time. An arbitrary input function may be approximated by a series of discrete impulses
or steps. As the resolution of the discrete functions becomes fine the output will be
shown to approach that from the arbitrary input function.
The learning objectives relevant to this practical are to:
• LO 1.1 Understand what a 'system model' is and how to compose system models for
single-input/single-output (SISO) plants.
• LO 1.4 Represent and simulate systems models by block diagrams and transfer functions
in MATLAB and Simulink.
• LO 1.5 Appreciate how linearity, superposition, and convolution provide a framework
for determining the response of a linear system to arbitrary inputs
LO 1.1 LO 1.4 LO 1.5
Part 1: Linearity • • •
Part 2: Superposition • • •
Part 3: Convolution • • •
Background
Two important properties of linear systems are proportionality and superposition. These
principles are depicted in Figure 1. In the first part of this experiment, these concepts are
demonstrated on the mass spring system. We will use impulsive forcing functions
because the results lead to a conceptual and analytical approach for obtaining the
response to an arbitrary forcing function later in the experiment.
Figure 1: The Principles of Proportionality and Superposition
Figure 2: Mass-Spring system
Dynamical
System
Input
F(t)
Output
y(t)
Dynamical
System
Input
F1(t)
Output
y1(t)
Dynamical
System
Input
F2(t)
Output
y2(t)
y(t)
tt*
y*
y(t)
tt*
αy*
Dynamical
System
Input Output
αF(t) αy(t)
Proportionality
Superposition
y(t)
tt*
y1*
y(t)
tt*
y2*
y(t)
tt*
y1*+y2*
Dynamical
System
Input Output
F1(t)
+
F2(t)
y1(t)
+
y2(t)
If Then
If Then
Part 1: Proportionality
1. The experimental apparatus should be set up to replicate the mass-spring
system of Figure 2. Slide the first carriage by hand (avoid contacting the
limit switches) to verify that it moves freely.
2. On the desktop of your computer is a file named “prac1.zip”. Extract this
to your desktop.
3. Start MATLAB.
4. In MATLAB set C:\users\uqmech\prac1\ as your working directory (the
folder you just extracted).
a. In the MATLAB command window type
cd(‘C:\users\uqmech\prac1\’)
5. Open the file RectilinearPlant.slx and RectilinearPlantReset.slx
6. Set the Base Address for the computer you are working at (See Appendix
C).
7. Now you want to implement an impulse centered about t = 1. This
impulse should have a force of 10N over a width of 50ms.
To add blocks to your model, drag them from the Simulink library which can be accessed by
clicking the icon circled in Figure 3. Drag into your model two ‘Step’ blocks, an ‘Add’ block, two
‘Scope’ blocks and a ‘Display’ block and connect them as shown in Figure 3.
Figure 3: Simulink setup for an impulse driving force.
To simulate an impulse, two steps are used, one for the rising edge and the other for the falling
edge. As such, set the first step to have a step time as half the impulse width before the impulse
time (i.e. t - 0.025) and a final value of 10. Setup the second step to have a step time as half the
width of the impulse after the first step (i.e. t + 0.025) and a final value to negate the first step
(i.e. -10). When these steps are added together, they form an impulse of magnitude 10 and
width 0.05 seconds at time t (see Figure 4).
Figure 4: Constructing impulse from the superposition of two step
functions.
8. Build and run the RectilinearPlantReset.slx model. For the procedure to
build and run this Simulink model, refer to Appendix B.
9. Build and run the RectilinearPlant.slx model.
10. Change the impulse amplitude to 20N and rerun the experiment.
Observation
How does changing the forcing function input amplitude affect the output
(neglecting mechanism friction effects)? Explain using the terminology
defined in Figure 1.
Part 2: Superposition
1. Change the impulse width to 25ms (20 N amplitude) and repeat the
appropriate steps above. Measure the times when the output
oscillation phase is at π , 3π /2, and 2π of the cosine function (i.e. first
negative slope zero crossing, first minimum, and first positive slope zero
crossing) and identify them as t1, t2, and t3 respectively. You should
“zoom” plot scaling to obtain the best resolution to measure these
times (see Figure 5).
Figure 5: System response locations of interest.
2. Now implement a second impulse centered about t1 (20N, 25ms)
3. Rebuild and run your model, recording the results.
4. Remove your impulse at t1 and repeat the process to implement the
second impulse at t2.
5. Remove your impulse at t1 and repeat the process to implement the
second impulse at t3.
Observation
Explain the system output for each of the three cases in terms of the principle of superposition
using the terminology defined in Figure 1. You may consider F1(t) to be the initial impulse, and
F2(t) to be the second. Show based on measurements of the initial single pulse response (Step
5) how the values for your double pulse case are predicted by superposition. You should
account for the finite width of the pulses in your evaluation.
Observation
If the system model were that of a pure oscillator with ideal pulse input (infinitesimal duration), its
response following the second pulse (equal pulse amplitudes) would be
= �() + �( − )��
Use calculus techniques to predict the first oscillation maximum (if one exists) in each of the three
double impulse cases tested above. How does this prediction compare with the experimental
results?
Hint: The trigonometry identity: ( − ) = ()() + ()() will help.
Part3: Convolution & Response to Arbitrary Input
Theory
In the next part of this experiment, we use the linearity principles and impulse responses
investigated in the previous section to study the response of the mass-spring system to
an arbitrary input.
In looking at linearity and superposition we obtained the response to a single impulsive
force. We may call this response
() = ℎ( − )
for time after , where h(•) is the unit impulse response, is the time of the center of
the pulse and is the impulse strength. Now
() = ()ℎ( − )
where () is the pulse amplitude1 at time and is the pulse width.
We now extend the principles of proportionality and superposition from the case of two
pulses as demonstrated in the previous experiment, to an arbitrary number of impulsive
forces. We expect that
() = �ℎ( − )()
In the limit, the response function becomes
() = � ℎ( − )()
0
This equation is known as the convolution integral and is useful in describing the output
of a linear system in response to an arbitrary input function.
The aim of the second part of this practical is for you to design an experiment that
validates the convolution integral for the system of Figure 2.
1 This was denoted * in the previous experiment.
Figure 5: Impulsive Force Series to Approximate Continuous
Trapezoidal Forcing Function
6
0
24 ms
each
pulse
Continuous
Impulse Series
Time (ms)
6
0
0 192 384 576 768 960 1152
64 ms
each
pulse
Time (ms)
192 ms even
centerline spacing
48 ms even
centerline spacing
a) Coarse Approximation b) Finer Approximation
0 192 384 576 768 960 1152
3 3
In the procedure that follows we shall first obtain the response of the system to the two
impulsive force series described in Figure 5. We then obtain the continuous-time
trapezoidal forcing function response and compare it to the progressively refined
impulsive series approximations.
Procedure:
1. You have been provided with blocks that simulate both impulse series.
Find these on the course website and incorporate first the coarse then
the fine approximations into your model.
2. Attach a clock block to the front of the trapezoidal forcing function.
3. Connect the trapezoidal forcing function to the plant. You may want to
put a scope on this input as well.
4. Build and run your model, recording the results, for both impulse series.
5. By means of comparison, you have also been provided with a block that
simulates the trapezoidal input waveform. Incorporate this block into
your model, build and run, recording the results.
Observations
Describe the responses of the system to the two impulse series and how closely they
approximate the response of the continuous function. Relate these results to the principles
of superposition and proportionality from the previous section.
If the pulses in subplot b of Figure 5 were widened to 40 milliseconds and the same technique
of matching the force-time area with the continuous function were applied how would this affect
the response?
What would the result be if the pulse centerline interval and the pulse widths were both reduced
to 10 milliseconds?
Appendix A – Building a real time Simulink model
To interface with the ECP hardware, the model you have constructed must be built. This
build process automatically generates the code required to interface with the hardware.
The following steps detail the process to build your model.
1. Click the “Build Model” button. If there are any errors, refer your problem
to a tutor. If successful, you should see a compile script running in the
MATLAB terminal. It is good practice to watch this complete before
proceeding.
2. Ensure the amplifier is turned on by pressing the black ‘ON’ button on the
front of the ECP control box. Click the “Connect To target” button to
upload the model to the apparatus.
3. Click “Run” button when you are ready to execute the input. Note (before
running anything on the platform it is important to re-zero the encoders
by building and running the ‘RectilinearPlantReset.slx’ file using the same
steps shown in this Appendix).
Step 1 Step 2 Step 3
Appendix B – Resetting the encoders and limit switch
The Error Flag can be set by any number of safety features in the Rectilinear Plant. To
reset the system, you have to use the ‘ECPDSPReset.slx’ file
1. Locate the model ‘RectilinearPlantReset.slx’ on the desktop of your
computer (e.g. C:\users\uqmech\prac1)
2. Build and run the model (refer to Appendix A).
3. All encoder readings will be reset if the value in the ENC1Pos changed
from a 0 to a 1 when it was run.
Appendix C – What is the base address for the computer I’m using?
The hardware at each desk uses a specific address to communicate with the PC. For the Prac to
work properly, you need to ensure that the equipment I/O range matches that set in MATLAB. It
is important that you check this at the start of every Prac.
1. Find the computer’s I/O range through these steps:
a. Open Device Manager
b. Expand ‘Motion Controllers’ and right click on ‘PMAC PCI Motion Control Card’
c. Select ‘Properties’
d. In the properties window select the ‘Resources’ tab
e. Take note of the ‘I/O Range’ value
2. Open ‘RectilinearPlant.slx and ‘RectilinearPlantReset.slx and make sure the I/O
address matches the one you have just written into the prac booklet. Otherwise,
change it in the file. To do this for each block:
a. In ‘RectilinearPlantReset double click on the blue ECPDSP Reset Block make sure
I/O address matches device manager.
b. In ‘RectilinearPlant double click on the ECP Rectilinear plant block and again on
the blue ECPDSP Driver1 and change the address to match.