do_blocking_move_to(current_position[X_AXIS],current_position[Y_AXIS],current_position[Z_AXIS]+Z_RAISE_AFTER_PROBING);// this also updates current_position
do_blocking_move_to_z(current_position[Z_AXIS]+Z_RAISE_AFTER_PROBING);// this also updates current_position
floatoldXpos=current_position[X_AXIS];// save x position
if(dock){
floatoldXpos=current_position[X_AXIS];// save x position
do_blocking_move_to(current_position[X_AXIS],current_position[Y_AXIS],current_position[Z_AXIS]+Z_RAISE_AFTER_PROBING);// rise Z
do_blocking_move_to(X_MAX_POS+SLED_DOCKING_OFFSET+offset-1,current_position[Y_AXIS],current_position[Z_AXIS]);// Dock sled a bit closer to ensure proper capturing
do_blocking_move_to_z(current_position[Z_AXIS]+Z_RAISE_AFTER_PROBING);// raise Z
do_blocking_move_to_x(X_MAX_POS+SLED_DOCKING_OFFSET+offset-1);// Dock sled a bit closer to ensure proper capturing
digitalWrite(SLED_PIN,LOW);// turn off magnet
do_blocking_move_to(oldXpos,current_position[Y_AXIS],current_position[Z_AXIS]);// return to position before docking
}else{
floatoldXpos=current_position[X_AXIS];// save x position