Browse Source

Fixed Z_PROBE_PIN pullup bug.

Documented some additional areas that should be addressed if Z_PROBE is
fully separated from Z_MIN or Z_MAX.
Fixed a documentation error in sanity checks. Servos start at 0 not 1.
Chris Roadfeldt 10 years ago
parent
commit
17707e7479
4 changed files with 565 additions and 397 deletions
  1. 1
    1
      Marlin/Conditionals.h
  2. 554
    391
      Marlin/Marlin_main.cpp
  3. 1
    1
      Marlin/SanityCheck.h
  4. 9
    4
      Marlin/stepper.cpp

+ 1
- 1
Marlin/Conditionals.h View File

186
       #define ENDSTOPPULLUP_ZMIN
186
       #define ENDSTOPPULLUP_ZMIN
187
     #endif
187
     #endif
188
     #ifndef DISABLE_Z_PROBE_ENDSTOP
188
     #ifndef DISABLE_Z_PROBE_ENDSTOP
189
-      #define ENDSTOPPULL_ZPROBE
189
+      #define ENDSTOPPULLUP_ZPROBE
190
     #endif
190
     #endif
191
   #endif
191
   #endif
192
 
192
 

+ 554
- 391
Marlin/Marlin_main.cpp
File diff suppressed because it is too large
View File


+ 1
- 1
Marlin/SanityCheck.h View File

116
         #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_AND_ENDSTOP
116
         #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_AND_ENDSTOP
117
       #endif
117
       #endif
118
       #ifndef SERVO_ENDSTOPS
118
       #ifndef SERVO_ENDSTOPS
119
-        #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 1 to use Z_PROBE_AND_ENDSTOP
119
+        #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 0 or above to use Z_PROBE_AND_ENDSTOP
120
       #endif
120
       #endif
121
       #ifndef SERVO_ENDSTOP_ANGLES
121
       #ifndef SERVO_ENDSTOP_ANGLES
122
         #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP
122
         #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP

+ 9
- 4
Marlin/stepper.cpp View File

76
 static volatile bool endstop_x_hit = false;
76
 static volatile bool endstop_x_hit = false;
77
 static volatile bool endstop_y_hit = false;
77
 static volatile bool endstop_y_hit = false;
78
 static volatile bool endstop_z_hit = false;
78
 static volatile bool endstop_z_hit = false;
79
+static volatile bool endstop_z_probe_hit = false;
79
 
80
 
80
 #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
81
 #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
81
   bool abort_on_endstop_hit = false;
82
   bool abort_on_endstop_hit = false;
258
 #define DISABLE_STEPPER_DRIVER_INTERRUPT() TIMSK1 &= ~BIT(OCIE1A)
259
 #define DISABLE_STEPPER_DRIVER_INTERRUPT() TIMSK1 &= ~BIT(OCIE1A)
259
 
260
 
260
 void endstops_hit_on_purpose() {
261
 void endstops_hit_on_purpose() {
261
-  endstop_x_hit = endstop_y_hit = endstop_z_hit = false;
262
+  endstop_x_hit = endstop_y_hit = endstop_z_hit = endstop_z_probe_hit = false;
262
 }
263
 }
263
 
264
 
264
 void checkHitEndstops() {
265
 void checkHitEndstops() {
265
-  if (endstop_x_hit || endstop_y_hit || endstop_z_hit) {
266
+  if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) {
266
     SERIAL_ECHO_START;
267
     SERIAL_ECHO_START;
267
     SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
268
     SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
268
     if (endstop_x_hit) {
269
     if (endstop_x_hit) {
277
       SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
278
       SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
278
       LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
279
       LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
279
     }
280
     }
281
+    if (endstop_z_probe_hit) {
282
+    	SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
283
+    	LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP");
284
+    }
280
     SERIAL_EOL;
285
     SERIAL_EOL;
281
 
286
 
282
     endstops_hit_on_purpose();
287
     endstops_hit_on_purpose();
549
           if(z_probe_endstop && old_z_probe_endstop)
554
           if(z_probe_endstop && old_z_probe_endstop)
550
           {
555
           {
551
         	  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
556
         	  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
552
-        	  endstop_z_hit=true;
557
+        	  endstop_z_probe_hit=true;
553
 
558
 
554
 //        	  if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
559
 //        	  if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
555
           }
560
           }
596
           if(z_probe_endstop && old_z_probe_endstop)
601
           if(z_probe_endstop && old_z_probe_endstop)
597
           {
602
           {
598
         	  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
603
         	  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
599
-        	  endstop_z_hit=true;
604
+        	  endstop_z_probe_hit=true;
600
 //        	  if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
605
 //        	  if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
601
           }
606
           }
602
           old_z_probe_endstop = z_probe_endstop;
607
           old_z_probe_endstop = z_probe_endstop;

Loading…
Cancel
Save