Stepper motor encoder

Hello everyone, I am working on a project and using Nema23 stepper motor with HSD57 closed loop driver. (Driver) I need to read encoder data, actually I can read when I connect A+ B+ and gnd to my STM32 F401RE,but I got one way information (When motor goes forward and backward same number I got). When I connect again A+ B+ and GND to STM32 and A- and B- to gnd to STM32, in this way I can read both backward and forward movements. But I am afraid of burning the encoder, cause its originally works differancially but I use it one way, and connect to other pins to ground. What should I do to not burning the encoder?

The encoder should work properly if you connect only A+, B+ and GND to the MCU, but ONLY if the encoder output voltage is 3.3V.

The A-, B- outputs are for RS485/422 differential connections and have nothing to do with "forward and backward" movement direction.

Movement direction is encoded in the relatives phases of A and B output transitions.

Thanks for your replying, but when I connect only A+, B+ and GND I got only one way information. I don't get negative number but when I connect A-, B- to gnd I got negative number

Most likely, that is a problem with the wiring, or the code you forgot to post.

By the way my encoder output voltage is 5.0V. Is this the problem?

Logic level shifters are required to safely connect 5V outputs to 3.3V inputs.

Hi, @maprex

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

A copy of your code would help as well.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

Connect the " - " outputs to GND with 4.7k resistors.

Hi, @maprex
Driver data sheet.
Easy-Servo-Driver-JK-HSD57.pdf (316.7 KB)

It looks like you have to have these connections to the encoder.

So do not gnd any of the A+, A-, B+ or B- terminals.
When you need to connect the encoder to a controller, then use A+ and B+ and EGND connections.

Tom.... :smiley: :+1: :coffee: :australia:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.