I have a URCap that attempts to implement a sine weave function. This function runs as a thread. I followed the guide here:
The weave pattern only activates when a condition is satisfied (egs if START_WEAVE = True, and is implemented within the weave function). In the main program:
The weave pattern only activates when the robot tries to move towards DEST_WP.
However, what I noticed is whenever the program cycles back to START_WP, the TCP coordinates of START_WP is offset by a little bit (in the range of 5-15mm, along x and y), and the offset is not consistent each cycle. The START_WP coordinates continue to deviate further and further away from its original position with each cycle.
The lines of code I have used for implementing the weave function:
Hope to seek some advice on this!
You may want to look at disabling the path offsetting when you are ending the weave. There should be a path_offset_disable command you can use in the URScript. Otherwise it will hold the last offset you had when you told it to stop since it was never disabled and continue adding onto it each cycle.
Thanks for the reply!
I have modified my program to check if the boolean register is false (this indicates that the weave motion should stop) to trigger the path_offset_disable(). However, I get an error on the UR stating “Another thread is already controlling the robot”. Tried inserting path_offset_disable() into the end of my program node tree however the deviation issue still persists. Is there any other way of resolving this?
I would place the disable call in the main program as it is taking it as a robot motion call. So after the START_WEAVE = false; call the disable as your main program, in this case, is in control of the movements. Also, if you are going to have the Thread loop and just watching for the variable, I would put another sync() for the thread while loop as well or else you will run into another error.