Body position constrained by ChLinkTSDA spring rest length

30 views
Skip to first unread message

Roberto Echeverria

unread,
Nov 5, 2021, 9:19:54 AM11/5/21
to ProjectChrono
Dear all,

I am trying to simulate a simple box attached to a virtual ground object.
On first instance i am defining a prismatic constraint so that the box can only move in the X-Axis.

constr_Box_Ground = chrono.ChLinkLockPrismatic() 
constr_Box_Ground.Initialize(Box, ground, chrono.ChCoordsysD(Box.GetPos(), chrono.Q_from_AngY( m.pi/2 )))
system.AddLink(constr_Box_Ground)

On top of that i am defining a spring (ChLinkTSDA) with a rest length of 2 units.

force_Box_Ground = MySpringForce()         
spring_Box_Ground = chrono.ChLinkTSDA()
spring_Box_Ground.Initialize(Box, ground,True, chrono.ChVectorD(0, 0, 0), chrono.ChVectorD(0, 0, 0), False,2)
spring_Box_Ground.RegisterForceFunctor(force_Box_Ground)
spring_Box_Ground.AddAsset(chrono.ChPointPointSpring(0.05, 80, 15))
system.AddLink(spring_Box_Ground)

I want to start the simulation with the box located at a different position than the rest length so that the box should start bouncing from one direction to another without adding any mass so, i change the position of the Box.

Box.SetPos(chrono.ChVectorD(5, 0 , 0 )). #5units in the X axis

The problem here is that the position of the box  is overridden by the spring rest length and in the beginning of the simulation the box  appears at a distance of 2 from the origin instead of 5.

Is this behavior intended? How can i start the simulation with a spring length different than the rest length?

Kind regards

Roberto


Radu Serban

unread,
Nov 6, 2021, 6:14:41 AM11/6/21
to rob...@gmail.com, ProjectChrono

No, the behavior of the TSDA force element is as you expect it.   See demo_IRR_spring.py which shoes exactly this.

I’m not exactly sure what is happening in your code (as far as I can tell, the parts you showed are correct).  If I were to guess is that you have a relatively large damping coefficient (and maybe spring constant) in your definition of MySpringForce which make it so that the body very quickly settles at the rest position. Start by setting a zero damping coefficient.  Does the system behave as you expect it?  If not, please post your entire code.

 

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/430f4a6d-aac5-4cc0-8dfe-4dccbb8ff58dn%40googlegroups.com.

Roberto Echeverria

unread,
Nov 8, 2021, 3:00:12 AM11/8/21
to ProjectChrono
Goog morning Radu and thanks for your answer as it was exactly what was happening. The damping coefficient was so high and the integration time was too large, the combination of both was forcing the system to go its stable position as soon as the simulation started.

I am trying to simulate some components with huge turning inertia of a wind turbine (blades) in combination with smaller components located at the center of rotation, I am learning little by little that the differences in inertia require much smaller integration times.

Thans again and kind regards

Roberto
Reply all
Reply to author
Forward
0 new messages