Step Pulse Doubler
larsif78
Posts: 1
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
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
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 -->