bs2: fastest way to accurately send pulses
RGuyser
Posts: 90
ello!
for this project i am doing i need to send pulses very quickly, the simplistic method i have been using seems to be limited.
spI VAR word
spI=3200 'set steps per inch to 3200
FOR x = 1 TO inches
FOR xstep= 1 TO spI
HIGH stepper1
PAUSE 1
LOW stepper1
PAUSE 1
NEXT
NEXT
i do this because the numbers(spI) i am using easily exceed the limit. inches is a multiplier for SPI. i am pretty sure the 'pulsout' command may be faster, but how do i get it to send an accurate number of pulses?
Thanks!
for this project i am doing i need to send pulses very quickly, the simplistic method i have been using seems to be limited.
spI VAR word
spI=3200 'set steps per inch to 3200
FOR x = 1 TO inches
FOR xstep= 1 TO spI
HIGH stepper1
PAUSE 1
LOW stepper1
PAUSE 1
NEXT
NEXT
i do this because the numbers(spI) i am using easily exceed the limit. inches is a multiplier for SPI. i am pretty sure the 'pulsout' command may be faster, but how do i get it to send an accurate number of pulses?
Thanks!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
without a scope or other equipment to measure thee current rate, i have no idea what would be correct, unfortunately.. but, roughly 4-8 times faster would be fine...i suppose i should do an experiement with just pulsout and how fast it can pulse... the stepper driver circuitry probably wont work after pulses get either too close together, or too short...
With PULSOUT you could trim off a little, here to HIGH 1 millisecond and low about 1.1 millisecond:
FOR xstep= 1 TO spI
PULSOUT stepper1,500 ' 500 for 1 millisecond on original BS2
NEXT
There are tricks you can do to get faster sequences of pulses, by using the PWM or the SHIFTOUT commands, but with those the pulse widths might be too short. For example the following command generates 73 pulses in a lttle over 1 millisecond:
PWM stepper1,73,1
but each HIGH pulse is only 4.5 microseconds long.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com