## Set internal friction of joints

Typically: "How do I... ", "How can I... " questions
Jay
Posts: 11
Joined: 14 Oct 2015, 16:34

### Set internal friction of joints

Hi,

I am simulating a tracked vehicle and modeled each track as five rollers. I need to calculate joints energy consumption of the whole system, I did this by the following two methods:
1. Set desired torque to joints by giving a very high desired velocity (999999) first, read joint velocity and actual joint torque, then do the calculation;
2. Set desired velocity to joints, for example, 2 m/s, read joint torque and actual angular velocity, then do the calculation.

When using method 1, the vehicle will keep accelerating to a high velocity, which is not preferred. My question is how to set the maximum velocity in this torque control mode.

When using method 2, the desired velocity will be reached in a very short time, after that, the torque is nearly zero because there is no internal friction in the joints. I searched previous posts, the admin gave the solution as setting the desired velocity of the joint as zero, then the max. force/torque will act as the joint internal friction. The question is how can we set an internal friction in joints when the desired velocity is not zero. Thanks a lot for any help.

Regards,
Jay

coppelia
Posts: 7928
Joined: 14 Dec 2012, 00:25

### Re: Set internal friction of joints

Hi Jay,

for 1, if you want to limit the max. velocity of your joints, simply set its target velocity to what is needed. You can also do this programmatically with simSetJointTargetVelocity.

About question 2: this will depend on the used physics engine. With Bullet/ODE/Newton, you cannot do this. With Vortex, there is a parameter that you can set: Joint axis friction. With the other engines, you could always programmatically compensate for the internal friction (e.g. by subtracting a given value to the torque you apply to your joint).

Cheers

Jay
Posts: 11
Joined: 14 Oct 2015, 16:34

### Re: Set internal friction of joints

coppelia wrote:Hi Jay,

for 1, if you want to limit the max. velocity of your joints, simply set its target velocity to what is needed. You can also do this programmatically with simSetJointTargetVelocity.

About question 2: this will depend on the used physics engine. With Bullet/ODE/Newton, you cannot do this. With Vortex, there is a parameter that you can set: Joint axis friction. With the other engines, you could always programmatically compensate for the internal friction (e.g. by subtracting a given value to the torque you apply to your joint).

Cheers

When doing a simulation with Bullet/ODE/Newton engines, since we cannot add internal friction to the joints. So when the vehicle move on a flat terrain, once an impulse torque input is given, the vehicle will keep running forever without any further torque input. But the real thing is the motor need continuous torque to keep moving. How can we programmatically compensate friction in this situation.

Regards,
Jay

coppelia
Posts: 7928
Joined: 14 Dec 2012, 00:25

### Re: Set internal friction of joints

Ok, there is actually one other way to mimic the friction in a joint. For that, you need to set a linear/angular damping factor to the dynamic shape attached to the joint: the damping of that body will gradually dissipate the translational/rotational movement. You can do this in the material properties.

Cheers

hajs
Posts: 4
Joined: 20 Nov 2019, 10:18

### Re: Set internal friction of joints

Jay wrote:
11 Nov 2015, 01:23
Hi,

I am simulating a tracked vehicle and modeled each track as five rollers. I need to calculate joints energy consumption of the whole system, I did this by the following two methods:
1. Set desired torque to joints by giving a very high desired velocity (999999) first, read joint velocity and actual joint torque, then do the calculation;
2. Set desired velocity to joints, for example, 2 m/s, read joint torque and actual angular velocity, then do the calculation.

When using method 1, the vehicle will keep accelerating to a high velocity, which is not preferred. My question is how to set the maximum velocity in this torque control mode.

When using method 2, the desired velocity will be reached in a very short time, after that, the torque is nearly zero because there is no internal friction in the joints. I searched previous posts, the admin gave the solution as setting the desired velocity of the joint as zero, then the max. force/torque will act as the joint internal friction. The question is how can we set an internal friction in joints when the desired velocity is not zero. Thanks a lot for any help.

Regards,
Jay
hey

Please tell me how u did the calculations to find the energy consumption. I am also working on my project on vrep. My next task is to find the energy consumption. How i can perform it?

thanks

coppelia
I think if you have the torque exerted by a joint (i.e. sim.getJointForce) and the angle it has moved, you can compute the energy it dissipated/accumulated.