Stepper motor only vibrates, wont turn correctly.

Hi, I am currently working on my senior design project for electrical engineering which happens to involve the use of a stepper motor to turn a turret, all controlled by a micro controller. I have spent the last few days trying to get my motor setup to work but can get it quite right. For prototyping reasons I am using an arduino mega, one of the generic l298n driver boards, and a 12-24V nema 17 stepper. I have made sure to have the winding correctly figured out (using ohm meter found the ones that have no resistance between them) and connected them so that coil 1 goes to out1 and out2 and coil 2 goes to out3 and out4. I have also tried every other combination of those 4 wires that I could think of. The motor will either vibrate, or turn a bit but the number of steps seems random and it sometimes “jumps” back and forth. I am running an 18.5V, 4.9A power supply for the motor/driver supply, and powering the driver logic with the arduino+5v out. I have also made sure to attatch both the 18V supply’s ground and the GND coming out of the arduino together at the GND connector of the driver. I earlier had the motor sorta working with a 12V source but the torque was terrible ( barely held with my fingers and it stalled out).

Part number for the Motor is: 17HS16-2004S

I have also done a connectivity check from the l298n pins to all the connectors and everything seems to be connected.

Here is an attempt at uploading a schematic of my setup:

C:\Users\Justin\Desktop\Justin’s%20Shtuff\Images

Any help would be appreciated :smiley:

You have the wrong sequence for the windings.

How so? The same sequence seems to work when I use a 12v supply but then acts crazy when I try using the 18v I’ve.

The L298 chip is ancient technology and nearly useless for that high current, low resistance (1.1 Ohms/phase) motor. The chip is overheating and shutting down.

You need a modern motor driver like the DRV8825 breakout board from Pololu. Be sure to follow the directions to set the current limit to something reasonable, like 1.5 amps/phase. https://www.pololu.com/product/2133