Trouble Runing Script on UR5 Robot - Using HAL Plugin

Hi,

I am trying to control a UR5 Robot using the HAL plugin.

On my first try using export urscript code, the robot worked just fine, following the path defined exactly as planned on grasshopper.

One week later, i try to run new script, the robot keeps going to one specific position. I try to run the previous script, can’t be helped, the robot still doesn’t run properly.

Could anyone bring any feedback on such situation ? Here are the following images of how the robot reacts.

In the following, you can see picture of how is the tool working from grasshopper, i believe the TCP is well setup, as long as the TCP configuration through 3 points in the UR5 controlpad.


Following is the script :
def MainModule() :
#Variables
movep(p[0.75,-0.16,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0,0.042,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.1,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.1,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.08,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.08,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.18,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.18,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.16,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.16,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.26,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.26,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.24,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.24,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.34,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.34,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.16,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,-0.005,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.75,-0.2,0.045,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.32,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.32,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.42,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.42,0.022,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0,0.042,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.42,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)
movep(p[0.616,0.42,-0.008,0,0,0], a=0.001, v=0.15, r=0.001)

end
MainModule()

Any hint, help, comment, direction, is very very welcomed.
Thank you in advance for your time.
Best,
Ghali

@gari.kun Are you suggesting that running the same script twice, a week apart, is producing different results? That sounds an awful lot like a robot configuration issue. Don’t forget that the TCP isn’t just a point, it is a pose. The pictures look like the Z axis of your TCP is flipped. Generally speaking it should come out of the tool rather than back towards the robot. This will also require you to flip your targets so they face down too.
I can see that your script doesn’t set the TCP explicitly. Is this an error on the export side (I can’t repro if it is) or have you removed that line?

@s.andraos Thanks for your reply !
Yes, Running the same script twice a week apart !! I did reset the robot to be sure it is same configuration, didn’t help. I guess it is my TCP …

On Grasshopper, the TCP Plane (Z Axis) is flipped yes, but so are my targets ! The Z axis are matching.

Regarding the pose / Rotation of the tool, i haven’t removed any line from the script. I Run the script as exported by HAL.

This is almost certainly an issue with the TCP not being set by the script. I can’t, however, reproduce that behaviour in our test files. Could you please upload the offending file (or the necessary portion). Thanks

Here is a portion of the file…
2018_06_23_URROB_FlatPath_FEEDBACK.gh (80.8 KB)

I internalized all poins, curves, and also the tool.
Looking forward to your answer. Also, is it possible to input a different speed for each target ? If yes, how would you suggest doing that ? I tried merging different targets, but the solver doesn’t respond.

First, let’s see how the exported script inputs the TCP coordinate system.
Best,

This is confirmed to be an issue in our export engine. It has a fairly deep reach so it might take a little while to fix but thank you for alerting us to it. You can ensure the tcp is set by starting with a motion in joint space at the beginning of your program. I would suggest that this is a good practice anyway to ensure your robot is starting from a known position and the configuration is correct in the simulation. You can see examples of this in the demo files at our Beta site.
You can set different settings per Move component so you can split your targets and feed them to different Moves and apply different settings. You will then need to Combine your moves before passing them to the controller, again you can see this in the demos.