Shop OBEX P1 Docs P2 Docs Learn Events
Step Pulse Doubler — Parallax Forums

Step Pulse Doubler

larsif78larsif78 Posts: 1
edited 2007-02-21 06:36 in BASIC Stamp
Hello

I need to control a step motor using an encoder input. I have the encoder input working but I can not get the motor to spin faster than a 1 RPS. I need the motor to move much faster. Here is·my code. Is there a way I can get the STAMP to run faster? I have a BS2SX. Could I be limited by the processing speed of the BS2SX?

Thanks.
Larry

' {$STAMP BS2sx}
' {$PBASIC 2.5}

setup:
reps VAR Word
encoder CON··· 2········ 'Encoder input pin
encodercount VAR Byte··· 'Variable to hold encoder tics
HIGH 6

pulse:
reps = 0
DO WHILE (reps <50)
PULSOUT 6, 25
PAUSE 1
reps = reps + 1
LOOP

main:
COUNT encoder,3,encodercount ' read more than one encoder pulse to dampen the pulses
IF (encodercount >1) THEN pulse
GOTO main
END





Post Edited (larsif78) : 2/21/2007 5:50:38 AM GMT

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-02-21 06:36
    Larry -

    Remove the PAUSE 1 out and your motor will rotate slightly faster.

    I suppose it's possible that your motor might be constrained by a weak power supply. Is the power supply for the stepper motor large enough for the jon? What is the nameplate voltage on the motor, and what voltage are you using?

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
Sign In or Register to comment.