frankaemika/franka_ros

[docs] Explenation to CartesianImpedanceExampleController

Opened this issue · 4 comments

Hey,
I'm working on a project where I build something similar to the cartesian impedance controller. So I started to try to understand how this example is working. However I have a hard time understanding the physics and math behind the controller just from looking at the code. I'm just in the process of trying to understand the equations using dimensional analysis.
Can you offer some more in depth explanations of how the math and physics of the Controller is working? A link would help as well.
I could imagine contributing some documentation for this controller, because I think it is really useful for a lot of applications.

So basically I have a hard time to understand how the Torque dimension in tau_task and tau_nullspace (M L2T-2) is composed here.

Which dimensions and units do the variables: cartesian translational/roational stiffness/damping and (jointspace) nullspace stiffness/damping have.
Stiffness is translational: M L2T−2 (Unit: N/m) or rotational: M L1T−2 (Unit: N/rad).
The damping variables are calculated depending the stiffness: damping = 2* sqrt(stiffness). The comment says damping ration = 1, which may refer to damping. However I'm missing the mass here. So where does this equation comes from?
And in consequence which dimensions have the different damping variables?

Futher just for sanity check PD control in the commend means: Proportional and differential control. The proportional part is stiffness * cartesian_error/ stiffness * joint_error and differential is damping * jacobian * joint_velocity/damping * joint_velocity ? However for tau_task booth components are substracted as in tau_nullspace the proportional part is added and the differential is substracted? I tested it and it is correct like this, but I don't get why.

Further I wonder for tau_nullspace about the first factor: Here transposed pseudo inverted Matrix is multiplied with the transposed jacobian, so we get an 7x7-Matrix, which should be the identity matrix by definition(not sure I read/remember this correctly), or? So the more or less the first factor get's zero. So what does it mean to create the pseudo inverse of the jacobian for a q? However the first factor must be L2. Which makes sense if we multiply the jacobian with another jacobian.

Further for applying new stiffness and equilibrium poses, the controller uses a digital infinit low-pass filter. The filter parameter α is defined α = dt/RC-dt with an α of 0.005. Is this a random number or maybe dependend on the 1kHz control loop frequency?

I'm learning a lot in the process. Thank you for your patience!

For the start, I would recommend you to read the paper:

It should give you a good overview of the maths regarding Cartesian impedance controller.

@Maverobot Hello, may I know why there is no gravity term when computing the tau_d? This term is added by tau_d << tau_task + tau_nullspace + coriolis, which are from Cartesian PD control, nullspace PD control, and the coriolis effect. Could you please explain that? Thank you.

Hi @Yitian-Xian, the gravity term can be considered as part of tau_task.

Cheers,
Zheng

@Maverobot Hi, thank you for your answer. However, I find it very hard to understand. First of all, in your recommended paper, from Equation 10, we can see that there is a gravity term over there. In addition, what if the current pose is equal to the desired pose, it seems that in this situation tau_task would be zero.

I am very confused. Could you please explain it further? Thank you very much!!