5

I have 2 stepper motors in my micromouse. Every so often one of the stepper motors will turn back one step. My set up is a PICAXE and a ULN2803A and to clock the pulses i just turn the outputs on or off on the picaxe. The stepper motors are back to back so if one is rotating clockwise the other must be going anticlockwise to make it go forwards. This leads me to powering my outputs using the following:

; Coil 1 of one stepper motor is output 0
; Coil 4 of one stepper motor is output 3
; Coil 1 of the other stepper motor is output 4
; Coil 4 of the other stepper motor is output 7
let pins = %10000001
wait 1 ;wait 1 second
let pins = %01000010
wait 1 ;wait 1 second
let pins = %00100100
wait 1 ;wait 1 second
let pins = %00011000

So why is it rotating backwards after 2 puleses? Have I got the coils the wrong way?
UPDATE:
I've just again checked that i have the correct coil numbers and this is correct. So the coils are the correct.

Dean
  • 8,408
  • 27
  • 70
  • 120

2 Answers2

4

You're skipping steps.

Full drive mode for a stepper looks like this:

 Step A  A' B  B'
  1   1  0  1  0
  2   1  0  0  1
  3   0  1  0  1
  4   0  1  1  0
  1   1  0  1  0

One of the A windings and one of the B windings are always on, and the rotor is resting halfway between the two powered windings. This gives you maximum torque.

Half stepping sacrifices some torque to give you twice the resolution:

 Step  A  A' B  B'
  1    1  0  1  0
  1.5  1  0  0  0
  2    1  0  0  1
  2.5  0  0  0  1
  3    0  1  0  1
  3.5  0  1  0  0
  4    0  1  1  0
  4.5  0  0  1  0
  1    1  0  1  0

The half steps don't have as much torque, since only one winding is on part of the time. But, the half steps are close to a full step, so it doesn't take much to get the rotor there.

You're skipping the full steps and just using the half steps. You might also be sequencing the windings wrong. I can't tell because your numbering scheme is atypical.

See a reference like this one for more information and pictures.

Ron
  • 289
  • 1
  • 4
  • By the way, it might make your code more simple if you WIRE the steppers backwards instead of CODING them backwards. Swap the B and B' wires to reverse the direction of rotation on a stepper. – Ron Mar 07 '11 at 14:48
  • Great answer but to my delight i had blown a ULN2803A. Because it was only missing certain steps which showed me that certain darlington arrays were broken. As the one stepper motor was working fine – Dean Mar 07 '11 at 21:16
1

Have you blown the ULN2803A? As the coils are correct and the pulses also work. Try swapping the stepper motors over if the same happens then you have blown the ULN2803A.

Dean
  • 8,408
  • 27
  • 70
  • 120