## What accuracy to expect for trajectory tracking using position control

Official Python bindings with a focus on reinforcement learning and robotics.
paperstiger
Posts: 4
Joined: Thu Jun 27, 2019 8:54 pm

### What accuracy to expect for trajectory tracking using position control

Hi all, I am using pybullet to simulate ur5 robot. I have a trajectory (time stamped joint configuration and velocity) that I want to track. What my code does is basically

Code: Select all

``````for i in range(self.eeId - 1):
p.setJointMotorControl2(self.robotId, i + 1, p.POSITION_CONTROL,
target_p[i], target_v[i], positionGain=1, velocityGain=0.5)
``````
where target_p and target_v are calculated from evaluating a function which does interpolation.

This code sort of works but has unsatisfactory trajectory tracking error (maximum of 0.01 for some joint). I calculate this error by comparing the logged joint angles and target_p. It is like (the subplot below)

I found that:
1. increase positionGain does not improve tracking accuracy once it reaches a value like 1.

My question is:
1. How on earth is position control implemented?
2. Is there anyway to improve this tracking accuracy since this is quite essential to my application?

steven
Posts: 65
Joined: Mon Nov 05, 2018 8:16 am
Location: China

### Re: What accuracy to expect for trajectory tracking using position control

Could you provide a complete simple test? i can work with you to find the root cause.

paperstiger
Posts: 4
Joined: Thu Jun 27, 2019 8:54 pm

### Re: What accuracy to expect for trajectory tracking using position control

steven wrote:
Fri Jun 28, 2019 1:39 am
Could you provide a complete simple test? i can work with you to find the root cause.
Here you go. I am sharing a minimum test case and you can download it from here.

steven
Posts: 65
Joined: Mon Nov 05, 2018 8:16 am
Location: China

### Re: What accuracy to expect for trajectory tracking using position control

why did you said "maximum of 0.01 for some joint"? i add the following to print the max delta, the value is about 0.006. how much tracking accuracy do you need? the accuracy is very high if don't care about the velocity.

max value= 0.006000822848596599

paperstiger
Posts: 4
Joined: Thu Jun 27, 2019 8:54 pm

### Re: What accuracy to expect for trajectory tracking using position control

steven wrote:
Sun Jun 30, 2019 5:45 am
why did you said "maximum of 0.01 for some joint"? i add the following to print the max delta, the value is about 0.006. how much tracking accuracy do you need? the accuracy is very high if don't care about the velocity.

max value= 0.006000822848596599
Actually I do care about velocity and want to improve this accuracy as much as I could.

Did you try the second test case, using python minimum_debug_case.py 1? I bet in that case, stranger things will happen.

steven
Posts: 65
Joined: Mon Nov 05, 2018 8:16 am
Location: China

### Re: What accuracy to expect for trajectory tracking using position control

in the second case, the robot collides with the ground which will impact the links and joints of the robot.

paperstiger
Posts: 4
Joined: Thu Jun 27, 2019 8:54 pm

### Re: What accuracy to expect for trajectory tracking using position control

steven wrote:
Mon Jul 01, 2019 12:47 pm
in the second case, the robot collides with the ground which will impact the links and joints of the robot.
Wait, really? I should have used the software with GUI turned on.