SignalExpress

cancel
Showing results for 
Search instead for 
Did you mean: 

analog signal duty cycle incorrect

I am using an NI PCIe 6535 board to send digital timing signals to a custom PCB.

 

The signals are digital square wave signals with various duty cycles and phase shifts.

I also need to send a 12 bit ramp signal to the board.

 

I am having issues with the frequency.

I need the timing signals to run at 833.33333 khz.

I need the lsb of the ramp to run at 416.666666khz.

 

To create the timing signals I am using "Create Analog signal", so that I can set up the square wave with the appropriate phase shift and duty cycle.

Then I conver from analog to digital.

 

I am using a DAQmx generate to output the signal to the PCB. I have noticed that the DAQmx gen frequency directly controls the ramps frequency.

However for the digital timing signals there is some scaling factor. The frequency of the digital timing signals can be set in the timing signals them selves. The sample rate in the analog signal also effects the frequency.

To get the frequencies that I need. I had to set the"create analog signal" sample rate at 2.778G S/s, the "create analog signal" frequency to 1.2889GHZ, and the DAQmx generate frequency to 1.66666 MHZ. At those numbers, I get the timing signals to output at 833.333KHZ and the second bit of the ramp at 416.6666HZ (for the ramp I upped it to 13 bit and I don't use bit 0, as it outputs at 833KHZ).

However at these settings all of my timing signals have the same phase, and the same duty cycle, even though I have them set differently.

 

Can someone please help? I think the issue is that I have the sample rate and frequency of the "create analog signal" block set too high, but if I set them lower my signals will not be at the right frequency.

 

 

Download All
0 Kudos
Message 1 of 5
(6,311 Views)

Hi dwkaufman,

 

What frequencies did you get when you changed the sampling rate?  How did you determine you were outputting the wrong frequencies?

 

Also, could you post your project here?  It may help save time for us in trying to debug it together.

 

Thanks,

 

David B

National Instruments

Applications Engineer

0 Kudos
Message 2 of 5
(6,270 Views)

Hello,

 

Since you are using a PCIe-6535 to output your signals, this board only does purely digital output from its parallel 32 channel port through the VHDCI connector on the front.  I see you tried to create your waveform sample pattern using a "Create Analog Signal" Express VI.  Not the typical way I would expect a user to build their waveform, but it looks like it may work.  One thing I noticed is after checking out the digital waveform (I converted from analog to digital as well) I saw 50% duty cycle, yet the sample markers were correct.  I checked the convert VI, and it looks like it automatically compresses the analog waveform when performing the conversion and doesn't actually send the full data to the card like one would expect.  So on the "DWDT Analog to Digital.vi" function, be sure compression is false.

 

Next, as you know, there is no way the board can generate that many giga-samples of data.  You will still need to perform some type of scaling or decimation to fit the waveform frequency to the board.  Looks like you are aware of this, but I'm just double clarifying.  

 

So, check the compression, be sure to decimate, and let us know if that works.  I'll post the snippet I looked at below:

 

 

ForumCreateAnalogSigToDig.PNG

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 3 of 5
(6,245 Views)

Hi David,

 

We found that there seems to be a weird divider between the sampling rate of the analog signal module, the analog signal sample rate, and the f daqmx gen.

After various tests we made a chart of what we observed. Fsignal and sample rate are values set in the "create analog signal" module, Fdaqmxgen is set in the "DAQmx generate" module. We used a "create anaolg signal" module to create the square wave, then convert analog to digital convert the square wave to digital.

We have "repeated signal" and "N periods" checked.

Fsignal Fdaqmxgen Sample rate Frequency   measured on the scope
1GHZ 10MHZ 100G s/s 100KHz
100MHZ 10MHZ 100G s/s 10KHZ
1GHZ 1MHZ 100G s/s 10KHZ
10GHZ 10MHZ 100G s/s 1MHZ
100GHZ 10MHZ 100G s/s 10MHZ
100GHZ 10MHZ 100G s/s 5MHZ

 

The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.

 

 

To meaure the frequencies were using an HP 54600A oscilloscope, and probing standoff pins on our custom pcb.

 

We have several versions of the project, attached is the latest one.

 

Kyle,

 

How do I set the compression to false?

The picture below looks like labview? We are using signal express.

 

I can't change the frequency on the DAQ mx gen because I need the ramp to run at a set frequency.

There is a divider between the daqmx gen and the f signal. I have to set the Fsginal in the GHZ to get it to out at the right frequency. The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.

 

Thanks,

Devin

 

0 Kudos
Message 4 of 5
(6,243 Views)

Sorry about the LabVIEW, yes in SignalExpress you don't have the option to enable/disable compression, I assume it is not compressing the data here.

 

I want to restate the issue you are having because it's not clear by your previous post.  What you are seeing is a wave at the frequency you want, yet it does not have phase shifting nor is it anything but 50% duty cycle.  Looking at the 83.3% duty cycle, you would need at least 6 samples per period to achieve this, as the least common denominator.  5 samples would be high, 1 samples low.  For 41.666% duty cycle, you need 12 samples to achieve that duty cycle rate.  5 samples high, 7 samples low.  

 

With our digital boards, you must oversample to do this, so your clock will have to run at 30x and 60x the rate you want to generate at. For  a duty cycle of 83.3% and a rate of  833.333 kHz, assuming 6 samples per period, you need to run at 5 MHz.  Same goes for 416.666 kHz at 12 samples per period.  

 

Set your board to run 5 MHz.  Output waveform 1 to have 5 samples high, 1 sample low.  You may shift those samples to shift phase (for example, 111110 is 0 deg phase, 111101 is 360/6 = 60 deg phase shift).  If you need to shift with finer resolution, you have to increase the number of samples used, but this will also increase your sample clock rate.  You may be able to do it once (bump it to max 10MHz, 24 samples for the 41.666% and 12 samples for the 83.333%) to get phase shifts of 360/12 degrees resolution and 360/24 degrees resolution.

 

All in all, I think what you are trying to do is possible, just gotta work it out in math, create the waveforms properly, and then give it a run.  I'm not sure why you are using the Gigahertz frequencies, just enter 10MHz into the Sample rate under sampling conditions and your output frequency in "Frequency Hz" under your Signal Calculation Setup.  It should work out, assuming that I haven't misinterpreted your application.

 

 

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 5 of 5
(6,240 Views)