I want to run the tool plate from as close to -360 degree around to +360 degrees. I understand that I have to give some offset so I use -350 to +350 but even at that, the robot does not know to go in the correct direction to get to the opposite waypoint. I can get it to work with a crutch of 50-degree increments but then those intermediate waypoints seem to have small pauses as each waypoint. It does not have a smooth operation. Is there a better way? I want the tool plate to oscillate back and forth from -350 to +350 and back to -350 and then repeat.
You can try to use small steps through a sevroj command:
This should produce a smooth rotation, let me know if it works out for you.
I wrote your program and gave it a try. While I can’t figure out how to control the speed of the servoj() I can see that it is moving (like a snail) even after reducing the wait time. The documentation says that a:, v: are not used in this version.
I forgot to mention the other problem associated with this question and that is speed control as well. The problem is similar to the head pat and belly rub challenge that people commonly try to demonstrate as a party trick. The challenge is to rub your belly with one hand in a circular motion and pat your head with the other hand. This is relatively easy and is analogous in my further question with respect to controlling not only the rotation of the tool plate, but to rotate the tool plate while moving 1000 mm from p[0,0,0,0,0,Rz] to p[1,0,0,0,0,Rz) at 10 mm/s while at the same time looping the tool plate with a much faster angular velocity spinning back and forth as many times as possible while traveling from Wpt1 to Wpt2.
I have overcome the limitation of one speed for the overall system by subdividing the distance between wpt1 and wpt2 into smaller segments. Then the rotation has to complete over a smaller distance in XY so it appears faster. The whole thing would be better if I could tell the robot to go from wpt1 to wpt2 at 10 mm/s and rotate the tool plate back and forth at a custom independent acceleration and velocity.
Then to make this problem even harder, I want to synchronize two UR10e robots so they are looping a rotation of their tool plates in near exact synchronicity from -350 to +350 or anything in between, while at the same time moving the arms to different waypoints in X,Y,Z.
I’ve achieved something similar before by putting the movement inside a frame force node applying an Rz torque. This spins the tool at the angular velocity specified in the force node while getting the rest of the movement parameters from the MoveL. You’d need some extra logic to make sure you didn’t hit the final joint rotation limits, and would need to be thoroughly tested to make sure the behavior was as intended in all circumstances but could be worth a try…
Inverting the sign on the torque value would make it spin in the opposite direction.