Home› Programming
Discussion
Back to discussions page
wileydavis
Posts: 11 Apprentice
Incremental move from current position |
2.3K views
|
Answered | |
/ Most recent by matthewd92
in Programming
|
6 comments |

we just got our ur5 and robotiq gripper loading parts on one of our Cnc mills and it's working great but I'd like to program a few routines that require an incremental move from the robots current position. We're using the force feature to insert parts so I don't always know ahead of time exactly where the tcp is. Can anyone provide a simple example of how to move say 1" from the current position in the z with respect to a particular reference feature? I feel like this is probably obvious but I'm missing something.
Best Answers
-
matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,261 Handy
@wileydavis
You can do this a couple of ways, create a variable and then use this as a waypoint or just use script to do the move.newWaypoint = pose_trans(Tool,p[0,0,.0254,0,0,0]) Movel newWaypoint
The pose trans function is transposing the current tool position by using the Tool pose, you can't type that you'd have to select it from the pose drop down menu. If you want to type it it would be something like thispose_trans(get_actual_tcp_pose(),p[0,0,.0254,0,0,0]),a=1.2,v=.25)</code>newWaypoint = pose_trans(get_actual_tcp_pose(),p[0,0,.0254,0,0,0]) </pre>If you want to do it all programmatically then it would simply become something like this<br><br><pre class="CodeBlock"><code>movel(
Where a and v are the acceleration and velocity in m/s/s and m/s respectively.
The the other way which I use occasionally is to use a relative waypoint. I don't like the control that this gives you or rather lack in my opinion but it's relatively easy to set up and builds this command behind the scenes for you -
BeachChE Founding Pro Posts: 19 Handy
Wiley,
You have to set up the moves in a order of:
MoveJHLPU_01 - Prep move standard move (move just before your "1"MoveL (MUST BE MOVE L)new_pos_1 (set by variable) your "1"HLUP_02 (relative move) (first set point = to your "1", second set point = your move in ZHLPU_03 (relative move) if you need a second move, such as first set point = second set point in above move, then second set point in this move = where you would like to go.MoveJHLPU_04 (Standard move)
Then the vaviable move and relative moves have to happen under a linear move "MoveL"
You can do gripper commands or other commands under the MoveL statement. -
matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,261 Handy
@wileydavis
1. I believe coordinates are always in meters, I think polyscope is just doing a conversion for display. If you used the backup magic file and pulled the programs off the robot you could then open the .script file of your program and see what your program is being converted to. This is also a great way to learn how the polyscope commands are being converted to URScript at compile time.
2. You teach it with a known point but it's relative to the point that proceeds it so if that point is varying then the relative will still do the same move relative to where it started.
3. I don't use pose_add very often but in this case you shouldn't see any difference. What you can do is do a pose add and and pose trans to to two different variables using the same parameters and see what the calculated poses are. That will help you understand what the difference is. We are a lot of times transposing a feature to base coordinates so we need to do pose trans.
1: I assume from what you provided that script coordinates are expressed in meters regardless of the units the polyscope gui is set to use, is that correct?
2: When using the relative waypoint, is there a way to use the current position as the start point? In my attempts to use it it seemed like you have to specify a known start point ahead of time.
3: What is the difference between pose_add and pose_trans?
Thanks again.