Leaf spring substitute system

Simbody is useful for internal coordinate and coarse grained molecule modeling, large scale mechanical models like skeletons, and anything else that can be modeled as bodies interconnected by joints, acted upon by forces, and restricted by constraints.
POST REPLY
User avatar
Walter Lux
Posts: 3
Joined: Mon Apr 18, 2022 2:56 am

Leaf spring substitute system

Post by Walter Lux » Tue Jul 16, 2024 7:40 am

I want to describe the shape of a leaf spring in a simplified system where a chassis is fixed to the ground and an axle with tires is constrained to always remain on the ground. Essentially, I have three points between which I want to mount the leaf spring.

I create the leaf spring using rigid bodies, each connected by 2 pins. Each of these pins is assigned a spring stiffness. The spring is hinged to the 2 chassis points with a pin each. Ideally, I want to insert the leaf spring into the system in its undeformed state with defaultQZero = 0, so that the leaf spring assumes its shape due to the assigned spring stiffness upon assembly. Is this possible?

Currently, I have the problem that when I realize the topology, as expected, in Model-stage, the spring does not deform correctly according to the spring stiffness. When I subsequently raise the stage to acceleration, the deformation of the spring remains the same.

Is there a way to correctly describe the deformation of the leaf spring based on the stiffness in the initial state?

Thanks!

for (int i = 0; i < segments; ++i)
{
SimTK::MobilizedBody::Weld nextSegment(previousBody, SimTK::Transform(SimTK::Rotation(), segmentPosition), segmentBodyInfo, SimTK::Vec3(0));

// Create Y and Z pins for the segment
SimTK::MobilizedBody::Pin nextSegmentYPin(nextSegment, ZtoY, pinYBodyInfo, SimTK::Vec3(0));
SimTK::MobilizedBody::Pin nextSegmentZPin(nextSegmentYPin, YtoZ, pinZBodyInfo, SimTK::Vec3(0));

// Create springs for the Y and Z pins with the determined stiffness
SimTK::Force::MobilityLinearSpring leafSpringPoint4YSpring(forceSubsystem, nextSegmentYPin, SimTK::MobilizerQIndex(0), stiffnessY, 0.0);
SimTK::Force::MobilityLinearSpring leafSpringPoint4ZSpring(forceSubsystem, nextSegmentZPin, SimTK::MobilizerQIndex(0), stiffnessZ, 0.0);

lastPin = nextSegmentZPin;
previousBody = nextSegmentZPin;
}

User avatar
Michael Sherman
Posts: 809
Joined: Fri Apr 01, 2005 6:05 pm

Re: Leaf spring substitute system

Post by Michael Sherman » Tue Jul 16, 2024 8:40 am

Assembly analysis is for satisfying position constraints. In this case it sounds like you would like the spring to minimize its stored potential energy, that is have the system relax so that it is in a steady state. That's a "static" or "equilibrium" analysis, if I understand your question.

Simbody doesn't have a built-in analysis for that but you can achieve it in various ways. The most straightforward would be to set up an optimization problem that adjusts q's to minimize potential energy. But an easy alternative is to add some damping, then run a forward analysis until the system stops moving. Then record the resulting configuration and use it as the initial conditions for your simulation.

Regards,
Sherm

User avatar
Walter Lux
Posts: 3
Joined: Mon Apr 18, 2022 2:56 am

Re: Leaf spring substitute system

Post by Walter Lux » Wed Jul 17, 2024 7:02 am

Thank you for the quick response and the help! You understood the question correctly, it is a static analysis.

Today, I tried the second solution. I assigned realistic masses and inertias to all bodies. I can run the system without assigning spring stiffness to the leaf spring. Even with small spring stiffness values and few solid links, the simulation takes an extremely long time. Besides the RungeKuttaMersonIntegrator, I also tried the CPodesIntegrator, which is recommended for stiff problems. Is there anything else I can test?

I think I will need to try optimization. Thank you for this idea.

Regards,
Walter

User avatar
Michael Sherman
Posts: 809
Joined: Fri Apr 01, 2005 6:05 pm

Re: Leaf spring substitute system

Post by Michael Sherman » Wed Jul 17, 2024 7:40 am

You could try:
- CPodes limited to Order 1 (that makes it implicit Euler)
- SemiExplicitEulerIntegrator
- Use fixed step or very loose accuracy requirement, like 10%
- Use less damping or large masses to avoid extreme stiffness

Optimization is still probably the most direct approach.

User avatar
Walter Lux
Posts: 3
Joined: Mon Apr 18, 2022 2:56 am

Re: Leaf spring substitute system

Post by Walter Lux » Tue Jul 23, 2024 7:24 am

I've now optimized the q's, and although I haven't solved all the problems yet, it works perfectly in a test system. The optimization was much easier than I thought, thanks to the easy-to-understand example. Comparing it to a spring with low stiffness that can oscillate, the result is the same, but it happens much faster!

It's truly amazing what can be achieved with Simbody. Thanks for the idea and the work on Simbody!

User avatar
Michael Sherman
Posts: 809
Joined: Fri Apr 01, 2005 6:05 pm

Re: Leaf spring substitute system

Post by Michael Sherman » Tue Jul 23, 2024 9:15 am

Awesome! Thanks, Walter.

POST REPLY