Go Down

Topic: Level shifter outputting incorrect voltage (Read 171 times) previous topic - next topic

mattb42

Aug 06, 2020, 06:52 pm Last Edit: Aug 06, 2020, 06:58 pm by mattb42
I am trying to drive a Nema 17 12-24V stepper motor using a Teensy 4.0 as the controller, with a TB6600 stepper driver. The Teensy outputs 3.3V through its signal pins but the stepper driver needs 5V, so I have a 3.3V to 5V level shifter bumping the signal voltage up.

When I run a very basic program on the Teensy (keeping the DIR pin high, and flipping the PUL pin low to high every 60 microseconds) I see no movement in the stepper. After checking the voltage in and out of the level shifter, it looks like the input is fine (~3-3.3V), but the output is maxing out at 2.6V isntead of 5V. This doesn't seem to be enough to get anything through the stepper driver. About 0.9 milliamps are being drawn through each signal pin.

I tried switching the Teensy and level shifter out with a Nano so I could test the code and the driver. With the 5V output from the Nano going straight to the driver and the exact same code, the stepper runs beautifully. This, coupled with the fact that the Teensy is outputting the correct 3.3V signals, leads me to believe that the issue lies in the level shifter. I have no idea WHERE the issue may be within the shifter, though.

Help me Arduino forums, you're my only hope.

EDIT: The schematic does not have GND connected to the stepper driver, although it SHOULD be. For some reason I can't upload the corrected image.

JCA34F

You don't have PUL-, DIR-, and  EN- connected to Teensy's GND. How much current does the drive's input opto couplers require? How much can the level shifter supply?

ShermanP

It's possible the level shifter can't supply enough current to drive the stepper driver.  You could disconnect the driver from the shifter, then measure the shifter's output as you change its inputs.  If they are 5V unloaded, then the driver is doing something that drags the shifter outputs down, and you probably need some other method of level shifting.  It doesn't seem you really need bidirectional shifting anyway, and from the datasheet it seems this shifter has very weak outputs so it can detect which side is driving which.

Have you tried connecting the Teensy directly to the driver.  It might work if the driver inputs accept 3.3V as HIGH on the control inputs.



MarkT

This is a standard driver with optocoupler inputs, just connect it up, should just work even
at 3.3V.  Opto coupled inputs here look like a resistor in series with an IR LED, so no external resistor
needed.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

Go Up