<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/1033" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2007-05-25T14:35:12+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/1033</id>

		<entry>
		<author><name><![CDATA[bone]]></name></author>
		<updated>2007-05-25T14:35:12+00:00</updated>

		<published>2007-05-25T14:35:12+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4326#p4326</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4326#p4326"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4326#p4326"><![CDATA[
<blockquote class="uncited"><div>What do you mean by this? Do you suggest to differentiate between static and dynamic friction? From the top of my head I remember that the coefficients are nearly the same, so I wonder if this is worth the effort. </div></blockquote>The difference in coefficients can be small or very large.  Take a look the tables on this page for some examples:<br><br><a href="http://www.roymech.co.uk/Useful_Tables/Tribology/co_of_frict.htm" class="postlink">http://www.roymech.co.uk/Useful_Tables/ ... _frict.htm</a><br><br>Lead on mild steel, for example, has a coefficient of 0.95 for both static and dynamic friction.  Near the other end of the scale, zinc on cast iron has a static friction of 0.85 but a dynamic friction of only 0.21!  And then of course a good friction model of lubricated surfaces would require even more complexities including the actual velocity.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=1626">bone</a> — Fri May 25, 2007 2:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2007-05-25T08:28:34+00:00</updated>

		<published>2007-05-25T08:28:34+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4324#p4324</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4324#p4324"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4324#p4324"><![CDATA[
I see that this is a nice optimization since you basically decouple the friction from the normal impulse in the inner loop. On the other hand you don't have any friction at all in the first frame, right? Do you use any heuristic to get an initial first guess (e.g. Erin's first friction solution from his poster session at the GDC)?<br><blockquote class="uncited"><div>PS. One improvement would be the addition of modifying the code to use a static and dynamic friction constant like in the G&amp;B&amp;F paper</div></blockquote>What do you mean by this? Do you suggest to differentiate between static and dynamic friction? From the top of my head I remember that the coefficients are nearly the same, so I wonder if this is worth the effort. Is there any example where this improves the quality of the simulation? <br><br><br><br>Anyway, or there any other ideas to improve friction? <br><br><br><br>Cheers,<br>-Dirk<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Fri May 25, 2007 8:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sbroumley]]></name></author>
		<updated>2007-05-25T05:30:38+00:00</updated>

		<published>2007-05-25T05:30:38+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4323#p4323</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4323#p4323"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4323#p4323"><![CDATA[
Afte reading your e-mail Dog - you are right - you are already doing what I mention.<br><br>My physics code is actually based on a hybrid of Erin's previous paper (GDC 2005) and sequential impulses - so it's a slightly different implmentation, but mathematically equivalent. <br><br>The difference is in my code the limits of the friction constraints are not updated in the inner loop iterations of the solver (only from the previous frames results) - so it's faster, but not quite as accurate.<br><br>Sorry for the confusion.<br>-Steve.<br><br>PS. One improvement would be the addition of modifying the code to use a static and dynamic friction constant like in the G&amp;B&amp;F paper. As an example there's a good open source "JigLib" physics lib by Danny Chapman that has this implemented.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=207">sbroumley</a> — Fri May 25, 2007 5:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dog]]></name></author>
		<updated>2007-05-25T00:47:20+00:00</updated>

		<published>2007-05-25T00:47:20+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4321#p4321</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4321#p4321"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4321#p4321"><![CDATA[
I'm a little confused by this - I'm not sure if what I do is the same as you, or if there is some new thing I should try out.<br><br>Currently I set my friction impulse limit with something like:<br><br>float maxTangentImpulse = frictionConstant * impulseAccumulator;<br><br>where I use the accumulated impulse from the current contact calculation.  Isn't this the same thing? Or is it important to use the previous frame's value, and if so why? Or is this something specific to a central friction model?<br><br>And what do you mean by previous frame, do you mean previous solver iteration, or really previous frame?<br><br>Thanks!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=60">dog</a> — Fri May 25, 2007 12:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sbroumley]]></name></author>
		<updated>2007-05-24T22:48:13+00:00</updated>

		<published>2007-05-24T22:48:13+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4320#p4320</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4320#p4320"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4320#p4320"><![CDATA[
I don't have my home brew code handy, but off the top of my head:<br><br>For contact constraints you should already be warming starting the solver with the previous frames contact normal impulse. Let's call this N for each contact.<br><br>For each friction constraint (I use 2 tangents + 1 twist for each contact manifold like Dirk), you set the constraint min and max limits proportional to the sum of the previous frames contact normal impulses for the whole manifold.<br><br>So<br><br>// Compute sum of previous frames contact manifold normal impulses<br>// (I use up to 4 contacts per manifold)<br>Limit = N0 + N1 + N2 + N3  etc..<br><br>// For each friction constraint:<br>FMax = Limit * k;<br>FMin = -Limit * k;<br><br>where k is a tuneable constant.<br><br>This means the friction limit is a frame behind what it should really be, but it's very easy to implement and it doesn't slow down the solver iteration loop at all.<br><br>You can also pseudo implement static and dynamic friction by changing the limit k depending on the velocity of the contact manifold.  If Vel &lt; threshold use k-static, else use k-dynamic. <br><br>Let me know if this doesn't make sense and I could dig up the code...<br>-Steve.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=207">sbroumley</a> — Thu May 24, 2007 10:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dog]]></name></author>
		<updated>2007-05-24T05:24:30+00:00</updated>

		<published>2007-05-24T05:24:30+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4317#p4317</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4317#p4317"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4317#p4317"><![CDATA[
<blockquote class="uncited"><div>A simple way to improve the friction model is to make the friction force proportional to the previous frames computed contact normal force (as opposed to just a constant like the demo is if I remember correctly).<br><br>This makes stacks look much more realistic as objects at the bottom have more friction and so are harder to push out of the stack as expected.</div></blockquote>Do you have an equation for that?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=60">dog</a> — Thu May 24, 2007 5:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sbroumley]]></name></author>
		<updated>2007-05-24T01:22:38+00:00</updated>

		<published>2007-05-24T01:22:38+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4315#p4315</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4315#p4315"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4315#p4315"><![CDATA[
A simple way to improve the friction model is to make the friction force proportional to the previous frames computed contact normal force (as opposed to just a constant like the demo is if I remember correctly).<br><br>This makes stacks look much more realistic as objects at the bottom have more friction and so are harder to push out of the stack as expected.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=207">sbroumley</a> — Thu May 24, 2007 1:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2007-05-23T08:30:47+00:00</updated>

		<published>2007-05-23T08:30:47+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4300#p4300</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4300#p4300"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4300#p4300"><![CDATA[
Actually I am looking into improving the friction model in Erin GS solver. At the moment I only solve the friction in the manifold center and apply an additional twist impulse to mimic the torsional friction. Another trick (also suggested on the forum here) is to align one friction direction with the relative velocity in the contact plane.  <br><br>So what would be a better friction model and friction solver? I see that I could solve a 3D mini LCP for the friction at the manifold center (2 tangents + 1 twist), but the question is if this improves the quality in a way that it justifies the exta computational effort.<br><br>I implemented the G&amp;B&amp;F paper and I liked the friction and stacking results. From my personal experience Erin method works very nice when you warm-start the simulation. Ideally I would like to get rid of the warmstarting so could you explain a little bit more how friction could be improved and why the friction model has such a big impact on the GS convergence? In particular why is there a difference in feeding the old velocities rather then the new velocities?<br><br>Finally, what do you mean by position projection? I am not aware of any position projection in the sense of a position constraints solver in this paper (e.g. Jacobsen). They suggest this at the end, but if IIRC this was only experiemental.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Wed May 23, 2007 8:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[KenB]]></name></author>
		<updated>2007-05-22T21:39:35+00:00</updated>

		<published>2007-05-22T21:39:35+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4299#p4299</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4299#p4299"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=4299#p4299"><![CDATA[
<blockquote class="uncited"><div>Evan,<br><br>You can read about SI here:<br><br><a href="http://www.gphysics.com/files/GDC2007_ErinCatto.zip" class="postlink">http://www.gphysics.com/files/GDC2007_ErinCatto.zip</a><br><br>The important difference with Guendelmann is how clamping is performed and how joints are handled.<br><br>You are right, to handle loops and auxiliary constraints, I'm computing effective masses using test impulses and solving for the Lagrange multipliers.</div></blockquote>Hmm, I think main difference between this method and the G&amp;F&amp;B paper is that they put null on the right hand side (i.e. they look for zero contact velocities), and manage overlaps by position projection. Position projections typically make you loose control over quantities that should be conserved, and at the end of the day this also forces you to use three iterative passes - collisions, contacts and positions, and this becomes quite slow.<br>The method described by Catto is actually a quite nice description of a Gauss-Seidel solver, but the paper lacks a good friction model (and solver for friction).<br>Another difference between Catto's model and the G&amp;F&amp;B paper is that in the G&amp;F&amp;B paper they use the old velocities to construct the friction cone. This is wrong in a sense, but it makes the mass matrix positive definite, and this gives reasonable convergence with the G-S solver, so eventually it is often better than feeding evil mass matrices to G-S.<br>The the effective inertia of a collision/contact in the G&amp;F&amp;B model is thus just n^T K n (with n the normal and K the collision matrix), while it should be n^T K (n - mu t) with the proper friction cone (here mu is the Coulombd friction coefficient and t is the direction of the tangential velocity). Typically the G&amp;F&amp;B model gives exaggerated friction and some artefacts, but this is often preferred in games and animation, over a more precise - but nearly unsolvable friction model...<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=1339">KenB</a> — Tue May 22, 2007 9:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erin Catto]]></name></author>
		<updated>2007-03-11T18:11:35+00:00</updated>

		<published>2007-03-11T18:11:35+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=3839#p3839</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=3839#p3839"/>
		<title type="html"><![CDATA[LCP w/friction]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=3839#p3839"><![CDATA[
Evan,<br><br>You can read about SI here:<br><br><a href="http://www.gphysics.com/files/GDC2007_ErinCatto.zip" class="postlink">http://www.gphysics.com/files/GDC2007_ErinCatto.zip</a><br><br>The important difference with Guendelmann is how clamping is performed and how joints are handled.<br><br>You are right, to handle loops and auxiliary constraints, I'm computing effective masses using test impulses and solving for the Lagrange multipliers.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=12">Erin Catto</a> — Sun Mar 11, 2007 6:11 pm</p><hr />
]]></content>
	</entry>
	</feed>
