Simulation Loop ODE Solver

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
Solved!
Go to Solution.
Attachments:
Signal Multiplication.JPG ‏46 KB

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 and Simulation Group - LabVIEW R&D - National Instruments

Similar Messages

  • Memory function in Control and Simulation loop - ODE solver problem

    Hello,
    I am currectly using the control & simulation loop to simulate the behaviour of what is essentially a spring-damper-mass system. In the process the change in time (dt) is being used to integrate an arbitrary value. I am using a built in memory function to store the time, to calculate the time change (dt).
    The simulation is rather complex, due to the necessary accuracy needed, not all the ODE solvers can handle it. Currently I am using Adams-Moulton method, this works fine for the simulation. However it cannot detect the change in time, the change is constantly zero. This problem worked it self out by using another ODE solver, but then the simulation was rather messed up (even when I tuned the step sizes and tolerances). So I am quite confident that Adams-Moulton is one of the best suited ODE solver for the problem at hand.
    Is there another way to store the previous time and use it calculate the time difference, than using the memory function? Has anyone experienced such problems before?
    I have been doing alot of error searching using the probe, but I am quite sure that there is a problem with the ODE solver and the memory function. See picture below, showing in basic how the change in time is being calculated.
    I am rather new to LabVIEW, so if there could be something else I have missed I will be glad to hear it.
    PS! I have tuned the minimum step size/relative and absolute tolerances for the Adams-Moulton to simulate the behaviour of the system correctly.
    Solved!
    Go to Solution.

    Hi Willy,
    I am sorry, I can not upload the VI some of the content is confidential. I have attached a larger picture of the section were the change in volume and time is calculated, dV and dt. Also I have marked the two memory functions used. Hopefully this can help.
    My parameters:
    - ODE solver Adams-Moulton
    - Relative tolerance      1e-8
    - Absolute tolerance     1e-7
    - Minimum step size     0,0005
    - Maximum step size    0,01
    - Initial step size           0,01
    - Auto discrete time      On
    - Decimation                 0
    - Synz loop to timing source off
    Attachments:
    06-05-2014 21-20-00.png ‏52 KB

  • Simulation loop feedback

    Can someone tell me how to input a process variable to PID.vi inside of a simulation loop? I'd use a shift point (I think that's what it is called), but that doesn't seem to work with simulation loops.
    Thanks,
    Brian

    muks wrote:
    But am still not sure about simulation loop.
    A Simulation loop is part of the LabVIEW Control Design and Simulation Module.
    bcglaxer,
    The Simulation loop does not allow shift registers because you can create feedback loops by simply wiring the output of a system back to its own input (usually through a summation block).  In the case of "PID.vi", this VI isn't very well suited for use inside a Simulation loop because the loop natiely calculates integrals based the user configured ODE solver settings.  The integral calculation done by "PID.vi" are not necessary in this case.  A better solution for PID control with a Simulation loop would be to use "CD Construct PID Model.vi" ouside of the loop, then wire the model into a Transfer Function block inside the loop.  See the attached image to see how this can be done.
    I would strongly recommend reading through the documentation for the Control Design and Simulation Module.  In LabVIEW, go to "Help>>Search the LabVIEW Help", then expand the "Control Design and Simulation Module" section in the "Contents" tab.
    Chris M
    Attachments:
    pid_simulation.JPG ‏28 KB

  • Control & Simulation Loop failed to compile

    Dear Forum Members,
    I have a problem with a Control & Simulation Loop program (attached) that just doesn't compile & run.  I believe that the problem is associated with the 'Feedback Node' at the bottom of this Control & Simulation Frame since if this is taken out the program will run ok.
    Can anyone please advise me if this 'Feedback Node' is incorrectly used or in violation of anything.  I have tried various ways to overcome the problem i.e. initialising it at the start but nothing works.  The error message that I received just says "VI failed to compile".
    Appreciate any help with this.

    Hello bunnykins, 
    The Feedback node really isn't a supported function in control design and simulation. The behavior you're reporting, and the work around are both documented in the know issues of the module here: 
    201449
    Return
    A Feedback Node on a Simulation Diagram causes the VI to fail to compile
    The Feedback Node does not make sense semantically within a Simulation Diagram, due to the fact that most ODE Solvers will execute the diagram multiple times per iteration and may need to reject steps and try again, filling the Feedback Node with bad data.
    Workaround: Use the Memory block from the Simulation Utility palette. If a delay of greater than 1 is desired you can chain multiple memory blocks in sequence.
    Reported Version: 8.5
    Resolved Version: N/A
    Added: 07/31/2010
    Applications Engineer
    National Instruments
    CLD Certified

  • Basic simulation loop question

    Hi. I've been searching this board for quite some time, but couldn't find what I'm really looking for.
    I'm an absolute beginner when it comes to Labview. I'm working on a school project that includes controlling the pneumatic actuated inverted pendulum via Labview 2011 and cRIO9074, and I'm having trouble understanding all of the parameters in the simulation loop that grant real time simulation. What really bothers me are three parameters and their correlation: scan period (scan engine properties), step size and period (simulation properties). Right now I've achieved real time simulation with this parameters: scan period (10ms), step size (0.01ms), period (1(I don't know what unit)). When I try to change scan period to 5ms, the whole simulation speeds up twice ("simulation time" function displays 2s for every 1 second that passes in real time. 
    So can someone please explain these parameters in normal words (context help is confusing) and how to achieve real time simulation for desired sampling time?
    Thanks in advance! 

    There's more extensive help than the context help. Even from the context help, you can click "detailed help" to get to LabVIEW's help file. Did you look through this material? Here are a few tips:
    for real-time, only use a fixed step solver (RK1-4)
    choose the step size you desire, then select the "1 kHZ" or "1 MHz" clock. Select "Auto Period" and then you don't have to worry about calculating the period.
    Step size determines how much time is added to the simulation time every time the diagram executes. Period determines how many ticks of the hardware clock pass between every execution of the sim loop. If you want "real time" which implies that the simulation time passes at the same rate as actual time, then the "Auto Period" option will look at your step size, look at the clock you've selected, and automatically calculate the period required to run at real time.
    As stated in the help context, the unit of period depends on the clock you've selected. If you've selected a 1 kHZ clock, there are 1000 clock ticks per second and the unit of period (each clock tick) is 1 ms. If you select the 1 MHZ clock, there are 1,000,000 clock ticks per second so the unit of period is 1 us.
    Say you select the 1 kHZ clock and choose a period of 15. This means the simulation loop will execute once every 15 ms of actual time. If you want real-time, you should set the step size to 15 ms. This would cause the simulation time to advance at the same rate as actual time. If you set the step size to 30 ms, the simulation time will run twice as fast as actual time.
    I don't know anything about scan period; that is not a simulation parameter. Hope this helps, and good luck.

  • Synchronize Control and Simulation loops

    When simulating control systems with LV Control and Simulation loops, I often have multiple loops running at different rates. For example, I have a PWM loop running at 20 kHz, a data acquisition loop running at 100 kHz, and a control loop running at 10 kHz. How can I synchronize all of these loops so that they stay on the same time base? Obviously the master time base will need to be at least as fast as the fastest simulation loop.
    I've tried synchronizing all loops to the 1 kHz clock (I'm running on Windows), but each loop runs one period per clock tick (e.g. my 20 kHz loop counts up 50us per clock tick, my 100 kHz loop counts up 10us per clock tick, etc). I need all of the loops to be synchronized to one master time base so the simulation time is identical in each loop, but each loop will be executed at a different rate.
    Any thoughts?
    Solved!
    Go to Solution.

    Hello,
    A quick suggestion - why can't you run all three systems in a single simulation loop, but have different sample rates for the blocks for each system ?
    Is your system entirely digital, or a mixture of continuous and digital - it may simplify things if you can convert everything to discrete time.
    Hope this helps,
    Andy Clegg
    Consultant Control Engineer
    www-isc-ltd.com

  • Simulation loop timing

    I am having trouble runnnig my simulation in real time.  I am using LabVIEW version 10.0F2 and acquiring signals using a PCI-6230. In the simulation loop parameters, I am using the solver: Runga-Kutta 1 (Euler) with a step size of 0.005, and in the timing parameters I have it syncronized with the timing source, source type: 1 KHz clock with a period of 5.For a relatively simple VI these settings seem to work just fine. In a slightly more complicated VI, which happens to be saved as a Simulation SubVI for another VI, I see that the loop timing is completely off. Also by removing components of the subvi the timing changes drastically. Please advise.

    duplicate
    LabVIEW Champion . Do more with less code and in less time .

  • How to use Fuzzy Logic Controller for transfer function in labview control and simulation loop?

    I am facing problem with fuzzy PD logic controller for transfer function in control and simulation loop.
    Plz Help me in this regard...................
    i have attache snapshot of my program
    Attachments:
    fuzzy in simulation loop.JPG ‏52 KB

    Hi Sankhadip,
    Sorry for the late response. I was looking at your code and
    I noticed that the graph scale does not start from zero. That might be the
    reason why you don't see the transient in the simulation. To change the scales
    simply double click on the lower limit and set it to zero. If this is not the
    expected results, can you please post the expected results, so we can see what are the
    differences between the results . Also, you might be using different
    solvers, and that gives different results as well.    
    Thanks and have a great day.
    Esmail Hamdan | Applications Engineering | National
    Instruments

  • Input for CD Linear Simulation.vi in a Simulation Loop

    Hi I'm new to LabView and I was trying to implement a real time estimator for a linear system, so a steady
    state gain is acceptable (estimator doesn't need to be adaptive). It will be
    implemented in real time target (cDAQ). The estimator will get the acquired
    data (there are 2 inputs and 1 output) from the real system.
     I have learned and tried few different ways to do it but finally decided to try using CD State
    Estimator.vi (standalone) in a Simulation Loop. My questions are:
     1. I found that the only way to use the estimator model with the acquired input is by
    using CD Linear Simulation.vi. Is there another alternative to do the
    estimation?
     2. However, with CD Linear Simulation.vi I had problem: According
    to the LabView help, if the input signals are more than 1, we have to specify
    the input as 2D array with smaller dimension as the number of channels and the
    larger dimension as number of points in each channel.
     While for every execution in the loop I will get only 2 x 1 data (see appended array 3 in the
    attached example file). How can I be able to use the measured data as the two
    inputs for the CD Linear Simulation.vi?
     Thank you.
    Attachments:
    2015_03_31_Test DAQ in sim loop.vi ‏299 KB

    Hi Mike,
    Thanks for the reply.
    I browsed through some examples and tried some things; here are the updates, maybe useful for others in the future.
    About the CD Linear Simulation.vi; In the example finder I found CDEx Kalman Filter.vi which uses CD Linear Simulation.vi to compare the estimation with real system states for two inputs.  The number of samples of the inputs was given as a constant (e.g. N samples), from which the array of N x 2 data is built and fed to CD Linear Simulation.vi. So up to now I can’t see a way of using CD Linear Simulation for feeding input to the estimator model built from CD State Estimator.vi in a “real time “ way.
    I look forward to hearing from anyone if it can be done.
    So, from here I tried another alternative to implement this real time estimator: using Discrete State Space Function. So I generate the estimator state space model in Mathscript and feed it to that function.
    I use kalman (mathscript) function to generate the estimator model.
    Interesting thing is, (although irrelevant with my original enquiry), that this kalman command seems not generate correct estimator model with multiple input (e.g. if in the original system there are inputs u1 and u2 with one output y, I expect the generated estimator model would have three inputs i.e. u1, u2, and y. But the generated estimator only has one input (??)).
    I remember that the kalman command from Matlab has the same problem which I neglected at that time.
    So this time in labView I also did the same thing as the last time, which is taking the gain generated from the same kalman command and build manually the A and B matrices of the estimator.
    I haven't browsed though to see if someone has used this kalman command for multi input system and noticed this. 
    Nevertheless, this alternative seems working well so hopefully it works well too with the RT target.
    Thanks.

  • Simulation Loop: Code could not be generated correctly for this VI

    Running LabView Simulation 8.2 on Windows XP laptop.  I have a Simulation Loop that keeps generating the following error message:
    "Simulation Loop: Code could not be generated correctly for this VI"
    The only reference I can find in my searches is to using an RTX target, which does not apply.  When I click on Show Error it just highlights the Sim Loop
    Any ideas on how to debug this?

    Perhaps you can start removing things until you don't get the error any more. How big is the code in the loop?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Stopping the VI when running a infinite simulation loop

    Hi,
    This is my first time on this forum and for that matter, I started with Labview a few months back. I am developing a standalone application for servo motor control through USB 6211. The motor control was completed and I created a DLL which I could run through VC++. My application requires me to call this DLL or an EXE based on this VI repeatedly with direction, velocity and angle parameters and the remainder of the program depends on the finishing of this executable.
    The issue was that the VI did not stop execution after the motor was turned off, I suppose due to the simulation loop. I tried using the abort execution block but was advised to avoid doing so. My next step was to move all the DAQ assistant blocks into a while loop and couple the motor ON/OFF control with the stop button. But this hasn't helped either. I am attaching the VI and the SubVI here. I went through the board but did not come across a query involving a simulation loop. Any suggestions?
    Attachments:
    rotate.vi ‏551 KB
    Velocity_Con.vi ‏430 KB

    Hi Vivek!
    Thank you for contacting National Instruments.  From the information you have provided here, along with the attached VIs, I would agree that it is the simulation loop that is causing the problems when stopping the VI.  It looks like you are using the LabVIEW Simulation Module. 
    When using these loops there are two primary ways of stopping their execution.  The total simulation time can be controlled from the input node, the box at the upper left of the loop, or the Halt Simulation VI can be used from within the Utilities palette.  I would suggest taking a look at the detailed help for the simulation loop in order to better understand the methods of stopping this execution.  As you mentioned it is always good programming practice to avoid using the abort button because this can result in open references being left without any programmatic resolution.
    I hope this helps!  Let me know if there is anything else I can help with or clarify.  Have a great day!
    Jason W.
    National Instruments
    Applications Engineer

  • Simple counter within Control & Simulation Loop

    Does anyone know a simple way of creating an incremental counter within the Control & Simulation Loop ? It's not possible to have a For loop within the Control & Simulation Loop hence the shift register method is out.

    The "simulation parameters" function on the utilities pallete outputs a "Timestep Index" that is incremented each step. That's the simplest option. Alternatively, you could use a sub VI that executes on major steps and contains a for loop.

  • Simulation loop inside subVI inside a simulation loop

    First of all, let me just say, I've got to hand in my work in 24 hours so please any help will be appreciated.
    I've got a simulation loop inside a subVI inside a simulation loop. If I give the inner loop enough time to run, i.e make its duration smaller than the time step of the outer simulation loop. Shouldn't everything run smoothly? Or is this just a no-no with labview?
    Thank you

    Hi VicMackie,
    This help file on the properties of the Simulation Loop is likely to help you out.
    I believe from you posts that you're wanting the loop to run every second.
    Therefore you want to check "Synchronize loop to timing source" and set your 1kHz clock or set a 1kHz <reset> so that it'll reset on every invocation of the loop. From your post, I understand that you've already done this.
    As the period is in milliseconds, for a period of a second you'd want to set your period to 1000 milliseconds, which is the default (1000).
    I'd recommend leaving the step size at the default for now and just modifying the Timing Parameters tab to confirm whether the loop will execute every second if you set the period to 1000.
    Best wishes,
    Tori
    Student

  • Extract Signal Tone Information in Control & Simulation Loop

    Hi,
    I have a simple Block Diagram to try Control & Simulation Loop. I added a Sine Wave signal and a Waveform Chart connected to it. They work just fine.
    I tried to add a Extract Single Tone Information , from Signal Processing, and connect it to the output of the Sine Wave generator but I do not know how to create a proper Time Signal.
    I thought of storing the output of the Sine Wave in an array but I was unsuccessful since I could not add any shift register to this type of control loops.
    Any help or suggestions?
    Thanks
    Attachments:
    Control_n_Sim_Test.PNG ‏9 KB

    Hi Siamak,
    Thanks for your reply mate.
    However, when I built a same BD as you posted on, it somehow didn't work. I also attached a photo of my BD here.  I used the gauge to measure when I run the programme. The gauge shows there is no signal output after the "collector"VI (gauge no.13). would you please check it for me? Many thanks!
    BR
    Floyd
    Attachments:
    tone info extraction.png ‏134 KB

  • Maxon EPOS Simulation Loop

    Hello,
    I'm using LabVIEW 8.5.1 and I have modeled and simulated a plant I'm developing within a Simulation Loop (attached) and now I want to go and implement the system, but it doesn't appear to be as simple as just dropping the transfer functions and putting DAQ Output and Input VIs in as specified in the "Introduction to LabVIEW in 3 Hours for Control Design and Simulation" tutorial for this particular system. I have a Maxon RE-40 brushed DC motor and a HEDS 5450 encoder interfaced with an EPOS 24/5 positioning controller that communicates with my PC through an RS-232 cable. Can someone talk me through how I can communicate with this system with the VI I already built for simulation purposes?
    Thanks,
    Brian
    Attachments:
    Control System V8.vi ‏215 KB

    Well you have the simulation running right? The point of the transfer function is to represent the response of the physical system right? Well replace the transfer function with the routines for writing values to the system and reading the response that relates to the transfer function output.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • In fullscreen mode, is there a way to prevent the page from shifting down when displaying the menu and tabs?

    In fullscreen mode (F11), when moving the mouse toward the top of the screen to display the tabs & stuff, the page displayed is shifted down. This makes it annoying when returning down with the mouse - you want to reach a certain link, for example, b

  • MacBook Pro to TV under Mac OS?

    Folks ... I just bought a MacBook Pro i7 ... all's well. I can even connect to my Samsung plasma flat screen (40") TV using a Thunderbolt adapter and appropriate cable - provided I'm running Windows 7. Under Mac OS 10.6.7 what I see is the original g

  • Please Help my iPhone is not charging properly

    lastnight i put my iphone4 on charge at 11% when i plugged it into the wall and swithed on the power it had no reaction at all it didnt light up make a noise at all so i plugged it into a different outlet it still done the same thing so i left it ove

  • Apps not showing

    First I was having problems with an app I purchased accidentally. After having resolved that issue with iTunes support, I used restrictions . Then it seems that turned off the features to even look at the app store content. So I took restrictions off

  • How to handle Event when a radio button in selection screen is clicked

    Hi all,    What is the Event generated when a radio button is clicked in the selection Screen. My requirement is .If one radio button is clicked a field in selection screen should be greyed.    Here I used AT SELECTION-SCREEN OUTPUT. but this event i