0
\$\begingroup\$

I'm working on a motor controller design that I would like to be as flexible as possible without driving up my BOM cost and board area more than necessary. To that end, I would like to use a single input circuit and connector to handle both single-ended and differential encoders. I'm operating under the assumption from my own experience that most encoders run on a 5V supply (is this a bad assumption?).

I've come up with a couple of options so far but I'm not sure which is better or if I'm missing something else entirely.

  • Use a single-ended logic buffer such as a 74LVC07A. When a differential encoder is used, only connect the positive lines. My concern here is that I'm not sure of what the voltage of a single line is relative to ground. Does a 5V differential encoder typically output 0V and 5V, or is it more like +/-2.5V?
  • Use a RS-422/485 differential line receiver. When a single-ended encoder is used, ground the negative input. I'm not sure how complex the grounding configuration would need to be here. Is there a pulldown resistor configuration that won't interfere with a differential encoder? If not, I would probably need to use a FET to selectively pull the line low.
\$\endgroup\$
5
\$\begingroup\$

When you set out to make something that can support differential or single ended connections from the encoder why not try what I have done on a number of projects.

Before delving into that let me clarify for you that differential encoders do not output voltage swings that go above and below GND. A single A+ or B+ or A- or B- will always swing from GND to some positive voltage (very typically 5V). The differential aspect comes onto play simply because the A- and B- pins are simply logically inverted from their A+ and B+ counterparts.

Also note that differential receivers are designed to pull the difference out from between a pair of signals that are nominally logical inversions of each other. The typical differential receiver will be capable of detecting from a signal pair that has reduced amplitude, even down to less than half a volt, due attenuation through a very long cable. The receivers also can accommodate a common mode voltage range that extends below GND so that they can detect in situations where there can be a number of volts of GND level shift between different subsystems. (Even without signal level attenuation the receivers in a differential system are also capable of rejecting high noise levels on each signal of a pair).

In my designs I bring in from a connector all of A+, A-, B+ and B-. The A+ and B+ inputs go directly to the + inputs of a AM26LV32 quad differential line receiver. (Note that some designs will also require the Z or Index channel as well). The A- and B- inputs go to a dual 2->1 analog mux chip (I use the TS5A22362 part). The outputs of the switch chip then go to the - inputs of the AM25LV32.

The other side inputs of the analog mux chip come from a TLV431 shunt reference chip setup to produce a voltage level of ~2.5V. A control line from my MCU is used to switch the analog mux for either the single ended mode or the differential mode. In the single ended mode the AM26LV32 is seeing its + input swing approx 0 to 5V and the - input is set at a mid point threshold from the TLV431. (Note that this really assumes that the encoder is not 100's of feet away and as such does not expect there to be a huge GND shift between the encoder and the receiver. With a 2.5V reference and 0-5V swing signals a GND voltage difference between encoder and receiver of a up to a volt can still be easily accommodated for single ended operation).

The AM26LV32 is a great part because it can take the 0 to 5V inputs and run with a VCC of 3.3V. This permits automatic level conversion of the outputs to 3.3V logic levels for connection to the MCU (or as in my typical case an FPGA).

I also anticipate that some encoders that operate in single ended mode may be connected in an open drain / open collector configuration with output pullups to a higher voltage such as +12V. I take care of that in my design by running the encoder signals through a 2.2K resistor before presenting them to the above described circuitry. The downwind side of the 2.2K resistor is also connected off to an ESD / voltage clamp diode chip that is connected into the +5V supply. I use the DVIULC6-4SC6 for these clamps. The beauty of this setup is that it allows for encoders that may be outputting voltages in the range of 0 to as high as 15V or 16V but works just as well for 0-5V encoders.

If the reference was changed to something more like 1.7V to 2V then the circuit would even work nicely for single ended encoders that operated at 0->3.3V voltage swings.

\$\endgroup\$
  • \$\begingroup\$ Isn't it a bit risky to use the clamp that has a clamping voltage of 12V before 26LV32 which has an absolute maximum input diff voltage of 12V as well? Wouldn't it be better to use a 5.5V TVS instead? Can you elaborate? \$\endgroup\$ – Martin Jan 22 at 4:06
  • \$\begingroup\$ @Martin - If you read closely in my posting you will note that I said that all my input signals run through a 2.2K resistor. The downwind side of the 2.2K resistor connects to the 26LV32 inputs (either directly or through the analogue switch mux). The downwind side of the resistor also connects to one of the signal clamp pins of a DVIULC6-4SC6. The clamp part has its Vbus connected to the 5V supply and its GND connected to the digital GND. This clamps the excursion of the signal to just a little over 5V or a little under GND. (continued) \$\endgroup\$ – Michael Karas Jan 22 at 4:46
  • \$\begingroup\$ (continued from above) Obviously the series 2.2K resistor limits the overall current from the input side so the clamp diodes in the DVIULC6-4SC6 do not get exposed to high currents. \$\endgroup\$ – Michael Karas Jan 22 at 4:47
0
\$\begingroup\$

These days there are specialized solutions for this kind of thing such as MAX14890.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.