I have a fare bit of past experience in using Stepper Motors and I firmly believe that they have a place in Robotics and Control.
The Picaxe 18M2 High Power Project Board goes part way to enabling this with its L293D bi-direction current driver on 'motors C and D'. However, little is said as to how to use it to step a stepper motor.
A Stepper motor requires that its 2 sets of motor windings are wired as motors C and D. Then once connected it can be stepped to use its angular precision of 3.6 degrees (or even 1.8 degrees).
The state of the windings have to sequence through 4 states
The subroutine I came up with for clockwise stepping is below:
SingleStepCW:
if StepState = 3 then
high B.5
low B.4
high B.7
low B.6
endif
if StepState = 2 then
low B.5
high B.4
high B.7
low B.6
endif
if StepState = 1 then
low B.5
high B.4
low B.7
high B.6
endif
if StepState = 0 then
high B.5
low B.4
low B.7
high B.6
endif
let StepState = StepState + 1
if StepState > 3 then
let StepState = 0
endif
pause StepTime
return
Calling it like:
let NumSteps = 100
for Cnt = 0 to NumSteps step 1
;Stepper clockwise
call SingleStepCW
next Cnt
would give a precise full rotation of the stepper motor.
I also put together a subroutine for Counter Clockwise, where the states of the windings sequence in reverse.
From here one then needs to put together control over where the motor is, where it needs to be and have many steps it needs to take.
Two final issues:
a. The need for a microswitch sensor to find and possition the motor at its 'home position'.
b. That the 18M2 High power board only has one L298D socket. If you need to use 2 stepper motors to drive Robot Wheels, you then needs to build
something like a Shield board for a 28X2 Shield Base.
The Picaxe 18M2 High Power Project Board goes part way to enabling this with its L293D bi-direction current driver on 'motors C and D'. However, little is said as to how to use it to step a stepper motor.
A Stepper motor requires that its 2 sets of motor windings are wired as motors C and D. Then once connected it can be stepped to use its angular precision of 3.6 degrees (or even 1.8 degrees).
The state of the windings have to sequence through 4 states
The subroutine I came up with for clockwise stepping is below:
SingleStepCW:
if StepState = 3 then
high B.5
low B.4
high B.7
low B.6
endif
if StepState = 2 then
low B.5
high B.4
high B.7
low B.6
endif
if StepState = 1 then
low B.5
high B.4
low B.7
high B.6
endif
if StepState = 0 then
high B.5
low B.4
low B.7
high B.6
endif
let StepState = StepState + 1
if StepState > 3 then
let StepState = 0
endif
pause StepTime
return
Calling it like:
let NumSteps = 100
for Cnt = 0 to NumSteps step 1
;Stepper clockwise
call SingleStepCW
next Cnt
would give a precise full rotation of the stepper motor.
I also put together a subroutine for Counter Clockwise, where the states of the windings sequence in reverse.
From here one then needs to put together control over where the motor is, where it needs to be and have many steps it needs to take.
Two final issues:
a. The need for a microswitch sensor to find and possition the motor at its 'home position'.
b. That the 18M2 High power board only has one L298D socket. If you need to use 2 stepper motors to drive Robot Wheels, you then needs to build
something like a Shield board for a 28X2 Shield Base.