Shop OBEX P1 Docs P2 Docs Learn Events
Stepper Control Problem — Parallax Forums

Stepper Control Problem

NWUpgradesNWUpgrades Posts: 292
edited 2009-06-12 02:16 in BASIC Stamp
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

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2009-06-12 02:03
    NW

    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
  • NWUpgradesNWUpgrades Posts: 292
    edited 2009-06-12 02:16
    I do not have that manual. I only have Boe Bot manual and What's A Microcontroller manual. I am using a BS2 Chip. I got the code from John on this forum and 4 years ago it worked just as it is with a different type of controller I had. See pages 472-476 if you are at all interested!!! I just left another posting with sample code the Mfgr. sent, but I am not sure what it was written in and am asking for programmers help.
Sign In or Register to comment.