# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Scaling the World for a 6-Dof Spring DamperPosted: Sun Jun 25, 2017 6:36 pm

Joined: Sun Jun 25, 2017 6:03 pm
Posts: 3
I am currently trying to scale up my setup (consisting of two rigid bodies connected by a btGeneric6DofSpring2Constraint) to fall within the suggested dimensions for a concise simulation.

In order to do so, I followed to the provided Wiki http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Scaling_The_World.

I scaled all the linear properties and concerning the resulting forces, everything turned out physically consistent.
Note that I did not scale up the liner and angular stiffness and damping values.

However I encountered significant deviations concerning the spring-related torques resulting due to a angular spring offset. I guess that this issue arises due to the fact that the torques should be scaled (*scale^2) as well. However I do not see a way of scaling the internal torque representation of the btGeneric6DofSpring2Constraint. Should i simply scale up the angular spring stiffness and spring damping by a factor (*scale^2) or is there a better more elegant way to retrieve physically consistent results (forces, torques, motion) when trying to scale a world containing the btGeneric6DofSpring2Constraint?

Top

 Post subject: Re: Scaling the World for a 6-Dof Spring DamperPosted: Mon Jul 31, 2017 6:21 pm

Joined: Sun Jun 25, 2017 6:03 pm
Posts: 3
I was able to boil it down to the following:

For now, rotational stiffness and damping vales are chosen independent from the scale.

The stiffness itself does not alter the behavior of the system. The deviations are caused entirely by the damping part. An experiment with altering the scale and non-existent damping showed results independent from the scaling factor, just as desired (K_stiff = 20.0, K_damp = 0.0):

Attachment:

Screenshot from 2017-07-31 19-59-15.png [ 22.16 KiB | Viewed 598 times ]

However when repeating the same experiment with no stiffness and a positive damping factor, significant differences arise when scaling up. (K_stiff = 0.0, K_damp = 9.0): The image denotes the system responses for different scales.

Attachment:

Screenshot from 2017-07-31 19-58-36.png [ 26.75 KiB | Viewed 598 times ]

I found the corresponding code snippet in btGeneric6DofSpring2Constraint.cpp

Code:
btScalar fs = ks * error * dt;
btScalar fd = -kd * (vel) * (rotational ? -1 : 1) * dt;
btScalar f = (fs+fd);

info->m_constraintError[srow] = (vel + f * (rotational ? -1 : 1)) ;

btScalar minf = f < fd ? f : fd;
btScalar maxf = f < fd ? fd : f;

//printf("%.3lf\n",f);
if(!rotational)
{
info->m_lowerLimit[srow] = minf > 0 ? 0 : minf;
info->m_upperLimit[srow] = maxf < 0 ? 0 : maxf;
}
else
{
info->m_lowerLimit[srow] = -maxf > 0 ? 0 : -maxf;
info->m_upperLimit[srow] = -minf < 0 ? 0 : -minf;
}

info->cfm[srow] = cfm;
srow += info->rowskip;
++count;
}

Interestingly if i comment out th if clause, everything just works fine, so I guess it all has to do with

Code:
btScalar minf = f < fd ? f : fd;
btScalar maxf = f < fd ? fd : f;

and the lines thereafter. I'd be greatful for any kind of suggestion.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 16 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities