Bipolar stepper motor vibrating, not turning

Hello,

I have a bipolar stepper motor with following specs:

Voltage: 12V
Current: 1.5A
Wires: 4

I am providing it 12V directly from a PC power supply. But the motor is not running.

Then I have tried running it from easydriver, but it is only vibrating according to the code and not moving. Here is the code:

[ltr][color=#313334][color=#808080]//////////////////////////////////////////////////////////////////[/color]
[color=#808080]//©2011 bildr[/color]
[color=#808080]//Released under the MIT License - Please reuse change and share[/color]
[color=#808080]//Using the easy stepper with your arduino[/color]
[color=#808080]//use rotate and/or rotateDeg to controll stepper motor[/color]
[color=#808080]//speed is any number from .01 -> 1 with 1 being fastest - [/color]
[color=#808080]//Slower Speed == Stronger movement[/color]
[color=#808080]/////////////////////////////////////////////////////////////////[/color]


[color=#808080]#define DIR_PIN 2[/color]
[color=#808080]#define STEP_PIN 3[/color]

[color=#f63333]void[/color] setup[color=#66cc66]([/color][color=#66cc66])[/color] [color=#66cc66]{[/color] 
 [color=#000066]pinMode[/color][color=#66cc66]([/color]DIR_PIN, [color=#000000][b]OUTPUT[/b][/color][color=#66cc66])[/color]; 
 [color=#000066]pinMode[/color][color=#66cc66]([/color]STEP_PIN, [color=#000000][b]OUTPUT[/b][/color][color=#66cc66])[/color]; 
[color=#66cc66]}[/color] 

[color=#f63333]void[/color] loop[color=#66cc66]([/color][color=#66cc66])[/color][color=#66cc66]{[/color] 

 [color=#808080]//rotate a specific number of degrees [/color]
 rotateDeg[color=#66cc66]([/color]360, 1[color=#66cc66])[/color]; 
 [color=#000066]delay[/color][color=#66cc66]([/color]1000[color=#66cc66])[/color];

 rotateDeg[color=#66cc66]([/color]-360, .1[color=#66cc66])[/color]; [color=#808080]//reverse[/color]
 [color=#000066]delay[/color][color=#66cc66]([/color]1000[color=#66cc66])[/color]; 


 [color=#808080]//rotate a specific number of microsteps (8 microsteps per step)[/color]
 [color=#808080]//a 200 step stepper would take 1600 micro steps for one full revolution[/color]
 rotate[color=#66cc66]([/color]1600, .5[color=#66cc66])[/color]; 
 [color=#000066]delay[/color][color=#66cc66]([/color]1000[color=#66cc66])[/color]; 

 rotate[color=#66cc66]([/color]-1600, .25[color=#66cc66])[/color]; [color=#808080]//reverse[/color]
 [color=#000066]delay[/color][color=#66cc66]([/color]1000[color=#66cc66])[/color]; 
[color=#66cc66]}[/color]



[color=#f63333]void[/color] rotate[color=#66cc66]([/color][color=#f63333]int[/color] steps, [color=#f63333]float[/color] speed[color=#66cc66])[/color][color=#66cc66]{[/color] 
 [color=#808080]//rotate a specific number of microsteps (8 microsteps per step) - (negitive for reverse movement)[/color]
 [color=#808080]//speed is any number from .01 -> 1 with 1 being fastest - Slower is stronger[/color]
 [color=#f63333]int[/color] dir = [color=#66cc66]([/color]steps > 0[color=#66cc66])[/color]? [color=#000000][b]HIGH[/b][/color]:[color=#000000][b]LOW[/b][/color];
 steps = [color=#000066]abs[/color][color=#66cc66]([/color]steps[color=#66cc66])[/color];

 [color=#000066]digitalWrite[/color][color=#66cc66]([/color]DIR_PIN,dir[color=#66cc66])[/color]; 

 [color=#f63333]float[/color] usDelay = [color=#66cc66]([/color]1/speed[color=#66cc66])[/color] * [color=#ff33ff]70[/color];

 [color=#a1a100]for[/color][color=#66cc66]([/color][color=#f63333]int[/color] i=[color=#ff33ff]0[/color]; i < steps; i++[color=#66cc66])[/color][color=#66cc66]{[/color] 
 [color=#000066]digitalWrite[/color][color=#66cc66]([/color]STEP_PIN, [color=#000000][b]HIGH[/b][/color][color=#66cc66])[/color]; 
 [color=#000066]delayMicroseconds[/color][color=#66cc66]([/color]usDelay[color=#66cc66])[/color]; 

 [color=#000066]digitalWrite[/color][color=#66cc66]([/color]STEP_PIN, [color=#000000][b]LOW[/b][/color][color=#66cc66])[/color]; 
 [color=#000066]delayMicroseconds[/color][color=#66cc66]([/color]usDelay[color=#66cc66])[/color]; 
 [color=#66cc66]}[/color] 
[color=#66cc66]}[/color] 

[color=#f63333]void[/color] rotateDeg[color=#66cc66]([/color][color=#f63333]float[/color] deg, [color=#f63333]float[/color] speed[color=#66cc66])[/color][color=#66cc66]{[/color] 
 [color=#808080]//rotate a specific number of degrees (negitive for reverse movement)[/color]
 [color=#808080]//speed is any number from .01 -> 1 with 1 being fastest - Slower is stronger[/color]
 [color=#f63333]int[/color] dir = [color=#66cc66]([/color]deg > 0[color=#66cc66])[/color]? [color=#000000][b]HIGH[/b][/color]:[color=#000000][b]LOW[/b][/color];
 [color=#000066]digitalWrite[/color][color=#66cc66]([/color]DIR_PIN,dir[color=#66cc66])[/color]; 

 [color=#f63333]int[/color] steps = [color=#000066]abs[/color][color=#66cc66]([/color]deg[color=#66cc66])[/color]*[color=#66cc66]([/color]1/0.225[color=#66cc66])[/color];
 [color=#f63333]float[/color] usDelay = [color=#66cc66]([/color]1/speed[color=#66cc66])[/color] * [color=#ff33ff]70[/color];

 [color=#a1a100]for[/color][color=#66cc66]([/color][color=#f63333]int[/color] i=[color=#ff33ff]0[/color]; i < steps; i++[color=#66cc66])[/color][color=#66cc66]{[/color] 
 [color=#000066]digitalWrite[/color][color=#66cc66]([/color]STEP_PIN, [color=#000000][b]HIGH[/b][/color][color=#66cc66])[/color]; 
 [color=#000066]delayMicroseconds[/color][color=#66cc66]([/color]usDelay[color=#66cc66])[/color]; 

 [color=#000066]digitalWrite[/color][color=#66cc66]([/color]STEP_PIN, [color=#000000][b]LOW[/b][/color][color=#66cc66])[/color]; 
 [color=#000066]delayMicroseconds[/color][color=#66cc66]([/color]usDelay[color=#66cc66])[/color]; 
 [color=#66cc66]}[/color] 
[color=#66cc66]}[/color][/color][/ltr]

Regards

That usually means that the wires are not connected from the driver to the motor in the right order.

I have detected the coils by lighting an LED, so am connecting them in order.

I have used this tutorial to drive the motor directly from the supply, but in vain.


These links may be useful
Stepper Motor Basics
Simple Stepper Code

And please post code properly - use the code button </>

so your code looks like this

and is easy to copy to a text editor. See How to use the Forum

...R

Capri2794:
I have detected the coils by lighting an LED, so am connecting them in order.

I have used this tutorial to drive the motor directly from the supply, but in vain.

youtube

Just corrected your link

...R

I don't have the patience to watch 4 minutes of video. I can't imagine what value there is in trying to run a stepper motor without a driver.

An Easydriver can only provide 750mA. You need a BigEasydriver or a Pololu A4988 or (slightly better than them) the POlolu DRV8825 for your 1.5amp motor.

...R

Thank you Robin. That was a great help.

Are you sure your motor does 200 steps per rev? You might be pulsing too fast. It's not clear from the code that you are actually 8x micro-stepping. Show a schematic and reference the motor, and driver please.

The LED test tells you which wires are on which coils. At the end of the video the dude says there are 4 ways to hook up the wires. Did you try them all?

Capri2794:
I have detected the coils by lighting an LED, so am connecting them in order.

I have used this tutorial to drive the motor directly from the supply, but in vain.

[

[/quote]](http://www.youtube.com/watch?v=ZEcQW5rCbSQ)

ps, the 'direct-to-transformer' method only works with AC, or at best half-wave rectified current(with an appropriate voltage divider.) Is your 12V power supply DC?

Well, that, and it turns an expensive stepper motor into an expensive AC motor. Probably ideal for a geared clock, but wastes the control that a normal stepper affords. If that's what you are after, why not use a synchronous motor.