xbpeng / DeepMimic

Motion imitation with deep reinforcement learning.
https://xbpeng.github.io/projects/DeepMimic/index.html
MIT License
2.27k stars 485 forks source link

Estimate kd and kp for PID controller #174

Open tfederico opened 2 years ago

tfederico commented 2 years ago

Hello,

how did you estimate the values of kp and kd for the humanoid?

If I were to develop a different model, how could I estimate the 2 parameters?

tfederico commented 2 years ago

I am trying to build a robotic hand model controlled using pybullet. However, I am having some issues regarding the tuning of the PD controller.

Simulated and kinematic models are working properly, but when I set the PD controller parameters and try to apply an action this happens.

@xbpeng do you have any suggestion about how to perform PD controller tuning?

xbpeng commented 2 years ago

cool, thats a neat looking hand! In your video, it kind of seems like there are no forces being applied to the joints? They just seems to kind of fall over. It could be that your PD gains are too small, so it's not really applying large enough forces to hold the target pose. In general, I set kd = 0.1kp, and then just tune kp until it can track a desired motion close enough. You also want to make sure the gains are not too large, else the movements become too stiff. So set them to be just large enough to do what you while, while also not being too stiff.

tfederico commented 2 years ago

I tried estimating the parameters for the PD controller but it didn't work, so I switched to a position controller and it's following the reference motion.

Do you have any idea why? My guess is that it's related to the fact that the hand base is not moving in the 3D space, so it's different from the humanoid scenario.