Home › Forum › SOFA › Using SOFA › JointSpringForceField Problems
Tagged: 64_bits, Linux_ubuntu, SOFA_1912
- This topic has 5 replies, 3 voices, and was last updated 3 years, 11 months ago by
Hugo.
-
AuthorPosts
-
27 May 2020 at 15:45 #16404
Edd
BlockedHi there,
I have recently been using the jointspringforcefield to represent a ball-joint style constraint with rigid bodies, that has angular stiffness and damping. I would like minimal translation movement between joined points (if possible none). An example is where I have set KS_T (translational stiffness) to 1e+10, and KS_R (rotational stiffness) to 5000, I find that with increased value of KS_T that the overall system appears damped, almost as if the translational stiffness is interfering with the rotation stiffness and damping. If the provided scene file has the values of KS_T varied the change in behavior is apparent.
Am I mistaken on how to model this, or is there a different approach?
Also I see the documentation states that KD is damping coefficient, is this for rotational or translational? As no more detail is provided.Thank you for your help!
<?xml version="1.0" ?> <Node name="root" gravity="0 -9.81 0" dt="0.01" time="0"> <RequiredPlugin name="SofaOpenglVisual"/> <RequiredPlugin name="SofaPython" pluginName="SofaPython" /> <Gravity name="G" gravity="0.1 0 0" /> <VisualStyle displayFlags="showBehaviorModels showCollisionModels showForceFields" /> <VisualStyle displayFlags="hideVisual showBehaviorModels showForceFields showCollisionModels showMechanicalMappings" /> <BruteForceDetection name="default40" /> <DefaultContactManager name="default41" response="default" /> <DefaultPipeline name="default42" /> <MinProximityIntersection name="default43" alarmDistance="1" contactDistance="0.5"/> <EulerImplicitSolver name="cg_odesolver" printLog="0" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver template="GraphScattered" name="linear solver" iterations="25" tolerance="1e-009" threshold="1e-009" /> <Node name="default44" gravity="0 -9.81 0"> <PythonScriptController filename="keyboardControl.py" classname="KeyboardControl"/> <MechanicalObject template="Rigid3d" name="DOFs" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1 3 0 0 0 0 0 1 5 0 0 0 0 0 1 7 0 0 0 0 0 1" velocity="0 0 0 0 0 0" force="0 0 0 0 0 0" externalForce="0 0 0 0 0 0" derivX="0 0 0 0 0 0" restScale="1" /> <FixedConstraint template="Rigid3d" name="fixOrigin" indices="0" /> <UniformMass template="Rigid3d" name="mass" totalMass="1" /> <Node name="default45" gravity="0 -9.81 0"> <MechanicalObject template="Rigid3d" name="attaches" position="0 0 0 0.707914 0 0 0.707914 -1 0 0 0.707914 0 0 0.707914 1 0 0 0.707914 0 0 0.707914 -1 0 0 0.707914 0 0 0.707914 1 0 0 0.707914 0 0 0.707914 -1 0 0 0.707914 0 0 0.707914 1 0 0 0.707914 0 0 0.707914 -1 0 0 0.707914 0 0 0.707914 1 0 0 0.707914 0 0 0.707914" velocity="0 0 0 0 0 0" force="0 0 0 0 0 0" externalForce="0 0 0 0 0 0" derivX="0 0 0 0 0 0" restScale="1" /> <FixedConstraint template="Rigid3d" name="fixOrigin" indices="0" /> <RigidRigidMapping template="Rigid,Rigid" name="default46" input="@.." output="@." repartition="1 2 2 2 2" /> <JointSpringForceField template="Rigid3d" name="joint springs" spring="BEGIN_SPRING 0 1 FREE_AXIS 0 0 0 1 1 1 KS_T 1e+3 1e+3 KS_R 500 500 KD 50 R_LIM_X -0.8 0.8 R_LIM_Y -1.57 1.57 R_LIM_Z -2 2 END_SPRING BEGIN_SPRING 2 3 FREE_AXIS 0 0 0 1 1 1 KS_T 1e+3 1e+3 KS_R 500 500 KD 50 R_LIM_X -0.8 0.8 R_LIM_Y -1.57 1.57 R_LIM_Z -2 2 END_SPRING BEGIN_SPRING 4 5 FREE_AXIS 0 0 0 1 1 1 KS_T 1e+3 1e+3 KS_R 500 500 KD 50 R_LIM_X -0.8 0.8 R_LIM_Y -1.57 1.57 R_LIM_Z -2 2 END_SPRING BEGIN_SPRING 6 7 FREE_AXIS 0 0 0 1 1 1 KS_T 1e+3 1e+3 KS_R 500 500 KD 50 R_LIM_X -0.8 0.8 R_LIM_Y -1.57 1.57 R_LIM_Z -2 2 END_SPRING " /> </Node> <SphereCollisionModel template="Rigid3d" name="Cubes For Collision Cube1" radius="0.2" /> </Node> </Node>
28 May 2020 at 21:32 #16452Binesh
BlockedHi @eddhoare
if you want to reach to minimum translation between joint points you must increase K coeff to high value such as 1e+10 for rotation and translation but high value ignore some features such as collision computation . you must tune this value based on your scene.
if you want to get any delay between joints you can separate “Visual” model and “Collision” model in your sceneBest,
Behnam Binesh
31 May 2020 at 23:45 #16478Hugo
KeymasterHey @eddhoare
I read maybe to fast your post, but you are saying that you are having damping effect due to stiffness, correct?
You should see your EulerImplicitSolver: you are adding Rayleigh damping related to stiffness. This numerical damping will therefore depend and act with the defined stiffness of your system. You should set it to 0 by default.Best,
Hugo
1 June 2020 at 11:39 #16494Edd
BlockedHi Behnam and Hugo,
Thank you, both of your help is very appreciated!
I shall try this immediately!Kind regards, Edd.
1 June 2020 at 12:38 #16498Binesh
BlockedHi Dear @Hugo
zero(0) value for Rayleigh damping in euler solver make our scene very unstable and we set 0.1 for this variable.
is it OK?Best,
Behnam Binesh
6 October 2020 at 13:50 #17292Hugo
KeymasterHi @secretdevil
Sorry I did not reply to your comment.
I always advise to use default 0 Rayleigh parameters in order to make sure of what you are actually simulating (physical parameters and numerical settings).Subsequently adding damping will change the physical behavior by damping your system, thus making it more stable (because more robust to sudden changes). But it means you are not working with the same modeling assumption anymore.
Best
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.