Browse Source

Merge pull request #794 from MissionSt/g29_requires_home

Prevent G29 without first homing in X and Y
alexborro 11 years ago
parent
commit
73f0ee9345
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      Marlin/Marlin_main.cpp

+ 10
- 1
Marlin/Marlin_main.cpp View File

@@ -76,7 +76,7 @@
76 76
 // G10 - retract filament according to settings of M207
77 77
 // G11 - retract recover filament according to settings of M208
78 78
 // G28 - Home all Axis
79
-// G29 - Detailed Z-Probe, probes the bed at 3 points.  You must de at the home position for this to work correctly.
79
+// G29 - Detailed Z-Probe, probes the bed at 3 or more points.  Will fail if you haven't homed yet.
80 80
 // G30 - Single Z Probe, probes bed at current XY location.
81 81
 // G90 - Use Absolute Coordinates
82 82
 // G91 - Use Relative Coordinates
@@ -1409,6 +1409,15 @@ void process_commands()
1409 1409
             #error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
1410 1410
             #endif
1411 1411
 
1412
+            // Prevent user from running a G29 without first homing in X and Y
1413
+            if (! (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) )
1414
+            {
1415
+                LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN);
1416
+                SERIAL_ECHO_START;
1417
+                SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN);
1418
+                break; // abort G29, since we don't know where we are
1419
+            }
1420
+
1412 1421
             st_synchronize();
1413 1422
             // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
1414 1423
             //vector_3 corrected_position = plan_get_position_mm();

Loading…
Cancel
Save