diff --git a/grbl/config.h b/grbl/config.h index 941da5ba7..823ffc06d 100644 --- a/grbl/config.h +++ b/grbl/config.h @@ -35,6 +35,7 @@ // one configuration file by placing their specific defaults and pin map at the bottom of this file. // If doing so, simply comment out these two defines and see instructions below. #define DEFAULTS_GENERIC +#define DEFAULTS_ABC_AXIS #define CPU_MAP_2560_INITIAL // Serial baud rate @@ -105,6 +106,9 @@ #define HOMING_CYCLE_0 (1<step_event_count >> 1); +#ifdef A_AXIS + st.counter_a = st.counter_x; +#endif } st.dir_outbits = st.exec_block->direction_bits ^ dir_port_invert_mask; @@ -347,6 +361,16 @@ ISR(TIMER1_COMPA_vect) st.steps[X_AXIS] = st.exec_block->steps[X_AXIS] >> st.exec_segment->amass_level; st.steps[Y_AXIS] = st.exec_block->steps[Y_AXIS] >> st.exec_segment->amass_level; st.steps[Z_AXIS] = st.exec_block->steps[Z_AXIS] >> st.exec_segment->amass_level; +#ifdef A_AXIS + st.steps[A_AXIS] = st.exec_block->steps[A_AXIS] >> st.exec_segment->amass_level; +#endif +#ifdef B_AXIS + st.steps[B_AXIS] = st.exec_block->steps[B_AXIS] >> st.exec_segment->amass_level; +#endif +#ifdef C_AXIS + st.steps[C_AXIS] = st.exec_block->steps[C_AXIS] >> st.exec_segment->amass_level; +#endif + #endif // Set real-time spindle output as segment is loaded, just prior to the first step. @@ -404,6 +428,46 @@ ISR(TIMER1_COMPA_vect) else { sys_position[Z_AXIS]++; } } +#ifdef A_AXIS + #ifdef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING + st.counter_a += st.steps[A_AXIS]; + #else + st.counter_a += st.exec_block->steps[A_AXIS]; + #endif + if (st.counter_a > st.exec_block->step_event_count) { + st.step_outbits |= (1<step_event_count; + if (st.exec_block->direction_bits & (1<steps[B_AXIS]; + #endif + if (st.counter_b > st.exec_block->step_event_count) { + st.step_outbits |= (1<step_event_count; + if (st.exec_block->direction_bits & (1<steps[C_AXIS]; + #endif + if (st.counter_c > st.exec_block->step_event_count) { + st.step_outbits |= (1<step_event_count; + if (st.exec_block->direction_bits & (1< -settings.max_travel[idx]) { return(true); } - } else { + // allow disabling soft limit per axis by setting max travel to zero + if (settings.max_travel[idx]) { + #ifdef HOMING_FORCE_SET_ORIGIN + // When homing forced set origin is enabled, soft limits checks need to account for directionality. + // NOTE: max_travel is stored as negative + if (bit_istrue(settings.homing_dir_mask,bit(idx))) { + if (target[idx] < 0 || target[idx] > -settings.max_travel[idx]) { return(true); } + } else { + if (target[idx] > 0 || target[idx] < settings.max_travel[idx]) { return(true); } + } + #else + // NOTE: max_travel is stored as negative if (target[idx] > 0 || target[idx] < settings.max_travel[idx]) { return(true); } - } - #else - // NOTE: max_travel is stored as negative - if (target[idx] > 0 || target[idx] < settings.max_travel[idx]) { return(true); } #endif } + } return(false); }