[SOLVED] Odd behavior with collisions between object ...

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

[SOLVED] Odd behavior with collisions between object ...

Postby misho » Mon Apr 20, 2020 8:02 pm

Hi all,

I am experiencing the following odd behavior with collisions. Here is my setup:

Image
Image

I have a space capsule "A", docking to a space station through a docking adapter "B". The space station itself is an assembly of Newton objects, each itself a compound collision, connected using "hard" hinges. There are 13 Newton objects forming a space station assembly, starting with object "B" (docking adapter) and ending with habitation modules "C" and "D".

The space capsule "A" is aligned with the docking adapter "B" and it approaches it very slowly along the longitudinal axis, with the aim of connecting and docking. The parts in the compound collisions of both "A" and "B" where they come into contact are both flat, short cylinders, representing the docking rings of both objects. (almost like 2 coins coming to contact face to face)

The problem is, when they slowly approach and eventually come into contact, object "A" reacts rather violently to the collision, pitching upwards in unnatural way. I have worked on this methodically, trying to figure out where the problem is, and after a quite a bit of detective work, found out that the culprits are objects "C" and "D" - if I remove them, the collision behaves properly. Moreover, I found out that the mass of "C"/"D" was the problem.

If mass of objects "C" or "D" was decreased, the collision behaved properly. The "breaking point" of the mass value was somewhere between 15000 and 16000 kg (at 15000kg, collision works, at 16000kg, it misbehaves - I didn't go further to determine exact threshold)

Clearly, there is something in the solver that is not liking larger mass objects, be it the mass of single body, or somehow the mass of the whole assembly, reaching some kind of threshold.

Any idea why this would be happening?
Last edited by misho on Tue Apr 21, 2020 1:51 pm, edited 1 time in total.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Odd behavior with collisions between object assemblies

Postby JernejL » Tue Apr 21, 2020 8:50 am

Julio will probably make more sense of this as he has better understanding of mass / joint stuff, but in the meantime, i have 2 options you can look into:

NewtonUserJointMassScale maybe can be used? this is what was discussed here: viewtopic.php?f=9&t=9220

Alternatively, you could just rebuild the cmpound collision with 1 piece when objects are docked, this would probably greatly increase numerical stability.

An older version of newton also had some issues with violent compound collision reactions, this is how it looked to me (when truck front and rear of trailer come into contact), this bug was fixed last year around may, maybe you just need to update newton to latest version:
https://youtu.be/k0Io2BwUKG4?t=82
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Odd behavior with collisions between object assemblies

Postby misho » Tue Apr 21, 2020 1:47 pm

JernejL wrote:NewtonUserJointMassScale maybe can be used? this is what was discussed here: viewtopic.php?f=9&t=9220


Hi! Thanks for the help! I implemented the above, and it did the trick!! I used the joint version, and also, I wasn't sure which parameter goes first - turns out the larger parameter must be the first one, I guess in order to give the ratio greater than one:

Code: Select all
if(dSourceMass > dTargetMass)
   pHinge->SetBodyMassScale(dSourceMass, dTargetMass);
else
   pHinge->SetBodyMassScale(dTargetMass, dSourceMass);


Also, I used direct Joint method, since I have access to it. Works well, weird behavior is gone! Thanks again!
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: [SOLVED] Odd behavior with collisions between object ...

Postby JernejL » Wed Apr 22, 2020 5:05 am

Glad i helped, hopefully julio still has some insight on what went wrong and what could be done to correctly fix it.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: [SOLVED] Odd behavior with collisions between object ...

Postby misho » Thu Apr 23, 2020 3:34 pm

Thanks, yes, I hope so too, I wouldn't mind the explanation...
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: [SOLVED] Odd behavior with collisions between object ...

Postby Julio Jerez » Fri Apr 24, 2020 1:56 pm

The may be some close loop that is leading to a singular matrix.
My suspicion is that some who they are contact and joints acting together and the Solver does not like that very much.
you say the mass of one body is 16000 kg what is the mass of the small body?

but in any case the mass classed joint is a good solution, this is like a pulley and as long is used on terminal joints is should be find.
The size effect is that is work both ways, when scaling the large mass down, the effect is that the light object has a more power over the heavy body, basically the weak body is seen a stronger.

let it go for now until is become a bigger problem. also try adding some debug code that show the contacts. see if there are some contacts that should not be present, in general those together with joint are the sources of sub-matrices with high condition numbers.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [SOLVED] Odd behavior with collisions between object ...

Postby misho » Fri Apr 24, 2020 2:09 pm

Hi Julio!

The smaller body (the truss) has 1323 kg. Also, yes, I have checked and re-checked, and there is no interference in collisions of any of the adjacent bodies. I have experienced instability with that in the past (which makes sense, a solid body cannot be forced to be inside another solid body) and I have adjusted my models to have their connecting points outside of collisions, so that when the bodies are connected with hard joints, their collisions are away from each other. The visual model extends a bit further than the collision model, so visually they look connected (no gaps), whereas in Newton, the collisions have small gaps so that they don't react with each other.

In any case, it is stable now, it works well!
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 3 guests

cron