01-15-2017 08:14 PM
I have a rotary encoder with complementary outputs (datasheet). Its maximum output frequency is 125kHz.
Because I don't understand how to appropriately use and size pull-up/down resistors, I'm unable to get this to interface nicely with LabVIEW code and DAQmx. (The crucial point being, I suppose, that the input voltage is 12..24V (I have 17V since the power supply is also controlling some load cells/amplifiers requiring 14..24V) and the output seems to be around 12V high and ~350mV low with no external resistors pulling in any direction).
Ideally, I would like to (using as few additional hardware components as possible for a good solution) connect my encoder output to my NI USB-6356 DAQ board and then have it count edges using DAQmx.
Currently, I have to use an AI Voltage channel, after connecting PFI8 (the Counter0 terminal) and the AnalogComparisonEvent, then a separate CI Cnt Edges read. This isn't too terrible, but it's quite a bit more to set up (boo-hoo) and more importantly, requires the use of an AI. The speeds make it more challenging for me to get reliable results (perhaps because my code is bad) when using a comparitively slow AI, instead of the very fast digital counter inputs.
What should I be doing here?
Solved! Go to Solution.
01-16-2017 01:02 AM - edited 01-16-2017 01:05 AM
Hi cbutcher,
Because I don't understand how to appropriately use and size pull-up/down resistors,
You really should. It's just basic electrics with Ohm's law and Kirchhoff rules!
Which encoder do you use? Your datasheet lists several options…
as few additional hardware components as possible for a good solution)
3 resistors (pull-up, pull-down, input) and a Z-diode (5.1V) to protect the DI pin…
According to the datasheet of the USB6356 you could even connect your encoder directly to the DIO pins, but I would prefer some external protection circuit to be an the safe side! (It already mentions an internal pul-down resistor you just need an input resistance with a Z diode…)
01-16-2017 01:47 AM
GerdW wrote:Which encoder do you use? Your datasheet lists several options…
The CWZ5GH - a small functional circuit diagram is given on the first page. It consists of a pair of transistors (one PNP, one NPN, each being connected to the appropriate power line (+ve, gnd) by a 7.5 Ohm resistor, with that in series with a 24 Ohm resistor to output.) Simulation with LTSpice and reading on wikipedia give me a basic understanding of pull-up/down but it's unclear how I would size a pull-down to get a 5V high for arbitrary input voltage. I could size it for 17V, but then if I change to 16V for some reason, my resistor would need changing (Perhaps this is just how it is, without a comparator circuit?). Seemingly a pull-up resistor will make my high level be the same as the power +ve rail, which will be far too high to be recognised as a 5V TTL for LabVIEW.
Your description of components needed makes me think I should have the output connected to both +ve and gnd with a resistor each, then connected using the diode to prevent voltages greater than 5.1V being passed as a digital input - I suppose that this neatly avoids having to size the pull-up resistor too carefully to the power supply, but I imagine you didn't mean for me to use it as a voltage regulator.
01-16-2017 02:06 AM
01-16-2017 02:10 AM