Code center > Bugs and fixes

Friction

<< < (3/3)

EricL:

--- Quote from: Numsgil ---I'm running an ex nihilo sim.  I had brownian on and wanted to dampen it with friction.  Instead of damping it it amplified the motions!
 
 The stronger the kinetic friction should have been the faster and faster the bots started moving.
--- End quote ---
I'm looking at this.  It's involved.  Kinetic friction isn't backwards, what's happening is that the resistance force is exceeding the velocity!  Your bots are being propeled (backwards) by friction!

The problem is that the resistance impulse vector is used both for forces which should never exceed the bot's velocity (like friction and tie and sphere drag forces) as well as things which should (like the push back force from the field edges).  I'm also not at all convinced that the resistive forces are taking each other into consideration properly I.e. the sphere drag and kinetic friction may sum to exceed the bot's velocity.

I'm probably going to have to make the field edge push back operate directly on velocity (like collisions) and reserve the resistance vector for frictional and drag forces, then put some sanity checks in to insure the different opposition forces sum correctly.  May or may not make the next version.  Depends on the time I can allocate.

Numsgil:
I'm having a similar issue in the C++ source with static friction, now that I think of it.  I ended up just commenting it out and working on other parts.

EricL:
FYI, in 2.42.4. I have changed kinetic friction to operate directly on a bot's velocity and have left the vector of resitition for other forces.  Kinetic friciton appears to behave well now.  There are still strange brownian-induced harmonics with tied bots - the physics of torque and hooke forces in ties and their relationship to other forces still needs some tweaking - but at least now kinetic friction dampens such forces as one would expect.

Note that the sim must have some Z axis gravity for the kinetic friction setting to operate.  I.e. the actual kinetic friction is a function of the bot's mass, the sim's Z axis gravity and the coeffecient of kinetic friction.  If any of these are 0, there will be no effect from kinetic friction.

Navigation

[0] Message Index

[*] Previous page

Go to full version