Problem with "initial conditions failed to converge" when connecting rotational to translational system

6 views (last 30 days)
Hello, I have a problem with connecting a translational to a rotational system. Since the wheel axle doesn't fit my requirements I wrote myself a block (source code below). This block works ok with a force source (constant or varying inputs are both ok) and a ode14x solver. Ode 23t generates many warnings. As soon as I want to connect my block to a pneumatic piston chamber and connect the chamber to an orifice and a heat flow source I get a "initial conditions failed to converge error". It works ok without an orifice being directly connected to a pneumatic atmospheric reference but still generates warnings. My source code is the following:
component PKK
%Connector translational to rotational system
nodes
A=foundation.mechanical.rotational.rotational;%rot:left
P=foundation.mechanical.translational.translational;%trans:right
end
parameters
radius={0.0064,'m'};%Radius
laenge={0.0205,'m'};%length
Phi0={pi,'rad'};%Initialwinkel
Phider0={1,'rad/s'};%Initialwinkelgeschwindigkeit
end
variables
t={0,'N*m'};%torque through
w={1,'rad/s'};%Rotational velocity acrosse
f={586.5194,'N'};%force through
v={0,'m/s'};%velocity across
phi={pi,'rad'};
end
function setup
%Through and across variables for mechanical motion
across(v,P.v,[]);
through(f,P.f,[]);
%Through and across for rotational motion
across(w,A.w,[]);
through(t,A.t,[]);
phi=Phi0;
end
equations
v ==(-radius*sin(phi)+radius*radius*sin(phi)*...
cos(phi)/sqrt(laenge*laenge-radius*radius*...
sin(phi)*sin(phi)))*w;
w == phi.der;
t*w == f * v;
end
end
Is there something wrong with the code? I am sure that my mass and my inertias initial conditions fit together. But I don't know what to do with the initial conditions of my pneumatic piston chamber. The initial extension ist ok, do I need to adapt the others as well? And if, how do I know the connection between the variables to calculate the initial conditions? Or did I make a completely different mistake? Here is one of my models: Without piston chamber: http://www.mathworks.de/matlabcentral/fileexchange/34690-problematic-model-without-pneumatic-piston-chamber and heres the one with piston chamber: http://www.mathworks.de/matlabcentral/fileexchange/34735-problematic-model-with-pneumatic-piston-chamber/content/Problematic_model_with_pneumatic_piston_chamber.mdl
Thanks for any help. Regards, Janne

Answers (5)

Guy Rouleau
Guy Rouleau on 21 Jan 2012
Your code looks good. I think that the issue is that it often (depending on how it is connected) lead to index-2 DAE.
The equation linking V and W is non-linear, which can be difficult for the Simscape solver to solve.
What I recommend is to include stiffness and damping between the rotational and translational part.
The variable ratio transmission block included with SimDriveline uses this technique to avoid resulting in index-2 DAE. Looking at the documention for this block should help to implement the stiffness and damping:

Janne
Janne on 24 Jan 2012
Is that the only possibility? In a simple model a high stiffness works very well, but in my more complex model I get the following error if the stiffness is higher than 1e8: Derivative input 7 of 'Otto_prozess_rot_customblock/Solver Configuration/EVAL_KEY/EXEC_BLOCK1' at time 0.0005 is Inf or NaN. Stopping simulation. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances) Or might that be caused by something different? Thanks for the answer, but I had hoped for a more elegant solution. Regards Janne

Guy Rouleau
Guy Rouleau on 25 Jan 2012
I looked at the model you linked, but the custom file is missing, like the parameter values.
Adding stiffness and damping make your block more "flexible"... both in the mechanical sense and in the sense that it is easier to connect. This means that the Simscape solver will be converge even if initial settign of blocks do not match... the flexibility of the block will absorb the difference.
I noticed that in your model, a fixed-step solver is used. With a stiffness as high as 1e8, a fixed-step solver with step-size of 0.0005 will easily go unstable. A small deformation in the flexible gearbox will generate a very large force... that will then generate a large deformation and bang... infinite derivative.
With Simscape , I always recommend starting with a variable step solver (stiff, like ode15s) before considering moving to fixed. The following link can help with that:
The only other possible cause for the error you receive is that there is an inconsistency in the initial values for the blocks in your network. For example, are your certain that the initial velocity of the Mass and of the Rotational inertia on each side of your block match?
If they don't this could explain the error message you get.
If you want us to give a deeper look, I would recommend contacting technical support with your model and all necessary files to run it.

Janne
Janne on 25 Jan 2012
Hello Guy, well I chose an angle phi of pi(rad), a translational velocity v of 0m/s, an agular velocity w of 1rad/s, a torque T of 0 and a force F of 0, radius and laenge have a value different to zero. The force is the only thing where I am not sure, because there the pneumatic piston chamber might produce a different value(due to the initial pressure and temperature not being identical to the ambient pressure and temperature). But
T*w=F*v; -> that should be fine
w=phi.der; -> phi got an initial value and
v ==(-radius*sin(phi)+radius*radius*sin(phi)*... cos(phi)/sqrt(laenge*laenge-radius*radius*... sin(phi)*sin(phi)))*w;
-> in this case v == 0*w, because of the value of phi.
So I think all should be fine - am I mistaken?
Regards and thanks,
Janne
  1 Comment
Guy Rouleau
Guy Rouleau on 26 Jan 2012
Everything you mention here looks good to me... you seem to know very well what your are doing and have verified everything carefully.
The only thing I can think of is the Index-2 DAE limitation I mentioned before.
Without all your files to reproduce, I am not sure what else to add.

Sign in to comment.


Janne
Janne on 13 Feb 2012
Well I kind of figured it out. I added a spring but at first the results didn't make any sense. By moving the spring into different places I found at last one place, where it doesn't affect my system too badly. I think my biggest problem was figuring out where to put that spring to still get acceptable results. Especially because at first I thought the place where I inserted the spring wouldn't make a difference at all. Thanks a lot for all your answers, they were very valuable to me and helped me a lot in solving my problem.

Categories

Find more on Foundation and Custom Domains in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!