Browse Source

Merge pull request #1805 from thinkyhead/fixup_probing

Optimize coordinate copying, fix EXTRUDER_RUNOUT_PREVENT
Scott Lahteine 9 years ago
parent
commit
41ded7e996

+ 1
- 1
Marlin/Configuration.h View File

@@ -503,7 +503,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
503 503
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
504 504
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
505 505
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
506
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
506
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
507 507
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
508 508
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
509 509
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/Marlin.h View File

@@ -227,7 +227,7 @@ void enquecommands_P(const char *cmd); //put one or many ASCII commands at the e
227 227
 void prepare_arc_move(char isclockwise);
228 228
 void clamp_to_software_endstops(float target[3]);
229 229
 
230
-void refresh_cmd_timeout(void);
230
+void refresh_cmd_timeout();
231 231
 
232 232
 #ifdef FAST_PWM_FAN
233 233
   void setPwmFrequency(uint8_t pin, int val);

+ 2
- 3
Marlin/MarlinSerial.cpp View File

@@ -287,7 +287,6 @@ MarlinSerial MSerial;
287 287
 #endif // !AT90USB
288 288
 
289 289
 // For AT90USB targets use the UART for BT interfacing
290
-#if defined(AT90USB) && defined (BTENABLED)
291
-   HardwareSerial bt;
290
+#if defined(AT90USB) && defined(BTENABLED)
291
+  HardwareSerial bt;
292 292
 #endif
293
-

+ 2
- 2
Marlin/MarlinSerial.h View File

@@ -153,8 +153,8 @@ extern MarlinSerial MSerial;
153 153
 #endif // !AT90USB
154 154
 
155 155
 // Use the UART for BT in AT90USB configurations
156
-#if defined(AT90USB) && defined (BTENABLED)
157
-   extern HardwareSerial bt;
156
+#if defined(AT90USB) && defined(BTENABLED)
157
+  extern HardwareSerial bt;
158 158
 #endif
159 159
 
160 160
 #endif

+ 119
- 80
Marlin/Marlin_main.cpp View File

@@ -1009,6 +1009,8 @@ inline void sync_plan_position() {
1009 1009
     plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1010 1010
   }
1011 1011
 #endif
1012
+inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1013
+inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
1012 1014
 
1013 1015
 #ifdef ENABLE_AUTO_BED_LEVELING
1014 1016
 
@@ -1020,7 +1022,7 @@ inline void sync_plan_position() {
1020 1022
       refresh_cmd_timeout();
1021 1023
       calculate_delta(destination);
1022 1024
       plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
1023
-      for (int i = 0; i < NUM_AXIS; i++) current_position[i] = destination[i];
1025
+      set_current_to_destination();
1024 1026
     }
1025 1027
   #endif
1026 1028
 
@@ -1564,7 +1566,7 @@ static void homeaxis(int axis) {
1564 1566
 
1565 1567
     float oldFeedrate = feedrate;
1566 1568
 
1567
-    for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i];
1569
+    set_destination_to_current();
1568 1570
 
1569 1571
     if (retracting) {
1570 1572
 
@@ -1769,7 +1771,7 @@ inline void gcode_G28() {
1769 1771
 
1770 1772
   enable_endstops(true);
1771 1773
 
1772
-  for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i]; // includes E_AXIS
1774
+  set_destination_to_current();
1773 1775
 
1774 1776
   feedrate = 0.0;
1775 1777
 
@@ -1997,7 +1999,7 @@ inline void gcode_G28() {
1997 1999
     if (mbl_was_active) {
1998 2000
       current_position[X_AXIS] = mbl.get_x(0);
1999 2001
       current_position[Y_AXIS] = mbl.get_y(0);
2000
-      for (int i = 0; i < NUM_AXIS; i++) destination[i] = current_position[i];
2002
+      set_destination_to_current();
2001 2003
       feedrate = homing_feedrate[X_AXIS];
2002 2004
       line_to_destination();
2003 2005
       st_synchronize();
@@ -2776,13 +2778,13 @@ inline void gcode_M42() {
2776 2778
 
2777 2779
 #if defined(ENABLE_AUTO_BED_LEVELING) && defined(Z_PROBE_REPEATABILITY_TEST)
2778 2780
 
2779
-  // This is redudant since the SanityCheck.h already checks for a valid Z_PROBE_PIN, but here for clarity.
2781
+  // This is redundant since the SanityCheck.h already checks for a valid Z_PROBE_PIN, but here for clarity.
2780 2782
   #ifdef Z_PROBE_ENDSTOP
2781 2783
     #if !HAS_Z_PROBE
2782
-      #error "You must have a Z_PROBE_PIN defined in order to enable calculation of Z-Probe repeatability."
2784
+      #error You must define Z_PROBE_PIN to enable Z-Probe repeatability calculation.
2783 2785
     #endif
2784 2786
   #elif !HAS_Z_MIN
2785
-    #error "You must have a Z_MIN_PIN defined in order to enable calculation of Z-Probe repeatability."
2787
+    #error You must define Z_MIN_PIN to enable Z-Probe repeatability calculation.
2786 2788
   #endif
2787 2789
 
2788 2790
   /**
@@ -4613,7 +4615,7 @@ inline void gcode_T() {
4613 4615
     #if EXTRUDERS > 1
4614 4616
       if (tmp_extruder != active_extruder) {
4615 4617
         // Save current position to return to after applying extruder offset
4616
-        memcpy(destination, current_position, sizeof(destination));
4618
+        set_destination_to_current();
4617 4619
         #ifdef DUAL_X_CARRIAGE
4618 4620
           if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false &&
4619 4621
                 (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder))) {
@@ -5338,9 +5340,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_
5338 5340
 {
5339 5341
   if (!mbl.active) {
5340 5342
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5341
-    for(int8_t i=0; i < NUM_AXIS; i++) {
5342
-      current_position[i] = destination[i];
5343
-    }
5343
+    set_current_to_destination();
5344 5344
     return;
5345 5345
   }
5346 5346
   int pix = mbl.select_x_index(current_position[X_AXIS]);
@@ -5354,9 +5354,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_
5354 5354
   if (pix == ix && piy == iy) {
5355 5355
     // Start and end on same mesh square
5356 5356
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5357
-    for(int8_t i=0; i < NUM_AXIS; i++) {
5358
-      current_position[i] = destination[i];
5359
-    }
5357
+    set_current_to_destination();
5360 5358
     return;
5361 5359
   }
5362 5360
   float nx, ny, ne, normalized_dist;
@@ -5387,9 +5385,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_
5387 5385
   } else {
5388 5386
     // Already split on a border
5389 5387
     plan_buffer_line(x, y, z, e, feed_rate, extruder);
5390
-    for(int8_t i=0; i < NUM_AXIS; i++) {
5391
-      current_position[i] = destination[i];
5392
-    }
5388
+    set_current_to_destination();
5393 5389
     return;
5394 5390
   }
5395 5391
   // Do the split and look for more borders
@@ -5477,64 +5473,58 @@ void prepare_move() {
5477 5473
 
5478 5474
   #endif // DELTA
5479 5475
 
5480
-#ifdef DUAL_X_CARRIAGE
5481
-  if (active_extruder_parked)
5482
-  {
5483
-    if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0)
5484
-    {
5485
-      // move duplicate extruder into correct duplication position.
5486
-      plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
5487
-      plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS],
5488
-          current_position[E_AXIS], max_feedrate[X_AXIS], 1);
5489
-      sync_plan_position();
5490
-      st_synchronize();
5491
-      extruder_duplication_enabled = true;
5492
-      active_extruder_parked = false;
5493
-    }
5494
-    else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) // handle unparking of head
5495
-    {
5496
-      if (current_position[E_AXIS] == destination[E_AXIS])
5497
-      {
5498
-        // this is a travel move - skit it but keep track of current position (so that it can later
5499
-        // be used as start of first non-travel move)
5500
-        if (delayed_move_time != 0xFFFFFFFFUL)
5501
-        {
5502
-          memcpy(current_position, destination, sizeof(current_position));
5503
-          if (destination[Z_AXIS] > raised_parked_position[Z_AXIS])
5504
-            raised_parked_position[Z_AXIS] = destination[Z_AXIS];
5505
-          delayed_move_time = millis();
5506
-          return;
5476
+  #ifdef DUAL_X_CARRIAGE
5477
+    if (active_extruder_parked) {
5478
+      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
5479
+        // move duplicate extruder into correct duplication position.
5480
+        plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
5481
+        plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS],
5482
+            current_position[E_AXIS], max_feedrate[X_AXIS], 1);
5483
+        sync_plan_position();
5484
+        st_synchronize();
5485
+        extruder_duplication_enabled = true;
5486
+        active_extruder_parked = false;
5487
+      }
5488
+      else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) { // handle unparking of head
5489
+        if (current_position[E_AXIS] == destination[E_AXIS]) {
5490
+          // this is a travel move - skit it but keep track of current position (so that it can later
5491
+          // be used as start of first non-travel move)
5492
+          if (delayed_move_time != 0xFFFFFFFFUL) {
5493
+            set_current_to_destination();
5494
+            if (destination[Z_AXIS] > raised_parked_position[Z_AXIS])
5495
+              raised_parked_position[Z_AXIS] = destination[Z_AXIS];
5496
+            delayed_move_time = millis();
5497
+            return;
5498
+          }
5507 5499
         }
5500
+        delayed_move_time = 0;
5501
+        // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
5502
+        plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS],    current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
5503
+        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS],
5504
+            current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder);
5505
+        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
5506
+            current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
5507
+        active_extruder_parked = false;
5508 5508
       }
5509
-      delayed_move_time = 0;
5510
-      // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
5511
-      plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS],    current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
5512
-      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS],
5513
-          current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder);
5514
-      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
5515
-          current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
5516
-      active_extruder_parked = false;
5517 5509
     }
5518
-  }
5519
-#endif //DUAL_X_CARRIAGE
5510
+  #endif // DUAL_X_CARRIAGE
5520 5511
 
5521
-#if !defined(DELTA) && !defined(SCARA)
5522
-  // Do not use feedmultiply for E or Z only moves
5523
-  if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
5524
-    line_to_destination();
5525
-  } else {
5526
-#ifdef MESH_BED_LEVELING
5527
-    mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
5528
-    return;
5529
-#else
5530
-    plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
5531
-#endif  // MESH_BED_LEVELING
5532
-  }
5533
-#endif // !(DELTA || SCARA)
5512
+  #if !defined(DELTA) && !defined(SCARA)
5513
+    // Do not use feedmultiply for E or Z only moves
5514
+    if ( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
5515
+      line_to_destination();
5516
+    }
5517
+    else {
5518
+      #ifdef MESH_BED_LEVELING
5519
+        mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
5520
+        return;
5521
+      #else
5522
+        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate/60)*(feedmultiply/100.0), active_extruder);
5523
+      #endif  // MESH_BED_LEVELING
5524
+    }
5525
+  #endif // !(DELTA || SCARA)
5534 5526
 
5535
-  for(int8_t i=0; i < NUM_AXIS; i++) {
5536
-    current_position[i] = destination[i];
5537
-  }
5527
+  set_current_to_destination();
5538 5528
 }
5539 5529
 
5540 5530
 void prepare_arc_move(char isclockwise) {
@@ -5546,9 +5536,7 @@ void prepare_arc_move(char isclockwise) {
5546 5536
   // As far as the parser is concerned, the position is now == target. In reality the
5547 5537
   // motion control system might still be processing the action and the real tool position
5548 5538
   // in any intermediate location.
5549
-  for(int8_t i=0; i < NUM_AXIS; i++) {
5550
-    current_position[i] = destination[i];
5551
-  }
5539
+  set_current_to_destination();
5552 5540
   refresh_cmd_timeout();
5553 5541
 }
5554 5542
 
@@ -5718,7 +5706,16 @@ void disable_all_steppers() {
5718 5706
 }
5719 5707
 
5720 5708
 /**
5721
- * 
5709
+ * Manage several activities:
5710
+ *  - Check for Filament Runout
5711
+ *  - Keep the command buffer full
5712
+ *  - Check for maximum inactive time between commands
5713
+ *  - Check for maximum inactive time between stepper commands
5714
+ *  - Check if pin CHDK needs to go LOW
5715
+ *  - Check for KILL button held down
5716
+ *  - Check for HOME button held down
5717
+ *  - Check if cooling fan needs to be switched on
5718
+ *  - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT)
5722 5719
  */
5723 5720
 void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
5724 5721
   
@@ -5737,7 +5734,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
5737 5734
       && !ignore_stepper_queue && !blocks_queued())
5738 5735
     disable_all_steppers();
5739 5736
 
5740
-  #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH
5737
+  #ifdef CHDK // Check if pin should be set to LOW after M240 set it to HIGH
5741 5738
     if (chdkActive && ms > chdkHigh + CHDK_DELAY) {
5742 5739
       chdkActive = false;
5743 5740
       WRITE(CHDK, LOW);
@@ -5780,14 +5777,37 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
5780 5777
   #endif
5781 5778
     
5782 5779
   #if HAS_CONTROLLERFAN
5783
-    controllerFan(); //Check if fan should be turned on to cool stepper drivers down
5780
+    controllerFan(); // Check if fan should be turned on to cool stepper drivers down
5784 5781
   #endif
5785 5782
 
5786 5783
   #ifdef EXTRUDER_RUNOUT_PREVENT
5787 5784
     if (ms > previous_millis_cmd + EXTRUDER_RUNOUT_SECONDS * 1000)
5788 5785
     if (degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
5789
-      bool oldstatus = E0_ENABLE_READ;
5790
-      enable_e0();
5786
+      bool oldstatus;
5787
+      switch(active_extruder) {
5788
+        case 0:
5789
+          oldstatus = E0_ENABLE_READ;
5790
+          enable_e0();
5791
+          break;
5792
+        #if EXTRUDERS > 1
5793
+          case 1:
5794
+            oldstatus = E1_ENABLE_READ;
5795
+            enable_e1();
5796
+            break;
5797
+          #if EXTRUDERS > 2
5798
+            case 2:
5799
+              oldstatus = E2_ENABLE_READ;
5800
+              enable_e2();
5801
+              break;
5802
+            #if EXTRUDERS > 3
5803
+              case 3:
5804
+                oldstatus = E3_ENABLE_READ;
5805
+                enable_e3();
5806
+                break;
5807
+            #endif
5808
+          #endif
5809
+        #endif
5810
+      }
5791 5811
       float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
5792 5812
       plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
5793 5813
                       destination[E_AXIS] + EXTRUDER_RUNOUT_EXTRUDE * EXTRUDER_RUNOUT_ESTEPS / axis_steps_per_unit[E_AXIS],
@@ -5797,7 +5817,26 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
5797 5817
       plan_set_e_position(oldepos);
5798 5818
       previous_millis_cmd = ms; // refresh_cmd_timeout()
5799 5819
       st_synchronize();
5800
-      E0_ENABLE_WRITE(oldstatus);
5820
+      switch(active_extruder) {
5821
+        case 0:
5822
+          E0_ENABLE_WRITE(oldstatus);
5823
+          break;
5824
+        #if EXTRUDERS > 1
5825
+          case 1:
5826
+            E1_ENABLE_WRITE(oldstatus);
5827
+            break;
5828
+          #if EXTRUDERS > 2
5829
+            case 2:
5830
+              E2_ENABLE_WRITE(oldstatus);
5831
+              break;
5832
+            #if EXTRUDERS > 3
5833
+              case 3:
5834
+                E3_ENABLE_WRITE(oldstatus);
5835
+                break;
5836
+            #endif
5837
+          #endif
5838
+        #endif
5839
+      }
5801 5840
     }
5802 5841
   #endif
5803 5842
 
@@ -5806,7 +5845,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
5806 5845
     if (delayed_move_time && ms > delayed_move_time + 1000 && !Stopped) {
5807 5846
       // travel moves have been received so enact them
5808 5847
       delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
5809
-      memcpy(destination, current_position, sizeof(destination));
5848
+      set_destination_to_current();
5810 5849
       prepare_move();
5811 5850
     }
5812 5851
   #endif

+ 1
- 1
Marlin/SanityCheck.h View File

@@ -100,7 +100,7 @@
100 100
      * Require a Z Min pin
101 101
      */
102 102
     #if Z_MIN_PIN == -1
103
-      #if Z_PROBE_PIN == -1 || (! defined (Z_PROBE_ENDSTOP) || defined (DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
103
+      #if Z_PROBE_PIN == -1 || (!defined(Z_PROBE_ENDSTOP) || defined(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
104 104
         #ifdef Z_PROBE_REPEATABILITY_TEST
105 105
           #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
106 106
         #else

+ 1
- 1
Marlin/Servo.h View File

@@ -123,7 +123,7 @@ class Servo {
123 123
     int read();                        // returns current pulse width as an angle between 0 and 180 degrees
124 124
     int readMicroseconds();            // returns current pulse width in microseconds for this servo (was read_us() in first release)
125 125
     bool attached();                   // return true if this servo is attached, otherwise false
126
-    #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
126
+    #if defined(ENABLE_AUTO_BED_LEVELING) && PROBE_SERVO_DEACTIVATION_DELAY > 0
127 127
       int pin;                           // store the hardware pin of the servo
128 128
     #endif
129 129
   private:

+ 1
- 1
Marlin/configurator/config/Configuration.h View File

@@ -523,7 +523,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
523 523
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
524 524
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
525 525
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
526
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
526
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
527 527
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
528 528
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
529 529
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/Felix/Configuration.h View File

@@ -473,7 +473,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
473 473
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
474 474
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
475 475
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
476
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
476
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
477 477
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
478 478
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
479 479
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -473,7 +473,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
473 473
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
474 474
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
475 475
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
476
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
476
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
477 477
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
478 478
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
479 479
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -496,7 +496,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
496 496
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
497 497
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
498 498
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
499
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
499
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
500 500
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
501 501
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
502 502
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/K8200/Configuration.h View File

@@ -501,7 +501,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
501 501
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
502 502
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
503 503
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
504
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
504
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
505 505
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
506 506
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
507 507
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -525,7 +525,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
525 525
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
526 526
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
527 527
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
528
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
528
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
529 529
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
530 530
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
531 531
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -495,7 +495,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
495 495
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
496 496
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
497 497
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
498
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
498
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
499 499
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
500 500
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
501 501
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -541,7 +541,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
541 541
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
542 542
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
543 543
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
544
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
544
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
545 545
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
546 546
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
547 547
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -545,7 +545,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
545 545
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
546 546
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
547 547
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
548
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
548
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
549 549
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
550 550
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
551 551
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/makibox/Configuration.h View File

@@ -493,7 +493,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
493 493
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
494 494
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
495 495
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
496
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
496
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
497 497
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
498 498
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
499 499
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -495,7 +495,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
495 495
   // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
496 496
   // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
497 497
   // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
498
-  // To use a separte Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
498
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
499 499
   // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
500 500
   // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
501 501
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.

+ 5
- 5
Marlin/fastio.h View File

@@ -91,7 +91,7 @@
91 91
 	added as necessary or if I feel like it- not a comprehensive list!
92 92
 */
93 93
 
94
-#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
94
+#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
95 95
 // UART
96 96
 #define	RXD					DIO0
97 97
 #define	TXD					DIO1
@@ -426,7 +426,7 @@ pins
426 426
 #define PD7_PWM			NULL
427 427
 #endif	/*	_AVR_ATmega{168,328,328P}__ */
428 428
 
429
-#if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__) || defined (__AVR_ATmega1284P__)
429
+#if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
430 430
 // UART
431 431
 #define	RXD					DIO8
432 432
 #define	TXD					DIO9
@@ -929,7 +929,7 @@ pins
929 929
 #define PD7_PWM			OCR2A
930 930
 #endif	/*	_AVR_ATmega{644,644P,644PA}__ */
931 931
 
932
-#if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__)
932
+#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
933 933
 // UART
934 934
 #define	RXD					DIO0
935 935
 #define	TXD					DIO1
@@ -2024,7 +2024,7 @@ pins
2024 2024
 
2025 2025
 #endif
2026 2026
 
2027
-#if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__) || defined (__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
2027
+#if defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
2028 2028
 // SPI
2029 2029
 #define	SCK					DIO9
2030 2030
 #define	MISO				DIO11
@@ -3322,7 +3322,7 @@ Teensy   28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17
3322 3322
 #endif // __AVR_AT90usbxxx__
3323 3323
 
3324 3324
 
3325
-#if defined (__AVR_ATmega1281__) || defined (__AVR_ATmega2561__)
3325
+#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
3326 3326
 // UART
3327 3327
 #define	RXD					DIO0
3328 3328
 #define	TXD					DIO1

+ 6
- 3
Marlin/pins.h View File

@@ -187,7 +187,7 @@
187 187
   #define Z_MIN_PIN          -1
188 188
 #endif
189 189
 
190
-#if defined (DISABLE_Z_PROBE_ENDSTOP) || ! defined (Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
190
+#if defined(DISABLE_Z_PROBE_ENDSTOP) || !defined(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
191 191
   #define Z_PROBE_PIN        -1
192 192
 #endif
193 193
 
@@ -220,8 +220,11 @@
220 220
   #define Z_MIN_PIN          -1
221 221
 #endif
222 222
 
223
-#define SENSITIVE_PINS { 0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, PS_ON_PIN, \
224
-                        HEATER_BED_PIN, FAN_PIN, \
223
+#define SENSITIVE_PINS { 0, 1, \
224
+                        X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \
225
+                        Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \
226
+                        Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_PROBE_PIN, \
227
+                        PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, \
225 228
                         _E0_PINS _E1_PINS _E2_PINS _E3_PINS \
226 229
                         analogInputToDigitalPin(TEMP_BED_PIN) \
227 230
                        }

+ 3
- 3
Marlin/pins_RAMPS_13.h View File

@@ -62,12 +62,12 @@
62 62
   #define FILWIDTH_PIN        5
63 63
 #endif
64 64
 
65
-#if defined(Z_PROBE_ENDSTOP)
65
+#ifdef Z_PROBE_ENDSTOP
66 66
   // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
67
- #define Z_PROBE_PIN 32
67
+  #define Z_PROBE_PIN 32
68 68
 #endif
69 69
 
70
-#if defined(FILAMENT_RUNOUT_SENSOR)
70
+#ifdef FILAMENT_RUNOUT_SENSOR
71 71
   // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
72 72
   #define FILRUNOUT_PIN        4
73 73
 #endif

Loading…
Cancel
Save