LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: 2d raster scan photon counting optimization

Hi,

Based on this example (https://forums.ni.com/t5/Example-Code/Synchronize-Analog-Output-Sample-Clock-With-TTL-Pulse-Count/ta...), how could I determine the actual AO rate (or period, or frequency)? I have measured the AO period through the oscilloscope, dwell time of each "pixel" is 1ms. However, I have no idea how to adjust this value?

 

-Crystal

0 Kudos
Message 1 of 9
(1,652 Views)

After checking out the linked example and your comment at the tail end, I think there are 2 distinct answers you need.  (Please keep any followup discussion here -- that other thread is mainly an example, not the best place for ongoing discussion of your particular related problem).

 

1. The 'update rate' in the example is the AO sample rate.  If you are measuring 1 msec, it must be set for 1000 Hz.   If you set it for 2000 Hz, your scope will show 0.5 msec.  And so on.

 

2. The frequency of the sawtooth waveform you generate is distinct from but *dependent* on knowing this sample rate.   There are vi's in the Signal Generation palette that can generate a sawtooth pattern of data.  The combination of the # samples per sawtooth cycle and the analog output sample rate will determine the frequency of the sawtooth pattern.

     For example, let's say you have a 100 sample pattern to define your sawtooth.  Generating AO at 1000 Hz means you'll get a 10 Hz sawtooth.  Generating at 2000 hz will give you a 20 Hz sawtooth.  And so on.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 9
(1,636 Views)

Hi Kevin,

 

Thanks for the reply. It works! However, I have another two questions come up.

 

1.The maximum update rate for PCI-6733 should be 1000 kS/s. However, the maximum update rate I can use is 10kHz. If I set 100kHz, the 50 sawtooth waves I generate will become one large square wave instead of 50 sawtooth functions. It seems like it cannot be resolves. How can I get a 1000kHz update rate? (I only use 2 AO in PCI-6733)

 

2. I set the max voltage for both X and Y to 1V. The output indicator shows the correct voltage. However, what I see in the oscilloscope is that max Y is 10V and max X is 1V. How can I fix this? Is this something related to the max and min voltage when I create the virtual channel?

Screen Shot 2020-12-09 at 3.40.00 PM.png

IMG_9017.jpg

 

Thanks a lot!

 

-Crystal

0 Kudos
Message 3 of 9
(1,626 Views)

@Kevin_Price wrote:

After checking out the linked example and your comment at the tail end, I think there are 2 distinct answers you need.  (Please keep any followup discussion here -- that other thread is mainly an example, not the best place for ongoing discussion of your particular related problem).

-Kevin P


Actually, it can be split.   

 

Go at Kevin!  I am going to learn something here 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 9
(1,620 Views)

1. I can't really begin to guess unless you post the code.  Before you do, set your front panel controls to the values you want to use for the discussion, go to the "Edit" menu and select "Make Current Values Default".  Then save the vi and post it.

   Of note: the linked and confirmed example code has an 'Update Rate' control on the front panel.  Your screenshot does not.  Instead it has a 'Dwell Time of each pixel' control.   Clearly, you've made *some* changes and I have no way of knowing what they are.

 

2. Sounds to me like a problem with the probe config on your scope.  The Y channel is probably configured wrong, telling the scope it's 10x when it should be 1x (or 100x when it should be 10x).

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 9
(1,569 Views)

Hi Kevin,

 

I've attached the vi file. The second question has been solved. For the first question, dwell time is the derivative of the update rate.

 

I found that if update rate is higher, the number of X and Y steps should be higher enough to output a nice or correct sawtooth wave. So the update rate can go more than 10 kHz but the # of the steps need to be higher as well. I don't understand that why I need to increase the # of the XY steps to resolve the output sawtooth.

 

The parameters I need are 500 kHz update rate and 500 of # of XY steps.

 

For example, if # of steps is 500 and update rate is 500 kHz (dwell time = 0.002 ms), the sawtooth wave will become uneven and the voltage is not ranging from -10 to 10V.

IMG_9257.jpg

 

If # of step is 1000 and update rate is 500 kHz (dwell time = 0.002 ms), the sawtooth wave will be better than the case # of steps = 500 but the voltage is still not ranging from -10 to 10V.

IMG_9259.jpg

 

If if # of step is 2000 and update rate is 500 kHz (dwell time = 0.002 ms), the sawtooth wave is correct.

IMG_9262.jpg

 

Is there any way to fix the problem of uneven sawtooth wave at the high update rate?

Thanks!

 

-Crystal

0 Kudos
Message 6 of 9
(1,552 Views)

I removed all the DAQmx calls from your code b/c I don't have DAQmx installed for LV 2020.  All the examples you listed result in expected sawtooth patterns in the GUI graph indicator.  So the problem doesn't seem to be in the raster pattern calculation vi.

 

So that points to some kind of hardware related problem.  Look directly at the AO output signal while NOT connected to other equipment.  If things look right, then your DAQ device and external equipment aren't compatible for what you're attempting.

 

When you have a bigger ratio for (update rate) / (# steps in sawtooth pattern), it means that you're trying to generate a higher frequency sawtooth.  Apparently the combo of your DAQ device and your equipment has some limitation that prevents the the sawtooth ramp rate (aka slew rate) you're trying to achieve.   500 steps at 500 kHz is a 1000 Hz sawtooth.  Note that the scope can't slew from min to max AND that the downslope is very limited instead of nearly a vertical line.

 

That's a hardware limitation.

 

Note that with hardware unable to follow at <1000 Hz, there's little sense in a 500 kHz update rate.  Your apparent success showed up with a 250 Hz sawtooth.  So the ramp rate limitation would seem to be somewhere near 20 V / 4 msec. 

 

I still don't know if you're measuring an output of your equipment or if you're measuring the DAQ device's signal output while connected to an input of your equipment. 

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 7 of 9
(1,521 Views)

Hi Kevin,

Sorry for the late reply.

 

I measured the DAQ device AO without connect to any device. Is it the limitation of PCI-6733? Is there any method to generate higher frequency sawtooth?

Thanks!

 

-Crystal

0 Kudos
Message 8 of 9
(1,449 Views)

Specs for the 6733 rate it for 15V per microsecond, so this *shouldn't* be an inherent limitation of the DAQ board.  Not sure what else to say at this point, except to try other things to troubleshoot.  What happens if you generate a square wave?  Can you find a pattern to the anomaly as a function of frequency and/or amplitude?   Have you tried changing various scope settings or using a different (known-good) probe?   Do you have an analog input DAQ device you could connect to as an alternate measurement method?  Etc.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 9 of 9
(1,437 Views)