#### Discussion

Back to discussions page
The script manual says to use servoj(q, a, v, t=0.002, lookahead_time=0.1, gain=300) where a and v are not used at this time. When I use movel and movej, I can set the a,v for motion control. How do I control the robot acceleration and velocity for servoj?

• Posts: 965Founding Pro, Tactile Sensor Beta Testers Handy
With the servoj command you are responsible for planning the path, you tell it how far you want to move in the next cycle of the clock, 0.008 s for CB3 or 0.002 s for e-series.

You have to provide the acceleration and deceleration at the start and end of the motion by dictating how far it’s moving in the next clock cycle.
• Thank you so much for the quick reply.

Ok, so I have to tell it how far to move in the next clock cycle. Let's say that I have two waypoints 100 mm apart. How do I tell the servoj that I want to accelerate at 5 mm /s^2 to a velocity of 50 mm/s? Can I get the robot to calculate the changing distance at a given acceleration and then take the distance/0.002 s as the constant velocity? Then if I assume that I can calculate these values, how do I chop up the 100 mm span between my desired waypoints into distance/0.002 s segments?

What I am actually trying to do is draw a circle with .1 m radius. I am using x=rcos(theta), y=rsin(theta) to convert polar to cartesian. Then I calculate 360/theta to determine how many waypoints I need to complete a full circle. servoj works nicely to get a smooth rotation around the circle but as per my question, I have no control over the acceleration and velocity.

By your logic it seems that I need to calculate the distance the robot moves in 0.002 s while traveling at 50 mm/s which is 0.0001 m but the resolution of the robot is larger than 0.0001 m. How will the robot behave? Theta = ATAN (.0001 m /.1 m) = .06 degrees.

If I place .06 degrees back into x=rcos(theta), y=rsin(theta) to convert to cartesian coordinates to send the servoj to, the robot moves way slower than 50 mm/s. I have to put 5 degrees into theta to get reasonable speed at .1 m radius. The good news is that I can control speed but it feels like a black box because placing 5 degrees in for theta doesn't makes any sense. Moreover, I am stumped as to how to write an equation to calculate the changing distance/0.002 s while we accelerate to constant velocity.

I have attached the UR-10e URP file to show what I am doing if that helps.