Microcontroller › PIC › How to run the stepper motor ?.. › What you must do is to
What you must do is to investigate which is the secuence of the stepper motor.
The 16 posibilities are next:
IN1 IN2 IN3 IN4
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
” ” ” “
1 1 1 1
Get a battery or power supply of 3,6V
1º connect GND of Power to the GND of the motor.
2º Try all the 16 posibilities and if the motor turns note down in which direction.
3º If for example there are 3 secuencies that turn in right direction reproduce this, but betwen out a secuence and out the next secuence put a delay that will mark the velocity of the motor. Watch out with the delay is not too small.
while (1)
{
out port (0100) //Secuence 1 turn right
delay_ms (500) //delay 0,5 s
out port (1000) //Secuence 2 turn right
delay_ms (500) //delay 0,5 s
out port (1100) //Secuence 3 turn right
delay_ms (500) //delay 0,5 s
}
with this example the motor always turn in the right direction