If you motor runs up to 5 tps, then your code is probably ok, but it could be that you need to code it in assembler to run faster. I write most of my fast pic code in assembler, and just use the c for slower stuff., capping out at something like 5 revolutions per second.
Your use of the delay may be the problem. You should be looping while checking for the rising edge then the falling edge of the step pulse. No delay should be needed.
300 rpm is not that slow for a stepper, 600 rpm is about as fast as you should expect it to have reliable useable torque.
The supply voltage has a lot to do with speed. Increase the voltage and your motor should be able to run a lot faster. You may need resistors in series with the windings to give it a constant current source.
Also whats your motor winding inductance ? Higher current, lower inductance motors perform much better than motors with lower current higher inductance.
Larry K


LinkBack URL
About LinkBacks
utput_high(COIL1);



