A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by blackbird_dream » Thu Apr 12, 2018 3:10 am
Hi,
this is a video of a FLT bouncing on a wall onto its mast and fork. The model was built under Unity3D with the ND version dated Jan 2, 2018(7e379d7)
https://ufile.io/8590eHere is the same model built in delphi with NGD version 1.5 (special build, stiffer joints) :
https://ufile.io/bvz9kWhen the Unity model hits the wall from behind (i.e no joints interfere) the collision is realistic. It seems the explosion is due to dof violations in the joints.
I can upload a simplified model if needed to highlight the issue.
Last edited by
blackbird_dream on Mon Jun 11, 2018 2:42 am, edited 4 times in total.
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by blackbird_dream » Thu Apr 12, 2018 4:07 am
Here is my sample demo of a vehicle with a beam on front. The beam is connected by a slider actuator (transverse horizontal axis) to the vehicle:
https://ufile.io/mwzo5Here the same vehicle. The beam is part the vehicle, i.e. one box collider:
https://ufile.io/bzs18As can be observed when hitting the wall, the slider actuator restores much more energy than it should.
I ran the same test giving same results with:
- ND v 5cd99b5 dated 25 Feb
- NUP v 14dfb5a dated 10 Apr
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by blackbird_dream » Wed Apr 18, 2018 5:38 am
the immoderate bouncing is due to the mass ratio between subparts.
For example in this test, the main body is 2750kg and the fork is 50kg :
https://ufile.io/56zdeHuge bouncing may be noted
In this example the main body is 2500 kg and the fork is 300 kg. The fork's CoM is shifted back near the CoM of the main body. So the mass distribution of the whole vehicle is quite the same :
https://ufile.io/0ajqfhere the bouncing is quite normal.
The same issue was raised for v1.5 : depending on the mass ratio the joints were stiff enough or too loose. Here the trouble arises when bouncing.
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by Julio Jerez » Wed Apr 18, 2018 10:00 am
They soudl be able to handle that ratio.
why don't you put the videos in youtube, is easier to see them that way.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by blackbird_dream » Wed Apr 18, 2018 12:23 pm
What is your opinion ?
What could be done ?
Thks
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by JoeJ » Wed Apr 18, 2018 1:06 pm
Looks pretty bad.
Some things to try:
- Code: Select all
/*!
Set the solver algorithm use to calculation the constraint forces.
@param *joint pointer to the joint.
@param *model - solve model to choose.
model = 0 zero is the default value and tells the solver to use the best possible algorithm
model = 1 to signal the engine that is two joints form a kinematic loop
model = 2 to signal the engine this joint can be solved with a less accurate algorithm.
In case multiple joints form a kinematic loop, joints with a lower model are preffered towards an exact solution.
See also: NewtonUserJointGetSolverModel
*/
void NewtonUserJointSetSolverModel(const NewtonJoint* const joint, int model)
{
TRACE_FUNCTION(__FUNCTION__);
dgConstraint* const contraint = (dgConstraint*)joint;
contraint->SetSolverModel(model);
}
Use model 2 for joints you suspect they might cause problems (but they get softer this way)
Joints often have SetRowMax/MinFriction() calls (mostly for motors).
Tune the values to be as low as possible but necessary. They set the max force the joint is allowed to apply. Less force, less problems.
But the video shows explosion some time after the collision, so those things probably won't help. I guess there's a bug in Newton or the joints code. In such case i try to replicate the issue in the demos sandbox - but that's probably some work so wait for Julios suggestion...
Edit: looking again the explosion happens on wheel - ground contact, so making wheel joints soft would be interesting.
-
JoeJ
-
- Posts: 1453
- Joined: Tue Dec 21, 2010 6:18 pm
by Julio Jerez » Wed Apr 18, 2018 1:42 pm
yes that does not look right.
I have few ideas but the first I have to do is to sync to the plugin and unity and make sure is up to date.
There has been many changes and, I know Sweenie try to keep going but maybe some thong I have to verify are they way that support to.
I know I said I was going to do that last week, but I did no have time, I see if I do it during the week.
I am sure there has to be a way to solve those issues, if is worked once it should work again, the new library is support to be far better.
note:
I know there is a bug somewhere is the code, that David Gravel showed to me two weeks ago.
and I am try to merge 3.13 and 3.14 to see where the two library diverged so much.
I suspect the bug is in the low level math library because it affects everything and that's a sign of a bug in some low lever function. But since I have not been able to find by inspecting the code, I am doing it the old faction way, by comparing working revision to working revision from my SVN archive.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by blackbird_dream » Thu Apr 19, 2018 2:25 am
ok thks for your replies. I'm relying on you.
I believe the simple demo (1 main body on 4 wheels+ slideractuator +1 subbody ) is enough for debugging because the tremendous bounce is a marker of the bug.
In the original demo, maybe the explosion occurs when the vehicle hits the ground back but this results from the initial leap from the wall.
thks again. Looking forward to reading news from your investigations.
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by Dave Gravel » Sat Apr 21, 2018 2:01 pm
Hi Julio:
If the tires physics is done manually without the joints.
If you need to get it synchronisez with the joints, you need to do all tires calculations from a pre postlistener ? It is the right way to go ?
Maybe it can help for the problem.
-
Dave Gravel
-
- Posts: 800
- Joined: Sat Apr 01, 2006 9:31 pm
- Location: Quebec in Canada.
-
by Julio Jerez » Sun Apr 22, 2018 3:16 pm
If you are adding forces to the body, them you have to do it in the pre listener.
a pre listener is called after the force and torque callback, and is like a filter the operates on the bodies associated with that listener.
.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Dave Gravel » Sun Apr 22, 2018 4:19 pm
Good thanks Julio.
-
Dave Gravel
-
- Posts: 800
- Joined: Sat Apr 01, 2006 9:31 pm
- Location: Quebec in Canada.
-
by blackbird_dream » Mon Apr 23, 2018 2:22 am
Good to know this but in unity AFAIK there is only one way to add forces.it is the event onapplyforceandyorque.
I guess there are 2 problems.
1) the immoderate bouncing after the impact on the joint
2) the explosion when the vehicle lands on its wheels.
My main concern is the 1st issue
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by JernejL » Mon Apr 23, 2018 2:49 am
Julio Jerez wrote:If you are adding forces to the body, them you have to do it in the pre listener.
a pre listener is called after the force and torque callback, and is like a filter the operates on the bodies associated with that listener.
.
If you mean the listener functions there is no pre-forcetorque callback function, i cannot find that.
http://newtondynamics.com/wiki/index.ph ... _functions It would be really good feature to have that tho - forcetorque and tranfrorm general world listener callbacks (but you'd need to add threadid and time passed parameters to pass to the callbacks somehow (or provide a function to get that inside listener) ).
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by blackbird_dream » Mon Apr 23, 2018 4:54 am
here is a demo
without wheels.
The main body is just guided longitudinally with a slider joint (no gravity).
This demo shows the issue raised with the impact on the joint.
here the collider is attached to the fork so that the impact force transits through the slideractuator joint :
https://www.youtube.com/watch?v=L9Z39AYq-Pchere the collider is attached to the main body so that the impact force is directly tranmistted to it without transiting through the joint:
https://www.youtube.com/watch?v=Z_9l58txVXIthe difference of energy restored during the bounce is clearly visible.
Last edited by
blackbird_dream on Tue May 29, 2018 6:18 am, edited 1 time in total.
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 3 guests