Another homing cycle fix.

- The homing cycle should be working again. Reverted it back to how it
was about a month ago before I started to fiddle with it. Turns out
that my past self knew what he was doing.
This commit is contained in:
Sonny Jeon 2015-03-07 13:32:59 -07:00
parent 76730176da
commit e832595e6d
2 changed files with 10 additions and 6 deletions

View File

@ -23,7 +23,7 @@
// Grbl versioning system
#define GRBL_VERSION "0.9i"
#define GRBL_VERSION_BUILD "20150302"
#define GRBL_VERSION_BUILD "20150307"
// Define standard libraries used by Grbl.
#include <avr/io.h>

View File

@ -163,15 +163,19 @@ void limits_go_home(uint8_t cycle_mask)
// Initialize and declare variables needed for homing routine.
uint8_t axislock = 0;
uint8_t n_active_axis = 0;
system_convert_array_steps_to_mpos(target,sys.position);
system_convert_array_steps_to_mpos(target,sys.position);
for (idx=0; idx<N_AXIS; idx++) {
// Set target location for active axes and setup computation for homing rate.
if (bit_istrue(cycle_mask,bit(idx))) {
n_active_axis++;
if (bit_istrue(settings.homing_dir_mask,bit(idx))) { max_travel = -max_travel; }
if (!approach) { max_travel = -max_travel; }
target[idx] += max_travel;
// Set target direction based on cycle mask and homing cycle approach state.
if (bit_istrue(settings.homing_dir_mask,bit(idx))) {
if (approach) { target[idx] -= max_travel; }
else { target[idx] += max_travel; }
} else {
if (approach) { target[idx] += max_travel; }
else { target[idx] -= max_travel; }
}
// Apply axislock to the step port pins active in this cycle.
axislock |= step_pin[idx];
}