Jump to content
  • 0

Getting Rotary Encoder Direction Using USB-1608G DAQ


Mitesh

Question

Hello,

I am trying to use an LPD3806 rotary encoder with a 1608G DAQ. I have been able to use the counter pins to get and count the Phase A and Phase B pulses from the encoder, however, I cannot figure out how to get the direction of the encoder (whether it's rotating clockwise or counterclockwise). The main issue is that I cannot find a way to get the readings of both channels (from the encoder) simultaneously. Whenever I try to run the c_in_scan function (part of the MCC python API), I get an error stating that the 1608G DAQ does not support the use of c_in_scan. Hence, I cannot get synchronous readings from the encoder.

 

Any help would be appreciated.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Thanks Fausto,

I am planning to get the 1808X DAQ to replace my 1608G. The only problem I am encountering is that the 1808X only has 4 DIO pins and I need 6 pins. I have two motors that take a total of 4 DIO pins and I have two limit switches that need an extra 2 DIO pins. I think I could make use of the counter pins on the 1808X for the limit switches, however, I am not sure of the wiring requirements for the encoder with the 1808X. I have a few questions accordingly:

 

1. Does the encoder need to use any of the counter pins (CTR0 or CTR1) or does it only connect to the encoder inputs (ENC0A, ENC0B, ENC0Z and ENC1A, ENC1B, ENC1Z)?

2. Is there something that you could point me to that shows a wiring diagram for a quadrature encoder with 1808X?

3. Also, is there a Python example for reading the encoder data and telling the direction using the pulses from Channel A and Channel B? Do I manually have to read the two pulses and create a logic in my code (to figure out the direction) or does the DAQ do that for me?

 

I am a little confused about how the encoder inputs on the 1808X actually work. 

Link to comment
Share on other sites

  • 0

Hello @Mitesh.

The counter and encoder pins are separate inputs.

The encoder's A phase line should connect to the ENC#A terminal.  The encoder's B phase line should connect to the ENC#B terminal.  If your encoder has a Z wire, then it should be connected to the ENC#Z terminal.

image.png

 

Reference the UL Help for the library functions and examples (i.e. CInScan03).  The encoder's signals are used to determine system position (counts), velocity (counts per second), and direction of travel or rotation. 

https://www.mccdaq.com/pdfs/manuals/Mcculw_WebHelp/ULStart.htm

image.png

 

image.png

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...