Вы находитесь на странице: 1из 14

ECTE344 LAB REPORT

For Experiments 1-4

Luca Russo, 5223283


lr357@uowmail.edu.au
Table of Contents
Experiment 1 .............................................................................................................................................................. 1
Aim .......................................................................................................................................................................... 2
Method ................................................................................................................................................................... 2
Results ..................................................................................................................................................................... 2
Section 1 .............................................................................................................................................................. 2
Section 2 ............................................................................................................................................................. 3
Section 3 ............................................................................................................................................................. 3
Problems ................................................................................................................................................................. 3
Reflection ................................................................................................................................................................ 3
Learning Outcomes & Objectives ........................................................................................................................... 3
Experiment 2 .............................................................................................................................................................. 4
Aim .......................................................................................................................................................................... 4
Method ................................................................................................................................................................... 4
Results ..................................................................................................................................................................... 4
Section 1 .............................................................................................................................................................. 4

Section 2 .............................................................................................................................................................. 4
Section 3 ............................................................................................................................................................. 5
Section 4 ............................................................................................................................................................. 5
Problems ................................................................................................................................................................. 5
Reflection ................................................................................................................................................................ 5
Learning Outcomes & Objectives ........................................................................................................................... 5
Experiment 3 .............................................................................................................................................................. 6
Aim .......................................................................................................................................................................... 6
Method ................................................................................................................................................................... 6
Results ..................................................................................................................................................................... 6
Pre-lab ................................................................................................................................................................. 6

Section 1 .............................................................................................................................................................. 6
Section 2 ............................................................................................................................................................. 7
Section 3 ............................................................................................................................................................. 7
Problems ................................................................................................................................................................. 7
Reflection ................................................................................................................................................................ 7
Learning Outcomes & Objectives ........................................................................................................................... 7
Appendix ...............................................................................................................................................................8-14

1
Experiment 1
Aim
The experiment acts as an introduction to Simulink, a MATLAB tool useful when designing embedded systems.
Three major aspects of system design and testing are covered in the experiment; model building, error
debugging and interfacing with the Hilink hardware module.

Method
Prior to attempting the experiment, students are asked to familiarise themselves with the learning objectives
outlined in a 2005 paper by Feisel and Rosa [1], the Hilink user manual and basic Simulink UI.

The first section encompasses modelling a simple RL circuit (Fig.1.) within the Simulink environment. To do so,
students are familiarised with the procedure required to create a template file. Template files must be used as
the starting blank models when working with Hilink. Several Simulink icons are then described; one of them
being the Simulink Library Browser which is then explained in further detail. From here, fundamental features
such as block placement, block parameter configuration, subsystem creation, the diagnostic window, error
prone blocks and scope functionality are demonstrated.

Section two begins by identifying common errors that can occur when designing systems on Simulink. Certain
blocks output vectors have multiple elements, and thus have an associated width which may not be compatible
with other blocks. Also, if systems do not have properly defined initial conditions, they will fail to run. We are
introduced to these errors in or investigation of the vehicle suspension system block, which has both array
dimension errors and is missing initial conditions. These problems can be pre-empted by utilising inbuilt
Simulink display options and detected using the diagnostic window. The possible quick fix involving a demux and
terminator is outlined. A pre-built model is then debugged using call-backs within the model properties.

A Hilink board, along with a power cord and null modem cable, are needed for the third section of the
experiment. First the Hilink board is physically linked to the pc via null modem cable and plugged into power.
The library browser is then used to locate the Hilink test block which can be found in the ECTE344 Hilink library.
Running a model containing this block executes a hardware test for the Hilink to ensure proper functionality.
Once the hardware has been tested, modelling can begin.

Results
Section 1:

An investigation into the operation of the ‘sum’ and ‘derivative’ block is undertaken, with important fields such
as ‘List of signs’ outlined. The RL circuit model, as seen in figure 2, is run for the first time with the scope window
present. Two waveforms are fed into the scope, the result is shown in figure 3, one is the unchanged sinewave
and the other is the system output. The RL circuit subsystem mentioned earlier was duplicated and
implemented in sequence to model a second order system. Relevant parameters were adjusted to suit system
described in task. Outputs are monitored and recorded via two-input scope.

𝑉𝑖 = 0.95 𝑉 𝑝𝑘, 𝑉0 = 0.41 𝑉 𝑝𝑘


It is clear that the smaller waveform is a derivative of the larger one. Notice how the magnitude of the system
output is dependent on the rate of change in gradient of the input waveform. The input wave is then changed
from a sine wave to a step input, and changes in system behaviour are noted and the step response of the
system is plotted, see figure 4.

2
Section 2:

The debugged vehicle suspension system is implemented and tested from within a system. Task 1.2.3 involved
inserting a unique input as an alternative to a sine wave block, as seen in figure 5. The input can be modified by
changing the parameters of one of the many blocks which make up the input. Using this model, it was
determined that maximum system displacement occurs when input frequency is equal to two.

For further understanding, the inputs of the system are once again modified to determine another characteristic
of the system. The force required to displace the spring is evaluated by adjusting a slider gain block that is
adding gain to the system. We find that for the spring to touch its upper support anchor, 3.95N of force must be
applied.

Section 3:

The circuit depicted in Figure. 5. Is assembled in Simulink using the library browser to search for relevant blocks,
and call-backs are added to change the sampling frequency of the model to 2048Hz. Modifications were then
made to the model to allow for three outputs; angular velocity, radians per second and degrees per second. All
the aforementioned variables are important in the analysis of the motors behaviour. The first experiment opens
the door of possibilities when it comes to the use of Simulink in the analysis and design of systems, and the quick
implementation of models onto hardware is another indicator of how powerful a tool Simulink can be.

Problems
Scope resolution in section 1 is not fine enough. – To address this issue, internal parameters of the simulation
must be adjusted. Leaving the max step size as auto can lead to unclear plots in many cases. Change max step
size parameter from auto to 1/100/

Values of R and L are not initialised or given values during run time. – Once again, the blocks ‘model properties’
window must be opened for inspection. Call-backs are perfectly suited as a method to initialise system variables,
and thus, the resistors are given values via call back commands.

Vector dimension error and missing initial cond. in V Subsystem – This problem is briefly outlined in methods
section. Use a demux + terminator to terminate certain cells of the array then use call back for initial conditions.
Now the matrix dimensions of the two blocks agree.

Reflection
Hilink board number 53 was selected for use in this section. From now on the best attempt should be made to
acquire the same board due to variations in Hilink board characteristics. The experiment succeeded as an
introduction to interfacing with the Hilink board and using Simulink as a powerful tool in the analysis of a real-
world system. Additionally, valuable debugging tools are outlined and utilised throughout the experiment.

Learning Outcomes & Objectives


There is no clear-cut, most important learning outcome in this experiment. Each section deals with a necessary
aspect of using Simulink when modelling systems. Given the circumstances, the learning outcomes of section
two stand out in importance. Using Simulink tools for debugging errors is an invaluable skill to have when it
comes to system design as in many ways, debugging can be the most intimidating or time-consuming part of the
design process if inadequately prepared.

The following skills were expanded upon the completion of the experiment: Models, data analysis, design,
learning from failure, instrumentations

3
Experiment 2
Aim
The aim of this experiment is to develop a deeper understanding of the real-life system modelling process, and
vital control system criteria through the examination of a physical DC motor unit. In addition, the operation of
low-pass filters as well as their usefulness in solving issues related to dead zone and saturation is covered.

Method
A briefing is given on the distinction between a linear and non-linear system, why these distinctions are relevant
to the experiment and the application of transfer functions as a solution to problems faced by non-linear
systems. An important data analysis block, Least Squares Polynomial Fit (LSPF), is demonstrated by passing
through test data and demultiplexing the signal to two separate displays, m and b. The LSPF block attains a line
of best fit given input data. The step response of a transfer function is analysed using inbuilt scope measurement
tools. These tools will be crucial in gathering results in any experiment. The rest of the preparation activities
involves becoming acquainted with Simulink slider blocks, and how to connect a slider to the desired block.

The experiment is then divided into four sections, each dealing with a unique aspect of the modelling process.
Section one acts as practice in subsystem creation as well as covering the groundwork required for sections to
come. The subsystem can be seen in fig 6. This section also points out important characteristics of the E0 block,
specifically that mode can be switched from position to velocity in the block parameters window. The concept of
using a gain block as a way to convert between units it emphasised.

The next section entails combing knowledge gained about slider blocks and subsystems with multiple outputs
with hardware implementation. A modelled system, as shown in figure 7, is implemented in conjunction with
the Hilink board to investigate relating to linearity, steady state response, motor dead zone and saturation.

Directly following the application of Simulink as a real-world analysis tool, section three seeks to increase ones’
appreciation of Simulink as a design tool. The subsystem, called HilinkMultiOutSI, is recycled from the previous
section. Using values calculated from previous exercises, a transfer function is attained and compared to the
measured response of the real-world motor.

Finally, a lowpass filter is incorporated in the model in the form of a transfer function. The effects of the lowpass
on the system are explored. Sliders are taken advantage of for ease of modifying the sine wave block frequency
parameter while the simulation is running. The goal of this section is to investigate a system characteristic
known as gain crossover frequency.

Results
Section 1:

A laboratory instructor deemed the subsystem was constructed correctly.

Section 2:

The circuit simulation is run with voltage values ranging from −9 to 9, with a finer resolution for interval of −2
to 2. The resulting values for angular velocity are then added to table 1 and plotted, see figure 8. After
examining the generated plot, it can be deduced that the motors behaviour is linear for larger values of input
voltage. The static gain, 𝑘𝑚 is calculated manually;
343 − −340
𝑘𝑚 = = 37.9
18
From Figure.8, it is clear that a dead zone occurs near the zeros of the input voltage variable. This is an issue;
however, it may be overcome by exploiting a non-linear system where linearity halts.

4
Section 3:

Both the time constant, 𝑇𝑐 , and pole position, 𝑝𝑚 , of the system must be determined prior to continuing this
section. The steps to do so are as follows:

 Final value of input step block = 6 ∴ steady state value of angular velocity, 𝜔 = 223 𝑟𝑎𝑑/𝑠
 The rise time is defined as the time it takes for the system to rise to 63.21% of its steady state value
In this case (as measured on scope), that value is 10.7𝑚𝑠.
1 1
 The pole position is the inverse of the time constant → 𝑝𝑚 = = 10.7×10−3 = 93.5 𝑟𝑎𝑑𝑠/𝑠
𝑇𝑐

Now with the pole position and static gain calculated, a transfer function can be formed.
𝑘𝑚 37.9
𝑇𝐹 = 𝑠 = 𝑠
1+𝑝 1+
𝑚 93.5
The simulation is then run another time, this time with the calculated transfer function. Rise time and steady
state value are deduced from the scope. Steady state value = 224 𝑟𝑎𝑑/𝑠 and 𝑇𝑐 = 9.53𝑚𝑠. Discrepancies in the
rise time are to be discussed in the reflection section. Table. 2. compares various response properties for the
transfer function and motor.

Section 4:

The model depicted in figure 9 is run with a range of values for the filter time constant parameter. The results
are can be seen in Table.3. Clearly, as the filter time constant increases in value, the gain crossover frequency
decreases. This means that the system will become unstable at lower frequencies. The time filter constant is
then set to value shown in table. 3. and a new transfer function is formed by measuring the time constant of the
new system response. From the scope:

𝑉𝑎𝑣𝑔 = 224 → 63.21% 𝑜𝑓 𝑡ℎ𝑖𝑠 𝑣𝑎𝑙𝑢𝑒 = 141.6 & 𝑇𝑐 = 11.78 𝑚𝑠 → 𝑝𝑚 = 84.96 𝑟𝑎𝑑/𝑠
37.9
𝑇𝐹 =
1 + 𝑠/84.96
The new transfer function is then added to the model, as seen in figure 10 and its response properties are noted
in Table. 4. By inspecting the overshoot property, it can be said that the filtered DC motor would perform better
in a position control system. A smaller overshoot translates to more accurate positions. However, if the design of
a shaft velocity control system is to be considered, the unfiltered system will perform much better. Velocity
control depends on a much more responsive system. Therefore, a system with increased rise, delay and settling
time is not suited.

Problems
No major problems were faced in this experiment.

Reflection
The transfer function had very similar response characteristics to the real-world motor response. The
importance of experimentation and data gathering is accentuated throughout the procedures in this
experiment. Hence, the most valuable learning objective from this lab is the ability to derive system properties
through the analysis of real-world system. The transfer function is of vital importance in control theory and so,
being able to obtain one from a system is of utmost importance.

Learning Outcomes & Objectives


The following skills were expanded upon the completion of the experiment: Instrumentation, models,
experiment, data analysis, design and safety.

5
Experiment 3
Aim
The experiment focuses on furthering insight on the usefulness and application of bode plots to system design
and analysis. The behaviour of a DC motor is explored and reconstructed experimentally, and the overall
functionality of the frequency response estimation tool is highlighted. The importance of more complex
subsystems is also demonstrated.

Method
A new system is modelled in preparation for the following tasks. This model includes a dead zone block to
represent the non-linearity faced in the DC motor at lower voltage values. The system is fed an input chirp signal
with amplitude equal to 10 for testing purposes.

The experiment begins with the construction of a virtual function generator subsystem which will be useful
when attempting to experimentally estimate a valid transfer function of an unknown black-box (that is,
unknown) system. The virtual function generator subsystem consists of the following blocks: two sine waves,
two products, three gains, a clock, the debugged vehicle suspension system, summation, demultiplexer and
scope. In addition, various block parameters must be modified, and sliders/knobs must be implemented
correctly. The full composition of the function generator sub system can be seen in figure 15.

The model is again altered to include the HilinkMultiOutSI subsystem from experiment 2. A knob is associated to
the initial phase of the system. Input waveform frequency is adjusted during the simulation, with the intent of
lining up input waveform with the output, thus determining multiple pole location. It is important to carefully
scrutinise the amplitude of the input sine wave as too low a value would lie in the dead zone while too large a
value would lead to saturation, and therefore less reliable results. Once again, the step response is compared to
previous experiment transfer functions to evaluate the legitimacy of the method used.

Lastly, the model assembled in the previous section is run several times, incrementally doubling the frequency of
the input sine wave each time. This is repeated until a frequency is reached which is ten times that of the highest
pole calculated. The transfer function of the system is then expressed in both second order form and simplified
form.

Results
Pre-lab:

Research into the dead zone block revealed many key aspects of its operation. The function of the dead zone
block is to define a region in which the output must be zero. Integer, fixed-point and floating-point data types
are supports. By default, the limits of the block are defined between [−.5 5]. Moving forward, values for gain
ratio and phase are simulated by running the model shown in figure 11.

𝐺𝑎𝑖𝑛𝑑𝑏 = −12 𝑑𝑏, 𝑃ℎ𝑎𝑠𝑒 = −132𝑜


𝜋
The input waveform is changed to 𝑢(𝑡) = 10 × sin(10𝑡 − ). The input and output waveforms can be seen
2
as a sketch, in figure 12. A new model is created with a second order transfer function and its bode plot, shown
in figure 13, is plotted.

Section 1:

The clock is used to display the running time of the current simulation. It is a convenient block to do so as it uses
the double data type which suits the needs of time keeping. By adjusting the slider corresponding to frequency,
the change in phase can be monitored easily. Once shifted input and unshifted output waveforms align, the
frequency response directly corresponding to the new phase introduced. The system will be 45𝑜 lagging when
frequency is 1.54 𝐻𝑧, 135𝑜 lagging when frequency is 2.31 𝐻𝑧 and prduce unity gain when frequency is 1 𝐻𝑧.
6
Section 2:

The frequency at which the first pole occurs is found to occur at 𝑓1 = 11.8 𝐻𝑧 and the second occurs at 𝑓2 =
87.7 𝐻𝑧

Section 3:

The results of the system frequency response are shown in table 5 then plotted on a MATLAB semi-log bode
plot, seen figure 16. The semi-log plot comes in handy when one of the two variables is not increasing linearly.
This lab has a heavy dependence on comparison of system properties in order to draw conclusions. The final
second order system is defined as
37
𝑇𝐹 = 𝑠 𝑠
(1 + )(1 + )
55 93.5
This step response has characteristics that closer resemble that of the DC motor. To get the transfer function of
position when the input is radians, we simply multiply the above transfer function with 2𝜋. Resulting in the
function;
37 × 2𝜋
𝑇𝐹(𝑟𝑎𝑑𝑖𝑎𝑛𝑠) = 𝑠 𝑠
(1 + ) (1 + 600)
55
Problems
Saturation can easily occur if Simulink system parameters are not checked. In the same way, dead zone can
deduct from the relevance of the results obtained in this section. To overcome such issues, it is of extreme
importance that the amplitude of the sinusoidal input wave be carefully thought out, in a manner that avoids
both extremes.

Reflection
The experiment gives a good foundation in experimentation and analysis. The bode plot tool is an invaluable tool
in the analysis of input response of systems and, as such, is the centre of attention for this experiment.

Learning Outcomes & Objectives


Understanding the significance of experimentation in conjunction with applying bode plot analysis is the main
reason to undertake this experiment. The tasks included in this experiment expose various facets of the bode
plot as well as the effect of lowpass filtering on system response.

The following skills were expanded upon the completion of the experiment: Instrumentation, models,
experiment, data analysis, design, and safety.

References
All information and theoretical background is taken from ECTE344 control website and lecture slide.
7
Appendix
Experiment 1

Figure 2. Simulink model of RL circuit


Figure 1. RL circuit diagram

Figure 3. RL Circuit Voltage Waveform - sinusoidal

Figure 4. Figure 3. RL Circuit Voltage Waveform - step

Figure 5. Vehicle Suspension Subsystem w/ custom inputs 8


Experiment 2

Within the subsystem lies

Figure 6. Position and velocity monitoring subsystem

Figure 7. System linearity check model

Input Voltage Angular


(V) Velocity (rad/s)
−9 −340
−8 −305
−7 −268
−6 −226
−5 −186
−4 −147
−3 −106
−2 −66
−1.5 −45
−1 −25
−0.5 0
0 0
0.5 0
1 24
1.5 43
2 64
3 103
4 141
5 181
6 223
7 260
8 302
9 343
Figure 8. Real-world motor response
Table 1. Relation between motor
input voltage and angular velocity

9
Property Transfer Function DC motor
Overshoot 0.5% 0.9%
Rise time (10 – 90%) 16.42 𝑚𝑠 19.7 𝑚𝑠
Delay time (0 – 50%) 6.52 𝑚𝑠 8.21 𝑚𝑠
Settling time (within 5% of SS) 52.5 𝑚𝑠 70 𝑚𝑠

Table 2. Response properties of simulated and real-world system

Figure 9. System w/ added lowpass filter

Filter Time Constant Gain Crossover Frequency


0 1800 𝐻𝑧
0.01 540 𝐻𝑧
0.02 400 𝐻𝑧
0.03 320 𝐻𝑧
0.04 270 𝐻𝑧
0.05 230 𝐻𝑧
Table 3. System response with varying time constant

Figure 10. System w/ new filtered transfer function

Property Transfer Function filtered DC motor filtered


Overshoot 0.5% 0.35%
Rise time (10 – 90%) 17.5 𝑚𝑠 28 𝑚𝑠
Delay time (0 – 50%) 7.97 𝑚𝑠 17.05 𝑚𝑠
Settling time (within 5% of SS) 58.2 𝑚𝑠 82.08 𝑚𝑠
Table 4. Response properties of estimated filter transfer function and the filtered DC motor
10
Experiment 3

Figure 11. DC motor simulation

Figure 12. Sketch of system input (black) and output (red) waveforms

Figure 13. Bode plot of second order transfer function

11
Figure 14. System w/ Function Generator and dashboard modifiers

Ch1

Ch2

12
Figure 15. Contents of function generator block
Frequency (rad/s) Frequency (Hz) Phase shift (.𝑜 ) Gain (magnitude) Gain (dB)
1 0.159 0 37 31.5
2 0.318 9 37.9 31.5
4 0.637 13 38.8 31.7
8 1.274 15 38.6 31.6
16 2.55 17 36.9 31.2
32 5.09 21 35 30.6
64 10.19 40 28 28.9
128 20.37 61 19.6 25.8
256 40.73 105 10 20
512 81.49 135 5.03 14
1024 162.97 180 0.5 -0.6
2048 651.9 265 0.2 -14
Table 5. System properties with increasing frequency

Bode magnitude plot

Bode phase plot

13
Figure 16. Bode magnitude and phase plots from values in table. 5

Вам также может понравиться