@ -920,19 +920,28 @@ static void homeaxis(int axis) {
 
			
		
	
		
			
				
					      axis_home_dir  =  x_home_dir ( active_extruder ) ; 
 
			
		
	
		
			
				
					# endif  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					    current_position [ axis ]  =  0 ; 
 
			
		
	
		
			
				
					    plan_set_position ( current_position [ X_AXIS ] ,  current_position [ Y_AXIS ] ,  current_position [ Z_AXIS ] ,  current_position [ E_AXIS ] ) ; 
 
			
		
	
		
			
				
						
 
			
		
	
		
			
				
					    // Engage Servo endstop if enabled
 
 
			
		
	
		
			
				
					    # ifdef SERVO_ENDSTOPS 
 
			
		
	
		
			
				
					# if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)  
			
		
	
		
			
				
					    if  ( axis = = Z_AXIS )  engage_z_probe ( ) ; 
 
			
		
	
		
			
				
						else 
 
			
		
	
		
			
				
					# endif  
			
		
	
		
			
				
					      # if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) 
 
			
		
	
		
			
				
					        if  ( axis = = Z_AXIS )  { 
 
			
		
	
		
			
				
					          # if defined (Z_RAISE_BEFORE_HOMING) && (Z_RAISE_BEFORE_HOMING > 0) 
 
			
		
	
		
			
				
					            destination [ axis ]  =  Z_RAISE_BEFORE_HOMING  *  axis_home_dir  *  ( - 1 ) ;     // Set destination away from bed
 
 
			
		
	
		
			
				
					            feedrate  =  max_feedrate [ axis ] ; 
 
			
		
	
		
			
				
					            plan_buffer_line ( destination [ X_AXIS ] ,  destination [ Y_AXIS ] ,  destination [ Z_AXIS ] ,  destination [ E_AXIS ] ,  feedrate ,  active_extruder ) ; 
 
			
		
	
		
			
				
					            st_synchronize ( ) ; 
 
			
		
	
		
			
				
					          # endif 
 
			
		
	
		
			
				
					          engage_z_probe ( ) ; 
 
			
		
	
		
			
				
					        } 
 
			
		
	
		
			
				
						    else 
 
			
		
	
		
			
				
					      # endif 
 
			
		
	
		
			
				
					      if  ( servo_endstops [ axis ]  >  - 1 )  { 
 
			
		
	
		
			
				
					        servos [ servo_endstops [ axis ] ] . write ( servo_endstop_angles [ axis  *  2 ] ) ; 
 
			
		
	
		
			
				
					      } 
 
			
		
	
		
			
				
					    # endif 
 
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					    current_position [ axis ]  =  0 ; 
 
			
		
	
		
			
				
					    plan_set_position ( current_position [ X_AXIS ] ,  current_position [ Y_AXIS ] ,  current_position [ Z_AXIS ] ,  current_position [ E_AXIS ] ) ; 
 
			
		
	
		
			
				
					    destination [ axis ]  =  1.5  *  max_length ( axis )  *  axis_home_dir ; 
 
			
		
	
		
			
				
					    feedrate  =  homing_feedrate [ axis ] ; 
 
			
		
	
		
			
				
					    plan_buffer_line ( destination [ X_AXIS ] ,  destination [ Y_AXIS ] ,  destination [ Z_AXIS ] ,  destination [ E_AXIS ] ,  feedrate / 60 ,  active_extruder ) ; 
 
			
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
				@ -1198,6 +1207,9 @@ void process_commands()
 
			
		
	
		
			
				
					          current_position [ Z_AXIS ] = code_value ( ) + add_homeing [ 2 ] ; 
 
			
		
	
		
			
				
					        } 
 
			
		
	
		
			
				
					      } 
 
			
		
	
		
			
				
					      # ifdef ENABLE_AUTO_BED_LEVELING 
 
			
		
	
		
			
				
					         current_position [ Z_AXIS ]  - =  Z_PROBE_OFFSET_FROM_EXTRUDER ;   //Add Z_Probe offset (the distance is negative)
 
 
			
		
	
		
			
				
					      # endif 
 
			
		
	
		
			
				
					      plan_set_position ( current_position [ X_AXIS ] ,  current_position [ Y_AXIS ] ,  current_position [ Z_AXIS ] ,  current_position [ E_AXIS ] ) ; 
 
			
		
	
		
			
				
					# endif  // else DELTA