Shop OBEX P1 Docs P2 Docs Learn Events
stepper motor - Stampworks 2.0 Experiment 27 peculiarities? — Parallax Forums

stepper motor - Stampworks 2.0 Experiment 27 peculiarities?

charlieknoxcharlieknox Posts: 27
edited 2006-10-27 20:35 in BASIC Stamp
When using File....... SW20-EX27-Stepper_Control.BS2
'·· Purpose.... Stepper motor·control
in the demo portion (see partial code below),·using a 3.6 degree per step (100 steps/rev) stepper motor, if I keep the number of steps to 255 or less, the stepper motor makes a finite number of revolutions forward, then a finite number of revolutions in reverse.· If I go to 256 steps or higher, the stepper motor just rotates continuously forward, never stopping.· Just wondering if anyone knows why this occurs.· Thanks!· Charlie

Demo:
· FOR idx = 1 TO 255················ ' 1 rev forward· (goes ~2.5 revolutions)
··· GOSUB Step_Fwd
· NEXT
· PAUSE 200
· FOR idx = 1 TO 256····················· ' 1 rev back· (continues forever)
·· GOSUB Step_Rev
· NEXT
· PAUSE 200

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-27 20:35
    Charlie,
    ·
    ·· The variable idx is declared as a BYTE variable, which can only contain between 0 and 255…If you exceed that you can expect unpredictable results.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.