Jump to content
Sign in to follow this  
Nori

About a chain motion.

Recommended Posts

I have a question about Bullet Dynamics.

 

I really would like to know how I can use Bullet Dynamics motion well.

I sometimes try to make a chain motion but I cannot control it well.

I have tried various parameters in the Bullet system.

I have no idea how I should do.

Could someone please help me?
I have uploaded the test data.

 

ChainTest.zip

I hope someone can advise me soon.

Regards.

 

Nori.

ChainTest.zip

Share this post


Link to post
Share on other sites

Ola Nori, I am posting Chip answer, he had problems to post the attachment..

------------------------------

 

 

Hi Nori-

 

I looked at your chain project and have some general comments about getting Bullet to be more predictable for all simulations.  The attached project file has been modified and the chain now responds as it should.  Here’s my approach to all of my Bullet files:

 

As you’ll see in the modified project file, I substituted a very simple cylinder and tube (low poly’s) for your chain segments.  I only needed one model, and replicated it to form the links of a chain.  I ran Bullet on the simple model, and it reacted fine.  Then I simply added your high-res chain model as children to the low-res parents, and your chain segments followed the parents.

 

Here’s my approach:

 

My simple model only required a low poly cylinder and tube that were joined as one model.  There’s no need to make the cylinder and tube smooth.  You only need a few surfaces for Bullet to use to calculate the intersections of the links.  

 

I duplicated the same simple model repeatedly to form a basic chain, and added two low poly  planes (just 2 polygons) on either side of the chain segments.  This will keep the chain planar during it’s motion.  (Remember:  Once Bullet calculates the motion, the low poly models and planes will be turned off before final rendering.  The link motion will be “baked” into the project file, and Bullet won’t be needed during render.)

 

I ran the simulation on the low-poly parts (see Quicktime preview), and the chain reacted fine.  Then I simply parented your  high-res chain segments to the low-poly Bullet models, turned off the low poly models and your chain segments followed the baked Bullet motion.  

 

In general, always build the simplest mechanical representation of your physical model for Bullet.  Avoid using your full-res models; they will often result in unpredictable results because of the difficulty of calculating the intersections of the detailed polygons.  Once you have the low resolution models working in Bullet, parent the high-res models and render.  Use as many deflection planes, tubes, or other objects as you need to keep your parts in place, and then turn them off after Bullet has determined the motion.  

 

If you look at the Dynamics examples on the EI website, there are many “invisible” objects that I use to keep my objects on the path I want them go.  (For the Wall-E treads, there are also two planes on either side of the treads to keep them aligned.)

 

See the attached project file.  In my Selection Sets you’ll see only the low-res objects are used in the Bullet calculations, and your hi-res links simply follow their motion.  

 

Finally, alway remember to preview the motion rendering every frame.  Previewing every “nth frame” causes unpredictable results.  Once I got the results I wanted, I then created the final render using every 6th frame to get the chain to fall at a natural pace.

 

I hope this helps - let me know if you have any more questions!  Chip

 

CHAIN FILES.zip

 

  • Like 2

Share this post


Link to post
Share on other sites

Hi Tom.

Thanks for telling a way to control my chain motion.

I'll try to improve my project while I'm reading and looking at datas you uploaded for me.

Although I haven't tried it yet, even now I can understand whole concept and what Chip tried to let me know.

Anyway I will try after this soon.

I thank you and Chip.

Regards.

  • Like 1

Share this post


Link to post
Share on other sites

I have tried a way you told me using your sample data but unfortunately it has had a big problem.

Your sample data contains simple chain but there is a big difference between the cylinder and the tube.

The outside diameters are different.

So I cannot use it with a sprocket because I think the collision points are different and the chain is going to be slanted because of the different diameters.

I cannot use this ways for a drive chain.

I have remade my sample data on my way instead and I have uploaded but unfortunately I haven't been able to control it well.

Do you have different way to avoid it?

I hope you let me know better way if you like.

Thanks.

Regards. 

test20170331.zip

Share this post


Link to post
Share on other sites

Hi Nori,

 

I looked at your files and your tolerances are too tight on the simple chain segments.  There are polygons that are virtually occupying the same space, and Bullet can't calculate which surfaces are intersecting (because they intersect all the time).  You have to build a very "loose" simple chain model that fits your sprocket very loosely.  

 

If you're going to try and drive the chain with the sprocket, once the simulation begins the chain will sag and drop into place on the teeth of the drive sprocket.  Then you can move the sprocket slightly to tighten up the chain - but don't tighten it too much.  If you look at the "Wall-E Treads" under the Dynamics examples, you'll see the chain slacken at the beginning of the simulation while Bullet figures out how the parts fit together.  Then I moved the tensioning roller to tighten the tread segments before the drive sprocket begins to move the treads.  When the treads were too tight on the drive sprocket, the treads flew apart.  But they also came apart when the treads were too loose.  It takes some experimentation to find just the right tension.     

 

But in general always leave enough space between your surfaces to allow Bullet to be able to calculate which surfaces are separate between different model parts.  The simplified model needs to be an approximate representation of the actual geometry.  Modeling it too precisely will cause Bullet to become unstable  (as you found out!).  

 

Try re-modeling the simple chain to fit loosely on your sprocket to make it easier for Bullet to calculate the intersections.  No one will see the simple chain segments in the final animation so they don't have to look realistic.  The high-res models will follow their motion and look fine. 

 

Bullet requires a bit of trial and error.  It helps not to think of your geometry too literally - think of what Bullet is trying to calculate, and build a simple model that makes the math easier for the physics engine to calculate.

 

Good luck!  

 

Chip

Share this post


Link to post
Share on other sites

Hi Chip.

Thanks for testing and explaining.

I remade simple chain model today and the motion of the simple chain was good but I cannot control high-res models well.

I was not able to upload the data this time because the capacity is too small.

So I have used a storage service following.

http://firestorage.jp/download/001473027ce374a69699d9e491a167a3a14f1819

Could you please tell me about the cause if you like?

Regards.

Nori.

Share this post


Link to post
Share on other sites

I found the Wall-E Treads in this Forum and downloaded it but I cannot open it.

I tried it on Mac OS X 10.9.5 and Windws7 either.

Nori.

Share this post


Link to post
Share on other sites

I checked your file Nori, and the surfaces are still too close together and have too many polygons.  

Reduce the number so the cylinders are not as smooth (you only need 10 or 15 facets - don’t worry that it’s not smooth, you won’t see it in the final render).  But the main problem is that your cylinder is too thin.  The inner and outer surfaces are just a few pixels apart, so the normals on those two very close surfaces are confusing Bullet.  In fact, you don’t even need the outer polygons at all.  Just use a 10-15 cross section single surface tube.  It doesn’t need thickness; all Bullet needs is a one sided tube to simplify it’s calculations.  I would also add a little more space between the inner and outer tubes where the chain links are in contact.

I took your file and  made the first link static, and let the other links fall onto the sprocket.  They fell fine, but as you noticed they continue to move (jitter) because Bullet is confused due to the close tolerance of your very thin cylinder.  Try making it a single sided (zero thickness) cylinder with fewer cross sections.

Also, your sprocket needs to be simplified.  All those tiny facets in the teeth will also cause problems (too many conflicting surface normals).  It's a pretty model, but too detailed for Bullet.  Just like the simple links you created, model a very simple sprocket.  Don’t bevel the edges or round the teeth at all.  Make them square with as few polygons as possible.  Once again, you will attach the high resolution sprocket later after Bullet calculated the motion with the low res models.  

Sorry I can’t attach any files or images, but I think you get the idea.  Look at how crude my original low res chain links were.  Model all your objects like that, and let Bullet work it’s magic.  Then turn on the high res models, and it should look great.

Chip

 

(P.S.  I can't view any of the online animation examples either.  I wrote to Tomas to see if there's a problem with the EI server.)

Share this post


Link to post
Share on other sites

Hi Chip.

Thanks for writing back and checking again.

I can understand what you let me know.

First.

I must create simple-surface tubes and must spread each distance for two tubes to calculate.

Next.

I must create simple sprocket to calculate too.

Finally.

I attache high-poly each parts to simple models and turn off the simple models, and turn on high-poly models.

And animate them.

Right?

I will try to remake again.

Thanks.

Regards.

Nori.

Share this post


Link to post
Share on other sites

Yes Nori - that's the approach.  But just to be clear, only the low poly models are animated in Bullet.  The high poly models can be added at any time later to follow the Bullet motion.  I'm certain that once you build a low poly sprocket and reduce the number of cylinder faces and separate them with more space, your simulation will work.  Let me know what happens :-)  Chip

 

(P.S.  I'll try to attach a small image showing how simple my low-res models are.  Use as few polygons as you can.  I also noticed that it took me eight (!) different files to create this motion.  I tried many different combinations of speed, friction, tension etc. before I got it to work.  Finally, I noticed that you put a value of 200 for gravity.  I would recommend putting it back to 9.8 and rendering the motion slowly.  Then for the final file, render every 5 or 6 frames.  Using a high gravity value might cause the chain elements to be very "heavy" and they might not react as they would under normal gravity.)

 

(Sorry..., I couldn't attach the image.  I'll see if I can find out why the attachments aren't working.)

 

 

Share this post


Link to post
Share on other sites

Hi Chip.

Thanks for writing back.

I have understood since I read your reply.

So I will animate the low-poly models in advance and finally I will change them to highly-one.

I have a question about the gravity.

If I set it to 9.8 the speed is too slow and real one is not that slow.

I'm a little confused.

Anyway, I will try again.

Regards.

Nori. 

Share this post


Link to post
Share on other sites

That's correct Nori -

With gravity set to 9.8 the simulation will appear to run very slowly.  But this gives Bullet smaller time intervals to calculate the motion.  Once the simulation looks correct, then render every "Nth Frame" (every 3rd, 5th, 6th, etc.) frame - whatever it takes to get the speed to look more natural.  Setting the gravity to 200 makes everything very "heavy".  Just like in the physical world, a huge chain where each link weighs hundreds of pounds will react differently than a lightweight motorcycle chain.  Use 9.8 and then render every 5th or 6th frame.  But remember to always run Bullet previews for EVERY frame.  If you have "Nth frame" checked in the render window, Bullet will become unstable.  It needs to calculate every frame for the math to work correctly.  So don't forget to uncheck "Nth frame" before previewing the motion.

Chip

(P.S.  Tom and I may have figured out why I can't attach files to my comments.  If we get it fixed, that will help to explain how to get your file working :-)

Share this post


Link to post
Share on other sites

Hi Chip.

Thanks again.

I have understood about the gravity.

I will try again. ( Unfortunately I have no time to try because I have been busy since last weekend on my job. )

Anyway, I thank you and hope you can attach sample files on your comment.

Regards.

Nori.

Share this post


Link to post
Share on other sites

Ola Chip and Nori,

 
Just found the problem with video tutorials, need to install Flash Player in the Mac and allow it for EIAS3D.com 
We will take a look How to update the website code for HTML5
 
Thanks
 
Tom
 
EIAS3D Team
tom@eias3d.com
 

Share this post


Link to post
Share on other sites

Hi Tom.

I was looking for the video tutorial of Wall-E Treads but it doesn't exist here.

By the way, there is a zip file named "Wall-E Treads.zip" in your old post and I actually downloaded it several days ago.

Unfortunately I was not able to open the zip file.

Even if I try to open it, it changes to new zip file even though I had no idea.

In addition, if there is the video tutorial here I think I can watch it because I usually use Mac OS X 10.9.5 not Sierra and I have installed Flash player plug-in too.

So it's not related to my situation.

I have wanted to let you know about it.

Regards.

Nori.

Share this post


Link to post
Share on other sites

Hi Nori-

I sent you a solution last night to your direct Email.  Your data is fine - it just required some modifications to your Bullet parameters.  I think Tomas might post the files here for all to review to see how to approach your project.  Let me know if you didn't receive the data I sent.  I think you'll see that your approach is now right on track - good luck with you sim!

Chip

Share this post


Link to post
Share on other sites

Hi Nori-

I saw your post on the EI website and downloaded your file.  (I assume you received my direct Email with the samples I sent you?)  Your models are fine now, but some of your Bullet settings needed to be changed.

Your “Decomposer” in the Link Window was set to “Default”.  This option only works for very simple simulations, and I suggest using “VHACD” for all of your simulations.  It has to be set for all the links.

Then I experimented with the “Force Scale” (a global multiplier applied to all elements in your simulation).  The links were coming apart and I reduced the force scale incrementally to 0.05 so that the links would remain together.  (Try increasing the force scale yourself to see the results.)  

The Preview.mov file shows all the frames in the animation, and the final movie was rendered every 6th frame to get a more realistic speed.  You were very close to a solution - it just takes some experimentation to interpret why the links were coming apart.

All you have to do now is attach your high-res links, turn off the low-re links, and do a final render every 6th frame (or whatever speed you like).

Tomas:  This thread has gotten a few hundred reads on the EI website.  Maybe you might want to post these files as the final conclusion so everyone can see how to solve the problem?

Good luck with your project Nori!  I’m glad to see you were very near to the correct solution :-)

Chip


SOLUTION FOR NORI.zip

Share this post


Link to post
Share on other sites

Hi Tom and Chip.

Thanks for telling.

First, I tried to change parameters in Bullet dialogue but it didn't work well.

Next, I tried to preview your sample data without changing but it didn't work well too.

( with Bullet session dialogue.  )

I have uploaded the preview data I tried.

http://firestorage.jp/download/81affe0631a88755e30c1ac13a572a3abf508004

I have no idea why your sample also didn't work well as well.....

Is it because of Mavericks or something?

Anyway I hope you look at my preview movie.

Regards.

Nori.

PS.

Chip.

I cannot receive your direct email because I usually block emails from .com.

If I can know your email address I will input it into the acceptable directly in my rental server.

Share this post


Link to post
Share on other sites

Hi Nori-

I've sent you two Emails to your personal address recently - you should view them.  (I thought they were getting to you.)  The last one I sent showed the solution to your problem.  I still can't attach files to the EI website.  Once I hear from Nori directly, I'll re-send him the solution to his Bullet project.  Thanks!

Chip 

Share this post


Link to post
Share on other sites

Hi Chip.

Thanks for writing back.

Unfortunately I cannot receive your message adding ".com" because I always block the domain except I have added several address in excepting mail box.

I looked for you message but it was hard for me to find because there are so many spam mails.

So your message should be in among them.

I have no way to know your address but I can receive Tom's message.

So could you please tell me your email address asking Tom?

I will add you address into the excepting mail box.

If so, I will be able to receive your message directly.

Is it Okay?

Regards.

Nori.

Share this post


Link to post
Share on other sites

Tom said he will post the solution here on the website.  It contains the working project file, several small Quicktime movies and an explanation of what I did to your original file with some JPEG images.  It will all be self explanatory when Tom posts them soon :-)  Chip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×