Shift the location of a pallet to fallow a conveyor

I am using a pendant running URSoftware 5.11.1010327 to control a UR5e with a vacuum gripper. I have the system successfully picking up parts and loading them onto a pallet, but the end goal is to have the robot track and load a linearly moving pallet or allow the operator to change the pallets position without having to re-teach the points. I’m receiving an integer from a PLC representing the distance the pallet is from the location it was originally taught. Is there any way for me to use this as an offset for the pallet’s location?

Thanks

Absolutely. Teach your pallet to a feature, and then just reassign that feature using the offset passed from your PLC. A feature is just like any other Pose in Polyscope. I would make this a simple script function if it were me.

I don’t know how your PLC is formatting its offset, but lets pretend it’s just some number in the X direction.

Script code:

def shiftPalletFromPLC(plane_to_shift, PLC_offset):
  return pose_add(plane_to_shift, p[PLC_offset * SOME_CONVERSION_TO_METERS,0,0,0,0,0])
end

Polyscope:
image

Just be sure to pass the “const” version of the feature into your function (the one accessible through the POSE dropdown, not the variable dropdown) and assign it to the same feature selected from the Variable dropdown, NOT the Pose dropdown.

Now anything you have programmed to that feature has just been shifted in the X direction by whatever your PLC is sending.

Note this is shifting purely in the Base frame. If you need this to shift PLC_OFFSET amount in the X direction of the FEATURE, there’s quite a bit more script involved.

POTENTIAL DOWNSIDE:
Unfortunately it sounds like you’ve already programmed your whole pallet. If this was done to Base, you’ll have to reteach them all to a Feature. If you already taught it to a feature, great! You’re good to go!

1 Like

Hey,

I’ve got an “until contact” added to the moveL: Tool action point. (so that the robot doesn’t impact a part already loaded).that works when the base is the connected feature, however if I change the feature to a point so I’m able to move the palletizing command, the program ignores the until contact and will run into objects.

is this a bug? do you have any suggestions?

thanks

It seems like I created a palletizing program using a separate feature but the 4 corners of the pallet were based on the Base as a feature. so the approach and exit are different from the pallet positions themselves. Reteaching the 4 corners using the new feature doesn’t seem to have fixed the problem though.

Definitely reteach any points if you switch to a Feature. The robot will not properly calculate the positions if you just select a new feature after teaching the points to Base.

As for the Feature, I always create a Plane, not a point. I’m just speculating, but if you used a point it might be defining it’s TCP Z in such a way that it doesn’t properly interpret the tool contact.

How exactly are you using the tool contact? Inside a Direction Node, or a Move node?

You can try throwing the script command “zero_ftsensor()” in before you start using the tool contact.

In short, you might have found a bug. Can’t say I’ve ever seen this happen myself.

Its inside a move node, I’ll give the plane feature and "zero_ftsensor()” a try and see if it works.

the problem seemed to be the feature flipping the z axis. the contact wasn’t failing. it was working but then exiting down instead of up. I re-thought the exit and used a plane as a feature and it seems to be working, thanks.

No problem. Glad it’s working for you now.