LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation Loop ODE Solver

Solved!
Go to solution

I keep getting Error 2324: Labview Simulation Module: The ODE solver cannot meet the error tolerance using the minimum step size. I've broken my code down and my signal multiplication function seems to be the cause. If I don't multiply things it works fine. If I do, I get the error. Any ideas?

 

Thanks,

Brian

0 Kudos
Message 1 of 23
(4,847 Views)

Hey,

 

Did you try to debug the VI and probe your signals, maybe you have an NaN value somewhere.

 

Christian

Message 2 of 23
(4,828 Views)

Brian,

 

The Simulation Loop has some parameters that needed to be changed. In general, you can try to reduce the stepsize (double-click on the terminal on the left of the Simulation Loop) and change the minimal step size. Also, it is worth to change the relative and absolute tolerance to relax the values. If you increase, you can have some results.

 

Additional to that, in general, if you try to use a "pure" PID, you run into some numerical issues because of the transfer function has no limits and, also, if you try to have "KD" different than zero, it won't even run the simulation. To avoid this problem, use a value for the high frequency time constant higher than zero. This way, you won't run into this problem.

 

If you still have questions, please feel free to reply with you actual code and version of LabVIEW that you use.

 

Cheers!

Barp - Control, Simulation, RTT and HIL - National Instruments
Message 3 of 23
(4,812 Views)
Thanks Barp. I'd run into that problem with the derivative gain but was just hoping I could get away with PI control. That certainly clears one problem up. However, I'm unable to find a combination of step sizes and tolerances that will allow this to work. Do you have a standard range of values that usually work? I'm using Labview 8.5.

Thanks,
Brian
0 Kudos
Message 4 of 23
(4,793 Views)

Well, your simulation has a numerical problem in your configuration. If you see your block diagram, you are trying to divide a sinewave by the output of the system and, as you know, division by zero is not very appreciated by the simulation node.  Smiley Happy

 

Is it possible to remove this singularity by adding 2 to the sinewave or change the waveform to something that doesn't go to zero? If you do that, you just need to change the max stepsize to reduce a bit since it will do a longer step than it was supposed to be.

 

Hope this makes sense. Please feel free to reply if you have more questions!

Barp - Control, Simulation, RTT and HIL - National Instruments
Message 5 of 23
(4,759 Views)

Hi Barp.

 

It's me again. Your suggestions worked like a charm. However, I've run into some more problems as I try to tune the system. If I set the proportional gain to 11, the system runs wonderfully and I get great asymptopically stable graphs like I would expect for the system. However, if I set the proportional gain to 12, the program behaves strangely and won't give me full graphs. But once I step the grain up to 14, it's back to normal again. What is going on?

 

Thanks,

Brian

0 Kudos
Message 6 of 23
(4,684 Views)

In general, the problem you are running into is because there is some parameters for the solver that is not correctly set. I noticed that you have a Runge-Kutta 23 with 1 as maximum stepsize. Try to change to Runge-Kutta 45 with smaller stepsize 45. To change the solver, you just need to double click at the left node of the Simulation Loop. This should bring the configuration for the solver.

 

If you can't make it work, feel free to post your VI again with the parameters in place that gives you the incorrect result. To do that, you just need to put all parameters that gives you problem on the controls and go to the "Edit" menu and select "Make Current Values Default" and save the VIs. This way, when I open your example I can see what you have.

 

Cheers!

 

Barp - Control, Simulation, RTT and HIL - National Instruments
Message 7 of 23
(4,671 Views)

Hi Barp,

 

I'm trying to implement a physical current controller within a simulation loop and I'm running into the same ODE solver problems. Any suggestions for parameters?

 

Thanks,
Brian

0 Kudos
Message 8 of 23
(4,459 Views)
Brian, I tried to take a look at your code, but it is not clear in your zipped file what I should be opening. (It seems to be folders inside folders inside...) Could you please attach just your code or tell me where I should be looking inside this zip file and what I should run? Thanks, Christina Applications Engineer National Instruments
0 Kudos
Message 9 of 23
(4,431 Views)

The folders are because there are drivers for my servo controller included (otherwise you won't have some of the .vis in my code). You can find the actual code here:

EPOS Take 5 Folder/Documents and Settings/User/My Documents/UW/Research/Control System/EPOS Take 5.vi

 

Thanks!

Brian

0 Kudos
Message 10 of 23
(4,412 Views)