Experiment3: Open-loop Frequency Response Analysis


Connect the motor to the PC and open up MATLAB as in previous experiments
Remember to go to system processes and set the number of cores used by the MATLAB application to one.

Experiment 3 Synopsis
(1) Find the corner frequency of the motor system.
Set the input signal to be sine wave with small amplitude into the motor speed block at a low frequency like 1 rad/sec. Increase the frequency gradually until thephaseof the output signal is about 45 degrees lagging the phase of the input signal. This frequency is one of the corner frequencies of the DC motor. The other corner frequency will be when the phase of the output signal is lagging the input signal by 135 degrees.
(2) Measure the open-loop frequency response of the motor system.
The input is the input of the motor speed block and the output is the output of the motor speed block. Feed a sine wave into the input and measure thegainof the velocity of the motor and its phase over the range of frequencies from 1 rad/sec to 1000 rad/s. If possible take a few more measurements beyond the above frequency band. The further the frequency passes the band from both ends the more accurate results you can get for controller design in a later stage.
(3) Determine the transfer function when position is the output in radians
Using the results from Task 2

You must ask a demonstrator to check and sign your laboratory preparation written in your laboratory logbook. You are not allowed to start an experiment without completing the preparation for it.

Task 1- Corner (pole) frequencies

Build a Simulink model that can be used to find the corner frequencies of the motor

1)Construct the Simulink model shown below using the template found here and the motor speed block you have used in previous experiments. Its output units are in rad/sec.

2)Increase the amplitude of the input sine wave to increase signal to noise ratio for more accurate measurements. This happens because the noise of the encoder has a fixed magnitude.Make sure the amplitude of the sine wave input to the DC motor is no higher than the saturation limits which you identified in the previous experiment, in order to avoid saturation.

3)Remove the output filter by setting its time constant to zero. The output filter can only be used when the measured frequency is too noisy to measure and is less than one tenth of the bandwidth of the filter.

4)Adjust the frequency of the sine wave input so that there is a phase shift of 45 degrees between the input and output. Remember to increase the amplitude of input sine wave in order to increase the signal to noise ratio and, therefore, reduce the effects of encoder noise. A phase shift of 45 degrees corresponds to a shift of 1/8 of the period of the wave as shown below.

Note: The frequency in the Sine Wave block is in rad/sec.You can confirm this by setting Freq=1 in the sine wave block of Simulink and use your watch to see if the period is 1 sec or slower. If it is slower the unit should be rad/sec.

Figure 1

Tip: Try to apply Simulink model design techniques that were introduced in the first experiment. Designing efficient Simulink models is the key to success in the ECTE344 labs.
You can use the subsystem you designed in lab 1 as the input and set the reference signal to be lagging 45 degrees. The following diagram illustrates this point when signal B is in phase with signal C what is the phase shift of the system?

This frequency is the frequency of the 1st pole. Since the motor speed block is a second order system there exists another pole. The location of this pole is when the phase shift between the input and output is 135 degrees or 3/8 the period of the wave. Adjust the frequency of the sine wave input until you find the location of the second pole. Record the position of both corner frequencies. If it is too hard to measure the phase shift due to large differences in input and output amplitude adjust the amplitude of the sine wave and the gain of the gain block so that the two sine waves in the scope has approximately the same amplitude.

Note: You can add a DC componentto the sine wave input using a constant block and a sum block in order to avoid the nonlinearity at zero speed. If you have difficulty to measure the phase difference simulate sin(t) and sin(t+) using different  and study the difference between the two waves in order to figure out the relation between the wave forms and their phase difference.


Question 3.1: What is frequency of the first pole?
Question 3.2: What is frequency of the second pole?

Task 2- Open loop frequency response

In this task you will be required to construct a bode diagram from the experimental gain and phase data at various frequencies

1)Use a copy of the Simulink model constructed in task 1 for task 2. This is an open loop model and the goal of this task is to measure the open loop frequency response of the motor system.The gain block in figure 1, between the input and scope is used only to better visualise the signals and should not be used in the peak-to-peak voltage measurement of the input. If the input signal is too small to take measurements off in relation to the output signal (such as time difference in peaks) you may increase the gain of the gain block so as it makes the amplitude of the input roughly the same as the amplitude of the output and vice versa.

2)Measure the frequency response of the open loop real time control system for the open loop bode plot as follows. Set the amplitude of the sine wave block to 3 and adjust the frequency to 1 rad/sec. For a number of frequencies ranging from 1 rad/sec up to a frequency at least 10 times higher than the highest pole frequency obtained in Task 1 make a table through experiment in terms of the followings:


Question 3.3: Fill out the following table
frequency (rad/sec) / frequency (Hz) / Time between peaks (s), / phase shift (degree), / phase shift (degree) / input (peak to peak), / output (peak to peak) / Gain
1
2
4
… / … / … / … / … / … / … / …

3)The properties of the output signal can be measured using either the Simulink scope or a MATLAB plot using the method given in experiment 1. It is suggested (in the interest of time) to export your data to MATLAB and then plot it. Using the data cursor measure things like time difference in peaks. If the number of periods in the MATLAB plot is too high adjust the "limit data point to" value to a lower number to effectively zoom in on the waveform. The peak-to-peak voltage of the input should always be 6 assuming the amplitude of the sine wave is 3.

Note: the only measurements that need to be taken whilst conducting this part of the experiment are frequency, time difference between peaks and peak-to-peak voltage of the output.
The other columns in the table can be calculated as such:

Frequency (Hz) = Frequency(rad/sec)/(2π)
Absolute phase shift (degrees) = (Time Difference in the peaks)*(Frequency Hz)*(360 degrees)

Adjust the frequency of the sine wave input from 1 rad/sec to 400 rad/sec by going up the decades in the semi log axis, ie increasing logarithmically.
Once all the data required data has been collected produce the bode plots for the motor.
Using what you have learnt in class and in the preparation for this experiment, calculate the transfer function from the experimental results.

The first is a simplified model of the form K/(Ts+1). The low corner frequency 1/T should be less than 100 rad/sec. This is the simplified model for a DC motor that you have learned in Lecture 1. Make sure it is accurate by checking your result with a demonstrator because you are going to use it for controller design.

Optional: The second modelis of the form K/[(Ts+1)(Hs+1)]. You should not try to determine it if you are not confident that your data is of very high quality. This is the accurate model of the DC motor given in Lecture 1. Its determination is optional. No mark is allocated to the determination of this model.

If you cannot determine the transfer function from the bode plot, try to draw bode plots for a number of first and second order systems with different gains and corner frequencies in order to figure out the relation between a bode plot and its transfer function.


Question 3.4: Compare the bode plots of the estimated transfer functions from this experiment and experiment 2 and comment on their accuracy.
Question 3.5: Write down the transfer function one in the second order form and there other in the simplified form.
Question 3.6: Compare the step response of velocity output between the estimated transfer functions obtained in this experiment and experiment 2 using the step response of the realDC motor. Which transfer function is more accurate?

Task 3: Motor Transfer Function of Position Output

Note:The motor speed block in this program should be replaced using the one you used in previous experiment with output in rad/sec. The output filter should be removed by setting its time constant from 0.01 to zero. The gain at the output of the cos block should be changed in order to avoid the saturation of the Hilink board. Have a look first at the distorted output using a gain much higher than 8. Is it a sine wave or not at low frequencies?


Question 3.7: Determine the transfer function of the motor when position is the output in radians based on the transfer function for motor velocity determined in Task 2.