Discussion
Move Waypoint In One Direction Based On User Input? |
63 views
|
Answered | |
/ Most recent by matthewd92
in Programming
|
5 comments |

I have a UR10 that we want to use to tend a CNC lathe. I am wanting to teach the pallet sequence at the lowest spot on the table for a general program. For future uses I would like for the operator to be able to type in the Z dimension of the part that is being picked up and have the robot automatically offset that Z distance from the Lowest spot on the table that has already been taught. The X, Y, and rotations should remain the same. This way we would not have to reteach the pallet sequence for every job, rather we would just change the user input of part height and the program would do the rest for us.
I currently only use the polyscope tablet for programming our robot as I have not messed with any of the script programming to date.
What would be the best way to accomplish this?
I have my "Reference" position as p[-0.24712, -0.21240, -0.35914, 2.0482, 2.3821, 0.0057]. For example if I have a 50mm part I am trying to change this waypoint to p[-0.24712, -0.21240, -0.30914, 2.0482, 2.3821, 0.0057] to lift the grippers up off the table a bit.
I have tried making variables for Part Height, and placing that into the spot for Z in the new position but it does not seem to be working. When I look in my variables screen it shows the right pose numbers, but the arm is traveling way further down that what I am wanting.
Using the simulator and saving this also generates a script that you could then modify. The code below generates a script that is attached.
Setup the pallet with 4 columns and 4 rows spaced evenly 100mm apart in both X and Y
Create a feature plane called `pallet_corner` the X axis should align with your rows, Y axis with the columns, Z aligned with the tool (generally pointing into the table)
These functions are based on 0 based indexing, so the first position you would go to would be position 0, in our example the last position would be 15 (4*4-1)
If the robot does not move in the correct Z_position, simply flip the sign on what you are passing in. We assume that the positive number should come off the plane and so we reverse the sign in function
You would simply then use that nextPosition in your move using a variable as the waypoint type. You could also calculate your over pick position like this