VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use analogue input data from waveform acquisitions in real-time for closed-loop control?

Is it possible to use analogue input data from waveform acquisitions in real-time for closed-loop control?

 

I can see that the primary control loop (PCL) will be running at a relatively low frequency, ~1 kHz, whereas the DAQ will be required to sample at much higher frequencies, of the order of hundreds of kHz, to be able to pick up the frequencies required. I can imagine the setup involving the PCL importing the samples taken by the DAQ on each iteration and processing them - is this just an unrealistic idea of what the controller is capable of doing at 1 kHz, if, say, the DAQ is sampling at 100 kHz (giving 100 samples for the controller to import & process per PCL iteration)? For information, I've found the PCL limited to about 6.5 kHz when doing minimal processing with my controller (details below).

 

I'm using a PXIe-1071 chassis, with a PXIe-8100 controller, a PIXe-6341 DAQ and Veristand 2014. The model to do the processing would ideally be made in Simulink. I have successfully logged waveform data on the target hard disk but am yet to find anything about a waveform channel that will let me use the input data in real-time.

 

Thanks in advance,

Chris

0 Kudos
Message 1 of 8
(5,000 Views)

Just to add, it would also be accpetable for the PCL to run at say ~ 100 Hz and only import and process a subset of the samples on each iteration. The bulk of the processing would consist of a spectral analysis.

0 Kudos
Message 2 of 8
(4,988 Views)

Hi cjnicholls3,

 

I'm a little confused by your initial question. What do you mean by "Is it possible to use analogue input data from waveform acquisitions in real-time for closed-loop control?"?  Are you wanting to acquire analogue waveforms? Gain information about the waveforms?

 

Why do you want to alter the PLC frequency? 

 

Thanks, 

DanC12

0 Kudos
Message 3 of 8
(4,925 Views)

Hi Dan, thanks for your reply.

 

I am currently taking samples using waveform acquisitions then transfering the data from the target to a PC (after I've undeployed from the target) for analysis offline. I want to be able to use the data from waveform acquisitions in the model running in real-time, so that the model can calculate analogue outputs based on the inputs from the acquisition.

 

The importing and processing (in real-time) that I've spoken of will have to be done on each iteration of the PCL, so the frequency of the loop will probably have to be lowered in order for the processor to manage.

 

Thanks,

Chris

0 Kudos
Message 4 of 8
(4,921 Views)

Are you wanting your model to take in a buffer of data for each timestep, or do you want to produce a single-point value from your waveform acquisition and feed that to your model?

 

For instance, if your control loop runs at 1kHz, and your waveform analog acquisition task runs at 50kHz, are you expecting to pass a buffer of 50 samples into your model each time the model executes a timestep? Or would you expect to take the average/min/max or something of each 50 samples and pass that single value as a channel into your model?

Jarrod S.
National Instruments
0 Kudos
Message 5 of 8
(4,868 Views)

Hi Jarrod,

 

I'd like to pass the entire buffer of samples in preferably, and then carry out a spectral analysis on either every iteration of the loop or after several sets of samples have been taken, followed by a control algorithm. It could turn out that it is acceptable to take fewer than the 50 samples (in your example) on each iteration for the spectral analysis. How would the other option you give work? Is producing a single-point value from the waveform acquisition and feeding that into the model not equivalent to passing all the waveform data through a buffer and then doing the calculations? The DAQ card has no computational ability, so all the processing would be done by the controller in the PCL anyway?

 

Thanks a lot for your reply,

Chris

0 Kudos
Message 6 of 8
(4,860 Views)

There is an example custom device called the Waveform Analysis and Generation custom device that ships with VeriStand if you have LabVIEW support installed. It is installed here.

 

<LabVIEW>\examples\NI VeriStand\Custom Devices\Waveform Analysis and Generation

 

This might be worth looking at. It doesn't do exactly what you want, but maybe it will give you some ideas. It shows you how to read waveform data from a custom device, do calculations or analysis, and then write output data to other waveforms and to scalar channels.

 

There's no direct way to get the waveform data itself into your model, but this does show how you could do some inline processing of your waveform data and produce scalar values that you could map into a model. Hope this helps.

Jarrod S.
National Instruments
0 Kudos
Message 7 of 8
(4,819 Views)

Hi Jarrod,

 

Thanks for this, I'm something of a LabView novice so will try and get to grips with it before looking at the example properly.

 

Thanks for your help,

Chris

0 Kudos
Message 8 of 8
(4,792 Views)