Skip to content

Instantly share code, notes, and snippets.

@arthurwolf
Created November 28, 2014 22:05
Show Gist options
  • Save arthurwolf/b02d5709c2d3d547cb4a to your computer and use it in GitHub Desktop.
Save arthurwolf/b02d5709c2d3d547cb4a to your computer and use it in GitHub Desktop.
stepper interrupt
do the steps we decided to do from last interrupt ( we don't execute steps immediately but at the beginning of next interrupt, grbl does this too )
for each axis
store the new position for this axis based on the step just taken ( or not taken )
find the current block
for each axis in this block
find the move corresponding to that axis in that block
vel0 = velocity for this move ( this is pre-computed, and changes per-step )
acc = acceleration for this move ( this is pre-computed )
position for this axis += velocity + acceleration
this move's velocity = vel0 + acc ( this is per-step acceleration, note acc is pre-computed )
decide if we do a step for this axis, based on new position and bresenham
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment