Drift in simMechanics forward dynamics solver

2 次查看(过去 30 天)
I have boiled this down to the following simple example:
Say you were trying to model a plank not attached to the ground in SimMechanics (for a simple 2-D case). You would need a body with two joints attached to ground, one at -Rarm from the center of gravity, one at +Rarm from the center of gravity. These joints would need 1 prismatic DOF(allowing the up and down motion) and 1 rotational DOF (allowing their relative angles to change..
If you apply the same upward force to each side, (essentially pushing up on both sides of the plank with the same force) you would expect the entire body to move upward without rotation. However, when I attempt this, not only do I get the expected upward motion, I also get a very slight rotation.
If I put a body sensor on it, the angular accel looks like numerical noise around 0... the angular rate looks like a ramp and the angle looks parabolic. I assume someone is going to say something like--once you double integrate the error in angular acceleration your angle drift is pretty bad. But why is there any error at all if the forces are exactly the same at exactly the same distances away?
  2 个评论
Arnaud Miege
Arnaud Miege 2011-5-23
Can you upload your model to a filesharing site? It'd be a lot easier to comment on what's going on or make any suggestions.
Matt Anderson
Matt Anderson 2011-5-24
sorry, I had them email me when answers were added...but I guess not comments. I will work on this.

请先登录,再进行评论。

回答(1 个)

Guy Rouleau
Guy Rouleau 2011-5-24
Based on the description, it seems like your model contains a closed loop (something like ground-Joint-Body-Joint-Ground).
If this is the case, then SimMechanics cuts the loop at one joint and replace it by a constraint. This is explained here:
If you want to see which joint is replaced, enable the "Mark automatically cut joints" from the model configuration
Because of this "cutting", your closed loop is not as symetric as you think. One side is ideal and one side is resolved with a constraint.
One thing you can do is to put a Machine Environment block in the model. In the Constraint Tab, set the solver type to "Machine Precision". As explained here, this is your best bet for maximum accuracy:
However this is not perfect. As you mention, position is double integration of the force actuation. Consequently, even a small error the level of machine precision, when integrated twice will grow over time.
  3 个评论
Guy Rouleau
Guy Rouleau 2011-5-27
The scaling can help, but this is not guaranteed.
Can you provide more details on what is your end goal?
In real life, there will for sure be a small unbalance if one tries to build such system. It can be a small difference in the friction, the center of mass not exactly in the center, etc.
Knowing your final goal can help viewing the problem from a different angle and find how to get what you are really looking for.
Matt Anderson
Matt Anderson 2011-6-1
But these angular rotations fall in with what I am trying to measure, is there any way to decrease the numerical error. That is why I had decreased the tolerances. Does the numerical error come from the double integration of a double precision number and cannot be improved upon?
Arnaud Miege 8 days ago
What do you mean by what you are trying to measure? What is it you are trying to do? If there is no rotation, you can get rid of the revolute primitive in the custom joints or simply use a prismatic joint. The mass and inertia parameters are also tiny, and that's likely to cause numerical problems (when it comes to inverting the mass matrix, which will have a very small determinant)
Matt Anderson 8 days ago Delete
Yes, they are tiny values but real. I mean to close the loop around the revolute primitive, but the force is proportional to 1/d^2 of the prismatic distances...so when it rotates these distances go apart and the controller has to respond to drive the numerical drift to zero as well as the accel I am trying to measure. Would it help to scale all the values up by 1e6 and work in micrometers?
The model I provided was a striped down version of the plant with only 1 revolute and 1 prismatic. I am modeling a levitating disk with 6 degrees of freedom, but the fundamental problem is in the model I showed.
Matt Anderson 8 days ago Delete
The full plant model is extended by another revolute and all four points at (0,Rarm,0)(0,-Rarm,0)(Rarm,0,0)(-Rarm,0,0) are controlled by forcing them in the prismatic z direction. So, not only is the revolute necessary, there is actually another one.
Matt Anderson 8 days ago Delete
By the way, your ability to quickly cut to the most likely causes is very impressive. Thanks for your help so far.
Arnaud Miege 6 days ago
Not sure what else to suggest. Adding some control over the revolute joint will definitely help (I think) or in the short term, adding a stiff joint spring & damper to restrict the rotation. With regards to your problem, did you have a look at the Stewart platform demo models that ship with SimMechanics? It's not exactly what you're doing, but is fairly similar. See for example mech_stewart_trajectory.mdl.
Matt Anderson less than a minute ago Delete
yes, the Stewart platform is very close to my system...thanks for your help.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Assembly 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by