LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generete a pulse after a zero crossing detect in dynamic data with a phase delay.

Hi I´m acquiring a 60 Hz sinusoidal signal from NI USB-6363 in LabVIEW, so then i want to produce a pulse after a zero crossing in each semi-cycle with a phase delay with the NI USB-6363, for example Labview detects a zero cross and 120° after of the crossing i want to produce a pulse with a rising time of 50us. The phase delay needs to be controlled.

 

P.S. The acquiring block that I´m using produces Dynamic Data

 

0 Kudos
Message 1 of 8
(3,846 Views)

Please share what you have so far.

0 Kudos
Message 2 of 8
(3,805 Views)

Do you want to change the phase angle on a cycle-by-cycle (or half cycle) basis? If so, you will almost certanly need to go to a real-time OS or FPGA to make it work.

 

Consider the items which need to be accomplished:

1. Acquire the 60 Hz signal. (Note: You did not tell us the sampling rate or the number of samples you read on each iteration.)

2. Detect zero crossing in software.

3. Calculate the time delay which corresponds to a specific phase change of the input signal. (You mention 120 degrees but not the range of possible values or resolution.)

4. Create a suitable output pulse. (Since it appears you want to control the rise time, you must be using the analog output. Again you have not specified the sample rate or the number of samples to be written.)

5. Start or trigger the output pulse. (Software triggering.)

 

6. Repeat for the next cycle.

 

You refer to "semi-cycle." Does this mean one half of a full cycle? You also refer to 120 degrees after a zero crossing. Does the 120 degrees refer to a full cycle or is this one third fo a "semi-cycle"?

 

Your reference to Dynamic Data suggests that you are using the DAQ Assistant and running on Windows. Is this correct?

 

Look at the timing:

one half cycle at 60 Hz is 8.333 ms.

120 degrees at 60 Hz is 5.6 ms. 1 degree at 60 Hz is 46.3 us.

 

So you need to read blocks of data which are small enough that you have time to do items 2-5 in less than 5.6 ms (or less if the minimum phase shift is less than 120 degrees). But if the data acquisition is not synchronized with the 60 Hz signal, the zero crossing might occur at any sample in the block. Or, worse, the zero crossing might be partly in one block and partly in the next. The zero crossing detection must allow for that possibility. It also must allow for noise on the signal which might distort the position of the zero crossing.

 

If your output pulses are identical except for the starting time, you can send the same pulse repeatedly. However, the jitter on software triggering is, like any software timed outputs using Windows, on the order of tens of milliseconds. The DAQ Assistant tends to have more overhead than the DAQmx VIs which may make the timing even worse.

 

Even if the frequency of your input signal is precisely 60 Hz, the clock on the USB-6363 has an accuracy of 100 ppm (I think - I did not look it up), so exact synchronization of the AO to the input is difficult or impossible.

 

What is the purpose of your project? Are you trying to control the firing of a thyristor?

 

Lynn

0 Kudos
Message 3 of 8
(3,783 Views)

Hi JonhSold,

yeah my project is a thyristor firing control system but i'm in the construction of the first prototype, my range of firing is between 90° and 180° in each half cycle, positive and negatives, of the sinusoidal waveform and the firing pulse signal have to be after the zero crossing. I build a PCB circuit for that but I have a lot of problem with noise so them I´m trying to do that with LabVIEW.

So with FPGA in a compactRIO, you believe that I could do that ?

 

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

I have never used the FPGA, but I think the hardware may have the capability.

 

As an analog circuit designer before LabVIEW came along, my approach would probably be to build a voltage controlled phase angle controller in hardware. Set the voltage with an analog output from the DAQ device. Include optical isolation in the hardware to protect the DAQ device and computer from faults in the power system.  That way you still have LV control over the firing but without the complications of signifiicant timing constraints. 

 

You could monitor the firing angle timing by measuring the voltage or triggering waveforms on an additional analog input channel if desired.

 

Lynn

0 Kudos
Message 5 of 8
(3,760 Views)

Well, the joy of engineering is to do what you want with the stuff you can get 🙂

So, you have a USB6363 ...

-one analog trigger circuit   (for the zero crossing)

-DI change detection (catch falling and rising edge)

-timer (for the phase delay)

-DO(to output your signal)

 

for a correct phase delay, you maybe need to measure the line frequency (it's usually about 60Hz +-0.05Hz, ... too much off and the grid drives down)

But you have the trigger signal and another timer to measure the periode 🙂

If you control a simple heater, you can ignore that...

 

Maybe you have to wire a DO to a DI for the change detection... or at least output the analog trigger signal.

 

Read the X-series user manual and have a look at the examples as a starting point.

Have fun! 

 

 

 

 

 

 

 

 

 

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 6 of 8
(3,710 Views)

Can you please share how did you detect zero crossing during acuisition?

0 Kudos
Message 7 of 8
(3,366 Views)

If I can assume that the 60Hz signal is reasonably precise (i.e. no cycle-to-cycle variation), and I wanted, independent of the synchrony of my sampling clock with the signal-generating clock, the most accurate estimate of the zero crossing, here is what I would do (with the caveat that I am not an engineer):

  • collect at least one cycle of data at a convenient sampling rate (1KHz should be good).  Could even collect 1 second of data, 1000 points.
  • Fit (using ordinary Least Squares) a 60Hz sinusoid to the data, getting estimates of bias, amplitude, and phase.
  • As a check, determine (just by plotting) that the residuals are small and constant (showing that the signal really is at 60Hz).

You now have a very precise estimate of the phase of the sinusoid relative to the (accurate, one hopes) sampling clock of your hardware.  It is now a simple matter to figure out the 120° (and 300°) phase times.

 

Bob Schor

0 Kudos
Message 8 of 8
(3,353 Views)