Friction coefficient using tilt plane

Post Reply
Ehsanizadi
Posts: 72
Joined: Mon Dec 02, 2013 4:13 pm

Friction coefficient using tilt plane

Post by Ehsanizadi »

Hey all,

I put a cuboid block on a plane and tilted the plane very slowly (about half degree in 10 seconds) to see at which angle of inclination the block will slide. I did the test for various friction coefficients for the contact between block and the plane.
As a physical rule, the input friction ratio should be equal to tangent of the sliding angle of the plane, i.e:
a = tan (theta)
where:
a = input friction ratio
theta = angle at which sliding of block starts
Here is the result in form of a graph: (a vs tan (theta), [a on horizontal axis and tan(theta) on vertical axis]
[img]https://onedrive.live.com/redir?resid=1 ... hoto%2cbmp[/img]

The blue dashed line indicate the 1:1 line which the results should fit on that, however after 0.4 of input friction there is deviation in the results.

Note:
I am aware that in bullet the friction coefficient of a contact is calculated by multiplication of the friction coefficients of two contacting bodies. So, in the graph, "input friction ratio" indicates the resultant of muptiplication of friction coefficients of two contacting bodies.


Thank you for your help.
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Friction coefficient using tilt plane

Post by drleviathan »

Today I noticed a bug in btRigidBody::applyImpulse() where the linear component of impulse is not correctly computed when the impulse is applied at a non-zero offset from the RigidBody's center of mass. I've submitted a fix for the bug here: https://github.com/bulletphysics/bullet3/pull/272

It occurs to me that this might be the source of some discrepancy in friction behavior. Friction forces would be applied at the contact points, which are offset from the block's center of mass, and if the results of contact are communicated to the block through calls to applyImpulse() under the hood (*), then the bug would insert inaccuracies into the block's resultant velocity from contact.

You can test my theory by using a flattened block instead of a cube. When the block is more like a flat square, with a center of mass as close to the ramp's surface as possible, then friction impulses from the ramp will point more parallel to the offset vector and the resultant impulses imparted will be more physically correct.

Alternatively, you could apply the patch yourself and test the cube again.

(*) After a quick hunt it appears that simple collisions, and many of the constraint solvers, do indeed use applyImpulse() with non-zero offsets.
Ehsanizadi
Posts: 72
Joined: Mon Dec 02, 2013 4:13 pm

Re: Friction coefficient using tilt plane

Post by Ehsanizadi »

Thanks for your reply.

Actually, I already used a flattend block. Because if I'd have used a block with "height-to-width" ratio of considerable, overturning moments would incluence the results.
As you said, I played with the height of the blocks, but still there is no change in the results!

I am not sure, but based on the results I got, I don't think Bullet calls "applyImpluse()" under the hood! (i.e. when Bullet solves collisions internally). Because if it would have called that function, the results would have been affected already by that.

If applyImpulse() is called internally in Bullet for collision resolution, we could not see the over turning of any blocks when they are tilted (with high friction ratio). You can try it. Put a block (not vry flattened one) on a plane with coefficient of friction of 1 for example. and then tilt the plane slowly, you will see, instead of sliding, it overturns. (Corret me if I am wrong)

If so, still frictional force application is a question!
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Friction coefficient using tilt plane

Post by drleviathan »

Yeah, I take it back. There is no bug in btRigidBody::applyImpulse(). My logic applies to the special case I was working on when I "discovered" the bug, but not in general. I closed that pull request.

I guess the discrepancy of static friction in Bullet from the theoretical is just a quirk in how the contact points work. For games it is good enough but maybe not accurate enough to demonstrate some physics phenomena.

However... it just occurred to me that another thing you might try is to decrease the time step used in your simulation. Do your results change when increasing resolution to 120 fps, or higher?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Friction coefficient using tilt plane

Post by drleviathan »

Another idea: I think there is some default damping in the Bullet physics engine but I'm not sure how to turn it off. You can work around the damping (e.g. make it negligible) by increasing the mass of your block. Since you're colliding a block with mass against a ramp with infinite mass there are no mass ratio instabilities to worry about so you can make your block almost as massive as you like.
Ehsanizadi
Posts: 72
Joined: Mon Dec 02, 2013 4:13 pm

Re: Friction coefficient using tilt plane

Post by Ehsanizadi »

Even changing time step, iteration number (which is the main parameter for accuracy of phsysics), and also frames per second, all did not have any effect.

Based on the coulomb friction law, whcih bullet uses, mass does not affect the friction ration at sliding threshold. If it does, it will be strange.

But anyhow, for more assurance, I tried it also.

Still wondering.... :?:
Post Reply