Page 1 of 1

What accuracy to expect for trajectory tracking using position control

Posted: Thu Jun 27, 2019 9:05 pm
by paperstiger
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)

Image

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?

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

Posted: Fri Jun 28, 2019 1:39 am
by steven
Could you provide a complete simple test? i can work with you to find the root cause.

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

Posted: Fri Jun 28, 2019 3:41 pm
by paperstiger
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.

https://drive.google.com/file/d/1W6iPNO ... sp=sharing

Thank you for your time.

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

Posted: Sun Jun 30, 2019 5:45 am
by steven
thanks for your sharing.
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.

print("max value=", np.max(robotlog[mask,17:23] - qeval))
max value= 0.006000822848596599

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

Posted: Sun Jun 30, 2019 4:38 pm
by paperstiger
steven wrote: Sun Jun 30, 2019 5:45 am thanks for your sharing.
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.

print("max value=", np.max(robotlog[mask,17:23] - qeval))
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.

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

Posted: Mon Jul 01, 2019 12:47 pm
by steven
in the second case, the robot collides with the ground which will impact the links and joints of the robot.

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

Posted: Tue Jul 02, 2019 2:46 am
by paperstiger
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.