0

I am using an ESP32 a TB6600 micro stepper, and a Nema 23 stepper motor, I am trying to control the motor with the esp32 but the TB6600 requires a 5v signal, I tried to fix this by using a logic level converter (specifically this) but when I attempt to control the motor I get a very slight hum out of the motor and no movement.

The motor controller and motor both work as I tested it with an Arduino Uno.

void setup() {
  pinMode(15, OUTPUT);
  pinMode(16, OUTPUT);
  pinMode(17, OUTPUT);
  digitalWrite(16, HIGH);
}

void loop() {
 
  digitalWrite(15,LOW);
  digitalWrite(15,HIGH);
  digitalWrite(17, HIGH);
   delay(200);
}

Picture of Circuit Arduino circuit

Circuit Diagram Circuit Diagram

4
  • The inputs ENA, DIR and PUL appear to be leds of optocouplers based on this: dfrobot.com/product-1547.html . I guess that you don't need that logic level shifter which is anyway intended only for very low currents. It is strange, however, that 5v is specified. The wiring in the link I have supplied implies that LOW is on and HIGH is off. Ensure that any example code you are using matches your wiring.
    – 6v6gt
    Commented Jul 31, 2023 at 18:04
  • How much current the TB6600 needs on its inputs? Bidirectional level shifters can't provide much current on the high side as they are basically shorting LOW through the mosfets (HIGH is pulled up by few kiloohms resistors to HV)
    – KIIV
    Commented Jul 31, 2023 at 20:17
  • When you plug in your circuit, do you notice your motor getting hot? Also, why are you setting your pin 17 to high in your loop?
    – jonathan
    Commented Jul 31, 2023 at 21:55
  • 1
    It doesn't look like the motor controller shares a ground with your ESP32. Try connecting the grounds together and see if it helps.
    – Delta_G
    Commented Aug 1, 2023 at 4:13

2 Answers 2

0

I haven't used this kind of system, so I'm just guessing. But in the Manual it says:

When“EN”is in the valid state, the motor is in a free states (Off-line mode). In this mode, you can adjust the motor shaft position manually. When“EN”is in the invalid state, the motor will be in an automatic control mode. (Source).

It is not entirely clear what they mean by "manually". But you set pin 17 to HIGH and the result would fit the description. Maybe set 17 to LOW?

On another note: there is no delay/time between digitalWrite(15,LOW); and digitalWrite(15,HIGH);. This will create a very short pulse, which might be too short for the level shifting electronics to translate. Some delay() or equivalent non-blocking code between the two writes could help.

1
  • In this context, "manual" means physically manipulating the shaft rather than doing it through the motor controller. When steppers are disconnected, they can free spin. When they are powered with a constant signal or shorted, they will hold position and resist external forces that would otherwise cause them to free spin.
    – user10489
    Commented Aug 12, 2023 at 11:54
0

I figured out the problem, the logic level switcher I was using is meant for I2C sensors, and thus was only capable of converting open-drain signals and cannot perform push/pull level translation meaning it was not able to provide a data signal to the micro stepper. I replaced the shifter with a shifter capable of push/pull translation specifically This

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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