Regarding scaling behavior and possible simulation parameters

Typically: "How do I... ", "How can I... " questions
Post Reply
20183461
Posts: 5
Joined: 22 Dec 2021, 15:03

Regarding scaling behavior and possible simulation parameters

Post by 20183461 »

Good day,

I have a question regarding some scaling behavior in Coppelia that I do not seem to properly understand. Before I can explain the issue, let me summarize my simulation setup:
  • Large static surface with c = 10 linear damping factor
  • Two cubes resting on top of it, connected with a prismatic joint
  • Of those two cubes, one static cube serves as the base, the other dynamic cube (c = 10 linear damping factor, mass = 1kg) moves across the joint with respect to the base
The external control scripts reads the position of the prismatic joint as input and controIs the target velocity and maximum force as outputs.


I feed the system a randomized step pattern of forces as inputs, upon which the dynamic cube connected to the joint moves to certain positions as outputs. I measure these input/output pairs and estimate a transfer function based on the data.

Now, I expect my Coppelia setup to behave as a mass-damper system, i.e. mx’’ = F – cx’, where mass = 1, and c = 10, discretized with the same sampling rate as Coppelia. However, when applying the same force-inputs to this theoretical transfer function, the outputs have a similar shape but different size to the estimated system output (as can be seen in the figure below).

Image

This leads me to believe the CoppeliaSim is performing some scaling that I am not aware about. This assumption is also strengthened by the fact that when I increase the linear damping factor c of my theoretical transfer function, I can indeed get a response similar to the simulation setup (as can be seen in the figure below).

Image

Main question:
Am I missing something from the CoppeliaSim setup? Are some values scaled that I do not know about? I really could use some help with this part, as it is difficult for me to retrieve this information from the documentation.

Kind regards,
Daniel
Last edited by 20183461 on 27 Jan 2022, 12:28, edited 1 time in total.

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

Re: Regarding scaling behavior and possible simulation parameters

Post by coppelia »

Hello Daniel,

what engine are you using? And when you talk about linear damping factor, is that related to the engine's damping parameters? (e.g. Bullet linear damping, ODE linear damping. Keep in mind that the meaning of those damping values are very random and directly depend on how each engine interprets them (and typically for Bullet/ODE they do not have any unit and need to be set experimentally).

Also, you will notice that internally CoppeliaSim can uses some scaling, depending on the properties of the physics engine. e.g. typically when running Bullet, CoppeliaSim appropriately scales all values, since Bullet does not handle well small dimensions/values. You can however modify this in the general dynamics engine settings.

Also keep in mind that in one CoppeliaSim simulation step, there will be typically 10 dynamics engine sub-steps (by default, and that can be adjusted freely).

Cheers

20183461
Posts: 5
Joined: 22 Dec 2021, 15:03

Re: Regarding scaling behavior and possible simulation parameters

Post by 20183461 »

Edit:
I have discovered the issue! I was applying forces that would result in speeds larger than the target velocity of the joint. CoppeliaSim caps the applied forces to the target velocity, which means the 'true' applied force signal was smaller than I intended. This - in turn - leads to different dynamics.

Many thanks for the insights & help!
Daniel

----


Good day,

Yes, I am indeed using the engine damping parameters to model the cx' behavior of my system dynamics. I am using the default Bullet engine.

I have also tried to perform external damping, i.e. calculating the speed from position-measurements and applying the damping constant to this, and then only applying the resulting force (F_res = F - cx') to my Coppelia simulation. The results can be seen below:

(https://i.ibb.co/Qb1xq7r/force-input-th ... damped.png)

So still, the simulation still does not fully behave like I would have expected.


My dynamics engine timestep was indeed 5ms, with a 50ms simulation timestep. However, even after adjusting (so moving dynamics engine timestep to 50ms), the same behavior continued to occur.

I will have another look at the dynamics engine general properties (e.g. scaling)! I hope that you will also be able to share some more insights.

Many thanks,
Daniel

Post Reply