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:
Sonny Jeon
2012-09-30 19:57:10 -06:00
parent 4224ab4999
commit d30cb906f8
10 changed files with 201 additions and 88 deletions

View File

@ -31,7 +31,6 @@
#include "nuts_bolts.h"
#include <avr/interrupt.h>
#include "planner.h"
#include "limits.h"
// Some useful constants
#define TICKS_PER_MICROSECOND (F_CPU/1000000)
@ -299,7 +298,7 @@ ISR(TIMER1_COMPA_vect)
plan_discard_current_block();
}
}
out_bits ^= settings.invert_mask; // Apply stepper invert mask
out_bits ^= settings.invert_mask; // Apply step and direction invert mask
busy = false;
}
@ -396,7 +395,7 @@ static uint32_t config_step_timer(uint32_t cycles)
} else {
// Okay, that was slower than we actually go. Just set the slowest speed
ceiling = 0xffff;
prescaler = 6;
prescaler = 5;
actual_cycles = 0xffff * 1024;
}
// Set prescaler