Skip to content

Commit

Permalink
Home X-Axis under certain conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhubott committed Jan 28, 2016
1 parent 4ff71a1 commit 854dc98
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2312,11 +2312,19 @@ inline void gcode_G28() {

home_all_axis = (!homeX && !homeY && !homeZ && !setZhomeOffset) || (homeX && homeY && homeZ);

// Home the Z axis if it is to low
if(current_position[Z_AXIS] < 5)
//If we don't know our current location / home Z first
if(axis_known_position[Z_AXIS] == false)
{
homeZ = true;
}
else if(current_position[Z_AXIS] < 10)
{
//Position the Z axis if it is below 10
destination[Z_AXIS] = 10;
feedrate = max_feedrate[Z_AXIS] * 60;
line_to_destination();
st_synchronize();
}

#if ENABLED(G28_AUTOSET_Z_HOME_OFFSET)
if(setZhomeOffset)
Expand Down

0 comments on commit 854dc98

Please sign in to comment.