Jittery motion from joints; scale issue?

Typically: "How do I... ", "How can I... " questions
Post Reply
bessemermine
Posts: 16
Joined: 13 Mar 2013, 23:05

Jittery motion from joints; scale issue?

Post by bessemermine »

I created a simple model with two revolute joints (and one prismatic joint, just for testing), that is showing a lot of small, nosy oscillations in the simulation.
The two pin joints are supposed to be modeling torsional springs and dampers. The whole model is intended to model a small leg for a device in the 40-100 gram range, <100mm characteristic length.

The simulation file can be found here:
https://www.dropbox.com/s/aq3dx0ihwybj0 ... g_test.ttt

Note the small scale that this model was built for, where nominally 1 unit = 1 m, and this structure is just a few mm big. This is going to be one component in a larger model. Am I running into these noisy oscillations because of the small scale of the whole model? If this is just accuracy/precision settings, let me know what settings I might try changing to get a cleaner simulation.

If this is the case, I need to think of some solutions. The whole thing could be built with centimeter scale, but I'm not exactly sure what repercussions will arise resulting from this, or if there is an easy way to scale the whole thing all at once.

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: Jittery motion from joints; scale issue?

Post by coppelia »

Hello,

We tested your scene with ODE and Bullet, and with the time step that you selected (1ms) there is no suspect oscillation (just the regular spring-damper oscillation due to the fact that you have 2 revolute springs in your system).

Setting the time step to 10ms, then you can notice a lot of non-logical oscillations, in Bullet and ODE. We are currently integrating a third physics engine into V-REP (high-fidelity physics engine), and testing with that one and 10ms we still had a stable simulation.

With Bullet and ODE it is important to try, since those engines are more game engines. And never use too large force/torques when working with small masses.

Finally, you can always automatically have your whole dynamic world scaled internally. So if you set a scaling factor s=10, then:
  • all your dimensions will be scaled by s
  • all your masses will be scaled by s*s*s
  • all linear velocities will be scaled by s
  • all forces will be scaled by s*s*s*s
  • etc.
When reading value back, they are automatically scaled back. This happens behind the scenes and taken care by V-REP, and all you need to do is set that scaling factor in the dynamics engine dialog (parameter internal scaling).

Cheers

bessemermine
Posts: 16
Joined: 13 Mar 2013, 23:05

Re: Jittery motion from joints; scale issue?

Post by bessemermine »

Well, that's good news about the high fidelity physics engine. How about PhysX? But that's another game engine, and it might be more targeted to getting it done "fast" instead of "right".

Here's the phenomenon that I'm referencing:
http://i.imgur.com/XssP4JV.jpg (also shows the current setup for dynamics engine properties)
The noise that is present after about 50 milliseconds, and it looks like the joint torque is oscillating by about 20 mNm at every time step. I'd like to try and supress that noise a bit, considering the maximum torques during the touchdown and spring phase is only 50 mNm.
I would expect that in steady state, once the initial drop has been damped out by the D term of the springs, that the structure would be static, but the noise mentioned above continues.

Is this just the best that I should expect from ODE & Bullet? This is a scaled up version of a similar structure, which seems to have much smoother behavior: https://www.dropbox.com/s/aq3dx0ihwybj0 ... g_test.ttt

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: Jittery motion from joints; scale issue?

Post by coppelia »

It is strange because that shaking doesn't appear in the scenes I downloaded from you. What version of V-REP are you using?

bessemermine
Posts: 16
Joined: 13 Mar 2013, 23:05

Re: Jittery motion from joints; scale issue?

Post by bessemermine »

3.0.4 32bit, running on 64bit Windows 7.
Here's a rendered video: https://www.dropbox.com/s/nyz43gukq3kr7 ... jitter.avi

Are there some settings that are not saved into the scene file, and are only an application setting, that could be different between our setups?

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: Jittery motion from joints; scale issue?

Post by coppelia »

The 2 scenes you referred to are not the same as what I can see in the video recording (the legs are wider in the video, and the sphere is different). Please make sure to post exactly the same scene, otherwise we cannot reproduce the same effect.

Cheers

bessemermine
Posts: 16
Joined: 13 Mar 2013, 23:05

Re: Jittery motion from joints; scale issue?

Post by bessemermine »

Oh, shoot, sorry about that! The "2joint_leg_test" is the big, not-to-scale model that I did first, and I posted the wrong link, and didn't link to the right scene at all. No wonder it wasn't reproducible.

This should be the right one:
https://www.dropbox.com/s/fmhbtl3d90wis ... _scale.ttt
(segments are ~0.014 units long, 0.007 units wide, 0.001 units thick, thus the concern about scale)

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: Jittery motion from joints; scale issue?

Post by coppelia »

You have following masses involved:
  • bodyMass: 100 grams
  • upperSeg: 1 gram
  • lowerSeg: 1 gram
That is too much for the physics engines! Refer to the dynamics design considerations, mainly the points 7 and 8.

By increasing the mass of the upperSeg and lowerSeg to 10 grams, the whole thing becomes already much more stable.

Cheers

Post Reply