Stepper Control Problem
NWUpgrades
Posts: 292
I have a problem with a stepper motor controller I purchasedon E-Bay. It is actually kind of neat, as it can be run by push button or computer. Some time ago John sent me code to test my stepper motors. The motor spins CW and CCW when using the pushbuttons on the controller. However, when I try to run the program, it will only go CW. If I remove the CCW or the CW code, the motor will continously spin. There are 4 possible outputs to the stamp, but I am only using 2 of them for testing. The other 2 are to increase and decrease the speed. I have swapped 0 and 1, but it still moves CW only.
Here is a link to the controller: http://cgi.ebay.com/Stepper-Motor-Controller-Driver-I-2-Control-Modes_W0QQitemZ160340068089QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item25550346f9&_trksid=p3286.c0.m14&_trkparms=65%3A12%7C66%3A2%7C39%3A1%7C72%3A1205%7C240%3A1318%7C301%3A1%7C293%3A1%7C294%3A50
And here is the simple code: I would greatly appreciate any help or suggestions that anyone can provide. Thanks.
' {$STAMP BS2}
' {$PBASIC 2.5}
··· StepperDir····· PIN···· 0······················ ' direction control
··· StepperMove···· PIN···· 1······················ ' movement
··· CW············· CON···· 0
··· CCW············ CON···· 1
··· idx············ VAR···· Byte
··· Reset:
··· OUTPUT StepperDir
··· HIGH StepperMove····························· ' move on high-to-low transition
··· Main:
··· StepperDir = CW
··· FOR idx = 1 TO 100
··· PULSOUT StepperMove, 500
··· PAUSE 5
··· NEXT
··· StepperDir = CCW
··· FOR idx = 1 TO 100
··· PULSOUT StepperMove, 500
··· PAUSE 5
··· NEXT
··· GOTO Main
Here is a link to the controller: http://cgi.ebay.com/Stepper-Motor-Controller-Driver-I-2-Control-Modes_W0QQitemZ160340068089QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item25550346f9&_trksid=p3286.c0.m14&_trkparms=65%3A12%7C66%3A2%7C39%3A1%7C72%3A1205%7C240%3A1318%7C301%3A1%7C293%3A1%7C294%3A50
And here is the simple code: I would greatly appreciate any help or suggestions that anyone can provide. Thanks.
' {$STAMP BS2}
' {$PBASIC 2.5}
··· StepperDir····· PIN···· 0······················ ' direction control
··· StepperMove···· PIN···· 1······················ ' movement
··· CW············· CON···· 0
··· CCW············ CON···· 1
··· idx············ VAR···· Byte
··· Reset:
··· OUTPUT StepperDir
··· HIGH StepperMove····························· ' move on high-to-low transition
··· Main:
··· StepperDir = CW
··· FOR idx = 1 TO 100
··· PULSOUT StepperMove, 500
··· PAUSE 5
··· NEXT
··· StepperDir = CCW
··· FOR idx = 1 TO 100
··· PULSOUT StepperMove, 500
··· PAUSE 5
··· NEXT
··· GOTO Main
Comments
Take a look at EXP#27 in the Stamp Works Manual.
What You lack is the Binary output seq.
%1100
%0110
%0011
%1001
You have to step a stepper, and I dont see it in Your code
_________$WMc%________
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············································ BoogerWoods, FL. USA