The goal of this practicum is to generate Bode Plots that represent the frequency response of the robot’s vertical motion. You will send sinusoidal signals of varying frequency to the robot’s thrusters and measure their effect on the output.
Revisit Excel
Revisit LabVIEW
N/A
How frequency response changes with increasing frequencies, translation to Bode Plot
Straight line approximation
5 outputData Files for FrequencyResponse_XX
Turn in Submission Sheet (found on Sakai)
Robot Top Spring
Semi-log graph paper
Assembled robot
E79_F19_Controller.llb
FrequencyResponse_sample.xlsx
Find your robot and motor. It should be located in the cupboard in the west lab room. Remove the robot buoyancy floats from your robot as shown in Figure 4.1(b) below, and modify the robot frame to include the vertical “spring” (just like last week in Practicum 2D). Your robot should look like the one in Figure 4.1(c).
Dry test your robot and then get in the queue (see Reference Page for dry test instructions). Here is the checklist the queue master will check (Same as in P2D):
Original robot foam removed.
Robot top spring added.
Measured mass of robot.
Measured outer diameter of top spring PVC.
Dry test completed this week
Pressure tube taped to frame and pointing downward
The other end of the pressure tube is plugged into the pressure sensor on your board
Pressure tube is free of any water
Figure 4.1: (a) ROV frame that was completed in Practicum 1a; (b) ROV frame with 6.5” pieces removed; (c) the top spring mounted on the robot.
Once the check is complete, the proctor will add you to the list of prepared students and inform you when it is your turn to go.
If it is not your turn to go to the test tank room, read the rest of the manual carefully so you can work quickly when you get to the test tank room, then:
a. Complete section 8
b. Complete section 7 with the sample data file FrequencyResponse_sample.xlsx located on Sakai.
The VI should be open on the laptops in the tank room. If it is not, double click on the file E79_F19_Controller.llb. It should be located on the desktop. Double click on the file P2DandP3A.vi. There will be a copy on Sakai as well. Figure 5.3 shows the front panel of the VI. Note the following features:
The stop button near the top left. This should be used to stop the vi.
The toggle switch to choose the type of signal being sent to the thrusters. The two types are sinusoidal and Constant.
If the thruster signal type is sinusoidal, you can control the sinusoid frequency with the slider above the switch, or the numeric entry field.
If the thruster signal type is constant, you can control the value with the Slider named PWM Duty Cycle % (or the corresponding numeric entry field below).
The top right chart plots the signal being sent to the thruster.
The bottom right chart plots the pressure sensor voltage measurement.
Figure 5.3: The front panel of the VI named P2DandP3A.vi.
With the toggle switch of the front panel on Constant, vary the PWM duty cycle with the slider. Make sure the propeller spin rate increases with increasing PWM.
Check that your pressure sensor works by attaching the balloon pump and watching for the voltage change on the graph in the front panel.
NOTE: When you click run on the VI, it will prompt you to name your output file and choose where it will save to. If you don’t want the data in that run to be saved, click ‘cancel’ instead (helpful for testing). It is simple to save your output file to the desktop of the user you are currently using. This file will contain the pressure sensor voltages from the last run of the VI.
If both your motor and pressure sensor are working properly, you are ready to deploy your robot in the tank. If the text file output does not save correctly or the motor and pressure sensor are not working properly, contact an instructor or proctor.
REMINDER: When closing a VI, a window may pop up prompting you to save the VI and any lower level VI’s used within it, even if you didn’t make any changes. This will happen with any VI from a library that was just downloaded onto the computer, such as from Sakai or Google Drive. When that window pops up, just click the “save all” option, then it shouldn’t pop up again for that VI as long as it stays on the computer. If you need to re-download a library, then this window will pop up when closing the VI’s from that library, and you will need to save them once again so the window won't pop up anymore.
Gently lower your robot into the test tank. Shake the robot a bit to clear any bubbles trapped inside the PVC frame corners.
Check that the foam block is completely submerged and the top of the PVC on the robot is approximately at the line drawn on the top spring.
Use the bottom slide control to move the robot up and down. Ensure that your pressure sensor is working (the voltage should go up or down in opposite direction of the robot).
Follow the directions below:
With the VI not running, set the toggle switch to the down position, and set the PWM duty cycle to be 0. This constant setting of zero means that the robot should come to rest any time the toggle switch is moved to constant mode.
Run the VI and name the output file FrequencyResponse_XX, where XX are your initials and set it to save to the desktop.
Change the Frequency of the sinusoid to be 0.05 Hz, and set the toggle switch to the up position.
Watch the robot move up and down in unison with the input signal shown on the top right chart of the front panel.
If your robot is not in unison with the signal then your motor may be plugged in backwards. If so, turn the toggle switch off, hit the reverse button, then turn the toggle on again.
Make sure the output signal plot (the pressure sensor voltage) is also showing a sinusoidal response as well. The axes scrolling may make this difficult, but make sure you observe steady up and down motion in the signal.
See the plots in section 7 for what you should be getting.
Let the robot move around until it achieves sinusoidal steady state, and try to minimize any drifting of the robot. After a few cycles of sinusoidal steady state, set the toggle switch to the down position so that the input single to the thruster is no longer a sinusoid.
Repeat this process with frequencies of 0.1, 0.2, and 0.5. Pay attention to the phase and amplitude of your robot's motion relative to the applied thrust.
Stop the VI and, if the run was successful, find the output file on the desktop and move that file to a section-appropriate folder in My Documents. If the run was not successful, delete the output file from the desktop and try again.
Save your files to a USB drive or to the cloud so you can take them with you.
Return to your section lab room, and inform an instructor that another team can take your spot in the test tank room.
Dry your robot and put your robot away, returning the top spring to the general stock.
You will need this frequency response data for the rest of this practicum
Be sure to save it on the cloud or a USB drive, not a random E79 laptop. Be sure both partners have a copy.
Open your frequency response data file FrequencyResponse_XX in Excel.
REMINDER: The VI timer starts when you click run, but the time doesn’t start recording to the output file until you’ve chosen the name and directory for the output file. Because of this, the time column in the output file generated from the VI will have a near 0 number in the first row, then it will jump a couple of seconds in the next row and begin recording time normally from there. When you are looking at your data, delete the first row (with the near 0 time), then make a new column where you calculate the difference between the first recorded time after the jump and the current time in each row in order to get the elapsed time starting from 0.
Using your pressure sensor calibration equation from the module 2 Practicums, convert the pressure sensor voltage data to depth in meters. If you can’t find your equation, you can use the equation below. Note that every sensor is different and values will vary between sensors.
z = 0.648v - 1.54
Using Excel’s Chart type Scatter with Smooth Lines, plot the input signal sent to the thruster (% duty cycle) and the depth as a function of time. Since we want to compare the input signal to the output signal on the same plot, it may be easiest to plot the depth signal on a secondary axis. You can do this after plotting both signals by double clicking on the depth signal and, in the menu that pops up on the right, click on “series options” and select “secondary axis," or plot a scaled version of the depth signal. E.g. plot 5x or 10x the depth signal.
Figure 8.1 illustrates what a plot will look like (zoomed in), where the orange sinusoid is the input signal sent to the thruster, and the blue sinusoid is the measured depth – put on different axes to allow them to be compared.
Note: If your lowest frequency depth signals are 180 degrees out of phase with your input signal, this is because your wires were crossed when attaching your thruster to the PCB. You will need to flip one of your signals to allow them to be compared.
Figure 8.1: Plotting signal data to create a bode plot.
For each frequency that you set for your input signal (0.05, 0.1, 0.2, 0.5), extract the ratio of magnitudes and phase shift from your plots. This can be approximate. See arrows in Figure 8.2(a). The black arrows are used to obtain magnitudes, the red arrows are used to measure phase shift. The phase shift in this plot is negative.
Helpful Hint: Right click on your plot in your plot, select Format Chart. Click on the Size and Properties Icon, see Figure 8.2(b), and set the width to be something very large so you can zoom in.
Figure 8.2(a): Extracting magnitude and phase.
Figure 8.2(b): Size and Properties Icon.
Using your experimental data, you will construct a Bode plot that includes both magnitude and phase as a function of frequency. Note that for these bode plots we are comparing a depth to the duty cycle of the input signal. We are assuming the input signal is proportional to the force by some constant (F = constant*(% duty cycle)) so this is effectively a bode plot of displacement to force scaled by some constant. However this does not change the frequency response, which is what we care about.
Some helpful notes
Recall that you should plot magnitude in dB:
Recall that phase between two sine waves is the ratio of the delay between the signals to the signal period, scaled by degrees (360 degrees in a period).
To make your Bode plot cover more frequencies, assume that the magnitude in dB at 0.005Hz is constant and equal to the magnitude at 0.05 Hz. Assume the phase is 0 degrees at a frequency one generation lower than 0.05 Hz. Finally, assume the phase is -180 degrees at a frequency one decade greater than 2.0 Hz.
The magnitude of your output signal at 0.5Hz may be less than the noise level of the signal. Hence the data may be unusable and you may want to throw it out
Also, recall that we plot Bode plots as a function of frequency on a logarithmic scale, which is easier as a function of f for this practicum. To change your Bode plot to a logarithmic scale on the x axis, right click on the axis, select Format Axis… and check the Logarithmic Scale checkbox.
Add these plots to your submission sheet (Question 2 and Question 3).
Don't forget to add your answers to the questions you find in your practicum manual to your submission sheet for the day! (Question 1)
Find or re-derive your differential equation (using lumped element modeling) that represents the vertical motion of the robot. Assume the forces acting on the robot include a buoyancy spring force kx, a damping force bx ̇, and a thruster force f(t). Write your equation in canonical form, and define any standard parameters, (e.g. ζ,τ,ω_n), as a function of mass m, spring stiffness k, and linear drag coefficient b. You should have values for these parameters from Problem Set 3B. You only need spring stiffness and mass for the straight line approximation.
Derive the frequency response function G(jω).
Use the spring stiffness that corresponds to the measured diameter of your PVC tube to draw the straight line approximation Bode plot for your system. You will need to know the mass of your robot with the top spring. As we saw in part 7, we are assuming the force is proportional to the duty cycle by some constant. For your straight line approximation, you will also need to assume that your thruster force is a function of the PWM duty cycle d_PWM (t)% given by:
where
Be sure to use the semi-log graph paper provided. Double check your Bode plot makes sense with an instructor. Don’t forget to take a photo of the plot and add it to your submission sheet (Question 4 and Question 5).
1. E79 Practicum Manual 2D
2. Full Parts List (below):
Tools Per Station
Robot top spring
Laptop computer
MyDAQ
P2C Ribbon Cable
USB Drive
500g mass
PCB
Semi-log graph paper
Software
E79_F18_LabView_Library.llb
Materials Per Kit
ROV
Motor
Pressure Sensor