This experiment aims to generate a pseudo random binary

advertisement
Laboratory 5 – MMAN3210
Benjamin Cheam
z3252125
Tuesday 11-1, Wednesday 3-4
Introduction
This experiment aims to generate a pseudo random binary sequence (PRBS) and examine
the effects of generator parameters, evaluate the autocorrelation and power spectral characteristics
of the PRBS and to apply the statistical testing method to identify the frequency response of a
motion system. In this experiment, the system being tested is a monorail system.
The use of system identification has its application in all areas of manufacturing. System
identification utilizes the application of a certain input signal as it relies on the analysis of the input
and the output signals to identify the relationship between the two. The process of system
identification is determining the transfer function or an equivalent mathematical description for the
characteristic of a system by means of practical testing.
The method which system identification uses is a statistical method of identification. The
application determines the transfer function by online testing during normal plant operation with
minimal disturbance. This statistical method uses a non-deterministic forcing function which has
random characteristics. This random characteristics can be regarded as a wanted noise signal whose
amplitude when small enough can be almost indistinguishable from the normal input signal.
Method
The method used in this laboratory required the use of MATLAB coding. First we will need to
generate a pseudo random binary sequence (PRBS). In order to achieve this, we will need to assign
the number of sequence length (L), where L = 2N – 1. From this we have determined the number of
shift stages N. Next we will need to define the sampling time and the final time where the sequence
will terminate. To create the PRBS we need to create a ‘for’ loop using an xcorr function within
it. In order to scale and adjust the PRBS so that the amplitude is limited to ± 1, we will need to use a
‘for’ loop again. We then plot a graph for a PRBS against steps which is shown in graph 1 on the
next page.
The next step is to construct the Autocorrelation Function (ACF) which utilizes the xcorr
function. Also for the plot the use of the stairs function is required for the code. The graph on
the following page will show the plot obtained.
We now need to create a Power Spectral Density (PSD). In order to do this we will need to
specify the sample frequency which is equivalent to 1/δt. Then, we create a spectrum object using
the command ‘sp=spectrum.periodogram’. To plot the spectrum we must use the given command
‘psd(sp,U,’Fs’,Fs);’, where U is the PRBS input to the system. Next we will obtain the spectrum data
using the command ‘hpsd=psd(sp,U,’Fs’,Fs);’, where the frequency is given in hpsd.Frequencies and
the spectrum in hpsd.Data.
Now we must estimate the system frequency response. To do this we will need to construct
a drive signal as a combination of a sine wave and the PRBS. To achieve this we will use the code ‘U =
0.8 sin(2πx0.2xt)+0.2xU’. Next we obtain the displacement data in a time series as the output of the
system and obtain the spectral component from the output data. Here the system is a monorail
system which moves along a track. We then estimate the frequency response by calculating the ratio
of the output to the input power spectrums. In order to do this we will need the following equation:
In order to plot the estimated frequency response in a logarithmic scale we must use the Matlab
command semilogx(f,G). Finally we plot the input and output spectrums for comparison and we set
the axis label and legends
Results
Graph 1 – PRBS for N = 7
Graph 3 – PSD
Graph 2 – ACF corresponding to the PRBS
Graph 4 - Input/Output
Graph 5 - Frequency response shown in green
Discussion
Examining graph 2 in the previous page, it shows an acceptable ACF as there is only one
distinct spike which is the same for all changes in N although the spikes around it are minimal. This
replicates the randomness of the PBRS generated beforehand. Comparing the best ACF of graph 2 to
graphs 6 and 8, the latter two show correlation about 0 which show that the PRBS is not as random
as the example in the results. These correlations are shown by the peaks of the graph which linearly
grow larger until it hits the maximum at zero and then the graph is reflected about the y axis.
Looking at graph 3 in the result showing the PSD, this outcome would the optimal as it
shows randomness. Comparing this graph to the corresponding PSD for N = 5 and 9, we see that the
amplitudes of each high peaks are roughly the same. When examining graph 7, it can be observed
that the outcome is roughly periodic which implies that it is not totally random. This is true for graph
9 though it is not as distinct as graph 7.
Graph 6 – ACF N=5
Graph 7 – PSD N=5
Graph 8 – ACF N = 9
Graph 9 – PSD N = 9
By examining graph 5, we are able to describe the frequency response characteristics of the
monorail system being tested. We see that at lower frequencies, the input and output act similar to
each other but as the frequency increases, the power drops off. This drop in power is characteristic
in low pass filters which allows signals of a low frequency and minimises the amplitude of signals
with frequencies that are higher than that of the cut-off. This is also shown by the gain oscillating
about 0 as the frequency increases compared to the gain being well above zero at lower frequencies.
There are various advantages of PRBS from using the statistical method in system
identification. The binary nature of the signal simplifies the cross-correlation calculation as the
multiplication can be replaced by simple gating of the output time function and its inverse. Another
advantage of PRBS is that it is easy to generate and introduce to a system. The constant of the
change in time helps avoid the distortion which can occur when attempting to switch rapidly which
can be required with a completely random binary signal. A low intensity signal is another advantage
as the energy spreads over a wide frequency range thus making it a suitable forcing function for a
plant operating normally as it causes little disturbance from the operating condition. One last
advantage is that the power of the noise can be arranged to be in the band of frequencies of interest
by an appropriate choice of Δt and N.
Conclusion
From the experiment we have generated a Pseudo Random Binary Sequence, constructed an
Autocorrelation function and constructed a Power Spectral Density. The use of this statistical
method of identification was used in this experiment by applying it to a monorail system. It allows us
to generate a frequency response of the system thus concluding that a low pass filter is present
within the system. By varying the number of shift stages we are able to determine which number of
shift stages suits the system best. From the examples shown above and in the previous pages, it is
considered that the optimal number of shift stages is to be 7.
Download