Hi, everyone.
I want to use Python to control the end of the UR5 robotic arm to perform uniform acceleration movement along the y-axis of the base coordinate system of the UR5 robotic arm.
For example, the end of the robotic arm starts from the point (10, -10, 10) and undergoes uniform acceleration movement to (10, 0, 10). Then it immediately undergoes uniform deceleration movement until it reaches (10, 10, 10) and comes to a stop. Immediately after that, it undergoes uniform acceleration movement passing through (10, 0, 10), and then immediately undergoes uniform deceleration movement until it stops at (10, -10, 10). This process constitutes one cycle, and it repeats five times.
The absolute value of the acceleration during the entire process is equal. At the same time, except for stopping at the two end points, the robotic arm does not stop or experience any abnormal jitters at other times.
I tried to use Servop to control the robotic arm, but there seems to be a significant error between the positions I input and the positions the robotic arm interprets.
Hi
What you are describing, sound like a standard movel with a blend radius of 0 in every point and with a very low acceleration and a very high velocity, between the two points (10, -10, 10) and (10, 10, 10)?
as the linear motion should accelerate uniformly until it hits the velocity you have given it.
if this velocity cant be hit in the span of half the distant because the accelerations is to low or the velocity is to high, it will then at the mid point decelerate to the end point. but only if the blend radius is 0 as otherwiser it will at some point depending on the radius begin its movement to the next point.
if you are not seeing this, it could be because of your safety settings. as the robot will follow the safety based velocity over the velocity given in the movel function.
import socket
import time
ROBOT_IP = "192.168.1.84"
PORT = 30002
def main():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ROBOT_IP, PORT))
start_pose = "p[0.10, -0.10, 0.10, 0, 3.14, 0]"
end_pose = "p[0.10, 0.10, 0.10, 0, 3.14, 0]"
cmd1 = f"movel({start_pose}, a=0.1, v=0.25, r=0)\n"
s.send(cmd1.encode("utf-8"))
time.sleep(3)
cmd2 = f"movel({end_pose}, a=0.1, v=0.25, r=0)\n"
s.send(cmd2.encode("utf-8"))
time.sleep(3)
cmd3 = f"movel({start_pose}, a=0.1, v=0.25, r=0)\n"
s.send(cmd1.encode("utf-8"))
time.sleep(3)
s.close()
if __name__ == "__main__":
main()
Thank you very much for your answer.
As shown above, this is a code for controlling the robotic arm to perform the “movel” movement under the condition of setting the “blend radius” to 0.
It can be observed that when the robotic arm reaches the halfway position of its movement, which is [0.1 0 0.1], its speed cannot reach the maximum speed. Therefore, the robotic arm should slow down.
So the question arises: What is the deceleration rate? If I want the robotic arm to move seamlessly from the end_pose back to the start_pose without any pauses, should I precisely modify the ‘time.sleep’ function?
Needs to run in interpreter mode so motion instructions will be queued and no need to delay awaiting motion complete.