Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

Quadrature Encoder USB-6215 glitch

$
0
0

I'm using the USB-6215 for a quadrature encoder. I'm trying this two ways, with the same results:

 I add encoder channels A/B to PF0 and PF1 (terminal 1 and 2), using counter 0.  Power is of course from the connector.

1) NI-Measurement and Automation Explorer

  I create a new virtual channel for Position->Angular.

 2) Matlab

encoder_in_ch = sess.addCounterInputChannel(deviceID, 'ctr0', 'Position');
encoder_in_ch.EncoderType = 'X4';

 

However, when counting down below '0', the values stored jump to 4.295x10^9 (4294967294), which is 32-bits (2^32). Eg "15, 14, 13...1,0, 4.295e9,"

Then back to 0,1,...55, etc when moving back above zero.

Why is this not stored as a negative number, but a 32 bit values?

 

I see this in NI-MAX as well, and in the data that matlab stores for the encoder position.

 


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>