Author | Pavel Milanes Costa (CO7WT) - pavelmc@gmail.com, copyright © 2014, all rights reserved. |
Adapted-by | original design for jallib |
Compiler | >=2.4q3 |
This library implement the drive procedures for UNIPOLAR stepper motors See stepper_unipolar_common.jal for modes explanations
I used this tutorial in spanish here http://www.todorobot.com.ar/informacion/tutorial%20stepper/ This is a good source also http://www.cs.uiowa.edu/~jones/step/ thanks vasi vasi for the link.
* You must define the kind of mode you will use AFTER include the lib, if not it will use normal. * You have to know & declare the sweet spot frecuency/RPM of your motor, but... you can guess. * You can change the mode on the fly, but need to send a stepper_init() each time after that. * Creation date/time: 4 Nov 2014 04:28:50.UTC * This file is maintained by hand!!!
const bit STEPPER_BLOCKIGN = off
var byte _tmr0_load
var bit stepper_go = off
var word stepper_steps = 0
var word _isr_count
const bit STEPPER_BLOCKIGN = off
This is the non blocking version so we instruct the common lib about
var byte _tmr0_load
variables
var bit stepper_go = off
FALGS to manage the movement
var word stepper_steps = 0
this is the var in which we store the amount of steps to do it get decreased over time...
var word _isr_count
No documentation found
isr_proc()
interrupt procedure, must capture de interrupt and preload the tmr0 to the calculated value to account for the 1khz isr has to count interrupt to match stepper_delay to adjust the RPM and command to move.
stepper_init()
init procedure for the non blocking version
_int_setup()
procedure to calculate, setup and start the interrupt routine on tmr0
16f630 | 16f630_stepper_unipolar_nonblocking.jal |