LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Performance limitations of labview?

Hello,

I am thinking about creating a new testsytem with a high level data acquisition. At the moment I am not sure if the performance of labview is good enough for the requirements.

Hardware
- PC: HP xw4600: Intel Core 2 Duo E8500, 3.16 GHz, 4GB RAM
- NI PCI 6115
- NI PCI-GPIB (just for passing some settings to the function generator befor the measurement)
- function generator Agilent 33220A
- passive probe and clamp-on ammeter

Software
- Windows XP
- NI LabVIEW 8.2.1
- NI PID-Controll Set

We have a capacitive device under test (DUT) which should be driven in series resonance (about 40kHz). A sinus will be generated with the Agilent 33220A. With a passive probe and a clamp-on ammeter, voltage and current will be continuously sampled with the NI PCI 6115 (sampling rate 10MS/s/ch). Additionally, the output of a laser vibrometer will also be sampled continuously with the 6115 @ 10MS/s/ch.

Now, LabVIEW has to calculate impedance and phase (out of current and voltage measurement). The intention is to have a 0° phase, so if the phase is less than 0° frequency has to be increased and if the phase is more then 0° frequency has to be decreased. The regulation will be implemented in LabView with a PI controller. The frequency of the Agilent 33220A will be controlled over the modulation input of the function generator. So we only need to change a voltage on the modulation input to change the output frequency.

Tasks for LabVIEW
- Dataacquisition of 3 channles @ 10MS/s for each channel (NI PCI 6115)
- Calculating phase and impedance (out of voltage and current measuring)
- Calculating the regulation of a 0° phase with a PI controller
- Output an adjustment voltage (to the modulation input of the function generator) for the frequency output of Agilent 33220A

Questions
- How fast could such a setup regulate a 0° phase?
- Will there be an update rate of 100 - 1000 times per second (100Hz - 1kHz) realizable?
- What will be the bottleneck of this setup?

Thanks a lot for your help.

Best regards,
Michael

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

Michael,

 

since you are going to implement a controller, Windows is a no-go.

That being said, you have to use a real time target with the PCI 6115 included (so this would be a Desktop Real Time target). This is the first task: Is your PC RT-capable?

You can find information about this issue here.

 

Next step is the question: How fast is the requirement of your controller?

I am not sure if you are going the right direction here. You want to acquire three parameters (voltage, current of the DUT and the "laser vibrometer" which i assume is actually a voltage) with 10MS/s each. And you want to calculate the impedance and phase for each sample. So your control loop should take 1/10M s. So the controller frequency is 10MHz? Is that what you want?

If yes: Forget it. You will not achieve this. Not even if using FPGA (which would be the fastest platform).

"Normal" control loops are somwhere between 1Hz up to lets say 10kHz, only sometimes faster than this.

The bottleneck here is the way your algorithm works:

Are there some calculations which can be parallelized? What about input/output latencies?

 

Experience shows that due to input/output latencies, 3kHz seems to be achieveable quite stable, more is possible. The problem is, that these latencies are heavily dependent on the hardware, so i cannot give any garantee nor any promises. You would have to benchmark it.

On the other hand: The Agilent device is connected using GPIB. GPIB is, as many other hardwarebusses, not deterministic, so not real time capable. So if you set a new command, it can easily take more than 1ms (non deterministic!) until your Agilent device will react and create a new frequency. So in my eyes, a control loop faster than 1kHz is nonsense!

 

So taking these considerations into account, you face the following task:

1. Check if the system is RT capable

2. Implement an PI-algorithm running with up to 1kHz (remember to split the GPIB from the calculation, otherwise you mess up the determinism)

3. Make sure that the control loop timing matches the system (if the Agilent device can only change the output 100 times a second, the control loop timing above 100 Hz is nonsense!)

4. Do some benchmarks on the system using your algorithm.

5. If benchmarks not sufficient, optimize the system.

 

hope this helps,

Norbert

 

PS: Acquiring data with 10MHz is absolutly not necessary

 

[Edit]: I just misread the question on your post. The output of your controller seems to be an analog out of the 6115. Correct? If so, you can achieve 1kHz quite stable i'd say, but there is no garantee nevertheless. You have to check that using benchmarks. Except this (GPIB vs analog out), the rest of my posting is correct for your setup..... 

Message Edited by Norbert B on 11-23-2009 04:47 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 9
(4,102 Views)

Hello Norbert,

 

thanks a lot for your reply. Let me clarify some things.


Norbert B wrote:

Michael,

 

since you are going to implement a controller, Windows is a no-go.

That being said, you have to use a real time target with the PCI 6115 included (so this would be a Desktop Real Time target). This is the first task: Is your PC RT-capable?

You can find information about this issue here.


Thanks a lot. I will have a look at your advice.


Next step is the question: How fast is the requirement of your controller?
I am not sure if you are going the right direction here. You want to acquire three parameters (voltage, current of the DUT and the "laser vibrometer" which i assume is actually a voltage) with 10MS/s each. And you want to calculate the impedance and phase for each sample. So your control loop should take 1/10M s. So the controller frequency is 10MHz? Is that what you want?

 

If yes: Forget it. You will not achieve this. Not even if using FPGA (which would be the fastest platform).


There is a missunderstanding.

The acquisition will be with 10MS/s/ch, because I have to rebuild a sinus (in ideal, maybe it is not a sinus because of some "noise" so I need a high samplerate). With the aquired data I have to calculate impedance an phase and the correction for the frequency with a PI controller.

 

In my conception, I will sample 5 sine waves (which means 1250 samplepoints per channel) which needs minimum 125µs (5 x 1/(40kHz)). If I will reach a controller frequency of 1kHz I will have a maximum of 875µs left to calculate impedance, phase, frequency correction and output the new correction value for the modulation input of the function generator.


"Normal" control loops are somwhere between 1Hz up to lets say 10kHz, only sometimes faster than this.

The bottleneck here is the way your algorithm works:

Are there some calculations which can be parallelized? What about input/output latencies?

 

Experience shows that due to input/output latencies, 3kHz seems to be achieveable quite stable, more is possible. The problem is, that these latencies are heavily dependent on the hardware, so i cannot give any garantee nor any promises. You would have to benchmark it.

On the other hand: The Agilent device is connected using GPIB. GPIB is, as many other hardwarebusses, not deterministic, so not real time capable. So if you set a new command, it can easily take more than 1ms (non deterministic!) until your Agilent device will react and create a new frequency. So in my eyes, a control loop faster than 1kHz is nonsense!


The GPIB will only be used to set up some commands (e.g. start frequency, output level, offset, ...) before starting the acquisiton. After the acquisition was started, the change of the frequency works over changing a voltage with an anlog output of the 6115 at the modulation input of the function generator (no GPIB).


 So taking these considerations into account, you face the following task:

1. Check if the system is RT capable

2. Implement an PI-algorithm running with up to 1kHz (remember to split the GPIB from the calculation, otherwise you mess up the determinism)

3. Make sure that the control loop timing matches the system (if the Agilent device can only change the output 100 times a second, the control loop timing above 100 Hz is nonsense!)

4. Do some benchmarks on the system using your algorithm.

5. If benchmarks not sufficient, optimize the system.

 

hope this helps,

Norbert

 

PS: Acquiring data with 10MHz is absolutly not necessary

 

[Edit]: I just misread the question on your post. The output of your controller seems to be an analog out of the 6115. Correct? If so, you can achieve 1kHz quite stable i'd say, but there is no garantee nevertheless. You have to check that using benchmarks. Except this (GPIB vs analog out), the rest of my posting is correct for your setup..... 

Message Edited by Norbert B on 11-23-2009 04:47 AM

Thanks a lot and best regards,

Michael

 

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

MichaGue_01 wrote:
[...]The acquisition will be with 10MS/s/ch, because I have to rebuild a sinus (in ideal, maybe it is not a sinus because of some "noise" so I need a high samplerate). With the aquired data I have to calculate impedance an phase and the correction for the frequency with a PI controller.[...]

If the phase does not exceed a certain value, just measuring effective values could be sufficient.

If the phase is totally unknown and could have any value, you are correct. It is suggested to sample 10-20 times as fast as the highest frequency you want to sample in order to get a proper information about the shape of the signal. This sampled signals has to be transformed using FFT. Then you have two single values which can be used in your PI algorithm.

 

You can do this if you acquire the analog signal continuously and fetch enough values each time in order to run the FFT (at least a single period of your signal).

 

Taking this information into account, you should sample with (let's say factor of about 20) 1MHz. This is sufficient to see a clear shape of the signal. 10MHz is not really worth it in the background of needing fast computations.

 

If you want to go for 1kHz control loop time, please consider what you have to do in this time frame:

1. Acquire the signal continuously. Just fetch the values here

2. Compute FFT

3. Use FFT results for phase correction parameter

4. Use correction parameter to adjust analog output

 

Keep in mind that things can be done in parallel. So you can acquire data with the S-series device in parallel to your FFT/control algorithm. The problem which occurs using this approach is that changes are delayed since the waveform you acquire is altered by the iteration N-2 instead of N-1. Additionally, the samples you are using contain changes, which are "leveraged" by your FFT. So you have a single control loop iteration delay between In and Out.

But this is far easier to implement than the other approach:

1. Acquire enough samples to have at least one period of your signal. Stop acquisition

2. Compute FFT

3. Use FFT results for phase correction parameter

4. Use correction parameter to adjust analog output

 

This approach lacks due to latencies which occur due to start/stop of acquisition. This might lead to insufficient time for your control algorithm since as you can see, the computions needed are equal in both approaches. The advantage is that you will only see the most current results which occur after the last control loop's iteration N-1.

 

So everything i am talking about is primary: you have to benchmark your system if you have enough room for approach two. Otherwise, try to stick with approach one. 

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 9
(4,056 Views)

Hi Michael,

 

Nice task you have. Smiley Happy

 

I asume you are dealing with accelerometers (or force sensors) so one idea to speed up the control loop:

Normally these sensors could be seen a mass/spring/damping system, so after three points you should be able to calculate a good estination of the resonace point. 

 

You will need some settling time for the generator and the system itself.

 

And dont forget to compensate the delays of your system.

At 40kHz a 0.1 deg phase error is only about 9ns (equals 2m 50Ohm Koax) !!Smiley Surprised

Your vibrometer delay might have a factor 50 to 100 more, however you don't use it here....

And your current clamp (I don't talk about the bandwith)? 

Your Amplifier??

 

 

And also check a sine approximation algorythm (SAM) 😉 (not a FFT based one ... a 4 parameter fit) 

 

 

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


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

Michael,

 

Henrik has given some good advice.

 

If you find that trying to do the phase control in software is too difficult or expensive, why not use a phase-locked-loop IC (CD4046 for example) as a phase detector.  Follow it with a simple filter to drive the modulation input of the function generator.  For much less than 1% of the cost of any of the other major components you should be able to lock to zero phase in hardware.  You can continue to monitor the phase angle in software to validate your tests, but now the closed loop response time no longer becomes an issue.

 

Lynn 

Message 6 of 9
(4,024 Views)

johnsold,

 

That was my fist thought too 😉 

But compensating the delays in a maybe changing setup votes for the software. Another point is that noise and hum slow down the analog loop (or give phase noise), with a SAM this is much better 🙂 , however, a LOT more Hardware is involved then 🙂

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


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

Hi @ all,

 

thanks a lot for your advices.

 

The idea with a phase-locked-loop IC is very nice, but I haven't told the whole story. Beside the PLL I will also have to implement the measuring of an frequency sweep. So I will need the dataacquisition hardware and as Henrik already told the software solution will be in advantage by having noise.

 

The advice with a SAM is very good. Thanks a lot Henrik.

 

Best regards,

Michael

0 Kudos
Message 8 of 9
(4,011 Views)

johnsold,

 

Edit timed out so...

 

I already have (ab)used accelerometer as resonators 🙂  in a loop with an OP (with bulb gain feedback like the famous old HPs...)  ,  it oscillated , just .. not always at the resonance i was loking for 😉

 

Michael,

Look for the IMEKO2009  paper dealing about SAM uncertainties ...

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


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