LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear encoder Y values

I am using Labview 7.0 in conjunction with a pci-6220 card.  I am using a quadrature linear encoder.  I am having a problem extracting the Y values from the DAQ assistant.  I can extract the values OK, but the problem is that when the encoder is not in motion, the Y value immediately goes to '0'.  If the Encoder resumes motion, the Y value picks up where left off, as if the '0-spike' never occurred. 

I have attached a Print screen Jpeg of what the effect of the above problem is when implemented on a Chart.  Please note that I am using the 'Y' value from the encoder as the X-value on the Chart.  The Y value is voltage input taken from a Load cell.

I have also attached the VI as well.




Download All
0 Kudos
Message 1 of 10
(3,865 Views)
??
0 Kudos
Message 2 of 10
(3,848 Views)
Thank you for contacting National Instruments technical support.
 
Without any detailed information regarding the quadrature encoder you are using, it is difficult to know exactly why it is outputting this kind of value when no motion is detected.  Do you have any idea what the expected output is in this case?  Is the Y-output intended to be a timebase, or could you do without reading the Y-value altogether and simply have LabVIEW attach the computer's date/time stamp to the data stream coming from the other input lines?
 
These are some thoughts that you may consider in setting up your application.
 
Peter
 
Peter L.
Applications Engineer
National Instruments
www.ni.com/support/
0 Kudos
Message 3 of 10
(3,820 Views)


@peter L wrote:
Thank you for contacting National Instruments technical support.
 
Without any detailed information regarding the quadrature encoder you are using, it is difficult to know exactly why it is outputting this kind of value when no motion is detected.  Do you have any idea what the expected output is in this case?  Is the Y-output intended to be a timebase, or could you do without reading the Y-value altogether and simply have LabVIEW attach the computer's date/time stamp to the data stream coming from the other input lines?
 
These are some thoughts that you may consider in setting up your application.
 
Peter
 


Here is the data sheet for the linear encoder:
http://microesys.com/pdf/M1500_Data_Sheet.pdf

I do not think it is a hardware issue, however, because like I said the reading is still acurate even despite the 0 spike on the chart.  The encoder output is stereotypical quadrature, so I am sure there is no output when stopped.  The Y output was not necessarily intended to be the timebase-- I did not realize I needed a time base for an XY chart-- my logic was that I was just using the position & force as my axes, so there would be no time base needed.  I do have to read the Y value, because that is my input from the Load cell, or encoder, depending on what Y value you are referring to. Like I said, on the chart, my Y axis is the load cell input, and X axis is encoder input. 


0 Kudos
Message 4 of 10
(3,813 Views)
Hi,

When using a constant clock source, the DAQ Assistant that is doing the position measurement should still return a valid postion even when the encoder is stationary.  The DAQ Assistant WILL, however, return 0s if there is an error.  My guess is that when your encoder is stationary, the DAQ Assistant is returning a timeout error, which is not getting handled by your code (I noticed that you disabled automatic error handling on this VI).

If you've wired your encoder signal to be the clock source for your position measurement, a likely cause of this error is a timeout, as no clock pulses would be received when the encoder is stationary.  The fix here, would be to use a constant clock source to latch the values in from the count register at a regular interval, even when the encoder isn't turning.

Let me know if this helps you out.  We definitely want to make sure you get up and running.

Have a great day!
Travis W
0 Kudos
Message 5 of 10
(3,775 Views)
So how do you use a clock?  That is very much what I would like, but I have absolutely no idea how... When I go into DAQ assistant, I can only select external encoder?
0 Kudos
Message 6 of 10
(3,757 Views)
I meant  to say, I can only select external clock... Man, not having an edit feature really sucks ;).  I accidentally added the above post to another encoder question I had had a while back as well OOPS!
0 Kudos
Message 7 of 10
(3,753 Views)
Please!?
0 Kudos
Message 8 of 10
(3,730 Views)
... S O S...
0 Kudos
Message 9 of 10
(3,719 Views)
Hi,

You can use the other counter on your card to generate this external clock source.  Check out this KnowledgeBase, and this Discussion forum for a couple of ways to accomplish this.

The technique mentioned in the discussion forum above is a nice solution, as it requires no external connections.  To do this, however, you will need to create a seperate task for your second counter, and set the rate to be the same as the sample rate of your continous position measurement task.

Best of luck on the application, and let us know if you have any more questions.

Have a great day!
Travis W

Message Edited by Travis W on 10-16-2006 06:28 PM

Message Edited by Travis W on 10-16-2006 06:31 PM

0 Kudos
Message 10 of 10
(3,706 Views)