speed up for stepper

driedeker

New Member
I am trying to run two stepper motor with a 28x2 with 4mhz ex resonator ie a project board but it is not fast enough, have tried the setfreq to no evail.
I also noticed in the basic created with my scetch it changes speeds on its own,it swaps between m8 and m4 I think its to do with the pusls comand i am using 10us or 20us.
Anny help please
 

hippy

Technical Support
Staff member
Post your code then people can have a look at what it is doing and suggest how it might be improved upon.
 

nick12ab

Senior Member
What stepper motor? I didn't think stepper motors could spin very fast so if you're driving it too fast then it can appear to randomly change speed because the signals being too fast can cause the motor to temporarily stop or rotate backwards giving this appearance.

Are you saying that it APPEARS to swap between m4 and m8 or you swap it between m4 and m8? If the latter is correct, then the motor is bound to change speed.

Is the pusls command (whatever command that is) used to drive the stepper motor?
 

driedeker

New Member
logicator placed m4 commands in the pulse code the a m8 command this is what it looked like.
setfreq m4
pulsout 3,2
setfreq m8
setfreq m4
pulsout 3,2
setfreq m8
setfreq m4
pulsout 0,2
setfreq m8
setfreq m4
pulsout 3,2
setfreq m8
so have cleaned it up in basic
pulse is the command my poor spelling afraid
 

nick12ab

Senior Member
The fact that it stalls at 16MHz suggests that you're trying to run it too fast.

Use of a serial LCD might also be problematic - even if 'parallel tasking' is used - since serout stops all other processing until it has finished.

If the speed of the motor needs to be regulated, you may need to use a three-phase motor.
 

driedeker

New Member
Yes 16mhz is to fast thats the reason it stalls, the commands to step hit it to fast, so 8mhz is ok, what i need is to be able to test at 12mhz, but unable to get picaxe to ablige me.
 

nick12ab

Senior Member
Yes 16mhz is to fast thats the reason it stalls, the commands to step hit it to fast, so 8mhz is ok, what i need is to be able to test at 12mhz, but unable to get picaxe to ablige me.
You'll have to use an external 3MHz crystal/resonator.
 

driedeker

New Member
I am even thinking of a programable resonator to see what that works like. perhaps its a way of finding a sweet compromise.
 
Top