Shop OBEX P1 Docs P2 Docs Learn Events
Stepper motor drive + controller (wave sequency) — Parallax Forums

Stepper motor drive + controller (wave sequency)

OldSpringOldSpring Posts: 6
edited 2010-02-03 03:10 in Robotics
Hello, all;

This project use a H-Bridge Drive + BS2sx (controller) to drive a stepper motor.

Components:
1) Basic Stamp 2sx
Manufactory: http://www.parallax.com/
Datasheet: http://www.parallax.com/tabid/440/Default.aspx

2) Stepper motor
Manufactory: www.orientalmotor.com
Datasheet: http://catalog.orientalmotor.com/item/all-categories/pk-series-stepping-motors/pk243-01aa?&plpver=11&origin=keyword&filter=&by=prod

3) Mosfets, transistors, resistors, capaicitors
Bought from: http://www.mouser.com

Attached files:
a) Schematic:
smdschls6.jpg


b) Project code
'======================================================
'   File...... Stepper motor Drive + Controller
'   Purpose... BS2sx + Step Motor + H-Bridge Drive
'   Author.... OldSpring
'   Email..... [url=mailto:OldSprings@yahoo.com]OldSprings@yahoo.com[/url]
'   Started...
'   Updated... 28 July 2008
'
'   {$STAMP BS2sx}
'   {$PBASIC 2.5}
'   Wave sequence
'   step  1 2 3 4
'   +A    x
'   +B      x
'   -A        x
'   -B          x
'=======================================================
OUT1_A            PIN     8
OUT2_A            PIN     9
OUT1_B            PIN     10
OUT2_B            PIN     11
LOOP1 VAR Byte
SPEED VAR Byte      'Speed adjustment
LOW OUT1_A
LOW OUT2_A
LOW OUT1_B
LOW OUT2_B
Main:
FOR speed = 1   TO  9 STEP 3
'------------------- CW 360 degree --------------------
      FOR LOOP1 = 0 TO 50
        GOSUB STEP_CW
      NEXT
      PAUSE 100
'------------------ CCW 360 degree ----------------------
      FOR LOOP1 = 0 TO 50
        GOSUB STEP_CCW
      NEXT
      PAUSE 100
'------------------ CW 180 degree ---------------------
      FOR LOOP1 = 0 TO 25
        GOSUB STEP_CW
      NEXT
      PAUSE 100
'------------------ CCW 180 degree ---------------------
      FOR LOOP1 = 0 TO 25
        GOSUB STEP_CCW
      NEXT
      PAUSE 100
NEXT
'GOTO Main
END
'==================== Clockwise =====================
STEP_CW:          ' CW 7.2 degree
GOSUB STEP10
PAUSE SPEED
GOSUB STEP11
PAUSE SPEED
GOSUB STEP12
PAUSE SPEED
GOSUB STEP13
PAUSE SPEED
RETURN
STEP10:             ' CW 1.8 degree
HIGH  OUT1_A   '1
LOW   OUT2_A   '0
LOW   OUT1_B   '0
LOW   OUT2_B   '0
RETURN
STEP11:            ' CW 1.8 degree
LOW   OUT1_A   '0
LOW   OUT2_A   '0
HIGH  OUT1_B   '1
LOW   OUT2_B   '0
RETURN
STEP12:             ' CW 1.8 degree
LOW   OUT1_A   '0
HIGH  OUT2_A   '1
LOW   OUT1_B   '0
LOW   OUT2_B   '0
RETURN
STEP13:             ' CW 1.8 degree
LOW   OUT1_A   '0
LOW   OUT2_A   '0
LOW   OUT1_B   '0
HIGH  OUT2_B   '1
RETURN
'================== Counterclockwise =========================
STEP_CCW:          ' CCW 7.2 degree
GOSUB STEP00
PAUSE SPEED
GOSUB STEP01
PAUSE SPEED
GOSUB STEP02
PAUSE SPEED
GOSUB STEP03
PAUSE SPEED
RETURN
STEP00:             ' CCW 1.8 degree
HIGH   OUT1_A   '1
LOW    OUT2_A   '0
LOW    OUT1_B   '0
LOW    OUT2_B   '0
RETURN
STEP01:             ' CCW 1.8 degree
LOW    OUT1_A   '0
LOW    OUT2_A   '0
LOW    OUT1_B   '0
HIGH   OUT2_B   '1
RETURN
STEP02:              ' CCW 1.8 degree
LOW    OUT1_A   '0
HIGH   OUT2_A   '1
LOW    OUT1_B   '0
LOW    OUT2_B   '0
RETURN
STEP03:              ' CCW 1.8 degree
LOW    OUT1_A   '0
LOW    OUT2_A   '0
HIGH   OUT1_B   '1
LOW    OUT2_B   '0
RETURN



c) Project picture 1
smdproject0qr1.jpg


d) Project picture 2
smdproject1oq1.jpg


e) Project video:·
http://www.youtube.com/v/kekL5DpTUP0&hl=en&fs=1

Thanks to Parallax team and all forum users,
·
OldSpring (Author of the project)

More projects at OldSpring Project Website:
http://oldspring.110mb.com
http://oldspring.nvdv.com






Post Edited (OldSpring) : 8/7/2008 8:03:09 PM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-08-07 20:43
    OldSpring,

    Interesting Project...one recommendation would be to make a larger version of the schematic available and try to make it clearer which lines are connected. From the low resolution version it seems that even the I/O pins from the BASIC Stamp are shorted together. =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • bs2-manbs2-man Posts: 23
    edited 2010-02-03 03:10
    cool breadboard, wat is it called?
Sign In or Register to comment.