Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/12/00 18:01
Read: times


 
#7213 - RE: Stepper motor speed routines
Daniel,

I can't offer you code, but I can offer you advice. Use a timer in 16-bit mode with a variable preload to vary the interval of overflow. Enable the timer's interrupt. In this timer's interrupt service routine place a state machine that sends the proper control signals to the stepper motor. The state machine could be controlled from the main thread by a couple of bits, ex. direction,half/full step, some ints, ex. number of steps to take. The value of the preload would determine the speed of the motor. 12MHz, Ex, 0000h =~15.3 steps per second, FF00h =~3921.6 steps per second. 24MHz clock would double these values, etc. Other schemes may offer better resolution/control.
If better performance is desired, I would use a microcontroller with a more efficient architecture. A traditional 8051 may not be fast enough to get out of its own way at high motor speeds in this example. Surely someone has done this. Anyone?

Cory Spackman

List of 6 messages in thread
TopicAuthorDate
Stepper motor speed routines            01/01/70 00:00      
RE: Stepper motor speed routines            01/01/70 00:00      
RE: Stepper motor speed routines            01/01/70 00:00      
RE: Stepper motor speed routines            01/01/70 00:00      
Stepper motor speed routines IS NOW AVAL            01/01/70 00:00      
Stepper motor routines IS NOW COMPLETE!            01/01/70 00:00      

Back to Subject List