The Wayback Machine - https://web.archive.org/web/20200619081233/https://github.com/bulletphysics/bullet3/issues/2412
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the differences between the supported control modes #2412

Open
diegoferigo opened this issue Sep 19, 2019 · 2 comments
Open

Clarify the differences between the supported control modes #2412

diegoferigo opened this issue Sep 19, 2019 · 2 comments

Comments

@diegoferigo
Copy link

@diegoferigo diegoferigo commented Sep 19, 2019

Reading the documentation, it is not entirely clear to me what are the differences of the joint control modes supported in pybullet.

I try to recap them here, please @erwincoumans feel free to jump in to add more details and address holes in my understanding.

Let's assume that in all cases (excluding torque), the reference error is the following:

error = kp *  (pos_des - pos) + kd * (vel_des - vel)
  • VELOCITY_CONTROL: This is a pure proportional control for velocity that by default has kp=0 and kd=1. Gains should be in the range [0, 1].
  • POSITION_CONTROL (alias for CONTROL_MODE_POSITION_VELOCITY_PD): Similar to VELOCITY_CONTROL. By default it has kp=1 and kd=0. It allows to optionally specify both the target position and target velocity.
  • TORQUE_CONTROL: It should be enabled by disabling the default motorized joints passing a force=0. Later calls using this mode will send directly the torque to the joint.
  • PD_CONTROL: Similar to POSITION control but it allows specifying not normalized gains.

Questions:

  • Is kp ignored in VELOCITY_CONTROL?
  • What is the logic behind the normalized gains in VELOCITY_CONTROL and POSITION_CONTROL?
  • Is kd=0 by default in POSITION_CONTROL?
  • Is correct that in POSITION_CONTROL if kd=0 and a velocity reference is specified, it has no effect?
  • Is the description of PD_CONTROL correct? There's not much information about it.
  • Should PD_CONTROL with kp=0 and kd=1 behave as VELOCITY_CONTROL?

I think that a big difference of PD_CONTROL with respect to POSITION and VELOCITY is how the error is treated. I suspect that in the former case a joint force is generated, in the latter ones instead the error is minimized as constraint. Is this correct?

Related issues #2152 #1026

@Steven89Liu
Copy link
Contributor

@Steven89Liu Steven89Liu commented Sep 26, 2019

i also have these questions, thanks in advance.

@raunaqbhirangi
Copy link

@raunaqbhirangi raunaqbhirangi commented Jun 13, 2020

I think it's evident from the switch case here that PD_CONTROL and POSITION_CONTROL should have identical behavior.

I had an additional query. When using PD_CONTROL, the getJointState function seems to be returning zeros for the appliedJointMotorTorque return value. Is this intended behavior? I had imagined that this function would work for PD_CONTROL in the same way that it does for POSITION_CONTROL and VELOCITY_CONTROL. Not sure if this should be a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.