Page 1 of 1

Joint friction

Posted: Thu May 16, 2019 1:53 pm
by kapsl
Hi,
we are currently trying to simulate a 7DOF robot arm as close to reality as possible. We therefore want to have joint friction in Torque Control Mode.

I read that it is possible to emulate this over setting the force in
self._p.setJointMotorControlArray(self.kuka_uid, self._motor_indices, self._p.VELOCITY_CONTROL, forces=np.zeros(len(self._motor_indices)))
to a small value.

But originally there should be also the options
self._p.changeDynamics(self.kuka_uid, self._motor_indices, lateralFriction=friction,
rollingFriction=friction,
spinningFriction=friction,
frictionAnchor=1000)

I am not sure, what is the right friction here. But actually nevertheless what number i put in there, I did not see any difference?

Thanks!

Re: Joint friction

Posted: Fri May 17, 2019 1:45 am
by steven
kapsl wrote: Thu May 16, 2019 1:53 pm self._p.setJointMotorControlArray(self.kuka_uid, self._motor_indices, self._p.VELOCITY_CONTROL, forces=np.zeros(len(self._motor_indices)))
i think this is a method to simulate the joint friction, like the angularDamping.
kapsl wrote: Thu May 16, 2019 1:53 pm self._p.changeDynamics(self.kuka_uid, self._motor_indices, lateralFriction=friction,
rollingFriction=friction,
spinningFriction=friction,
frictionAnchor=1000)
these values take effect only when have some contact with other body.

Re: Joint friction

Posted: Fri May 17, 2019 8:49 am
by kapsl
What do you mean, "like the angular damping" Damping is something I can set and it works?!

Re: Joint friction

Posted: Fri May 17, 2019 9:12 am
by steven
1. p.setJointMotorControl2(obj,1,p.VELOCITY_CONTROL,targetVelocity=0,force=frictionForce)
2. p.changeDynamics(obj,j,linearDamping=value1, angularDamping=value2)

for my understanding, these two get the similar result with different methods. you can try it and see if get what you want.

Re: Joint friction

Posted: Fri May 17, 2019 9:16 am
by kapsl
Hi,
and thanks for your answer. Ok that makes sense! I do some system identification currently where I just use the second method with damping (currently the same value for linear and angular). Interestingly we partly get really large (and sometimes also negative) values, where the trajectory is most similar to the real robot. (negative dampings does not really make sense?!)

Do you know what exactly is the linear and angular damping in the joint?

Re: Joint friction

Posted: Sun May 19, 2019 10:42 am
by steven
you can google the damping then you can know what the damping is used for.
the damping force is a resistence that proportional to the velocity but in the opposite direction. as for the implementation in this engine, honestly so far i still don't understand what that equation below comes from. for more details you can refer to the function of btMultiBody::computeAccelerationsArticulatedBodyAlgorithmMultiDof() which is the most important function for the multibody, i think so at least.

Code: Select all

//adding damping terms (only)
const btScalar linDampMult = 1., angDampMult = 1.;
zeroAccSpatFrc[0].addVector(angDampMult * m_baseInertia * spatVel[0].getAngular() * (DAMPING_K1_ANGULAR + DAMPING_K2_ANGULAR * spatVel[0].getAngular().safeNorm()),
                            linDampMult * m_baseMass * spatVel[0].getLinear() * (DAMPING_K1_LINEAR + DAMPING_K2_LINEAR * spatVel[0].getLinear().safeNorm()));