# Implement impedance control - Inertia and jacobian matrix

**URL:** <https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600>\
**Category:** Technical Questions\
**Tags:** mechanical, force-torque, kinematics\
**Created:** [March 8, 2020, 1:43pm UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600 "2020-03-08T13:43:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![oren.spector](https://avatars.discourse-cdn.com/v4/letter/o/85f322/32.png) [@oren.spector](https://forum.universal-robots.com/u/oren.spector)\
**Post date:** [March 8, 2020, 1:43pm UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600/1 "2020-03-08T13:43:09Z")

</div>

Hello all,

I need H,J of the robot to perform trajectory in the eef in real-time. I didn’t find any note or explanation of how it can be done. for clarity, i would like to define parameters and receive it as input via rtde for every robot position.

thanks.

---

<div class="post-metadata">

**Author:** ![anon79053281](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon79053281](https://forum.universal-robots.com/u/anon79053281)\
**Post date:** [March 9, 2020, 8:44am UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600/2 "2020-03-09T08:44:40Z")

</div>

Do you want to control UR robot and receive actual position data from it in real-time?

---

<div class="post-metadata">

**Author:** ![oren.spector](https://avatars.discourse-cdn.com/v4/letter/o/85f322/32.png) [@oren.spector](https://forum.universal-robots.com/u/oren.spector)\
**Post date:** [March 9, 2020, 9:14am UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600/3 "2020-03-09T09:14:13Z")

</div>

I need H,J to convert eef movements to joint moments.

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [March 9, 2020, 3:07pm UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600/4 "2020-03-09T15:07:45Z")

</div>

It is not completely clear to me what you need and why. Maybe this is what you are looking for:  
[https://www.universal-robots.com/how-tos-and-faqs/faq/ur-faq/parameters-for-calculations-of-kinematics-and-dynamics-45257/](https://www.universal-robots.com/how-tos-and-faqs/faq/ur-faq/parameters-for-calculations-of-kinematics-and-dynamics-45257/)  
You can also take a look at the script functions:

- get\_inverse\_kin(x, qnear, maxPositionError=1e-10,maxOrientationError=1e-10, tcp=’active\_tcp’)
- get\_actual\_joint\_positions()

---

<div class="post-metadata">

**Author:** ![oren.spector](https://avatars.discourse-cdn.com/v4/letter/o/85f322/32.png) [@oren.spector](https://forum.universal-robots.com/u/oren.spector)\
**Post date:** [March 9, 2020, 4:43pm UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600/5 "2020-03-09T16:43:34Z")

</div>

I am trying to implement some sort of impedance control method in real time, i thought using H,J to compute the joint torques but now i understand there is no function to command torques.  
now i am trying to figure out other ways. I have tried movej,movep using rtde+register but both are updated only after the robot rich the joint/position goal. i also tried force\_mode but the robot does not move smooth using this command.

so to maybe summary the question, how can i implement something simple like PD controller in eef space(in real time)?

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [March 9, 2020, 7:08pm UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600/6 "2020-03-09T19:08:29Z")

</div>

You can use the script function  
get\_joint\_torques()  
to get the joint torques. If you are targeting to realize a close loop. You can take a look at the force mode function  
force\_mode(task\_frame, selection\_vector, wrench, type, limits)

---

<div class="post-metadata">

**Author:** ![oren.spector](https://avatars.discourse-cdn.com/v4/letter/o/85f322/32.png) [@oren.spector](https://forum.universal-robots.com/u/oren.spector)\
**Post date:** [March 9, 2020, 7:14pm UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600/7 "2020-03-09T19:14:16Z")

</div>

Is there any good material on force\_mode? Do I need to add the tool mass when I command in z-axis?  
just feedback as a customer, There is not much organize information on how to work on the robot for research purposes.

---

<div class="post-metadata">

**Author:** ![hade](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hade](https://forum.universal-robots.com/u/hade)\
**Post date:** [March 23, 2020, 11:50am UTC](https://forum.universal-robots.com/t/implement-impedance-control-inertia-and-jacobian-matrix/6600/8 "2020-03-23T11:50:37Z")

</div>

Please, check the following link

[https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/urscript-dynamic-force-control-20571/](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/urscript-dynamic-force-control-20571/)
