@ -588,27 +588,27 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
}
# endif
# if LINEAR_AXES = = 4
# if LINEAR_AXES > = 4
void do_blocking_move_to_i ( const_float_t ri , const_feedRate_t fr_mm_s /*=0.0*/ ) {
do_blocking_move_to_xyz_i ( current_position , ri , fr_mm_s ) ;
}
void do_blocking_move_to_xyz_i ( const xyze_pos_t & raw , const_float_t i , const_feedRate_t fr_mm_s /*=0.0f*/ ) {
do_blocking_move_to ( raw . x , raw . y , raw . z , i , fr_mm_s ) ;
do_blocking_move_to (
LINEAR_AXIS_LIST ( raw . x , raw . y , raw . z , i , raw . j , raw . k ) ,
fr_mm_s
) ;
}
# endif
# if LINEAR_AXES >= 5
void do_blocking_move_to_i ( const_float_t ri , const_feedRate_t fr_mm_s /*=0.0*/ ) {
do_blocking_move_to_xyz_i ( current_position , ri , fr_mm_s ) ;
}
void do_blocking_move_to_xyz_i ( const xyze_pos_t & raw , const_float_t i , const_feedRate_t fr_mm_s /*=0.0f*/ ) {
do_blocking_move_to ( raw . x , raw . y , raw . z , i , raw . j , fr_mm_s ) ;
}
void do_blocking_move_to_j ( const_float_t rj , const_feedRate_t fr_mm_s /*=0.0*/ ) {
do_blocking_move_to_xyzi_j ( current_position , rj , fr_mm_s ) ;
}
void do_blocking_move_to_xyzi_j ( const xyze_pos_t & raw , const_float_t j , const_feedRate_t fr_mm_s /*=0.0f*/ ) {
do_blocking_move_to ( raw . x , raw . y , raw . z , raw . i , j , fr_mm_s ) ;
do_blocking_move_to (
LINEAR_AXIS_LIST ( raw . x , raw . y , raw . z , raw . i , j , raw . k ) ,
fr_mm_s
) ;
}
# endif
@ -617,7 +617,10 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
do_blocking_move_to_xyzij_k ( current_position , rk , fr_mm_s ) ;
}
void do_blocking_move_to_xyzij_k ( const xyze_pos_t & raw , const_float_t k , const_feedRate_t fr_mm_s /*=0.0f*/ ) {
do_blocking_move_to ( raw . x , raw . y , raw . z , raw . i , raw . j , k , fr_mm_s ) ;
do_blocking_move_to (
LINEAR_AXIS_LIST ( raw . x , raw . y , raw . z , raw . i , raw . j , k ) ,
fr_mm_s
) ;
}
# endif
@ -822,7 +825,7 @@ void restore_feedrate_and_scaling() {
# endif
}
# endif
# if LINEAR_AXES >= 4 // TODO (DerAndere): Find out why this was missing / removed
# if LINEAR_AXES >= 4
if ( axis_was_homed ( I_AXIS ) ) {
# if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_I)
NOLESS ( target . i , soft_endstop . min . i ) ;
@ -1295,7 +1298,7 @@ void prepare_line_to_destination() {
bool homing_needed_error ( linear_axis_bits_t axis_bits /*=linear_bits*/ ) {
if ( ( axis_bits = axes_should_home ( axis_bits ) ) ) {
PGM_P home_first = GET_TEXT ( MSG_HOME_FIRST ) ; // TODO: (DerAndere) Set this up for extra axes
PGM_P home_first = GET_TEXT ( MSG_HOME_FIRST ) ;
char msg [ strlen_P ( home_first ) + 1 ] ;
sprintf_P ( msg , home_first ,
LINEAR_AXIS_LIST (
@ -1390,8 +1393,21 @@ void prepare_line_to_destination() {
# if ENABLED(SPI_ENDSTOPS)
switch ( axis ) {
case X_AXIS : if ( ENABLED ( X_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . x = true ; break ;
case Y_AXIS : if ( ENABLED ( Y_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . y = true ; break ;
case Z_AXIS : if ( ENABLED ( Z_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . z = true ; break ;
# if HAS_Y_AXIS
case Y_AXIS : if ( ENABLED ( Y_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . y = true ; break ;
# endif
# if HAS_Z_AXIS
case Z_AXIS : if ( ENABLED ( Z_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . z = true ; break ;
# endif
# if LINEAR_AXES >= 4
case I_AXIS : if ( ENABLED ( I_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . i = true ; break ;
# endif
# if LINEAR_AXES >= 5
case J_AXIS : if ( ENABLED ( J_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . j = true ; break ;
# endif
# if LINEAR_AXES >= 6
case K_AXIS : if ( ENABLED ( K_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . k = true ; break ;
# endif
default : break ;
}
# endif
@ -1454,11 +1470,21 @@ void prepare_line_to_destination() {
# if ENABLED(SPI_ENDSTOPS)
switch ( axis ) {
case X_AXIS : if ( ENABLED ( X_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . x = false ; break ;
case Y_AXIS : if ( ENABLED ( Y_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . y = false ; break ;
case Z_AXIS : if ( ENABLED ( Z_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . z = false ; break ;
case I_AXIS : if ( ENABLED ( I_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . i = false ; break ;
case J_AXIS : if ( ENABLED ( J_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . j = false ; break ;
case K_AXIS : if ( ENABLED ( K_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . k = false ; break ;
# if HAS_Y_AXIS
case Y_AXIS : if ( ENABLED ( Y_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . y = false ; break ;
# endif
# if HAS_Z_AXIS
case Z_AXIS : if ( ENABLED ( Z_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . z = false ; break ;
# endif
# if LINEAR_AXES >= 4
case I_AXIS : if ( ENABLED ( I_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . i = false ; break ;
# endif
# if LINEAR_AXES >= 5
case J_AXIS : if ( ENABLED ( J_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . j = false ; break ;
# endif
# if LINEAR_AXES >= 6
case K_AXIS : if ( ENABLED ( K_SPI_SENSORLESS ) ) endstops . tmc_spi_homing . k = false ; break ;
# endif
default : break ;
}
# endif
@ -1734,11 +1760,11 @@ void prepare_line_to_destination() {
# endif
//
// Back away to prevent an early X/Y sensorless trigger
// Back away to prevent an early sensorless trigger
//
# if DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM)
const xy_float_t backoff = SENSORLESS_BACKOFF_MM ;
if ( ( TERN0 ( X_SENSORLESS , axis = = X_AXIS ) | | TERN0 ( Y_SENSORLESS , axis = = Y_AXIS ) ) & & backoff [ axis ] ) {
const xyz _float_t backoff = SENSORLESS_BACKOFF_MM ;
if ( ( TERN0 ( X_SENSORLESS , axis = = X_AXIS ) | | TERN0 ( Y_SENSORLESS , axis = = Y_AXIS ) | | TERN0 ( Z_SENSORLESS , axis = = Z_AXIS ) | | TERN0 ( I_SENSORLESS , axis = = I_AXIS ) | | TERN0 ( J_SENSORLESS , axis = = J_AXIS ) | | TERN0 ( K_SENSORLESS , axis = = K_AXIS ) ) & & backoff [ axis ] ) {
const float backoff_length = - ABS ( backoff [ axis ] ) * axis_home_dir ;
if ( DEBUGGING ( LEVELING ) ) DEBUG_ECHOLNPAIR ( " Sensorless backoff: " , backoff_length , " mm " ) ;
do_homing_move ( axis , backoff_length , homing_feedrate ( axis ) ) ;
@ -1777,6 +1803,15 @@ void prepare_line_to_destination() {
case X_AXIS : es = X_ENDSTOP ; break ;
case Y_AXIS : es = Y_ENDSTOP ; break ;
case Z_AXIS : es = Z_ENDSTOP ; break ;
# if LINEAR_AXES >= 4
case I_AXIS : es = I_ENDSTOP ; break ;
# endif
# if LINEAR_AXES >= 5
case J_AXIS : es = J_ENDSTOP ; break ;
# endif
# if LINEAR_AXES >= 6
case K_AXIS : es = K_ENDSTOP ; break ;
# endif
}
if ( TEST ( endstops . state ( ) , es ) ) {
SERIAL_ECHO_MSG ( " Bad " , AS_CHAR ( AXIS_CHAR ( axis ) ) , " Endstop? " ) ;