inaccuracy in angular movement
-
- Posts: 27
- Joined: Fri Apr 20, 2007 7:29 pm
- Location: Germany
inaccuracy in angular movement
hi,
in order to get my servo working properly i need very accurate calculations.
but this does not happen, even under double precision mode.
imagine you have a btGeneric6DofConstraint which is limited to angular movement around the X axis.
one side of the joint is static an on the other side is a body attached with a distance of 10 units (radius).
the body has mass=1.0 & inertia.getX()=around 0.5
then you apply a constant torque of 50 units.
remember there is no gravity.
the result is a non_constant angular acceleration as you can see in the picture:
legend:
blue: torque
green: angular velocity
yellow: computed angle (btGeneric6DofConstraint->computeAngle(0))
red: just ignore (error value)
another thing is that the angular velocity never gets over a chertain value.
EDIT: the higher the mass of the body the lower the max. angular velocity and the higher the inaccuracy.
so there must be a bottleneck. how can i solve that?
thx in advance
in order to get my servo working properly i need very accurate calculations.
but this does not happen, even under double precision mode.
imagine you have a btGeneric6DofConstraint which is limited to angular movement around the X axis.
one side of the joint is static an on the other side is a body attached with a distance of 10 units (radius).
the body has mass=1.0 & inertia.getX()=around 0.5
then you apply a constant torque of 50 units.
remember there is no gravity.
the result is a non_constant angular acceleration as you can see in the picture:
legend:
blue: torque
green: angular velocity
yellow: computed angle (btGeneric6DofConstraint->computeAngle(0))
red: just ignore (error value)
another thing is that the angular velocity never gets over a chertain value.
EDIT: the higher the mass of the body the lower the max. angular velocity and the higher the inaccuracy.
so there must be a bottleneck. how can i solve that?
thx in advance
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
So what you have is a hinge joint where the hinge axis equals the global x-axis, right? One body is fixed, the other can move. Now you apply a constant torque, but no gravity. Is this so far correct?
So first thing I recommend is to use the hinge joint, since it should give you better precision. Then what result do you expect? If I understand you correctly the dynamic body should accelerate constant and its angular velocity should grow linear, what it obviously doesn't do. Are you sure angular damping is also disabled? I am not an expert with this, but as far as I know it should be better to use an angular motor and set the target velocity accordingly.
Cheers,
-Dirk
So first thing I recommend is to use the hinge joint, since it should give you better precision. Then what result do you expect? If I understand you correctly the dynamic body should accelerate constant and its angular velocity should grow linear, what it obviously doesn't do. Are you sure angular damping is also disabled? I am not an expert with this, but as far as I know it should be better to use an angular motor and set the target velocity accordingly.
Cheers,
-Dirk
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Yes, as Dirk pointed out, please try it again with the powered hinge in Bullet. Have you checked using the hinge motor, see ConstaintDemo.
Thanks,
Erwin
By the way, the generic d6 joint has a lot of (potential) issues. They might get resolved or documented. Also a Featherstone implementation would probably be better.
Thanks,
Erwin
By the way, the generic d6 joint has a lot of (potential) issues. They might get resolved or documented. Also a Featherstone implementation would probably be better.
-
- Posts: 27
- Joined: Fri Apr 20, 2007 7:29 pm
- Location: Germany
ok i'll try it with a hinge joint, but later i need 2 or even 3 directions of freedom, is that possible with multiple hinge joints?
another question about the angular motor: how does it try to reach the target velocity? does it overshoot under chertain circumstances e.g. gravity?
well, i'll try it out, thx so far.
max
another question about the angular motor: how does it try to reach the target velocity? does it overshoot under chertain circumstances e.g. gravity?
well, i'll try it out, thx so far.
max
-
- Posts: 27
- Joined: Fri Apr 20, 2007 7:29 pm
- Location: Germany
i noticed that trying the whole thing with a hinge would be a lot of work, which i only want to do if it is possible to simulate a 2-way hinge with only using hinges? (2 directions of rotational movement)
while still testing with the generic constraint i figured out that the body which rotates gets pulled inwards to the axis every 180 degrees (360 would be 1 rotation).
the result to this behavior is a velocity decrease at these points.
(as you can see in my first post)
then i decreased the mass down to 0.01 and applyed only a torque of 1 unit. now i get the same acceleration, but its stable now
but in the end it runs into some limitation (see at the plot), which i don't understand.
why is there such a limit at these low velocities and torques,
even with using double precision?
max
while still testing with the generic constraint i figured out that the body which rotates gets pulled inwards to the axis every 180 degrees (360 would be 1 rotation).
the result to this behavior is a velocity decrease at these points.
(as you can see in my first post)
then i decreased the mass down to 0.01 and applyed only a torque of 1 unit. now i get the same acceleration, but its stable now
but in the end it runs into some limitation (see at the plot), which i don't understand.
why is there such a limit at these low velocities and torques,
even with using double precision?
max
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
-
- Posts: 27
- Joined: Fri Apr 20, 2007 7:29 pm
- Location: Germany
i dont set any damping
setting it to 0 makes no difference,
but with some values such as 0.01 or 0.5 the body flies away out of the joint?
EDIT: everything seems to depend on the timestep:
if i choose a high timestep such as 0.01 a low mass of 0.1 and a torque of 1.0 accelerates the body only to a velocity of 0.005.
with a timestep of 0.02 this reacts normally.
maybe this is the point we should give attention?
setting it to 0 makes no difference,
but with some values such as 0.01 or 0.5 the body flies away out of the joint?
EDIT: everything seems to depend on the timestep:
if i choose a high timestep such as 0.01 a low mass of 0.1 and a torque of 1.0 accelerates the body only to a velocity of 0.005.
with a timestep of 0.02 this reacts normally.
maybe this is the point we should give attention?
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
-
- Posts: 95
- Joined: Fri Mar 31, 2006 7:13 pm
Hi,
time step dependency looks like one of my problem.
Try to disable this in btRigidBody.cpp
I think some of this parameter should be time step dependent but are not.
Also updateDeactivation() from btRigidBody seems to
work different dependent on time step.
But may be this is a bit of topic.
Devid
time step dependency looks like one of my problem.
Try to disable this in btRigidBody.cpp
Code: Select all
#define EXPERIMENTAL_JITTER_REMOVAL 1
Code: Select all
btScalar gLinearAirDamping = btScalar(1.);
//'temporarily' global variables
btScalar gDeactivationTime = btScalar(2.);
btScalar gLinearSleepingThreshold = btScalar(0.8);
btScalar gAngularSleepingThreshold = btScalar(1.0);
work different dependent on time step.
But may be this is a bit of topic.
Devid
-
- Posts: 27
- Joined: Fri Apr 20, 2007 7:29 pm
- Location: Germany
-
- Posts: 95
- Joined: Fri Mar 31, 2006 7:13 pm
Well you need to make it in this way >
because there is #ifdef test >
even if it is 0 it is still defined.
If you are asking me thin actually no, I am using Win64 and MacOS X.
Code: Select all
//#define EXPERIMENTAL_JITTER_REMOVAL 1
Code: Select all
#ifdef EXPERIMENTAL_JITTER_REMOVAL
If you are asking me thin actually no, I am using Win64 and MacOS X.
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
-
- Posts: 27
- Joined: Fri Apr 20, 2007 7:29 pm
- Location: Germany
after testing the demo i found out that there are only 2 problems:
first, the limit, which depends on mass, torque and timestep
and, with using low torque and higher mass the body does not accelerate.
(can be the same problem, but limit would be much more low)
the other problem (acceleration is unstable) seems to relate on my other code, so i gonna recode it completely. when this is finished i'll test your suggestion DevO.
@dirk i gonna send you the demo now if i find your e-mail addr.
if my plotter and the pngwriter does not compile under win you can disable it in AngularMovementDemo.h
EDIT: just send it to 'dondickied at users.sourceforge.net'
first, the limit, which depends on mass, torque and timestep
and, with using low torque and higher mass the body does not accelerate.
(can be the same problem, but limit would be much more low)
the other problem (acceleration is unstable) seems to relate on my other code, so i gonna recode it completely. when this is finished i'll test your suggestion DevO.
@dirk i gonna send you the demo now if i find your e-mail addr.
if my plotter and the pngwriter does not compile under win you can disable it in AngularMovementDemo.h
EDIT: just send it to 'dondickied at users.sourceforge.net'
-
- Posts: 27
- Joined: Fri Apr 20, 2007 7:29 pm
- Location: Germany
Dirk recommended me to use ODE for physics.
so i'm tying now to combine ODE with Bullet, see at new thread:
http://www.continuousphysics.com/Bullet ... php?t=1216
max
so i'm tying now to combine ODE with Bullet, see at new thread:
http://www.continuousphysics.com/Bullet ... php?t=1216
max