From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Input signal (pulse from encoder) analysis

Hi everyone,

 

I am using a rotary encoder to analyze the motion of a rotation shaft that is driving a piston. I want to verify that the piston's motion is consistent cycle-to-cycle and measure the frequency of rotation. My encoder outputs a Z-signal, which will pulse once per rotation, and an A-signal, which will pulse 500 times per rotation at equal distance increments around the axis of rotation.

 

I have looked at a number of sample VIs that analyze a waveform for dominant frequency, but those generally use a simulated waveform, and I don't know how to get the signal that I am reading into the DAQ into the correct form to analyze it this way. If I use the DAQ Assistant, my data is the blue type and I need Waveform to use the Pulse Measurements VI.

 

Also, if anyone has any thoughts as to the best way to verify that the rotations are consistent (I was thinking of subtracting different periods to see if the difference falls below some threshold), I would love to hear them.

 

I am using LabVIEW 8.5 (I know, an older version) with a PCI-6251 DAQ. I have done the 6-hour LabVIEW tutorial so I am somewhat familiar with the program, and have access to a number of VIs written by others in my lab, but they tend to be pretty complicated, and use DAQmx, which seems to require a number of different VIs.

 

Thanks in advance!

Meghan

0 Kudos
Message 1 of 5
(2,386 Views)

Hello, Meghan!

 

Did those examples from unclebump help answer your questions? Please let us know if you have more.

 

-Will

Will Hilzinger | Switch Product Support Engineer | National Instruments
0 Kudos
Message 3 of 5
(2,354 Views)

unclebump, thanks for those examples. I am trying to use them as a basis for the VI I need.

 

Will, thanks for the offer for more help - I think I'll take you up on it!

 

I'm currently working with the quadratureencoderm-series.vi from the examples (the dir_encoder_corr_dig_port.vi looked much more complicated). I changed the DAQmx from Counter Input>>Position>>Angular Encoder to Counter Input>>Frequency. This should work to read the frequency of the Z-signal? (Currently my encoder is broken and I am waiting for a replacement so I can test this out).But just trying to run the vi, I get:

 

 

My I/O to the DAQmx has an option of Dev6 (my PCI-6251) ctr0 or ctr1, the only two options even when I hit Browse...so the only options it gives me are unsupported?

0 Kudos
Message 4 of 5
(2,334 Views)

Hello, Meghan!

 

To just check the counters, you'll need to change a few more things. The error you're getting is likely because, although you changed the DAQmx create channel function to "Counter>>Frequency," your property node (DAQmx Channel) is still trying to receive information about your encoder. The error specifically refers to trying to find the A Input of the not disconnected encoder, but the B and Z inputs won't be there either (since the encoder isn't there). 

 

You should be able to bypass or delete the property node, and re-wire the "create channel" to the "start task." If you want to add a new property node that doesn't reference the encoder, you could do that, too.

 

Please let me know if you have any more questions on this!

 

-Will 

 

PS -  I'd like to commend you for your exceptionally clear questions. The fact that you've searched for examples already, are referencing a specific (available) VI, and have posted your error message all help us give you the best support possible. Thanks!

 

Will Hilzinger | Switch Product Support Engineer | National Instruments
0 Kudos
Message 5 of 5
(2,319 Views)