LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Avoiding jitter

There are others trying to help so I may back out. If you want to keep me and others that can not look at the LV code or watch vidieo, please post images of the code and the jitter along with mention of the magnitude of the jitter etc.

 

Sorry to ask but I will only be a distratction if I can't see the issue or the code.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 11 of 27
(1,177 Views)

hi Ben,

 

I don't want to bother too many people with this, but just in case you or someone had a Idea how to solve it, here is an image of a similar code. In this one, I only have 1 task, with 2 signal generators, with 80(sine) and 800 Hz (square). The time Jitter on the square signal is an oscillation with 15micro s. amplitude.

 

But I thought that this would be a common problem. I was sure some else had encountered this jitter trying to send two signals. Well, I hope some one can tell me what I am doing wrong.

 

Thank you very much for your time

 

marc

Download All
0 Kudos
Message 12 of 27
(1,166 Views)

What happens if you move the cod ethat gens the signal outside the loop such that the waveform is generated once and output continually?

 

Re the jitter

 

Is there jitter within the waveform or between each each generation?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 27
(1,161 Views)

@Ben wrote:

What happens if you move the cod ethat gens the signal outside the loop such that the waveform is generated once and output continually?

 

Re the jitter

 

Is there jitter within the waveform or between each each generation?

 

Ben


This is not Jitter!

 

What you are seeing is an artifact of the way you are generating the signals.  You do not generate an integer number of cycles meaning: your signal allways starts at 0 Deg and ends at an arbitrary phase the next waveform ALSO starts at 0 Deg causing a "Jump" every 10000 points.

 

Adjust your sample size by taking the actual sample rate and the actual period of your signals to get as close to an integer number of cycles as possible.  


"Should be" isn't "Is" -Jay
Message 14 of 27
(1,147 Views)

We may be driving at the same point Jeff.

 

If the signal is showing steps from output sample to sample, then that is a resolution issue solved with more bits and more samples.

 

If the signal stumbles between each set of outputs then that could be OS jitter caused waiting for CPU to gen the next set of output signals.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 15 of 27
(1,140 Views)

The jitter is still there if i just move the code.

 

I  am not sure what do you mean wether the jitter is within the waveform or between each generation.

 

Well, Your comment led me to drastically reduce the sample rate, obtaining a longer wave. And with a sample clock rate of 8k and a buffer with 80k samples, the time jitter is almost gone,  although the sinewave loses "smoothness" on the screen.Now the vibration only appears in some of the vertical lines of the square signal. I suppose that is what you meant with " each generation".

 

The voltage small jitter has not decreased though.

 

 edit: I wrote it before i read jeff message

0 Kudos
Message 16 of 27
(1,136 Views)

@Markitus wrote:

The jitter is still there if i just move the code.

 

I  am not sure what do you mean wether the jitter is within the waveform or between each generation.

 

Well, Your comment led me to drastically reduce the sample rate, obtaining a longer wave. And with a sample clock rate of 8k and a buffer with 80k samples, the time jitter is almost gone,  although the sinewave loses "smoothness" on the screen.Now the vibration only appears in some of the vertical lines of the square signal. I suppose that is what you meant with " each generation".

 

The voltage small jitter has not decreased though.

 

 edit: I wrote it before i read jeff message



Then you are on the right track!  You just proved that you were "Jumping" by having dicontinuities from the end of one waveform to the beginning of the next.  Nice work!


"Should be" isn't "Is" -Jay
Message 17 of 27
(1,120 Views)

I have just checked with a graph, with a sample clock rate and buffer size of : 80k,  and this is what i obtained,

 

The sinewave starts from 5 at each generation, but the square ends at -5:

 

squaresine.jpg

                0ssignal.jpg

 

 

So, clearly the end and start of the signal is not fitting. Thank you very much, I was not aware that could be a problem.

 

And, I don't want to abuse of your help, but do you have any idea of the other"jitter" ( if that is jitter). It is not as vibrating and clear as the previous problem. It is affecting the Sinusoidal and Square signals, moving slowly the whole waves up and down ( around 0.05V). 

 

thanks again!

 

marc

0 Kudos
Message 18 of 27
(1,114 Views)

Where sinewave= squarewave

 

sorry

0 Kudos
Message 19 of 27
(1,107 Views)

The VI depicted in Sineandsquaresignals.jpg is essentially the same as one of the DAQmx Shipping Examples.  LabVIEW's Basic Function Generator actually keeps the phase of the signal in a shift register so on each successive loop iteration the waveform will pick up where it left off from the previous iteration.  

 

If you were to write the waveform once and regenerate it, then you would want to make sure it was a complete period of your signal.  However, the example you have linked is configured to generate each sample one time--you must continually rewrite samples to keep the buffer filled (failure to do so would result in an underflow error rather than jitter on the output).  The phase of your output waveform is saved from loop to loop so writing a complete period at a time shouldn't be necessary.

 

This scenario could result in period-to-period jitter if your sample rate was not an integer multiple of your output signal since the waveform would not be exactly the same set of samples each time.  However, in your case the sample rate is a multiple of your desired frequencies so you should be getting the same output data from cycle to cycle.  In any case, the jitter would always be less than one sample (which is 1.25 us) so wouldn't explain what you are seeing in any case.

 

 

I think the apparent time jitter you are seeing (shown in the video) is quite possibly coming from noise on the sine wave output (I notice you are trigging the scope from the sine wave).  At ±5V and 80 Hz, the maximum slope of the sine wave would be 800 V/s (which is 1.25 ms/Volt).  Assuming you are triggering at 0, each mV of error would result in a a 1.25 us time difference on when the trigger is received.  So you're looking at an approximate ±6 mV of deviation in your output to account for the 15 us deviation in the trigger time.  I realize this is outside the accuracy spec of the analog output, but that spec assumes that the output has fully settled and I don't believe it accounts for noise.  <speculation> It's possible that the reason you see less jitter when running at a slower sample rate has to do with how the output settles--it does not transition linearly from voltage to voltage so you might end up with a steeper slope at the point of the trigger when your waveform has less samples in it </speculation>.

 

 

To give a better picture of what is actually going on, I'd suggest triggering the scope from the square wave (which has a very fast rise time) so you will have a relatively constant time reference.  The sine wave will have some noise on its output (which is probably normal) but I wouldn't expect any time jitter based on how you are configuring your outputs.

 

 

Best Regards,

John Passiak
Message 20 of 27
(1,092 Views)