How Do I Set Simscape Multibody Spring Damper Initial Properties?

36 次查看(过去 30 天)
I've been having some issues in much larger code I've been working and seem to have narrowed it down to the spring damper block.
I have a spring damper block between two frame transforms. The spring damper block is set to an initial position of zero. I would assume, then, that this means that the spring is at 0 length, meaning that the initial position of the block relative to the world frame would be simply the two frame transforms added together.
This is not the case.
I am not sure why this is happening, or if there's some other way I should be setting this up. This is a simplified example of what I have going on elsewhere in larger code - the "world" frame there is the center of the body, and then there are transforms to the hard mounts on the body where other systems actually connect. I've found that adding a spring damper block helps the simulation tremendously, but this failure to initialize correctly is killing my program.
Any help would be greatly appreciated, even if it's just an explanation of why this isn't working the way I expected.

采纳的回答

Sebastian Castro
Sebastian Castro 2016-5-31
I think what you want to do is use a Prismatic Joint block instead of a Spring and Damper Force block.
This block lets you specify an initial position target, as well as spring and damping. If you want the system to start at the spring equilibrium position, set up the initial position target to 0 and see if that's what you wanted.
When I try this, I get the Transform Sensor starting at -2 and ending at about -2.1. I believe this matches what you said you expected.
In fact, I didn't even know you could use the Spring Damping and Force block like that! The typical way to use Simscape Multibody is by defining degrees of freedom using joint blocks. The Spring and Damping Force block is useful when you want a straight-line spring force between two coordinate frames that may not be directly tied to a single degree of freedom.
- Sebastian
  2 个评论
Chuck Saunders
Chuck Saunders 2016-5-31
编辑:Chuck Saunders 2016-5-31
Well, it's frustrating that the spring damper block even exists then. Thanks for your tip; I had forgotten that those parameters existed in the joint (under internal mechanics instead of actuation).
Sebastian Castro
Sebastian Castro 2016-5-31
Again, there are other use cases for that block -- in situations where the straight-line direction of the spring/damping force is not along the same axis as the permitted motion.
- Sebastian

请先登录,再进行评论。

更多回答(1 个)

Omar Crypps
Omar Crypps 2016-10-2
Hi, I designed a model of 1 degree of freedom on Solidworks and i followed all the steps to export it to the Simulink of Matlab. However, there is always an error that appears after exporting it on Simlink.
Unfortuntely, I can't add a screen shot here but the error tells me " Constraint is not supported , the constraint has been exported as unknown constraint .

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by