Stepper moves randomly

Hi.

I'm workin with a bipolar stepper using the driver L298n and Stepper.h library, just by running th example codes the motor moves clockwise - counter clockwise randomly.

I have an external power source that gives 12V output connected to the driver.

i checked the connections and the pins with the driver, the result is the same.

Why that happens to my stepper?

Thanks.

Post your code.

Make a pencil drawing (NOT Fritzing, please) showing how YOU have everything connected and post a photo of the drawing.

...R Stepper Motor Basics

jpill: Why that happens to my stepper?

Thanks.

Make sure to say what kind of stepper motor you have. The motor will certainly behave randomly if the L298N cannot supply the necessary amount of current to the motor. If you have a variable bench/lab power supply, then try lowering the supply voltage a little. And then see if the motor starts behaving in the way you expect it.

Also need to make sure that the two coils are wired correctly, so that the voltages applied to the coils are correct (in terms of polarity) during the stepping sequence.

jpill: I'm workin with a bipolar stepper using the driver L298n and Stepper.h library, just by running th example codes the motor moves clockwise - counter clockwise randomly.

So why not using a DRV8825 and the AccelStepper library? Is that a low impedance bipolar stepper? (Most of them are - and those cannot be driven by an L298)

MarkT: So why not using a DRV8825 and the AccelStepper library? Is that a low impedance bipolar stepper? (Most of them are - and those cannot be driven by an L298)

I reckon it depends on application. I'm driving low impedance steppers reliably with L298N....and providing adequate torque for my purposes.

I'm using a4988 drivers too.

Hi.

First at all, i'm sorry for late response.

I checked the conections from the motor to the driver and made some combinations until i get the correct one.

Now i change to a Polou driver A4988 and it works fine to, give me more torque and use less pins.

https://www.pololu.com/product/1182

Thanks a lot for your answers.