Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

quadrature encoders and PCI-6602

I am using the PCI-6602 to attempt to measure the angular position of of a motion table.  the actual problem that i am having converting the counter's data into degrees.  the values that i am getting from the counter seem to vary quite a bit and i know that they shouldn't because the axis that i am measuring is only moving from -15 to 15 degrees.

i am using x4 decoding type, i have used interupts for the additional counters, and i have created a digital pusle train as a sample clock source. i am not sure what other information will be useful in answering my question, i do not think that i have problem with my connections, i think i am misunderstanding how to convert the array data from the counter to an array of degree measurments.

i have used the equation given in the Quadrature Encoder Measurements: How-To Guide to try this conversion but the numbers still seem to float around.

i know that may be a little confusing but thanks to anyone who can help.

Craig
0 Kudos
Message 1 of 3
(3,860 Views)
Hello Craig,

It looks like you are trying to do an x4 quadrature encoder measurement from scratch (i.e. do all the calcuations by yourself).  Using DAQmx however, we have a built in task type that allows you to use quadrature encoders directly.  Check out this example and see if that works for you.  I am assuming you are using LabVIEW, if this is not the case, let me know what you are programming in and I will try and find an example in that language (or you can search the example programs to see if you can find one).

Depending on the encoder, there will be some ambiguity as to position.  This is determined by the distance between pulses on the encoder.  You can also see some issues if your system is vibrating.  If you bounce back and forth across an edge of your encoder signal (usually due to vibrations), you can see unwanted ticks that will throw your position off.

I hope this helps, please let me know if you have any more questions.
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 2 of 3
(3,849 Views)
Neal,

Thanks for the quick response.  I was actually already using an example very similar to the one you showed me, but it used 3 counters, then I modified it to use 5 and added the digital pulse generation for the sample clock. I actually just fixed the problem that I was having, and was about to post my error on here.  I neglected to change the pusles per revolution properly.  The encoders gave me a count per degree specification that I needed to convert to counts per revolution so that it would count correctly.  Is it correct that the x4 decoding type will cause the measurement to be off by a factor of four?  If so that I have fixed all measurment problems that I had.

Thanks

Craig
0 Kudos
Message 3 of 3
(3,846 Views)