The goal of this practicum is to observe first and second order responses in electrical circuits in both the frequency and time domains. We will do this by making Bode plots of simple circuits and unpacking the time response of a motor. The motor example illustrates some interesting techniques: pulse width modulation (PWM) and time scale separation.
N/A
Revisit PWM
Time scale separation
Bode Plots: High/Low Pass
Second order step responses
All data taken in Section 4
Turn in Submission Sheet (found on Sakai)
DC Tachometer
Reflective Tape
Practicum 2C Table
100kΩ resistor
10x probe
Parasitic elements are resistors, capacitors, or inductors that exist in the world even when we don’t intend for them to be there. One common example is the resistance of wires. Another, often impactful, example is the capacitance of bread boards. We’re going to use what we’ve learned about Bode and transient responses to extract the capacitance of your breadboard.
Build an RC low pass filter with parasitic capacitance of the breadboard and a 100 kΩ resistor. Wire the circuit as shown in Figure 4.1. The two black wires create parasitic capacitances from the row in the middle to the rows above and below the resistor. The far side of these parasitic capacitors are grounded, so the circuit looks like a simple RC low pass filter as shown in Figure 4.2.
Figure 4.1: Low-pass filter with parasitic capacitance.
Figure 4.2: RC Low pass filter which models parasitic extraction circuit. The voltage source represents the function generator which will be attached to the input. The resistor represents the 100kΩ resistor added to the circuit. The capacitor is the parasitic capacitance between rows of the breadboard.
Use the function generator in your oscilloscope to drive a sine wave into this filter (the input is the airborne side of the resistor) using the settings shown in Figure 4.3. You will adjust the frequency to obtain a Bode plot.
“Amplitude” and “Offset” should not have much impact on your results. Setting “Amplitude” to somewhere between 1Vpp to 5Vpp (you can do mental math faster to check your work if you pick a nice round number like 2Vpp) and “Offset” to 0V should be fine.
Figure 4.3: Sinusoidal wave input.
In order to generate a Bode plot for this circuit, you will need to measure both the input and the output signals. Therefore, you need to use two channels at the same time as shown in Figure 4.4.
Figure 4.4: Measurement channels.
As shown in Figure 4.5, attach the yellow oscilloscope probe (going into channel 1) to the input and the green oscilloscope probe (going into channel 2) to the row of your breadboard with the resistor. Make sure you're using the 10x probe or that your probe is set to the 10x mode.
Figure 4.5: Low-pass filter circuit measurement.
The oscilloscope can display the peak-to-peak voltage as well as phase difference between two signals. To display peak-to-peak voltage, you should first press the “Meas” button on the oscilloscope.
As shown in Figure 4.6, you need to select “Source 1”, and then under “Type” choose “Amplitude”, and then select “Add Measurement”. This will display the amplitude on the lower right corner of the screen. Change to “Source 2” and add the amplitude of the other signal.
It is also a good idea to add a frequency measurement as shown in Figure 4.7, just to make sure it is consistent with the input frequency.
The measure function of the oscilloscope only works when the whole signal is on the screen, so make sure your screen is scaled so that your signal does not clip the edges of the screen.
Figure 4.6: Add amplitude measurement.
Figure 4.7: Add frequency measurement.
The oscilloscope can also show the phase difference between two sinusoidal signals. As shown in Figure 4.8, you should select “Phase” under “Type” and then select “Settings”
“Source 1” should be the output of the low-pass filter and “Source 2” should be the input.
The measurement setting should read Phase (1->2).
Double check that your sources are set up this way.
Figure 4.8: Add phase measurement.
After adding all the measurements, the oscilloscope screen should look like Figure 4.9. You can adjust input frequency by first pressing the “Wave Gen” button. The corner frequency for this circuit should be somewhere between 100 kHz and 200 kHz in the lab. At least two decades of frequencies need to be covered around the corner frequency to get a Bode plot.
For a good resolution, you need to take at least four data points per decade and cover two decades. It is also encouraged to take more data points around the corner frequency.
Figure 4.9: All measurements needed.
After taking all the data points for the Bode plot, you should generate a step response for this low-pass filter by putting in an appropriate input signal. In your homework you will use this result to extract the capacitance of your breadboard. An example step response is shown in Figure 4.10.
Figure 4.10: Low-pass filter step response.
Next you will build a high-pass filter using a resistor and a capacitor of your choice. As shown in Figure 4.11, the resistor and capacitor should be connected in series, and the voltage across the resistor is the output voltage. You should choose the resistor and capacitor values such that the corner frequency is around 1 kHz.
You can calculate the corner frequency as a function of R and C for a first order high pass, and you should do so instead of guessing and checking.
A schematic of a high pass filter is included in Figure 4.12 for reference during this calculation.
Figure 4.11: High-pass filter circuit.
Figure 4.12: Schematic of an RC high pass filter.
Make a Bode plot for this filter. Use the same techniques that you applied to the low pass filter to do so: i.e. cover two decades around your corner frequency with at least five points per decade. In this case, we know the corner frequency is 1 kHz, so you should cover frequencies from 100 Hz to 10 kHz.
Plot the step response for this high-pass filter. It should look similar to Figure 4.13. Extract the time constant from your plot and make sure it matches the inverse of the ω_c found from your Bode plot.
Figure 4.13: High-pass filter step response.
Please save all of the data that you obtained in this section. You will need the data for the Problem Set 4B. See Section 9 for details.
This section explores how our ROV utilizes the characteristics of a low pass filter to drive our motor at variable speeds with only a single point 5V power supply. Complete this section if time allows.
In this part of the lab, you will investigate the relationship between motor speed and the duty cycle of the square wave being sent to the motor . Each station should have a DC tachometer (in a blue bag in the gray box) with instructions. Read the instructions to understand how to use the tachometer.
Cut a 1 cm x 1 cm piece of reflective tape and place it on a propeller blade, as shown in Figure 5.1.
Figure 5.1: Reflective tape on the propeller.
Mount your motor on your robot and orient the robot on the table as shown in Figure 5.2.
Figure 5.2: Robot with proper motor mounting and orientation.
Now, drive your motor with a 5V square wave through the H-bridge on your PCB. First locate the ribbon cable assembly and breakout board that you used in Practicum 2C - review Section 5 of Practicum 2C if you need a reminder for how to set up this circuit.
Figure 5.3 shows the circuit setup from Practicum 2C.
Figure 5.3: Breakout board setup for driving the motor.
Just as in Practicum 2C, we will power the PCB by providing 6.6V and 5V to the Vm and 5V inputs (respectively) relative to the ground pins.
MAKE SURE THAT THE GROUND TAB ON THE BANANA PLUG IS ON THE CORRECT SIDE.
Figure 5.4: Power supply connected to BNC cable and banana cable.
Connect a BNC cable to the waveform generator output on the oscilloscope. This will drive the square wave through your PCB; the pin connections should be the same as in Practicum 2C.
Remember that you should never connect an oscilloscope probe to the waveform generator output.
Using oscilloscope probes, we will measure the input signal into the PCB and measure the output signal at the motor terminals (1Y and 2Y).
Figure 5.5: Breakout board setup with extended view of input power, signal and data collection.
Connect another oscilloscope probe to channel 2 of the oscilloscope. Connect the oscilloscope probe to terminal 1Y (you may find it easier to secure a wire to this terminal) to measure the signal output at the motor terminal.
Turn on your supply and set the 6V output to 6.6V (as high as it will go) and the 20V output to 5V.
Your h-bridge output (without the motor attached) should look like the green trace in Figure 5.6, while your input should lood like the yellow trace.
Figure 5.6: H-bridge input (yellow) and output (green) with motor off.
HAVE A PROCTOR OR PROFESSOR CHECK YOUR INPUT AND OUTPUT SIGNALS BEFORE PROCEEDING.
Turn off your power supply and function generator.
Connect your motor to your PCB.
Make sure that the probe connected to 1Y is still connected to this terminal after the motor is attached.
Turn on your power supply and function generator. Your oscilloscope screen should look similar to Figure 5.7.
Reduce the duty cycle on the input signal to 20% and measure the rotation speed of your motor.
In a perfect world, the average voltage going into the motor should be 5V*20% = 1V. The world isn’t perfect: your H-bridge does not output perfect square waves (as shown in Figure 5.7). Add an “Average-N Cycles” measurement for source 2 so that the oscilloscope will calculate the average voltage for you over N complete cycles.
Wait a few seconds for the motor to stabilize and then use the tachometer to measure the rotation speed. Record the maximum and minimum RPM from the tachometer. These numbers should be within 50 RPM in the absolute worst case, less variation is common. Also record the average voltage driving your motor.
Figure 5.7: H-bridge input (yellow) and output (green) with motor on.
Repeat the measurement by increasing the duty cycle by 10% at a time. Plot rotation speed against the average voltage of square wave. This relationship should be linear.
Why is it that the relationship between the rotation speed of your motor and the average voltage being supplied to it is linear?
In order to understand this, you first need to know that the motor is a very slow low-pass filter due to its long mechanical time constant, and that it has a cutoff frequency much below the frequency of the wave you are sending in.
With this information, try to answer the following questions and record the answers in your submission sheet.
Thus, the motor’s rotation rate, which is dependent on voltage, acts as though it is being powered by the average voltage of the square wave due to it being a low-pass filter and the square wave having a frequency higher than its cutoff frequency. This results in the linear relationship that you should have observed.
This scheme, where you use duty cycle to encode information by sending a square wave through a very slow low-pass filter, is called pulse-width modulation or PWM.
The duty cycle describes the amount of time during one cycle that the signal is in a high state. For example, a square wave with a duty cycle of 50% will be high for half its cycle and low for the other half (a normal square wave), while a square wave with a duty cycle of 80% will be high for 80% of its cycle and low for the remaining 20%. Thus, changing the duty cycle will in turn change the average voltage of the square wave.
We use PWM to create signals between 0V and 5V using a digital source that can only either be high at 5V or low at 0V by changing the duty cycle as described above. We use this method to power the motor on the ROV so that we can vary the voltage being supplied to the motor, and thus the rotation rate, even though we can only supply 0V or 5V.
Try answering the following questions about PWM and include the answers in your submission sheet.
Reduce the frequency to 10Hz and change the duty cycle back to 50%. Observe the motor’s performance. Is this input signal at an effective frequency for PWM?
You can reduce the frequency further down to 1Hz. What have you observed? Explain what happens if the motor is driving an underwater robot with so much drag that it has a 10s time constant.
Note: Time scale separation happens here when using PWM because there is both a mechanical, first order system and an electrical, second order system each with their own time constant. Since the mechanical time constant is very slow, it "overrides" the electrical system's response (since it has a much smaller time constant), so the result on the oscilloscope is a simple square wave. If you were to zoom in, you would see a second order response corresponding to each pulse of the PWM.
This topic was touched upon in practicum 3A, consider reviewing that practicum to see how it is connected to this concept.
To complete the practicum please…
· Return all tools and adapters from the gray box to the gray box.
· Return the oscilloscope probes to the top drawer of your workstation.
· Hang all cables neatly on the rack on the side of your workstation.
· Be sure the power supply and oscilloscope are off.
· Please store your robot with motor, box, and PCB in your designated cabinet.
· Please leave the ribbon cable and the practicum manual at your workstation.
In your homework you’re going to extract the capacitance of your breadboard by taking parameters from your first order low pass transient and frequency responses.
Calculate the time constant of the first order step response you put into your low-pass filter setup in section 4.
Plot the Bode plot for your low pass filter parasitic extraction setup and extract the corner frequency.
Compare the corner frequency to the time constant. Are they related in the way you expect?
Use the corner frequency of a low pass filter and the value of the resistance in your setup (100 kΩ) in section 4. The capacitance loading the node that you drove is composed of three parts, all of which are in parallel. The capacitance to the row above the row you drove, Cu, the capacitance to the row below the row you drove, Cd, and the capacitance of the scope probe (~15 pF). Extract the capacitance between two rows (e.g. to the row above or below, but not both.) This electrical model appears in Figure HW.1.
Figure HW.1: Model of capacitance in breadboard. Cu is capacitance to the row above, Cd is capacitance to the row below, and Cprobe is the capacitance of the oscilloscope probe.
Tools Per Station
Power Supply Function Generator
Oscilloscope
DC Tachometer
Reflective Tape
Breadboard
Practicum 2C Cable
Materials Per Kit
Robot
Motor
Main PCB
Breakout PCB