LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Jitter(shift left and right) in waveform graph and data.

Solved!
Go to solution

Good morning, I am making a LabVIEW program using the NI 6363 USB X. The program basically reads 9 analog channels simultaneously while outputting an analog output that is a triangle wave every 100ms. All inside a while loop where I also record the data read into a binary file. But for some reason, the graph jitters (shifts left and right) on the x axis every cycle. I am using a sampling rate of 50000, and the analog output should take 100ms.  Any idea of why this happens? Or how to make the graph stop jittering?

0 Kudos
Message 1 of 11
(2,141 Views)

First of all, it helps if you clean up your block diagram before posting. It's very unorganized with lots of unnessecary sequence diagrams, wire bends and local variables. 

 

Can you make video what you mean? I ran your code and I don't see what you describe. The video shows some random data of a DAQmx device I had lying around.

 

If you mean that the axes themselves are moving around you can right-click a graph go to advanced and disable Auto Adjust Scales.

Basjong53_0-1649693016617.png

 

0 Kudos
Message 2 of 11
(2,115 Views)

Hi, sorry for the clutter, it is my first post here. In the video below if you look at the triangle waveform it is shifting left and right. That is what I want to stop. Because I want each cycle to be the same. So that the triangle always starts at 30ms for example. I am using min(V) = -0.2, max(V) = 0.6, and Ramp rate = 300 on the analog output tab.

 

Thank you in advance and have a nice day.

0 Kudos
Message 3 of 11
(2,104 Views)

Apparently the attachment didn't stay. Here is the video.

0 Kudos
Message 4 of 11
(2,103 Views)

This behaviour happens because you aren't using any kind of hardware trigger. The software can jitter for all kinds of reasons, it'll never be exactly timed.

 

I'm not sure what you need to do with your software. But you need to at least synchronize the output and input by, for example, setting the analog input to start reading on the analog write start trigger.

0 Kudos
Message 5 of 11
(2,093 Views)

Ok, so is there a way to make it so when the analog output reaches -0.1V for example, it would read some samples before and after that? I was reading this page after what you said. https://www.ni.com/en-us/support/documentation/supplemental/21/ni-daqmx-data-acquisition-triggering-.... Or how would you do it if your interest is to just read the waveform? Because the other thing I am doing because of the jitter is to use threshold detection to know when the triangle starts.

0 Kudos
Message 6 of 11
(2,083 Views)
Solution
Accepted by topic author Camilo4600

As I understood from your program, you want to peridiodically send a triangle and then measure the response. You can use this simple triggered measurement where reading is synchronized with writing.

Simple Triggered Measurement.png

 

The data to write can be like this, where you can modifiy the time before and after the triangle.

Basjong53_0-1649752977672.png

 

Consider that both in your example and mine, the periodicity will not be exactly peridiodic, since there is still the software starting and stopping of the tasks. If you want exact perdiodicity, modifiy the above code with this:

Exact peridiodicity.png

 

Hope this helps, if you have more question, I'd be happy to answer them.

 

 

Message 7 of 11
(2,046 Views)

You really should clean up your diagram, it's 90% empty space.

 

And what is this monstrosity?

AeroSoul_0-1649758373085.png

 

0 Kudos
Message 8 of 11
(2,037 Views)

@AeroSoul wrote:

You really should clean up your diagram, it's 90% empty space.

 

And what is this monstrosity?

...

 


You know, we all started somewhere, he mentioned that this is his first post. Constructive criticism is good, but just saying that his code is bad doesn't help at all and discourages people from coming back to this forum.

 

With experience comes better code.

0 Kudos
Message 9 of 11
(2,032 Views)

Kudos for the really nice illustration from Basjong53!

 

Tidbit: because the tasks share a sample clock (and are started in the correct sequence), there's no need for the start trigger.  It doesn't hurt, but you'll find that if you remove it you get the exact same sync & behavior.

 

 

-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 10 of 11
(2,027 Views)