Modifying inertia matrix and inertia frame for a body

Typically: "How do I... ", "How can I... " questions
Post Reply
maxdox
Posts: 4
Joined: 26 Dec 2013, 16:56

Modifying inertia matrix and inertia frame for a body

Post by maxdox »

Hi all,
I have a problem with the settings concerning the inertia matrix and the inertia frame.

I have a rigid body with a complex shape (not a primitive shape). I computed the position of the center of mass of that shape with respect to a frame centered in a bounding box (I used MeshLab for doing that).
I also computed the inertia matrix with respect to a frame centered in the bounding box. The resulting matrix is not diagonal as expected, because with respect to the reference frame there is not a uniform distribution of mass and not even of volume. The products of inertia (the elements outside the main diagonal of the inertia tensor) are therefore not null.

I thought to insert these information in V-Rep, in order to have a more realistic dynamic behavior of the body (instead of simplifying things and neglect the products of inertia or consider the center of mass coincident with the center of the bounding box).

I did in the following way: in the 'rigid body dynamic properties', I set up the coordinates of the center of mass (computed with respect to the center of the bounding box) in 'Position of the inertia frame', using the edit boxes 'X', 'Y' and 'Z', and selecting 'Shape frame' to specify that the coordinates are relative to a frame centered in the bounding box (is it correct up to here?).
For the inertia matrix, I simply edited the 'inertia matrix' window and inserted the values that I computed in MeshLab. My inertia tensor was relative to a frame centered with the bounding box of the shape, and oriented like the shape frame in V-Rep (all computations were also relative to a unit mass), so I left selected the radio button 'Inertia & COM are relative to shape frame'.

The problem comes when I click on OK to accept the changes. I noted in fact that as a consequence of having specified non-null elements outside the main diagonal of the inertia matrix, the edit boxes relative to Euler angles 'alpha', 'beta' and 'gamma' (orientation of the interia frame) change automatically value to something that is different from zero (significantly far from zero). Why? In my opinion this should not happen. In fact I don't want to change the orientation of the inertia frame.
Ultimately, I have three frames, all parallel: the world frame (absolute frame), the inertia frame (centered in the center of mass of the shape) and the shape frame (centered in the bounding box). The fact that the inertia matrix has non-null elements outside the main diagonal, doesn't mean automatically that there is a different orientation between the inertia and the shape frame. In my case in fact this corresponds to a non regular distribution of the volume and of the mass around the main axis of the shape frame (and also of the inertia frame).

Is there something that I'm missing or I'm misunderstanding?

Thank you all for the attention and for your help,

Massimo

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Modifying inertia matrix and inertia frame for a body

Post by coppelia »

Hello Massimo,

for every body, you can find an inertia matrix that is diagonal. This of course depends on the reference frame you express the inertia matrix in.
V-REP will automatically compute that frame, that's why you will see alpha/beta/gamma change automatically and have the non-diagonal items vanish. So for the inertia frame, you have to imagine the shape frame, transformed by the alpha/beta/gamma and x/y/z values. This might appear as a little bit confusing.

The best approach is to calculate the inertia relative to the absolute reference frame (in Meshlab for instance), then enter that information in V-REP by not forgetting to select relative to world.

You can verify if everyrthing looks ok by right-clicking in a view [popup menu --> View --> Visualize inertias]. The inertia frames will be displayed in purple/red for all dynamic objects that are visible (you might have to toggle or inverse the visibility layers to see them).

Cheers

maxdox
Posts: 4
Joined: 26 Dec 2013, 16:56

Re: Modifying inertia matrix and inertia frame for a body

Post by maxdox »

first of all thank you for your prompt and detailed reply ...second: happy new year to you all!

In the last days I tried to modify the Kuka LWR4 model, available in last releases of V-Rep, in order to insert more realistic data for dynamic simulations.

I changed masses, inertia matrices and position of the center of masses for each link. Enabling the visualization of link's inertias (and properly adjusting their visibility layers) I verified the changes that I introduced. Red boxes and inertia frames from the graphic seem to be oriented as wanted, but something must be wrong, because as a side effect of having changed the orientation of the intertia matrices, now the links do not anymore properly rotate around their mobility axes.

Running the default LUA script associated to this model, you can see that the links move like if their axes of rotation were differently oriented with respect to their joint axes.

I don't understand the reason of this behavior and how can it be related to the changes carried out on the inertia matrices.

You can download and run the Kuka LWR4 modified model here:

http://www.dis.uniroma1.it/~labrob/peop ... a_LWR4.ttt

Any help will be greatly appreciated.
Thank you in advance,

Massimo

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Modifying inertia matrix and inertia frame for a body

Post by coppelia »

Hello Massimo,

try to run the simulation with Bullet, then ODE, finally with the Vortex engine. You will notice that Vortex handles your scene without any apparent problem. The reason is that Bullet and ODE have high limitations in various aspects (they are often refered to as game engines). Have a look at the dynamics design considerations, mainly design considerations 6, 7 and 8 in your case.

But in short: with Bullet and ODE, one has to cheat in many cases, otherwise simulation will not be stable.

Cheers

maxdox
Posts: 4
Joined: 26 Dec 2013, 16:56

Re: Modifying inertia matrix and inertia frame for a body

Post by maxdox »

Great! Thank you so much for your suggestions!

I installed the latest V-REP release and I run the simulation using Vortex.
Using this engine the simulation is now correct and the dynamical behavior is consistent with the phisics of the system.

Thank you again for your precious help,

Massimo

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Modifying inertia matrix and inertia frame for a body

Post by coppelia »

Hello again Massimo,

I have a quick question: where did you get the mass and inertia values from? Do you have a document?
Also, when you entered the inertia matrices, did you enter the massless values? I.e. the inertia values divided by the mass?

Cheers

maxdox
Posts: 4
Joined: 26 Dec 2013, 16:56

Re: Modifying inertia matrix and inertia frame for a body

Post by maxdox »

Hi,
I computed the link masses empirically, considering the disposition of the motors inside the links.
I distributed the total weight of the robot arm in this way:

link 0 (the fixed part of the manipulator - before joint 1): 1.35 Kg
link 1, 2, 3, 4: 2.7 Kg
link 5: 1.7 Kg
link 6: 1.6 Kg
link 7 (in my case it also includes an end-effector similar to a pen, but larger and made of alluminium): 0.4 Kg

The total sum is 15.85 Kg, very close to the weight of the real robot.

All inertia matrices have been computed in MeshLab with reference to a unitary mass, considering only the shapes of the links (that are empty inside), but WITHOUT considering the motors, that occupy volume inside the links and make the overall distribution of mass not uniform.

My goal was to obtain a dynamic model in V-rep identical to the dynamic model that I used in my motion planner (a plugin that I developed for Kite, a Siemens software application).
I collected all dynamic parameters in a short document. If you think that it can be of any help, I can share it in with the forum together with the final version of my V-rep model for the LWR4.

Cheers,

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Modifying inertia matrix and inertia frame for a body

Post by coppelia »

Thank you Massimo,

Yes, that would be great if you could make that document available on the forum!

Cheers

Post Reply