Updated limit/homing routine. Works, but needs more TLC.
- Added acceleration to the homing routine. - Homing now accounts for different step rates when moving multiple axes without exceeding acceleration limits. - Homing now updates all internal positioning variables to machine zero after completion. - "Poor-man's" debounce delay added. - Updated the delay_us() function to perform faster and more accurate microsecond delays. Previously, the single increments would add noticeable time drift for larger delays. - Fix a bug in the stepper.c prescalar calculations that was changed in the last commit. - Other minor fixes.
This commit is contained in:
8
gcode.c
8
gcode.c
@@ -114,6 +114,12 @@ void gc_set_current_position(int32_t x, int32_t y, int32_t z)
|
||||
gc.position[Z_AXIS] = z/settings.steps_per_mm[Z_AXIS];
|
||||
}
|
||||
|
||||
// Clears and zeros g-code parser position. Called by homing routine.
|
||||
void gc_clear_position()
|
||||
{
|
||||
clear_vector(gc.position);
|
||||
}
|
||||
|
||||
static float to_millimeters(double value)
|
||||
{
|
||||
return(gc.inches_mode ? (value * MM_PER_INCH) : value);
|
||||
@@ -336,7 +342,7 @@ uint8_t gc_execute_line(char *line)
|
||||
mc_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], settings.default_seek_rate, false);
|
||||
}
|
||||
mc_go_home();
|
||||
clear_vector(gc.position); // Assumes home is at [0,0,0]
|
||||
// clear_vector(gc.position); // Assumes home is at [0,0,0]
|
||||
axis_words = 0; // Axis words used. Lock out from motion modes by clearing flags.
|
||||
break;
|
||||
case NON_MODAL_SET_COORDINATE_OFFSET:
|
||||
|
Reference in New Issue
Block a user