Esp32 + stepper motor

Hi,

I'm trying t o connect my ESP32 to this stepper motor(17HS19-2004S1): https://www.amazon.pl/STEPPERONLINE-krokowy-Bipolar-przewody-drukarek/dp/B00PNEQKC0

using a driver (drv8825): https://www.amazon.pl/dp/B07CNJR2Z6?ref=ppx_yo2ov_dt_b_product_details&th=1

I'm following this instruction: A4988 Stepper Motor Driver with Arduino Tutorial (4 Examples)

  • setting up Vref to 1V

  • Green and Black go to 1A 1B

  • Red and Blue go to 2A, 2B- Dir goes to GPIO12

  • STP goes to GPIO14

  • Logic is powered by esp32 5v

  • Motor is powered by 12V DC

  • I don't have capacitor

When I power everything driver are getting hot, and motor is "jumping". It doesn't want to do one full rotation. It's going two-three step forward and then one-two step back.

I was even trying to connect in different configuration wires from motor to the drive and result is similar.

Could you advise? I guess "jumping" motor is a quite common problem. I don't understand what could be wrong.

Thanks!

Based on the information I was able to find, your step motor is for 2A current per coil.
Its driver is also for a maximum of 2A.

Therefore it is not the recommended driver for your motor.

As the current driver will work at its limit, it will heat up a lot.

Hi, I used 0,4A stepper driver and the result is the same - motor is jumping. I don't understand what I'm doing wrong.

0,4 driver for a 2 A motor?

Please show a detailed schematic how everything is wired.

That's wrong. 1A and 2A belong to one coil and 1B,2B to the other.

Which capacitor are you talking about? The capacitor between Vmot and Gnd close to the board is mandatory.

Lot of tutorials are saying that 1b ana 1a are the same coil. I will try

Sorry, I switched stepper motor from 2A to 0,4A

This is the wiring (compatible to A4988 wiring).
DRV8825_STEPPER-MOTOR_POLOLU

Can you post a datasheet of the motor? Not all motors with such low amps are suitable for a DRV8825. Often that are high impedance steppers that are inappropriate for a current driver.

@last_not_used_login
Have you adjusted the driver to the correct motor current?

Just want to confirm - what is a foruma for vref?
Vref = 1/2 * stepper motor Amper per coil? [Where vref is in Volts]

Yes. 12v

https://botland.com.pl/index.php?controller=attachment&id_attachment=1079

Motor: JK42HS34-0404

Current no voltage.....

" https://ardufocus.com/howto/a4988-motor-current-tuning/

= 0.4A, 30Ohm coil resistance
This is a 12V high impedance stepper. Not suitable for the DRV8825 current driver.

You may use it with your DRV8825, but then you need a much higher Voltage. About > 30V ( 45V is the max for the DRV8825).

Yes, if your current sense resistors are 0.1 Ohm

It is working when I increase Vref. but is missing steps.

You have a high impedance (12volt/30 ohm) stepper motor that is designed for low speed and should be used with a common H-bridge. Perfect match for an Adafruit motor shield v2 and a 12volt motor supply.

If you want to use this motor with a DRV8825, which is a current controlled driver, then you must increase driver supply to at least 24volt (36volt), to give the driver the headroom to supply the motor with the right current at higher step rates.

But you will never get the step rate of a modern low impedance motor with a current driver.
Leo..

Thanks for explaining. But I don't understand few things:

  1. For what that stepper motors can be used
  2. What is a impedance / what should be for my driver and similar
  3. What is a different between my driver and driver designed for this motor?
  4. I don't know if I understand - are you saying that for 12V motorv I can use 36V? What with Amper? 12v x 0,4A is less than 36V x 0,4A

One more time thanks for a explanation.
Now I know why my stepper motor is getting hot

Thanks!

Stepper motors are mainly designed for positioning - e.g. like in CNC machines.

Impedance describes the electrical behaviour of a coil. It is the sum of resistance and reactance. This is a bit more complex than simple resistors (its not simply Ohms Law).
https://www.britannica.com/science/electrical-impedance
Current controlling stepper drivers need the impedance of the stepper motor coil to work.

The DRV8825 is a current controlling driver. It needs the voltage Headroom ( e.g. 12V->36V) together with the impedance of the stepper coil to control the current. It isn't as easy as it seems to be :wink:.
A simple H-bridge only switches the voltage on and off. The current is limited by the high impedance of the stepper. The problem with high impedance steppers is, that the current drops significantly with higher step rates ( higher speed ). That means lower torque at higher speeds.
Current-controlling drivers can compensate for this (at least partially). So the torque drops less with higher speeds.

With the coil impedance it is not simply Ohms Law - things are more complicated. Some time ago a wrote an explanation how those drivers work - but unfortunately it is in german. Maybe it would be worth to translate it :thinking: