The first goal of this practicum is to incorporate your proportional control system simulated in practicum 5A into your actual robot, and validate the system is functional in our test tank.
The second goal of this practicum is to double check that all robot parts (software and hardware) are functional for our final robot deployment which will happen in Phake lake.
N/A
How to prepare for a field test
More P control
Save output file from tank room
Turn in Submission Sheet (found on Sakai)
Robot with umbilical
An assortment of data from old psets and practicums
Your goal for the test tank room is to validate that our robot systems can track a desired depth.
Before getting in the queue, you'll need to complete the following
Write down your pressure sensor calibration values (practicum 2D)
Write down your mystery resistor value for the temperature sensor (practicum 4A)
Pass a dry test
Pressure sensor works
Temperature sensor works
Motor works and responds to P control (if you blow into the pressure sensor tube the robot will respond when the depth plot moves around the target depth)
The motor propeller is not loose
Once you have completed these, get in the queue for the test tank - make sure you show that you have completed the items above to the proctor. If you have to wait for your turn, proceed to section 5. Return to section 4 when you get called to the test tank room.
Upon arriving in the test tank room, ask an instructor or proctor which station you will be using.
Set the VI parameters in the console for your robot specific parameters in the Calibration box.
Depth calibration entry field based on your pressure sensor calibration curve
Mystery resistor value based on your temperature sensor circuit resistor
Then, set the proportional gain K_P to be 250 using the Kp entry field.
If you perform the following and are not getting good data, see the list of tips below.
Have your robot track a desired depth of 0.2 m by typing 0.2 into the desired depth entry field. The robot will only track depth if the proportional feedback is turned on, so be sure that you are in proportional mode and not constant mode. Watch the robot and the depth chart on your VI to make sure the robot is actually tracking to the desired depth. Then enter a step change in the desired depth from 0.2m to 0.4m. Observe the robot's step response. Make sure you observe a full step response with the robot reaching steady state. There may be some small oscillations around the steady state depth. Make sure your data is being written to a file and that the data makes sense.
Your goal is to collect step response data for three unique K_P values. Start with K_P = 250 and then repeat your data collection for two additional K_P values. One must be for a K_P leading to an underdamped system, and the other can be for a K_P of your choosing (if you already identified the K_P for the critically-damped system in Section 5, then use that).
Tips if you are not getting good data
If your robot seems to move in the wrong direction, it is likely because you have your motor wires swapped on the PCB (relative to the assumption in the VI). To address this issue, simply click on the Reverse button on the VI.
Make sure your pressure sensor tube is free of any water
If your robot’s depth measurement doesn’t match the robot’s actual depth measurement, this is likely because your calibration is no longer valid in the current system. If time permits, adjust your pressure sensor calibration values in the VI - these are called "Depth Calibration slope" and "Depth Calibration intercept" (default values are 0.648 and -1.54, respectively).
Make sure your robot is neutrally buoyant. When the robot is unpowered, if you push the robot down and it floats right back up, remove some of your floaties. If your robot sinks, add some more floaties
Make sure your motor propeller is not loose. Tighten it with pliers if it needs to be tightened
Try increasing your nominal depth from 0.2m to a depth between 0.2m and 1m if your robot does not settle at 0.2m. Perform your step changes from this new depth (1 to 1.2m)
Diving too deep may compress the foam blocks and make the robot sink
Confirm you have logged data for all three cases in your output file, then remove your robot. Be sure your station is at least as clean and dry as you found it.
Save your output file to a location where you can easily retrieve it!
In this section we will use the simulator you've built up over the semester to figure out the best value of Kp for your robot to achieve critical damping. Critical damping is the condition under which your robot settles fastest with zero overshoot.
Revisit your VDSim_Control.vi from last week. If you can't locate your file, download E79_F19_PostP5A_w1128.llb from Sakai.
Make sure your VI is using your robot specific parameters (mass, buoyancy force and drag coefficient). If you forgot where to find them, mass and buoyancy were found in practicum 1C and drag coefficient was in the problem set after practicum 2D. Also look up the linear fit for your PWM->thrust curve (also in practicum 1C). A few notes on your values
Mass is in kg and should be without the top hat
Buoyancy force is in newtons and should approximately cancel out the force from the mass of your robot if your robot is neutrally buoyant
If you are unsure about your values, refer to the Problem Set 3B solutions. Your values should be approximately close to those values
You will also need to add in a block between your proportional gain and your plant which represents the conversion from PWM into thrust: right now your simulator assumes your control effort (the output of your Kp block) is already in the form of force. However, your control effort is really in the form of PWM, and you need to add a coefficient to convert from PWM into thrust just like the last homework. In order to calculate the thrust, fT(t), from the PWM control effort , Kp(zdes - z(t)), you will be using the equation from the last homework:
where α is the absolute value of the slope from your PWM to thrust curve from practicum 1C, which allows you to convert from PWM to thrust. You’ll need to add in a multiplication block after the Kp block and before the plant where you will use α to convert the PWM control effort to thrust.
Once you identify the plant block, add the multiplication block before the plant and use the slope of your PWM->thrust curve slope to convert to thrust. Take a screenshot of your new control block diagram VI and add it to your submission sheet (Question 1).
With your robot specific α, mass (m), and buoyancy (b), find the value of K_P that will lead to critical damping. This is the same caluclation you did in your homework but with your own values.
Run the VI to simulate the behavior of your system. Apply a step in your desired depth to the system and observe changes in the output. Confirm that the simulation is critically damped. Report your value for K_P for critical damping and capture a screenshot of the step response and add it to your submission sheet (Question 2)
Test a different value of K_P and add this to your submission sheet too (Question 2).
This simulator also offers a good opportunity to think about what parts of our system are our controller -- which is often a fully digital system -- and our plant -- the physical thing in the real world we're controlling. Take a screenshot of your simulator VI and use Paint to circle all of the blocks which represent things in the physical world and which, accordingly, are not included in the VI in the tank room. These circled blocks make up your plant. Add this annotated screenshot to your submission sheet.
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.
In this section, you will analyze the data you logged during your test tank deployment. From your test tank data, construct a plot of depth versus time for each Kp value. Overlay the desired depth versus time input step on the plot. Report these plots in your submission sheet (Question 3)
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.
Measure the steady state error, i.e. (zdes – z), where z is depth, for each of your step responses.
In your homework you found the impact of disturbances (buoyancy and mass) on your transfer function. Using the transfer function of the system including disturbances from buoyancy and mass, find the analytical steady state error for the different values of K_P. Use the full expression for Z(s), similar to what was shown in the second to last slide of Tutorial 22, and find e = zdes – z. Note that you can use the final value theorem as was done for the hovercraft problem. How does your analytical error compare to your measured values? Report your measured and analytical errors and comment on this in your submission sheet (Question 4)
Simulate the depth vs. time response for the Kp values you used in the tank using the simulator from section 5. Qualitatively compare the measured and simulated results and comment on any discrepencies in your submission sheet (Question 5). There are a wide variety of real world factors that could contribute to differences between these responses, so feel free to think broadly about your robot deployment as compared to your simulator's operation.
Finally, plot the temperature vs. time curve during the step response from your experimental data. (Question 6)
Perform one last dry test on your robot to make sure it is working before you take it to the lake.
Run P5B.vi on the dry computer and complete the following tests. Refer to the dry test in practicum 5A, the debugging guide, or an instructor if anything doesn't work.
a. Ensure the depth reading is about 0m. If not, adjust the depth calibration offset until your robot reports 0m. Make a note of your robot's depth calibration offset.
b. Blow into the pressure sensor and make sure the depth changes on the chart labelled “Depth (m)”.
c. Warm up the temperature sensor and make sure the temperature changes on the chart labelled “Filtered Temperature (C)”.
d. Change the desired depth to 1, set the proportional control gain K_P to be a value of 5000, and set the control mode to be proportional. The motor should spin. If you blow into the pressure sensor and the depth measurement matches the desired value, the motor speed should decrease. If you pass the desired value the motor should spin in the other direction.
1. Clean up your lab station, putting away all cables and probes to their appropriate places.
2. Make sure to remove the grey ribbon cable and pressure tube penetrator from your robot and return them to the central supply table. These are shared by all practicum sections, so we need to keep these in the lab.
3. Do not leave your robot in the cupboard, as you normally would. Take your robot with you and remember to bring it to Phake Lake next week!
4. Remember that there is no internet at Phake Lake, so write down your critical value of Kp, depth calibration offset and slope, and resistor value.
1. E79 Practicum Manual 1C
2. E79 Practicum Manual 5A
Tools Per Station
Laptop with LabVIEW
Short gray board to wire adapter
Long gray board to box adapter
Benchtop test equipment
Pressure sensor penetrator
Software
VDSim_Control.vi
Materials Per Kit
Completed robot with umbilical