Is a BasicStamp2 fast enough to drive a bipolar stepper?
hotrod
Posts: 14
I have a basicStamp2 driving a bipolar controller, Easydriver3v, and the motor is moving way too slow. My question, is the basic stamp pulses too slow of a frequency?
Should I buy a PWMpal to run the step pulses,or is that unnecessary?
Or, is the pulses I am sending with the stamp to fast making the stepper slip?
Should I buy a PWMpal to run the step pulses,or is that unnecessary?
Or, is the pulses I am sending with the stamp to fast making the stepper slip?
bs2
194B
Comments
StepClock······ PIN···· 6·············· ' Stepper chip step input
StepMin········ CON···· 8·············· ' Minimum step delay
StepMax········ CON···· 20············· ' Maximum step delay
StepDelay······ VAR···· Byte··········· ' Step delay working location
StepRamp······· VAR···· Byte··········· ' Ramp up/down point
MoveSteps······ VAR···· Word··········· ' Working location
Loop:
·· MoveSteps = 2000
·· GOSUB DoSteps························' Move stepper motor
·· PAUSE 1000
·· GOTO Loop
'
' This code is called to position the turntable. MoveSteps contains the
' step count.
'
' The variables StepDelay, StepRamp, StepMin, and StepMax are used to
' effect the delay between each step pulse. Stepping begins using StepMax
' (slowest motor rotation) and gradually decrease to StepMin (fastest
' motor rotation).·Toward the end·of the MoveSteps count, the delay
' period will begin increasing toward the StepMax value. This technique
' serves to smoothly ramp up/down the motor speed.
DoSteps:
·· StepRamp = 0······················ ' Initialize speed ramp
·· StepDelay = StepMax··············· ' Set slowest motor speed
·· DO WHILE (MoveSteps > 0)
····· HIGH StepClock················· ' Pulse the step pin
····· LOW StepClock
····· MoveSteps = MoveSteps - 1······ ' Decrement MoveSteps value
····· PAUSE StepDelay
····· IF MoveSteps <= StepRamp THEN
········ StepDelay = StepDelay + 1··· ' Increase delay
····· ELSEIF StepDelay > StepMin THEN
········ StepDelay = StepDelay - 1··· ' Decrease delay
········ StepRamp = StepRamp + 1····· ' Increment slowdown point
····· ENDIF
·· LOOP
·· RETURN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don Buczynski
http://www.buczynski.com
I put the Step_min at 0 and the motor is still not as fast as I would like. I just noticed that it takes 1600steps/rev for 1.8degree stepper motor. The EasyDriver is running in an eighth-step wave, since 200 * 8 = 1600. I also, just read that the Easydriver is permanently set to eighth-step mode. DAM!!!!
If, I need the motor to go faster would the PWMpal help?
I think I might switch to a brush DC motor with a H-bridge to drive it. My project does not require the precision that the stepper can operate.
Do you think this a bad Idea? Or, should I buy the PWMpal?
Thank you so much for the help.
I am really trying to understand how everything works together. It just takes time..........I wish I had more!!!!!!!
I had similar issues with step speed in my application. Fortunately, I had some control over the gear ratios used with the stepper motor and device so was able to use a BS2. Pbasic is slow; the reason that the pulse to the stepper chip only needs 1 pause statement. If you are close to your needed rate, there are other BS2 chips that run faster; e.g. BS2px.· The only other thought would be to use·an external·pulse multiplier cuircuit; e.g. 1 pulse in, two pulses out.·There would be some loss in step resolution but you say that is not an issue in your project.
A better choice might be to use the·propeller chip instead.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don Buczynski
http://www.buczynski.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen