LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation doesn't stop in Control & Simulation Loop

Solved!
Go to solution

I am working on a regulation in a Control & Simulation Loop. I have created a state space model and an observer in it.

Now i have implemented nearlly everything but now the simulation doesn't stop.

 

At first here is an image of the .vi when it still works:

1.jpg

 

But this isn't the final result i want to have.

I want to connect the output of the subtrahation (x-y 2) to the input of the outer product.

You can see it on the following picture:

2.jpg

 

If i do so, my simulation continious and never stops. The simulation time is still set to 10 sec.

 

Attached is the .vi. I hope someone can help me.

0 Kudos
Message 1 of 9
(4,162 Views)

Hi!

Did you try to use the "Halt Simulation Function"?

 

Stopping a Simulation Programmatically (Control Design and Simulation Module) - LabVIEW 2014 Control Design and Simulation Module Help - National Instruments
http://zone.ni.com/reference/en-XX/help/371894H-01/lvsimhowto/sim_h_stopprog/

Regards,

 

Julika Spitz

0 Kudos
Message 2 of 9
(4,129 Views)

I didn't use the halt funktion.

 

I just set the simulation time to 10 seconds. If the blocks are wired like the first picture shows then the vi works well and stops after this 10 seconds.

The confusing thing for me is, that the simulation doesn't stop automatically if the blocks are wired like the second picture shows.

0 Kudos
Message 3 of 9
(4,124 Views)

I understand your problem.

I just think that it can work, when you use the halt simulation function (probably in combination with the express vi "Elapsed time") instead of the simulation time implementation.

0 Kudos
Message 4 of 9
(4,113 Views)

I tried the "halt function" togehter with the "elapsed time.vi".

Now the Simulation stops after arround 10 seconds but the simulation still doesn't work correct. I can see it on the Waveform Chart. 

In the first case, there were build waves along the ten seconds and in the second case, there is nearly nothing happening.

 

So any other suggestions?

 

I've edited my vi, so here is teh new version.

0 Kudos
Message 5 of 9
(4,103 Views)

Hi,

i tried a few things in your vi. There is a thing that is really suprising me. When i delete everything which is connected to the output y(t) nothing changes and you can still run the vi with the result of the first case (see attached file).  But I don't know why the reaction is changed in the second case with the back coupling, because y(t) is still the same output. Are you sure that the calculation in the state space is correct?

0 Kudos
Message 6 of 9
(4,079 Views)

I can't run your .vi because it is from version 14.0 and i am using 13.0.1f2 😞

But i agree. What you are describing sounds curious.

I am sure that the state space is correct. I have already used it in Matlab/Simulink and there the regulation works well...

0 Kudos
Message 7 of 9
(4,072 Views)

Hi,

as you can see in the attached image i tried to use a feedback node. I choosed constant 1 but you have to select a proper value. I think the first value wasn't defined and could cause an error.

0 Kudos
Message 8 of 9
(4,050 Views)
Solution
Accepted by topic author corleone13375

I don't understand your suggestion. I've implemented a feedback node but this doesn't fix the problem.

 

But i have found an other solution for the problem. I have build the .vi completly new and used the Signal Arithmetics from Control Design And Simulation group. The gain block  and the summation block works better in my case than the numeric add and multiply blocks. Now the simulation runs and the regulation works well.

0 Kudos
Message 9 of 9
(4,032 Views)