Student Work W2014

Tuesday, March 18, 2014

SMT updates

SMT is now updated in the google drive. Please make sure to save your old one just in case: this new one crashes rhino a lot more often, but is much better at predicting when you'll get an A4/6 error.

Things we did in class:
add base plate to existing gripper geometry (extra 21.05mm)
un-comment out (delete ";") the tool name in your code if you ever want to overwrite the length of the tool that the robot knows (gripper without attachment)
Sublime: it's a cool not-new text editor we've discovered. Cool features include sleek black screen, color coding of python code and multi-line replace (ctrl-H)

Things I changed in the
open the code up at line 580 and follow along to make sure you understand what we changed. This is important!

new tool: smallgripper_UofM
added to the geometry file under resources, meshes and points labeled accordingly. Feel free to add your tool specifically or just import your gripper mesh into the file I made and save over it.

tcp definition: z length is 100.775 (just the gripper, no attachments), and the tool is rotated +22.5 degrees like we talked about in class. The tool might be rotated 90 degrees when programming vs. simulating, and if that is the case, just rotate the tool 90 degrees in the geometry file and save over it. Alternatively, you can change the TCP to 22.5+90=112.5 degrees. Same dealio.

TCPID: tool 2 - you should change the length of tool 2 on the pendant when you run it if you don't un-comment out the tool definition line like I said ^^

activation string: this is what is put at the beginning of the line. I put GRIPPEROPEN=FALSE (this is redundant, as it should already be off), and GRIPPERCLOSE=TRUE. If you ever need to edit what it puts at the beginning of the line, do it here. You can add as many commands as you want, including wait times (e.g. WAIT SEC 1)

Waiting: I didn't put in in here, but if you want to, just add it to the activation or deactivation string. You can put in "WAIT SEC (insert number here)" in quotations with a comma in the code. For example, your activation string might be ["GRIPPEROPEN=FALSE", "GRIPPERCLOSE=TRUE", "WAIT SEC 1.5"]

deactivation string: opposite order of activation string. Turns the gripper close off before turning on gripper open. Please be sure to turn off all outputs (both gripper close and open) before running code so you don't run into any issues. 

Meet in the robo room next tuesday, ready to demo work. Please have everything uploaded to the blog to present process work. 

Friday, February 14, 2014

Creating a Tool in superMatterTools

Hey! So today, you learn how to teach a tool not manually, but digitally, to the robot.
There are two parts to this. 1) you need to give the robot the tool, and 2) you need to tell it what it is. We will be working in Rhino and in Python, respectively.
We are going to start by taking an existing tool and converting it into our tool, the Pointy Cylinder. You can find the existing tools in the SMT/Resources/Geometry folder.
I'm starting with Laser_UofM.3dm, but you could use any of the other tools in there. You're going to notice all the tools are names <toolname>_UofM. This is important. First thing we're going to do is Save As so we have our own file and we get rid of an existing tool. I now have a file in the same sMT/Resources/Geometry folder named Cylinder_UofM.3dm that has a laser in it.
There are four parts of this tool. From bottom up, they are:

  1. The Orientation Points
  2. The Tool Changer
  3. The Tool
  4. The Tool Tip (TCP)

The Orientation Points and the TCP are the only parts of this model that sMT needs. The Tool and Tool Changer are what will appear when you simulate your program and are, presumably, how you will define your TCP.
The TCP is the very end of your tool, be it the nozzle of the extruder, the focal point of the laser, or the tip of your marker. It is a set of (x,y,z,a,b,c) coordinates. This point will follow the tool path precisely.
The Tool is a model of your tool. It is up to you the level of detail you want to go with this, as it will only be visible in sMT simulations. The part of this that should be precise is the tip of the tool, as that will be how you define your TCP.
The Tool Changer is what will allow us to easily switch between different tools in the future. The tools have the female end, and the robot the male end. When the male Tool Changer is attached to the robot, you will have to attach your tools to the female one in order to get them on the robot. As this has not yet happened, it is not important to us at this time.
The Orientation Points are how sMT knows the position and orientation of your tool. They are named <toolname>_UofM_Pt00, <toolname>_UofM_Pt01, and <toolname>_UofM_Pt02. They are located at the Origin, the Z axis, and the X axis, respectively. They must be named correctly in order for the tool to be read by sMT. sMT pulls a vector from 00 to 01 and another from 00 to 02, so they need not be at any specific distance, simply along the correct axis. A good rule of thumb is not to change or move anything unless you have to, however.

You can now delete any existing geometry you do not need, except for the Orientation Points. Rename these to match your file and tool name. You can rename objects at the top of the properties panel. Rename the layer that all the objects are on to match as well.
Next, we will model the tool. Look at how good I am at Rhino!
You may have noticed that all part of the existing tools are meshes and named <toolname>_UofM. We must do the same for our tool. You can do this using the Rhino command Mesh, and renaming the resulting meshes in the properties panel. When you are done modelling, don't forget to delete anything that is not a mesh or an Orientation Point! All your meshes must be "good" closed meshes, but it does not matter if they are joined or continuous or whatever. This can be verified with the Rhino command Check.
If there are any issues with your mesh, you can find instructions on how to fix it under the Mesh Diagnostics section of the Rhino 5 Check Help Article or you could try the MeshRepair plugin.
Next, locate your TCP's coordinates in your Rhino model, either a) by teaching the tool to the robot like we did for the last assignment and getting the coordinates from there, OR b) by snapping to it in your incredibly precise model and reading the coordinates from the bottom right corner of the screen. Take note of these as you will need them shortly. Convention dictates putting a point at your TCP, but it's not strictly necessary.
Save, and you have given the robot your tool. Part 1, complete!

Now we teach the tool to sMT. Open up the RhinoPython editor by typing in EditPythonScript (this should be familiar). This time, instead of opening up the usual sMT_00 file, we will be opening sMT_02_WorkCells. The following will involve editing variables in the code, but don't worry, no knowledge of code is in any way required.
First, we will edit the WorkCell Definition Dictionary. The Dictionary starts on line 355, but the Dictionary Definition we want to edit is for the Agilus Workcell. It is found at line 448. We need to include your tool as an option in the Process drop down menu. On line 449, after "Posprocess" and before the square bracket, type in a comma (,), a space ( ) and the name of your tool (<toolname>_UofM) inside quotations ("). It should look like this. Save the file.
Next, we are going to create a Dictionary Definition for our tool in the Process Dictionary. This Dictionary starts on line 539. To do this, we are going to copy an existing definition and edit it. Go ahead and copy all of the None_UofM definition (lines 546 - 577) and paste it at the end of the UofM section dictionary, before the MIT section (line 1187). Delete spacing dots as necessary if you want everything to align. For this simple tool (which doesn't turn on or off, doesn't rotate, etc) we will only have to edit 3 lines: 1188, 1192, and 1193. Line 1188 should say your <toolname> instead of the word "None". Line 1192, tCPDef, should be the coordinates of your TCP, written in (x, y, z, a, b, c). Copy them in either from real life or from your digital model. Finally, line 1193, tCPID. This should be the number of the tool you've taught the robot, or the tool number you would like it to use. This is less important now, because there are no set tools apart from yours, but will need to be more rigorous as we start adding tools. In context, with our relevant information changed, your new tool's Dictionary Definition should look something like this.
Save, and under the "Tools" menu at the top of the Python Editor, click "Reset Script Engine". You've told the robot what the tool is. Part 2 complete! You've done it! Hooray! Now you can run sMT, pick your tool, and have it not only appear in sMT but be included in your code.
To add the tool to the robots, go to
Startup -> Calibrate -> Tool -> Numeric input
Select tool no. 2 and change the x,y,z,a,b,c. Hit next to save. Should be good to go!

If there are any questions, see you guys at Office Hours.

Wednesday, January 15, 2014

Assignment 1 - LiteBrite and SMT

Watch in HD 720p on youtube

Update: There has apparently been some confusion regarding SMT download. You must download the folder shared on drive, unzip it, and use it from there. SMT will also prompt you to save the rhino file at some point, if you have not already, before you can use SMT. It does not matter where you save it, as long as it is saved somewhere.