LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize Control and Simulation loops

Solved!
Go to solution

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?

0 Kudos
Message 1 of 2
(2,480 Views)
Solution
Accepted by topic author shansen1

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
Message 2 of 2
(2,464 Views)