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: 

Integrate Signal from DAQmx (Encoder) for position

Hey all,

I already tried to search the internet, but unfornately I was not successful. I have a rotational Encoder with a resolution of 360 per revolution which is connected to a NI PCI-6221 Card. I am using a simple DAQmx task where I was able to read out the rotational speed. Except from a few peaks, the rps are displayed fine. In the next step I want to integrate the signal in Order to get the "travelled" distance, but using the integral block (see image below), I get very strange, unusable results. I am not very familiar with the DAQmx, so maybe someone could please help me out by first filtering the signal (to cut out the peaks (and avoid they are being added to the position) and then to proper integrate the "speed". My final goal is that when I am running i.e. the encoder at a rotational speed of 10 revolutions per second for 10 seconds, the final result is: 100 total revolutions. (or 500 rev. when running for 20 sec at a speed of 25 rps). Thank you very much1.PNG2.PNG

0 Kudos
Message 1 of 3
(2,127 Views)

Please attach your code (hint -- the file name has an extension of .vi, not .png or .jpeg).  With the exception of a LabVIEW snippet, we cannot test, exercise, or modify pictures.

 

Bob Schor

0 Kudos
Message 2 of 3
(2,124 Views)

Sorry! I have attached now the VI File of my problem. Again the goal is 1) to smooth the signal (eliminate peaks over 25 revolutions per second, approx. 14 values per second are read) and the most important thing is to integrate the revolutions (as mentioned at the first post for example: after 10 sec with 10 rps I get a result of 100). I would appreciate any help!

 

The Integration implemented in the provided program works very poorly, it counts up the values way to fast and I can't find any real behind it.

0 Kudos
Message 3 of 3
(2,096 Views)