Newton Body acceleration

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Newton Body acceleration

Postby misho » Wed May 30, 2018 10:36 am

I have a newton body in motion under earth gravity, propelled by a simple force applied to it. Everything looks good, except, when I obtain acceleration value using Newton's own function:

Code: Select all
dVector accelerationVector;
NewtonBodyGetAcceleration(nBody, &accelerationVector[0]);


I see intermittent "blips" where value dips to what looks like zero (it is hard to tell what the value is, since the readout happens at many FPS... I could insert code to determine what the actual value is)

I obtain the velocity the same way, and there are no value "blips", the readout is rock steady where it's supposed to be.

Any idea on why this is happening?
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Newton Body acceleration

Postby Julio Jerez » Wed May 30, 2018 2:11 pm

the acceptation is computed in two places, for a free single body in funtion
Code: Select all
void dgDynamicBody::IntegrateOpenLoopExternalForce(dgFloat32 timestep)
...
   m_accel = m_externalForce.Scale4(m_invMass.m_w);

and for bodies with joints in function
Code: Select all
void dgWorldDynamicUpdate::CalculateNetAcceleration(dgBody* const body, const dgVector& invTimeStep, const dgVector& maxAccNorm2) const

   dgVector accel (invTimeStep * (body->m_veloc - body->m_accel));
   dgVector alpha (invTimeStep * (body->m_omega - body->m_alpha));


in both cases is a function of the velocity at a = (v(t+ dt) - v(t)) / dt
so if velocity is smooth a - be very small.
if velocity is changing in magnify that acceleration should be more of less const to smooth,

but of your body are suggested to conservation gravitational forces, of the for
f = G * m / r ^2

the neither velocity non acceleration be correlated, since there are not linear quantities.
basically the acceleration effect is a gradual change of the direction of the velocity leaving the magnitude almost constant.

you set a brake point on those two functions and put dgTraces, to check if the values make sense to you. do not get the latest code it is broken now.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton Body acceleration

Postby misho » Wed May 30, 2018 2:14 pm

Ok thank you!

The values wouldn't make sense for almost certain - the gravity and velocity are steady (velocity increasing under thrust)... only the acceleration is having "blips", and they seem to go down to zero for an instant.

I was going to see if I get better results by computing my own acceleration from change in the velocity in a given time slice...
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Newton Body acceleration

Postby Julio Jerez » Wed May 30, 2018 3:14 pm

misho wrote:I was going to see if I get better results by computing my own acceleration from change in the velocity in a given time slice...


but that's how is calculated, unless there is a bug. are you in an older version or newer,
also is this recent bug?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton Body acceleration

Postby misho » Wed May 30, 2018 3:23 pm

I am on a month-old version, and this is the first time I've been checking acceleration values. I don't really need it for anything except for instrumentation display which I'm working on (part of a guidance system, which needs acceleration value to compute orbital ascent curve).

The body (a rocket) has a few other bodies attached to it with a hard joint, and the other bodies are not under power (the main body is carrying them). The whole assembly is behaving as expected, no sudden jerks or shifts.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Newton Body acceleration

Postby Julio Jerez » Wed May 30, 2018 3:27 pm

I see, you may have a version with bad joints, I have been experimentation with a better solver that for more that a month now and some commits are bogus.

tonight I will commit a stable version, you should get it and check again, the bug you are seeing may be a result of a work in progress bug.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton Body acceleration

Postby misho » Wed May 30, 2018 4:01 pm

Thanks! Sounds good!

I did notice that sometimes the "hard" joints get shifted - two objects that were precisely aligned all of a sudden are misaligned (while still attached)
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Newton Body acceleration

Postby misho » Sun Jun 10, 2018 12:13 pm

Hi! I haven't had a chance to upgrade and test the latest build, so before I do, any progress on this?

Things are definitely amiss in my present (month or so old) build - I see an acceleration value under a zero-G weightless, unpowered orbital coast condition...
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Newton Body acceleration

Postby Julio Jerez » Sun Jun 10, 2018 5:10 pm

The build should be stable now.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton Body acceleration

Postby misho » Mon Jun 11, 2018 10:30 am

Thanks Julio! I'll wrap a few things up and test it out.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 22 guests

cron