Hey Guys, I salvaged a Stepper Motor and Controller Board from a Vending Machine.. And thought I would try and control it with a Picaxe 20M2.. I am a Newbie.. So please forgive me if the "Code" or Terminology I use is not 100% Accurate.. I have the board wired to my 20M2 as shown in Picture..
I have read a lot about controlling a stepper motor, but all the info I found is in regards to controlling the motor directly.. instead of threw a type of controller. I understand the concept, but am having a hard time getting the motor to work under load. For instance I can get the motor to move in steps with the following code, but under a load it will not do anything.. (I mean under load in regards to the actual load it was under in the original machine, So I am not adding any more load then for what its original design was for.)
symbol PhaseA = B.0
symbol PhaseB = B.1
symbol Power1 = B.2
symbol Power0 = B.3
Symbol PushSwitch = PinC.0 'Tied High through 10K to 5VDC
High PhaseA
High PhaseB
Low Power1 'Sets Stepper to 60% Power to keep motor in place and not spin freely
High Power0
Main:
If pushswitch = 0 then let b1 = 1 endif
if pushswitch = 1 and B1 = 1 then let b1 = 0 goto spin endif
goto main
Spin:
Low Power0
pause 8
Low PhaseA
pause 4
Low PhaseB
pause 4
high PhaseA
pause 4
low PhaseB
pause 4
High Power0
goto main
So with that code I can get the motor to move (without anything on shaft - NO LOAD, Under Load it just wiggles and doesn't move), It takes about 30 Pushes to spin all the way around, so its not moving 1.8 Degrees per step.. Can anyone help me, or explain to me where my HEAD is not think properly... I want to be able to move the motor one step at a time.. As well I measured all these "Wires" with my scope (In original equipment), and that's how I came up with the pause times.. But My scope has been acting up and I cannot see the first 15ms from the first trigger, I can only see the running timing.
Thanks Steve
goto main
http://www.datasheetcatalog.org/datasheets/150/35361_DS.pdf
I have read a lot about controlling a stepper motor, but all the info I found is in regards to controlling the motor directly.. instead of threw a type of controller. I understand the concept, but am having a hard time getting the motor to work under load. For instance I can get the motor to move in steps with the following code, but under a load it will not do anything.. (I mean under load in regards to the actual load it was under in the original machine, So I am not adding any more load then for what its original design was for.)
symbol PhaseA = B.0
symbol PhaseB = B.1
symbol Power1 = B.2
symbol Power0 = B.3
Symbol PushSwitch = PinC.0 'Tied High through 10K to 5VDC
High PhaseA
High PhaseB
Low Power1 'Sets Stepper to 60% Power to keep motor in place and not spin freely
High Power0
Main:
If pushswitch = 0 then let b1 = 1 endif
if pushswitch = 1 and B1 = 1 then let b1 = 0 goto spin endif
goto main
Spin:
Low Power0
pause 8
Low PhaseA
pause 4
Low PhaseB
pause 4
high PhaseA
pause 4
low PhaseB
pause 4
High Power0
goto main
So with that code I can get the motor to move (without anything on shaft - NO LOAD, Under Load it just wiggles and doesn't move), It takes about 30 Pushes to spin all the way around, so its not moving 1.8 Degrees per step.. Can anyone help me, or explain to me where my HEAD is not think properly... I want to be able to move the motor one step at a time.. As well I measured all these "Wires" with my scope (In original equipment), and that's how I came up with the pause times.. But My scope has been acting up and I cannot see the first 15ms from the first trigger, I can only see the running timing.
Thanks Steve
goto main
http://www.datasheetcatalog.org/datasheets/150/35361_DS.pdf