Servoj: why does it not reach last position?!

Hello,
using servoj by slicing a simple point to point movement using a loop shows unexpected behaviour: The calculated target point is not reached. If i vary the number of slices by running the loop different times (starting with running loop 10 times at 100mm path to running it 2000 times at same pathlength), the miss in path length keeps the same, nearly 3mm (as i can measure).
If i do the same with movel command the cobot really precisely reaches the target point
Does anyone knows this problem and can explain it to me?
Thanks in advance.

Hello again,
it became better by changing the lookahead_time to the min (0.03) and gain to the max (2000) value, but is still there. So is there a parameter that behaves like the I-term of PID controller like the gain does like the p-term (like written in script manual 13.1.34, page 38)??
Was able to tune it using the stopj(a), that made the cobot overshoot a bit (over the short missed target point). But this is little too fuzzy in my eyes.
Would really like to understand and know!
Best regards!
Hannes

With ServoJ there is no guarantee that you will actually reach your target. If there is not enough time or your step is too large it might never reach it. The function heavily relies on constantly being fed with new targets. It does not know what the next target will be and can therefore not act accordingly(ie begin to decelerate near the end). Therefor it is also important to stop it nicely otherwise your can potentially get some high deacellerations.

To compensate for this you have at least 2 options:

  1. is to add a movej/movel after your loop with the last target of your list. This is by far the easiest way and it will also make sure you decelerate nicely while reaching the target that you were aiming for.

  2. A different way Is to check if your target is the last target (for instance if they are in a list) and then add a loop around the servoj until your target speeds are below a certain threashold. Something along these lines:

    if(last_target):
        while(norm(get_target_joint_speeds()) > 0.0001):
            servoj(target_q)
        end
    else:
        servoj(target_q)
    end

I hope it answers your question.

2 Likes

We are experiencing a similar issue with our ur10 were the arm is not reaching the target or does so by only going halfway. I think the method you mentioned is a good solution but Iā€™m not sure how it would be implemented.