12-08-2011 09:33 AM
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!
12-08-2011 09:39 AM
fellow newbie here.. i find it helps to post screendumps of what you have and/ or rudimentry flowcharts of what your tring to achieve.
12-08-2011 12:21 PM - edited 12-08-2011 12:25 PM
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:
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.
02-04-2012 06:00 AM
I came back to this project after some time, and I'm still confused about those parameters. Thanks for that explanation, but it's not quite what I'm looking for.
I'm doing a real-time project via cRIO9074 and I set up my Simulation Loop to synchronize to timing source. Now, the timing source is not 1kHz clock, it's synchronized to scan engine. I can acess "scan engine" under cRIO9074 properties in project tree and I set it up to 5ms. Trouble is, I don't know how to set up the rest (step size and period under simulation parameters) to achieve real time execution.
I've seen people using Timed Loop which offers the same "synchronize to scan engine" option without "unnecessary" (for me) "step size" and "period" option, but I have to use Simulation Loop.
Any help is welcomed.
02-06-2012 05:21 AM
Anyone? This is really important.
02-06-2012 03:33 PM
Sljiva,
I just want to make sure you're using the Control Design and Simulation Module. By simulation loop you are referring to the Control and Simulation Loop?
Here is the detailed help for the parameters of the Control and Simulation Loop.
http://zone.ni.com/reference/en-XX/help/371894E-01/lvsim/sim_configparams/
02-06-2012 07:07 PM
Yes, I'm using Control and Simulation Loop.
02-08-2012 06:57 AM
Hi sljiva,
It might be helpful if you post some screenshots of your existing code. That would help us better understand your application and question. Thanks!