Browse Source

Merge pull request #6491 from thinkyhead/rc_cleanup_wednesday

Various cleanups for recent merges
Scott Lahteine 8 years ago
parent
commit
f169c04604

+ 1
- 1
Marlin/Configuration.h View File

534
  * ===========================================================================
534
  * ===========================================================================
535
  * ============================= Z Probe Options =============================
535
  * ============================= Z Probe Options =============================
536
  * ===========================================================================
536
  * ===========================================================================
537
- *    @section probes
537
+ * @section probes
538
  *
538
  *
539
  *
539
  *
540
  *   Probe Type
540
  *   Probe Type

+ 63
- 63
Marlin/Marlin_main.cpp View File

2060
   #endif
2060
   #endif
2061
 
2061
 
2062
   #if ENABLED(BLTOUCH)
2062
   #if ENABLED(BLTOUCH)
2063
+
2063
     void bltouch_command(int angle) {
2064
     void bltouch_command(int angle) {
2064
       servo[Z_ENDSTOP_SERVO_NR].move(angle);  // Give the BL-Touch the command and wait
2065
       servo[Z_ENDSTOP_SERVO_NR].move(angle);  // Give the BL-Touch the command and wait
2065
       safe_delay(BLTOUCH_DELAY);
2066
       safe_delay(BLTOUCH_DELAY);
2066
     }
2067
     }
2067
 
2068
 
2068
-    // 
2069
-    // The BL-Touch probes have a HAL effect sensor.  The high currents switching
2070
-    // on and off cause big magnetic fields that can affect the repeatability of the
2071
-    // sensor.  So, for BL-Touch probes, we turn off the heaters during the actual probe.
2072
-    // And then we quickly turn them back on after we have sampled the point
2073
-    //
2074
-  #if ENABLED(BLTOUCH_HEATERS_OFF)
2075
-    void turn_heaters_on_or_off_for_bltouch(const bool deploy) {
2076
-      static int8_t bltouch_recursion_cnt=0;
2077
-      static millis_t last_emi_protection=0;
2078
-      static float temps_at_entry[HOTENDS]; 
2079
-      #if HAS_TEMP_BED
2080
-        static float bed_temp_at_entry;
2081
-      #endif
2082
-
2083
-      if (deploy && bltouch_recursion_cnt>0)         // if already in the correct state, we don't need to do anything
2084
-        return;                                      // with the heaters.
2085
-      if (!deploy && bltouch_recursion_cnt<1)        // if already in the correct state, we don't need to do anything
2086
-        return;                                      // with the heaters.
2069
+    /**
2070
+     * BLTouch probes have a Hall effect sensor. The high currents switching
2071
+     * on and off cause a magnetic field that can affect the repeatability of the
2072
+     * sensor. So for BLTouch probes, heaters are turned off during the probe,
2073
+     * then quickly turned back on after the point is sampled.
2074
+     */
2075
+    #if ENABLED(BLTOUCH_HEATERS_OFF)
2087
 
2076
 
2088
-      if (deploy) {
2089
-        bltouch_recursion_cnt++;
2090
-        last_emi_protection = millis();
2091
-        HOTEND_LOOP() temps_at_entry[e] = thermalManager.degTargetHotend(e);        // save the current target temperatures 
2092
-        HOTEND_LOOP() thermalManager.setTargetHotend(0, e);                         // so we know what to restore them to.
2077
+      bool set_heaters_for_bltouch(const bool deploy) {
2078
+        static bool heaters_were_disabled = false;
2079
+        static millis_t next_emi_protection;
2080
+        static float temps_at_entry[HOTENDS];
2093
 
2081
 
2094
         #if HAS_TEMP_BED
2082
         #if HAS_TEMP_BED
2095
-          bed_temp_at_entry = thermalManager.degTargetBed();
2096
-          thermalManager.setTargetBed(0.0);
2083
+          static float bed_temp_at_entry;
2097
         #endif
2084
         #endif
2098
-      } 
2099
-      else {
2100
-        bltouch_recursion_cnt--;                                                    // the heaters are only turned back on
2101
-	if (bltouch_recursion_cnt==0 && ((last_emi_protection+20000L)>millis())) {  // if everything is perfect.  It is expected
2102
-          HOTEND_LOOP() thermalManager.setTargetHotend(temps_at_entry[e], e);       // that the bltouch_recursion_cnt is zero and 
2103
-          #if HAS_TEMP_BED                                                          // that the heaters were shut off less than 
2104
-            thermalManager.setTargetBed(bed_temp_at_entry);                         // 20 seconds ago
2085
+
2086
+        // If called out of order or far apart something is seriously wrong
2087
+        if (deploy == heaters_were_disabled
2088
+            || (next_emi_protection && ELAPSED(millis(), next_emi_protection)))
2089
+          kill(PSTR(MSG_KILLED));
2090
+
2091
+        if (deploy) {
2092
+          next_emi_protection = millis() + 20 * 1000UL;
2093
+          HOTEND_LOOP() {
2094
+            temps_at_entry[e] = thermalManager.degTargetHotend(e);
2095
+            thermalManager.setTargetHotend(0, e);
2096
+          }
2097
+          #if HAS_TEMP_BED
2098
+            bed_temp_at_entry = thermalManager.degTargetBed();
2099
+            thermalManager.setTargetBed(0);
2100
+          #endif
2101
+        }
2102
+        else {
2103
+          HOTEND_LOOP() thermalManager.setTargetHotend(temps_at_entry[e], e);
2104
+          #if HAS_TEMP_BED
2105
+            thermalManager.setTargetBed(bed_temp_at_entry);
2105
           #endif
2106
           #endif
2106
         }
2107
         }
2107
       }
2108
       }
2108
-    }
2109
-    #endif
2109
+
2110
+    #endif // BLTOUCH_HEATERS_OFF
2110
 
2111
 
2111
     void set_bltouch_deployed(const bool deploy) {
2112
     void set_bltouch_deployed(const bool deploy) {
2112
       #if ENABLED(BLTOUCH_HEATERS_OFF)
2113
       #if ENABLED(BLTOUCH_HEATERS_OFF)
2113
-      turn_heaters_on_or_off_for_bltouch(deploy);
2114
+        set_heaters_for_bltouch(deploy);
2114
       #endif
2115
       #endif
2115
       if (deploy && TEST_BLTOUCH()) {      // If BL-Touch says it's triggered
2116
       if (deploy && TEST_BLTOUCH()) {      // If BL-Touch says it's triggered
2116
-        bltouch_command(BLTOUCH_RESET);    // try to reset it.
2117
+        bltouch_command(BLTOUCH_RESET);    //  try to reset it.
2117
         bltouch_command(BLTOUCH_DEPLOY);   // Also needs to deploy and stow to
2118
         bltouch_command(BLTOUCH_DEPLOY);   // Also needs to deploy and stow to
2118
-        bltouch_command(BLTOUCH_STOW);     // clear the triggered condition.
2119
-        safe_delay(1500);                  // wait for internal self test to complete
2120
-                                           //   measured completion time was 0.65 seconds
2121
-                                           //   after reset, deploy & stow sequence
2119
+        bltouch_command(BLTOUCH_STOW);     //  clear the triggered condition.
2120
+        safe_delay(1500);                  // Wait for internal self-test to complete.
2121
+                                           //  (Measured completion time was 0.65 seconds
2122
+                                           //   after reset, deploy, and stow sequence)
2122
         if (TEST_BLTOUCH()) {              // If it still claims to be triggered...
2123
         if (TEST_BLTOUCH()) {              // If it still claims to be triggered...
2123
           SERIAL_ERROR_START;
2124
           SERIAL_ERROR_START;
2124
           SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH);
2125
           SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH);
2134
         }
2135
         }
2135
       #endif
2136
       #endif
2136
     }
2137
     }
2137
-  #endif
2138
+
2139
+  #endif // BLTOUCH
2138
 
2140
 
2139
   // returns false for ok and true for failure
2141
   // returns false for ok and true for failure
2140
   bool set_probe_deployed(bool deploy) {
2142
   bool set_probe_deployed(bool deploy) {
2146
       }
2148
       }
2147
     #endif
2149
     #endif
2148
 
2150
 
2149
-    #if ENABLED(BLTOUCH)
2150
-      #if ENABLED(BLTOUCH_HEATERS_OFF)
2151
-      turn_heaters_on_or_off_for_bltouch(deploy);
2152
-      #endif
2151
+    #if ENABLED(BLTOUCH) && ENABLED(BLTOUCH_HEATERS_OFF)
2152
+      set_heaters_for_bltouch(deploy);
2153
     #endif
2153
     #endif
2154
 
2154
 
2155
     if (endstops.z_probe_enabled == deploy) return false;
2155
     if (endstops.z_probe_enabled == deploy) return false;
2330
     return current_position[Z_AXIS] + zprobe_zoffset;
2330
     return current_position[Z_AXIS] + zprobe_zoffset;
2331
   }
2331
   }
2332
 
2332
 
2333
-  //
2334
-  // - Move to the given XY
2335
-  // - Deploy the probe, if not already deployed
2336
-  // - Probe the bed, get the Z position
2337
-  // - Depending on the 'stow' flag
2338
-  //   - Stow the probe, or
2339
-  //   - Raise to the BETWEEN height
2340
-  // - Return the probed Z position
2341
-  //
2333
+  /**
2334
+   * - Move to the given XY
2335
+   * - Deploy the probe, if not already deployed
2336
+   * - Probe the bed, get the Z position
2337
+   * - Depending on the 'stow' flag
2338
+   *   - Stow the probe, or
2339
+   *   - Raise to the BETWEEN height
2340
+   * - Return the probed Z position
2341
+   */
2342
   float probe_pt(const float x, const float y, const bool stow/*=true*/, const int verbose_level/*=1*/) {
2342
   float probe_pt(const float x, const float y, const bool stow/*=true*/, const int verbose_level/*=1*/) {
2343
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2343
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2344
       if (DEBUGGING(LEVELING)) {
2344
       if (DEBUGGING(LEVELING)) {
2507
 
2507
 
2508
 #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING)
2508
 #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING)
2509
 
2509
 
2510
-  //
2511
-  // Enable if you prefer your output in JSON format
2512
-  // suitable for SCAD or JavaScript mesh visualizers.
2513
-  //
2514
-  // Visualize meshes in OpenSCAD using the included script.
2515
-  //
2516
-  //   buildroot/shared/scripts/MarlinMesh.scad
2517
-  //
2510
+  /**
2511
+   * Enable to produce output in JSON format suitable
2512
+   * for SCAD or JavaScript mesh visualizers.
2513
+   *
2514
+   * Visualize meshes in OpenSCAD using the included script.
2515
+   *
2516
+   *   buildroot/shared/scripts/MarlinMesh.scad
2517
+   */
2518
   //#define SCAD_MESH_OUTPUT
2518
   //#define SCAD_MESH_OUTPUT
2519
 
2519
 
2520
   /**
2520
   /**

+ 23
- 21
Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h View File

293
 #define HEATER_1_MAXTEMP 245
293
 #define HEATER_1_MAXTEMP 245
294
 #define HEATER_2_MAXTEMP 245
294
 #define HEATER_2_MAXTEMP 245
295
 #define HEATER_3_MAXTEMP 245
295
 #define HEATER_3_MAXTEMP 245
296
+#define HEATER_4_MAXTEMP 245
296
 #define BED_MAXTEMP 115
297
 #define BED_MAXTEMP 115
297
 
298
 
298
 //===========================================================================
299
 //===========================================================================
316
   #define K1 0.95 //smoothing factor within the PID
317
   #define K1 0.95 //smoothing factor within the PID
317
 
318
 
318
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
319
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
319
-  
320
-    
320
+
321
   // FolgerTech i3-2020
321
   // FolgerTech i3-2020
322
   #define  DEFAULT_Kp 11.50
322
   #define  DEFAULT_Kp 11.50
323
   #define  DEFAULT_Ki 0.50
323
   #define  DEFAULT_Ki 0.50
324
   #define  DEFAULT_Kd 60.00
324
   #define  DEFAULT_Kd 60.00
325
 
325
 
326
+  // Ultimaker
327
+  //#define  DEFAULT_Kp 22.2
328
+  //#define  DEFAULT_Ki 1.08
329
+  //#define  DEFAULT_Kd 114
330
+
326
   // MakerGear
331
   // MakerGear
327
   //#define  DEFAULT_Kp 7.0
332
   //#define  DEFAULT_Kp 7.0
328
   //#define  DEFAULT_Ki 0.1
333
   //#define  DEFAULT_Ki 0.1
563
  */
568
  */
564
 //#define FIX_MOUNTED_PROBE
569
 //#define FIX_MOUNTED_PROBE
565
 
570
 
566
-
567
 /**
571
 /**
568
  *   Z Servo Probe, such as an endstop switch on a rotating arm.
572
  *   Z Servo Probe, such as an endstop switch on a rotating arm.
569
  *   NUM_SERVOS also needs to be set.  This is found later in this file.  Set it to
573
  *   NUM_SERVOS also needs to be set.  This is found later in this file.  Set it to
579
  *   with the possible exception of Z_ENDSTOP_SERVO_NR.
583
  *   with the possible exception of Z_ENDSTOP_SERVO_NR.
580
  */
584
  */
581
 //#define BLTOUCH
585
 //#define BLTOUCH
582
-//#define BLTOUCH_DELAY 375   // (ms) Enable and increase if needed
586
+//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed
583
 //#define BLTOUCH_HEATERS_OFF // if defined the printer's heaters are turned off during probe event
587
 //#define BLTOUCH_HEATERS_OFF // if defined the printer's heaters are turned off during probe event
584
 
588
 
585
 /**
589
 /**
602
 
606
 
603
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
607
 // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
604
 //#define Z_PROBE_SLED
608
 //#define Z_PROBE_SLED
605
-//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
609
+//#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
606
 
610
 
607
 /**
611
 /**
608
  *   Z Probe to nozzle (X,Y) offset, relative to (0, 0).
612
  *   Z Probe to nozzle (X,Y) offset, relative to (0, 0).
631
 #define XY_PROBE_SPEED 7500
635
 #define XY_PROBE_SPEED 7500
632
 // Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
636
 // Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
633
 #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
637
 #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
638
+
634
 // Speed for the "accurate" probe of each point
639
 // Speed for the "accurate" probe of each point
635
 #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
640
 #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
641
+
636
 // Use double touch for probing
642
 // Use double touch for probing
637
 //#define PROBE_DOUBLE_TOUCH
643
 //#define PROBE_DOUBLE_TOUCH
638
 
644
 
694
  */
700
  */
695
 
701
 
696
 //#define Z_MIN_PROBE_ENDSTOP
702
 //#define Z_MIN_PROBE_ENDSTOP
697
-
698
 #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
703
 #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
699
 
704
 
700
 // Enable Z Probe Repeatability test to see how accurate your probe is
705
 // Enable Z Probe Repeatability test to see how accurate your probe is
771
 #define Y_HOME_DIR -1
776
 #define Y_HOME_DIR -1
772
 #define Z_HOME_DIR -1
777
 #define Z_HOME_DIR -1
773
 
778
 
774
-
775
 // @section machine
779
 // @section machine
776
 
780
 
777
 // Travel limits after homing (units are in mm)
781
 // Travel limits after homing (units are in mm)
804
 //===========================================================================
808
 //===========================================================================
805
 //=============================== Bed Leveling ==============================
809
 //=============================== Bed Leveling ==============================
806
 //===========================================================================
810
 //===========================================================================
807
-
808
 // @section bedlevel
811
 // @section bedlevel
809
 
812
 
810
 /**
813
 /**
851
 #define AUTO_BED_LEVELING_UBL
854
 #define AUTO_BED_LEVELING_UBL
852
 //#define MESH_BED_LEVELING
855
 //#define MESH_BED_LEVELING
853
 
856
 
854
-
855
 /**
857
 /**
856
  * Enable detailed logging of G28, G29, M48, etc.
858
  * Enable detailed logging of G28, G29, M48, etc.
857
  * Turn on with the command 'M111 S32'.
859
  * Turn on with the command 'M111 S32'.
902
 
904
 
903
   // 3 arbitrary points to probe.
905
   // 3 arbitrary points to probe.
904
   // A simple cross-product is used to estimate the plane of the bed.
906
   // A simple cross-product is used to estimate the plane of the bed.
905
-
906
   #define ABL_PROBE_PT_1_X 39
907
   #define ABL_PROBE_PT_1_X 39
907
   #define ABL_PROBE_PT_1_Y 170
908
   #define ABL_PROBE_PT_1_Y 170
908
   #define ABL_PROBE_PT_2_X 39
909
   #define ABL_PROBE_PT_2_X 39
918
   //========================= Unified Bed Leveling ============================
919
   //========================= Unified Bed Leveling ============================
919
   //===========================================================================
920
   //===========================================================================
920
 
921
 
921
-    #define UBL_MESH_INSET 1         // Mesh inset margin on print area
922
-    #define GRID_MAX_POINTS_X 10     // Don't use more than 15 points per axis, implementation limited.
923
-    #define GRID_MAX_POINTS_Y 10
924
-    #define UBL_PROBE_PT_1_X 45    // These set the probe locations for when UBL does a 3-Point leveling	
925
-    #define UBL_PROBE_PT_1_Y 170   // of the mesh.
926
-    #define UBL_PROBE_PT_2_X 45
927
-    #define UBL_PROBE_PT_2_Y 25
928
-    #define UBL_PROBE_PT_3_X 180
929
-    #define UBL_PROBE_PT_3_Y 25
930
-    #define UBL_G26_MESH_EDITING     // Enable G26 mesh editing
922
+  #define UBL_MESH_INSET 1          // Mesh inset margin on print area
923
+  #define GRID_MAX_POINTS_X 10      // Don't use more than 15 points per axis, implementation limited.
924
+  #define GRID_MAX_POINTS_Y 10
925
+  #define UBL_PROBE_PT_1_X 45       // These set the probe locations for when UBL does a 3-Point leveling
926
+  #define UBL_PROBE_PT_1_Y 170      // of the mesh.
927
+  #define UBL_PROBE_PT_2_X 45
928
+  #define UBL_PROBE_PT_2_Y 25
929
+  #define UBL_PROBE_PT_3_X 180
930
+  #define UBL_PROBE_PT_3_Y 25
931
+  #define UBL_G26_MESH_EDITING    // Enable G26 mesh editing
932
+
931
 #elif ENABLED(MESH_BED_LEVELING)
933
 #elif ENABLED(MESH_BED_LEVELING)
932
 
934
 
933
   //===========================================================================
935
   //===========================================================================
1607
  */
1609
  */
1608
 //#define FILAMENT_WIDTH_SENSOR
1610
 //#define FILAMENT_WIDTH_SENSOR
1609
 
1611
 
1610
-#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75  //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software.  Used for sensor reading validation
1612
+#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75   // (mm) Diameter of the filament generally used (3.0 or 1.75mm), also used in the slicer. Used to validate sensor reading.
1611
 
1613
 
1612
 #if ENABLED(FILAMENT_WIDTH_SENSOR)
1614
 #if ENABLED(FILAMENT_WIDTH_SENSOR)
1613
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0    // Index of the extruder that has the filament sensor (0,1,2,3)
1615
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0    // Index of the extruder that has the filament sensor (0,1,2,3)

+ 4
- 8
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h View File

327
   // Default x offset in duplication mode (typically set to half print bed width)
327
   // Default x offset in duplication mode (typically set to half print bed width)
328
   #define DEFAULT_DUPLICATION_X_OFFSET 100
328
   #define DEFAULT_DUPLICATION_X_OFFSET 100
329
 
329
 
330
-#endif //DUAL_X_CARRIAGE
330
+#endif // DUAL_X_CARRIAGE
331
 
331
 
332
 // Activate a solenoid on the active extruder with M380. Disable all with M381.
332
 // Activate a solenoid on the active extruder with M380. Disable all with M381.
333
 // Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid.
333
 // Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid.
419
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
419
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
420
  */
420
  */
421
 //#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
421
 //#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
422
-
423
 //#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
422
 //#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
424
 //#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
423
 //#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
425
 
424
 
587
  */
586
  */
588
 #define BABYSTEPPING
587
 #define BABYSTEPPING
589
 #if ENABLED(BABYSTEPPING)
588
 #if ENABLED(BABYSTEPPING)
590
-  #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
591
-                       //not implemented for deltabots!
592
-  #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
593
-  #define BABYSTEP_MULTIPLICATOR 2 //faster movements
589
+  #define BABYSTEP_XY              // Also enable X/Y Babystepping. Not supported on DELTA!
590
+  #define BABYSTEP_INVERT_Z false  // Change if Z babysteps should go the other way
591
+  #define BABYSTEP_MULTIPLICATOR 2 // Babysteps are very small. Increase for faster motion.
594
   //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping
592
   //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping
595
   #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
593
   #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
596
   #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
594
   #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
1034
  * (https://github.com/ameyer/Arduino-L6470)
1032
  * (https://github.com/ameyer/Arduino-L6470)
1035
  */
1033
  */
1036
 
1034
 
1037
-
1038
 //#define HAVE_L6470DRIVER
1035
 //#define HAVE_L6470DRIVER
1039
 #if ENABLED(HAVE_L6470DRIVER)
1036
 #if ENABLED(HAVE_L6470DRIVER)
1040
 
1037
 
1155
  */
1152
  */
1156
 //#define EXTENDED_CAPABILITIES_REPORT
1153
 //#define EXTENDED_CAPABILITIES_REPORT
1157
 
1154
 
1158
-
1159
 /**
1155
 /**
1160
  * Volumetric extrusion default state
1156
  * Volumetric extrusion default state
1161
  * Activate to make volumetric extrusion the default method,
1157
  * Activate to make volumetric extrusion the default method,

+ 23
- 25
Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h View File

130
 // The following define selects which electronics board you have.
130
 // The following define selects which electronics board you have.
131
 // Please choose the name from boards.h that matches your setup
131
 // Please choose the name from boards.h that matches your setup
132
 #ifndef MOTHERBOARD
132
 #ifndef MOTHERBOARD
133
-//#define MOTHERBOARD BOARD_RAMPS_14_EEF
133
+  //#define MOTHERBOARD BOARD_RAMPS_14_EEF
134
   #define MOTHERBOARD BOARD_RAMPS_14_EFB       // gMax users please note:  This is a Roxy modification.   I print on glass and
134
   #define MOTHERBOARD BOARD_RAMPS_14_EFB       // gMax users please note:  This is a Roxy modification.   I print on glass and
135
                                                // I use Marlin to control the bed's temperature.  So, if you have a single nozzle
135
                                                // I use Marlin to control the bed's temperature.  So, if you have a single nozzle
136
-                                               // machine, this will work fine for you.  You just set the 
137
-                                               // #define TEMP_SENSOR_BED 75 to 0 down below so Marlin doesn't mess with the bed 
136
+                                               // machine, this will work fine for you.  You just set the
137
+                                               // #define TEMP_SENSOR_BED 75 to 0 down below so Marlin doesn't mess with the bed
138
                                                // temp.
138
                                                // temp.
139
 #endif
139
 #endif
140
 
140
 
261
 #define TEMP_SENSOR_3 0
261
 #define TEMP_SENSOR_3 0
262
 #define TEMP_SENSOR_4 0
262
 #define TEMP_SENSOR_4 0
263
 #define TEMP_SENSOR_BED 75   // gMax-1.5+ users please note:   This is a Roxy modification to the printer.   I want
263
 #define TEMP_SENSOR_BED 75   // gMax-1.5+ users please note:   This is a Roxy modification to the printer.   I want
264
-                             // to print on glass.   And I'm using a 400mm x 400mm silicon heat pad powered through 
265
-                             // a Fortek SSR to do it.   If you are using an unaltered gCreate machine, this needs 
264
+                             // to print on glass.   And I'm using a 400mm x 400mm silicon heat pad powered through
265
+                             // a Fortek SSR to do it.   If you are using an unaltered gCreate machine, this needs
266
                              // to be set to 0
266
                              // to be set to 0
267
 
267
 
268
 // Dummy thermistor constant temperature readings, for use with 998 and 999
268
 // Dummy thermistor constant temperature readings, for use with 998 and 999
325
   #define K1 0.95 //smoothing factor within the PID
325
   #define K1 0.95 //smoothing factor within the PID
326
 
326
 
327
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
327
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
328
-  
328
+
329
   // gMax J-Head
329
   // gMax J-Head
330
-    #define  DEFAULT_Kp 15.35
331
-    #define  DEFAULT_Ki 0.85
332
-    #define  DEFAULT_Kd 69.45
333
-    
330
+  #define  DEFAULT_Kp 15.35
331
+  #define  DEFAULT_Ki 0.85
332
+  #define  DEFAULT_Kd 69.45
333
+
334
   // Ultimaker
334
   // Ultimaker
335
-//  #define  DEFAULT_Kp 22.2
336
-//  #define  DEFAULT_Ki 1.08
337
-//  #define  DEFAULT_Kd 114
335
+  //#define  DEFAULT_Kp 22.2
336
+  //#define  DEFAULT_Ki 1.08
337
+  //#define  DEFAULT_Kd 114
338
 
338
 
339
   // MakerGear
339
   // MakerGear
340
   //#define  DEFAULT_Kp 7.0
340
   //#define  DEFAULT_Kp 7.0
474
 #define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
474
 #define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
475
 #define Y_MAX_ENDSTOP_INVERTING true  // set to true to invert the logic of the endstop.
475
 #define Y_MAX_ENDSTOP_INVERTING true  // set to true to invert the logic of the endstop.
476
 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
476
 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
477
-#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
477
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.
478
 
478
 
479
 // Enable this feature if all enabled endstop pins are interrupt-capable.
479
 // Enable this feature if all enabled endstop pins are interrupt-capable.
480
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
480
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
548
  * ===========================================================================
548
  * ===========================================================================
549
  * ============================= Z Probe Options =============================
549
  * ============================= Z Probe Options =============================
550
  * ===========================================================================
550
  * ===========================================================================
551
- *    @section probes
551
+ * @section probes
552
  *
552
  *
553
  *
553
  *
554
  *   Probe Type
554
  *   Probe Type
730
 #define Z_CLEARANCE_DEPLOY_PROBE   15 // Z Clearance for Deploy/Stow
730
 #define Z_CLEARANCE_DEPLOY_PROBE   15 // Z Clearance for Deploy/Stow
731
 #define Z_CLEARANCE_BETWEEN_PROBES  6 // Z Clearance between probe points
731
 #define Z_CLEARANCE_BETWEEN_PROBES  6 // Z Clearance between probe points
732
 
732
 
733
-//
734
-
735
 // For M851 give a range for adjusting the Z probe offset
733
 // For M851 give a range for adjusting the Z probe offset
736
 #define Z_PROBE_OFFSET_RANGE_MIN -20
734
 #define Z_PROBE_OFFSET_RANGE_MIN -20
737
 #define Z_PROBE_OFFSET_RANGE_MAX 20
735
 #define Z_PROBE_OFFSET_RANGE_MAX 20
792
 #define X_MIN_POS 0
790
 #define X_MIN_POS 0
793
 #define Y_MIN_POS 0
791
 #define Y_MIN_POS 0
794
 #define Z_MIN_POS 0
792
 #define Z_MIN_POS 0
795
-#define X_MAX_POS 420		// These numbers are not accurate for an unaltered gMax 1.5+ printer.  My print bed
796
-#define Y_MAX_POS 420		// is inset a noticable amount from the edge of the bed.  Combined with the inset, 
797
-                                // the nozzle can reach all cordinates of the mesh.
793
+#define X_MAX_POS 420   // These numbers are not accurate for an unaltered gMax 1.5+ printer.  My print bed
794
+#define Y_MAX_POS 420   // is inset a noticable amount from the edge of the bed.  Combined with the inset,
795
+                        // the nozzle can reach all cordinates of the mesh.
798
 #define Z_MAX_POS 500
796
 #define Z_MAX_POS 500
799
 
797
 
800
 // If enabled, axes won't move below MIN_POS in response to movement commands.
798
 // If enabled, axes won't move below MIN_POS in response to movement commands.
994
 #define Z_SAFE_HOMING
992
 #define Z_SAFE_HOMING
995
 
993
 
996
 #if ENABLED(Z_SAFE_HOMING)
994
 #if ENABLED(Z_SAFE_HOMING)
997
-  #define Z_SAFE_HOMING_X_POINT (((X_MIN_POS+X_MAX_POS)/2)-4) // X point for Z homing when homing all axis (G28).
998
-  #define Z_SAFE_HOMING_Y_POINT (((Y_MIN_POS+Y_MAX_POS)/2)+4) // Y point for Z homing when homing all axis (G28).
995
+  #define Z_SAFE_HOMING_X_POINT (((X_MIN_POS + X_MAX_POS) / 2) - 4) // X point for Z homing when homing all axis (G28).
996
+  #define Z_SAFE_HOMING_Y_POINT (((Y_MIN_POS + Y_MAX_POS) / 2) + 4) // Y point for Z homing when homing all axis (G28).
999
 #endif
997
 #endif
1000
 
998
 
1001
 // Homing speeds (mm/m)
999
 // Homing speeds (mm/m)
1035
 //
1033
 //
1036
 // M100 Free Memory Watcher
1034
 // M100 Free Memory Watcher
1037
 //
1035
 //
1038
-#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
1036
+//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
1039
 
1037
 
1040
 //
1038
 //
1041
 // G20/G21 Inch mode support
1039
 // G20/G21 Inch mode support
1619
  */
1617
  */
1620
 //#define FILAMENT_WIDTH_SENSOR
1618
 //#define FILAMENT_WIDTH_SENSOR
1621
 
1619
 
1622
-#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75  //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software.  Used for sensor reading validation
1620
+#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75   // (mm) Diameter of the filament generally used (3.0 or 1.75mm), also used in the slicer. Used to validate sensor reading.
1623
 
1621
 
1624
 #if ENABLED(FILAMENT_WIDTH_SENSOR)
1622
 #if ENABLED(FILAMENT_WIDTH_SENSOR)
1625
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0    // Index of the extruder that has the filament sensor (0,1,2,3)
1623
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0    // Index of the extruder that has the filament sensor (0,1,2,3)
1633
 
1631
 
1634
   // Display filament width on the LCD status line. Status messages will expire after 5 seconds.
1632
   // Display filament width on the LCD status line. Status messages will expire after 5 seconds.
1635
   //#define FILAMENT_LCD_DISPLAY
1633
   //#define FILAMENT_LCD_DISPLAY
1636
-#endif //FILAMENT_WIDTH_SENSOR
1634
+#endif
1637
 
1635
 
1638
 #endif // CONFIGURATION_H
1636
 #endif // CONFIGURATION_H

+ 1
- 1
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h View File

361
 // Default stepper release if idle. Set to 0 to deactivate.
361
 // Default stepper release if idle. Set to 0 to deactivate.
362
 // Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true.
362
 // Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true.
363
 // Time can be set by M18 and M84.
363
 // Time can be set by M18 and M84.
364
-#define DEFAULT_STEPPER_DEACTIVE_TIME 0    // usually is set to 120 seconds
364
+#define DEFAULT_STEPPER_DEACTIVE_TIME 0    // usually set to 120 seconds
365
 #define DISABLE_INACTIVE_X true
365
 #define DISABLE_INACTIVE_X true
366
 #define DISABLE_INACTIVE_Y true
366
 #define DISABLE_INACTIVE_Y true
367
 #define DISABLE_INACTIVE_Z true  // set to false if the nozzle will fall down on your printed part when print has finished.
367
 #define DISABLE_INACTIVE_Z true  // set to false if the nozzle will fall down on your printed part when print has finished.

+ 64
- 66
Marlin/example_configurations/gCreate_gMax1.5+/_Bootscreen.h View File

39
 
39
 
40
 // Width: 112, Height: 64
40
 // Width: 112, Height: 64
41
 const unsigned char custom_start_bmp[896] PROGMEM = {
41
 const unsigned char custom_start_bmp[896] PROGMEM = {
42
-	0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
43
-	0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
44
-	0x80, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
45
-	0x80, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
46
-	0x80, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
47
-	0x80, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
48
-	0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
49
-	0x80, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
50
-	0x80, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
51
-	0x80, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01,
52
-	0x80, 0x00, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x01, 0xc0, 0x01,
53
-	0x80, 0x00, 0x00, 0x06, 0x4d, 0x00, 0x00, 0x07, 0x38, 0x00, 0x00, 0x01, 0xc0, 0x01,
54
-	0x80, 0x00, 0x00, 0x0c, 0x26, 0x00, 0x0e, 0xe7, 0x39, 0xd3, 0xe1, 0xf3, 0xe7, 0xc1,
55
-	0x80, 0x00, 0x00, 0x19, 0x12, 0x00, 0x0f, 0xe7, 0x39, 0xf7, 0xf3, 0xfb, 0xef, 0xe1,
56
-	0x80, 0x00, 0x00, 0x37, 0xce, 0x00, 0x0e, 0xe7, 0x01, 0xf7, 0x73, 0xb9, 0xce, 0xe1,
57
-	0x80, 0x00, 0x00, 0x64, 0x66, 0x00, 0x0e, 0xe7, 0x01, 0xc7, 0xf3, 0xb9, 0xcf, 0xe1,
58
-	0x80, 0x00, 0x00, 0x4b, 0xa6, 0x00, 0x0e, 0xe7, 0x39, 0xc7, 0xf0, 0xf9, 0xcf, 0xe1,
59
-	0x80, 0x00, 0x00, 0xca, 0xb4, 0x00, 0x0f, 0xe7, 0x39, 0xc7, 0x03, 0xf9, 0xce, 0x01,
60
-	0x80, 0x00, 0x00, 0xcd, 0xa4, 0x00, 0x06, 0xe7, 0x39, 0xc7, 0x73, 0xb9, 0xce, 0xe1,
61
-	0x80, 0x00, 0x03, 0xa6, 0x6c, 0x00, 0x00, 0xe7, 0x39, 0xc7, 0x73, 0xb9, 0xce, 0xe1,
62
-	0x80, 0x00, 0xff, 0x13, 0xd8, 0x00, 0x0e, 0xe3, 0xf1, 0xc7, 0xf3, 0xf9, 0xef, 0xe1,
63
-	0x80, 0x01, 0x21, 0x88, 0x18, 0x00, 0x0f, 0xe1, 0xe1, 0xc3, 0xe1, 0xb9, 0xe7, 0xc1,
64
-	0x80, 0x06, 0x61, 0x16, 0x30, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
65
-	0x80, 0x04, 0x41, 0x23, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
66
-	0x80, 0x04, 0xfe, 0x41, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
67
-	0x80, 0x0b, 0x86, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x80, 0x00, 0x00, 0x01,
68
-	0x80, 0x1e, 0x01, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x80, 0x00, 0x00, 0x01,
69
-	0x80, 0x1c, 0x07, 0x22, 0x00, 0x00, 0x07, 0xbc, 0x3f, 0x9f, 0x81, 0xf8, 0xf1, 0xe1,
70
-	0x80, 0x08, 0x1f, 0xe2, 0x00, 0x00, 0x0f, 0xfc, 0x3f, 0xbf, 0x87, 0xfe, 0x71, 0xc1,
71
-	0x80, 0x00, 0x33, 0x62, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xb7, 0x87, 0x9e, 0x7b, 0xc1,
72
-	0x80, 0x00, 0xc2, 0x22, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xb7, 0x87, 0x9e, 0x7b, 0xc1,
73
-	0x80, 0x00, 0xc2, 0x3e, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x80, 0x7e, 0x3b, 0x81,
74
-	0x80, 0x01, 0xe6, 0x1e, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x83, 0xfe, 0x3f, 0x81,
75
-	0x80, 0x01, 0x3c, 0x12, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x87, 0x9e, 0x3b, 0x81,
76
-	0x80, 0x01, 0x1c, 0x26, 0x00, 0x00, 0x0f, 0xfc, 0x3d, 0xf7, 0x87, 0x9e, 0x7b, 0xc1,
77
-	0x80, 0x01, 0x70, 0x64, 0x00, 0x00, 0x07, 0xbc, 0x3c, 0xe7, 0x87, 0x9e, 0x7b, 0xc1,
78
-	0x80, 0x03, 0xc0, 0x58, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0xe7, 0x87, 0xfe, 0x71, 0xc1,
79
-	0x80, 0x0d, 0x80, 0xf0, 0x00, 0x00, 0x0f, 0x3c, 0x3c, 0xe7, 0x83, 0xde, 0xf1, 0xe1,
80
-	0x80, 0x1a, 0x00, 0xe0, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
81
-	0x80, 0x26, 0x00, 0x40, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
82
-	0x80, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
83
-	0x80, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
42
+  0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
43
+  0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
44
+  0x80, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
45
+  0x80, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
46
+  0x80, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
47
+  0x80, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
48
+  0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
49
+  0x80, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
50
+  0x80, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
51
+  0x80, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01,
52
+  0x80, 0x00, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x01, 0xc0, 0x01,
53
+  0x80, 0x00, 0x00, 0x06, 0x4d, 0x00, 0x00, 0x07, 0x38, 0x00, 0x00, 0x01, 0xc0, 0x01,
54
+  0x80, 0x00, 0x00, 0x0c, 0x26, 0x00, 0x0e, 0xe7, 0x39, 0xd3, 0xe1, 0xf3, 0xe7, 0xc1,
55
+  0x80, 0x00, 0x00, 0x19, 0x12, 0x00, 0x0f, 0xe7, 0x39, 0xf7, 0xf3, 0xfb, 0xef, 0xe1,
56
+  0x80, 0x00, 0x00, 0x37, 0xce, 0x00, 0x0e, 0xe7, 0x01, 0xf7, 0x73, 0xb9, 0xce, 0xe1,
57
+  0x80, 0x00, 0x00, 0x64, 0x66, 0x00, 0x0e, 0xe7, 0x01, 0xc7, 0xf3, 0xb9, 0xcf, 0xe1,
58
+  0x80, 0x00, 0x00, 0x4b, 0xa6, 0x00, 0x0e, 0xe7, 0x39, 0xc7, 0xf0, 0xf9, 0xcf, 0xe1,
59
+  0x80, 0x00, 0x00, 0xca, 0xb4, 0x00, 0x0f, 0xe7, 0x39, 0xc7, 0x03, 0xf9, 0xce, 0x01,
60
+  0x80, 0x00, 0x00, 0xcd, 0xa4, 0x00, 0x06, 0xe7, 0x39, 0xc7, 0x73, 0xb9, 0xce, 0xe1,
61
+  0x80, 0x00, 0x03, 0xa6, 0x6c, 0x00, 0x00, 0xe7, 0x39, 0xc7, 0x73, 0xb9, 0xce, 0xe1,
62
+  0x80, 0x00, 0xff, 0x13, 0xd8, 0x00, 0x0e, 0xe3, 0xf1, 0xc7, 0xf3, 0xf9, 0xef, 0xe1,
63
+  0x80, 0x01, 0x21, 0x88, 0x18, 0x00, 0x0f, 0xe1, 0xe1, 0xc3, 0xe1, 0xb9, 0xe7, 0xc1,
64
+  0x80, 0x06, 0x61, 0x16, 0x30, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
65
+  0x80, 0x04, 0x41, 0x23, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
66
+  0x80, 0x04, 0xfe, 0x41, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
67
+  0x80, 0x0b, 0x86, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x80, 0x00, 0x00, 0x01,
68
+  0x80, 0x1e, 0x01, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x80, 0x00, 0x00, 0x01,
69
+  0x80, 0x1c, 0x07, 0x22, 0x00, 0x00, 0x07, 0xbc, 0x3f, 0x9f, 0x81, 0xf8, 0xf1, 0xe1,
70
+  0x80, 0x08, 0x1f, 0xe2, 0x00, 0x00, 0x0f, 0xfc, 0x3f, 0xbf, 0x87, 0xfe, 0x71, 0xc1,
71
+  0x80, 0x00, 0x33, 0x62, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xb7, 0x87, 0x9e, 0x7b, 0xc1,
72
+  0x80, 0x00, 0xc2, 0x22, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xb7, 0x87, 0x9e, 0x7b, 0xc1,
73
+  0x80, 0x00, 0xc2, 0x3e, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x80, 0x7e, 0x3b, 0x81,
74
+  0x80, 0x01, 0xe6, 0x1e, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x83, 0xfe, 0x3f, 0x81,
75
+  0x80, 0x01, 0x3c, 0x12, 0x00, 0x00, 0x0f, 0x3c, 0x3d, 0xf7, 0x87, 0x9e, 0x3b, 0x81,
76
+  0x80, 0x01, 0x1c, 0x26, 0x00, 0x00, 0x0f, 0xfc, 0x3d, 0xf7, 0x87, 0x9e, 0x7b, 0xc1,
77
+  0x80, 0x01, 0x70, 0x64, 0x00, 0x00, 0x07, 0xbc, 0x3c, 0xe7, 0x87, 0x9e, 0x7b, 0xc1,
78
+  0x80, 0x03, 0xc0, 0x58, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0xe7, 0x87, 0xfe, 0x71, 0xc1,
79
+  0x80, 0x0d, 0x80, 0xf0, 0x00, 0x00, 0x0f, 0x3c, 0x3c, 0xe7, 0x83, 0xde, 0xf1, 0xe1,
80
+  0x80, 0x1a, 0x00, 0xe0, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
81
+  0x80, 0x26, 0x00, 0x40, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
82
+  0x80, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
83
+  0x80, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
84
 
84
 
85
-	0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1c, 0x03, 0xc0, 0x20, 0x10, 0x00, 0x01,
86
-	0x83, 0x24, 0x00, 0x00, 0x00, 0x00, 0x08, 0x92, 0x02, 0x20, 0x00, 0x10, 0x00, 0x01,
87
-	0x02, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x02, 0x23, 0x27, 0x39, 0x8c, 0xe1,
88
-	0x06, 0x38, 0x00, 0x00, 0x00, 0x00, 0x03, 0x11, 0x03, 0xc2, 0x24, 0x92, 0x49, 0x01,
89
-	0x04, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x02, 0x02, 0x24, 0x93, 0xc8, 0xc1,
90
-	0x0d, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x92, 0x02, 0x02, 0x24, 0x92, 0x08, 0x21,
91
-	0x08, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1c, 0x02, 0x02, 0x24, 0x99, 0xc9, 0xc1,
92
-	0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
85
+  0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1c, 0x03, 0xc0, 0x20, 0x10, 0x00, 0x01,
86
+  0x83, 0x24, 0x00, 0x00, 0x00, 0x00, 0x08, 0x92, 0x02, 0x20, 0x00, 0x10, 0x00, 0x01,
87
+  0x02, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x02, 0x23, 0x27, 0x39, 0x8c, 0xe1,
88
+  0x06, 0x38, 0x00, 0x00, 0x00, 0x00, 0x03, 0x11, 0x03, 0xc2, 0x24, 0x92, 0x49, 0x01,
89
+  0x04, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x02, 0x02, 0x24, 0x93, 0xc8, 0xc1,
90
+  0x0d, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x92, 0x02, 0x02, 0x24, 0x92, 0x08, 0x21,
91
+  0x08, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1c, 0x02, 0x02, 0x24, 0x99, 0xc9, 0xc1,
92
+  0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
93
 
93
 
94
-	0x10, 0x30, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x0f, 0xe0, 0x0f, 0x00, 0x01,
95
-	0x30, 0x20, 0x00, 0x37, 0x00, 0x00, 0x00, 0x12, 0x24, 0x08, 0x10, 0x09, 0x00, 0x01,
96
-	0x20, 0x30, 0x00, 0x6d, 0x80, 0x00, 0x00, 0x12, 0x24, 0x09, 0x88, 0x09, 0x00, 0x01,
97
-	0x10, 0x18, 0x1f, 0x60, 0xc0, 0x00, 0x00, 0x12, 0x24, 0x09, 0x48, 0x09, 0x00, 0x01,
98
-	0x30, 0x0c, 0x39, 0xe0, 0x60, 0x00, 0x00, 0x12, 0x24, 0x09, 0x90, 0x09, 0x00, 0x01,
99
-	0x30, 0x07, 0x90, 0x70, 0x60, 0x00, 0x00, 0x12, 0x24, 0x08, 0x60, 0x09, 0x00, 0x01,
100
-	0x10, 0x16, 0xf0, 0x18, 0x20, 0x00, 0x00, 0x12, 0x24, 0x08, 0x10, 0x09, 0x00, 0x01,
101
-	0x1a, 0x10, 0x60, 0x08, 0x30, 0x00, 0x00, 0x12, 0x24, 0x09, 0xc8, 0x09, 0x00, 0x01,
102
-	0x0b, 0x09, 0x80, 0x00, 0x30, 0x00, 0x00, 0x12, 0x24, 0x09, 0x24, 0x09, 0x00, 0x01,
103
-	0x0e, 0x07, 0x80, 0x00, 0x10, 0x00, 0x00, 0x13, 0xe4, 0x89, 0xc4, 0x89, 0xf9, 0x01,
104
-	0x06, 0x1e, 0x40, 0x10, 0x10, 0x00, 0x00, 0x10, 0x05, 0xc8, 0x09, 0xc8, 0x0b, 0x81,
105
-	0x06, 0x00, 0x40, 0x20, 0x10, 0x00, 0x00, 0x0f, 0xf8, 0x8f, 0xf0, 0x8f, 0xf9, 0x01,
106
-	0x03, 0x80, 0x00, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
107
-	0x01, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
94
+  0x10, 0x30, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x0f, 0xe0, 0x0f, 0x00, 0x01,
95
+  0x30, 0x20, 0x00, 0x37, 0x00, 0x00, 0x00, 0x12, 0x24, 0x08, 0x10, 0x09, 0x00, 0x01,
96
+  0x20, 0x30, 0x00, 0x6d, 0x80, 0x00, 0x00, 0x12, 0x24, 0x09, 0x88, 0x09, 0x00, 0x01,
97
+  0x10, 0x18, 0x1f, 0x60, 0xc0, 0x00, 0x00, 0x12, 0x24, 0x09, 0x48, 0x09, 0x00, 0x01,
98
+  0x30, 0x0c, 0x39, 0xe0, 0x60, 0x00, 0x00, 0x12, 0x24, 0x09, 0x90, 0x09, 0x00, 0x01,
99
+  0x30, 0x07, 0x90, 0x70, 0x60, 0x00, 0x00, 0x12, 0x24, 0x08, 0x60, 0x09, 0x00, 0x01,
100
+  0x10, 0x16, 0xf0, 0x18, 0x20, 0x00, 0x00, 0x12, 0x24, 0x08, 0x10, 0x09, 0x00, 0x01,
101
+  0x1a, 0x10, 0x60, 0x08, 0x30, 0x00, 0x00, 0x12, 0x24, 0x09, 0xc8, 0x09, 0x00, 0x01,
102
+  0x0b, 0x09, 0x80, 0x00, 0x30, 0x00, 0x00, 0x12, 0x24, 0x09, 0x24, 0x09, 0x00, 0x01,
103
+  0x0e, 0x07, 0x80, 0x00, 0x10, 0x00, 0x00, 0x13, 0xe4, 0x89, 0xc4, 0x89, 0xf9, 0x01,
104
+  0x06, 0x1e, 0x40, 0x10, 0x10, 0x00, 0x00, 0x10, 0x05, 0xc8, 0x09, 0xc8, 0x0b, 0x81,
105
+  0x06, 0x00, 0x40, 0x20, 0x10, 0x00, 0x00, 0x0f, 0xf8, 0x8f, 0xf0, 0x8f, 0xf9, 0x01,
106
+  0x03, 0x80, 0x00, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
107
+  0x01, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
108
 };
108
 };
109
-
110
-

+ 3
- 0
Marlin/language_en.h View File

408
 #ifndef MSG_ZPROBE_OUT
408
 #ifndef MSG_ZPROBE_OUT
409
   #define MSG_ZPROBE_OUT                      _UxGT("Z probe out. bed")
409
   #define MSG_ZPROBE_OUT                      _UxGT("Z probe out. bed")
410
 #endif
410
 #endif
411
+#ifndef MSG_BLTOUCH
412
+  #define MSG_BLTOUCH                         _UxGT("BLTouch")
413
+#endif
411
 #ifndef MSG_BLTOUCH_SELFTEST
414
 #ifndef MSG_BLTOUCH_SELFTEST
412
   #define MSG_BLTOUCH_SELFTEST                _UxGT("BLTouch Self-Test")
415
   #define MSG_BLTOUCH_SELFTEST                _UxGT("BLTouch Self-Test")
413
 #endif
416
 #endif

+ 1
- 1
Marlin/language_tr.h View File

233
 #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE  _UxGT("Daha Akıt")                                          // Daha Akıt
233
 #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE  _UxGT("Daha Akıt")                                          // Daha Akıt
234
 #define MSG_FILAMENT_CHANGE_OPTION_RESUME   _UxGT("Baskıyı sürdür")                                     // Baskıyı sürdür
234
 #define MSG_FILAMENT_CHANGE_OPTION_RESUME   _UxGT("Baskıyı sürdür")                                     // Baskıyı sürdür
235
 #define MSG_FILAMENT_CHANGE_MINTEMP         _UxGT("Min. Sıcaklık")                                      // Min. Sıcaklık:
235
 #define MSG_FILAMENT_CHANGE_MINTEMP         _UxGT("Min. Sıcaklık")                                      // Min. Sıcaklık:
236
-#define MSG_FILAMENT_CHANGE_NOZZLE          _UxGT("  Nozül: ")                                          //   Nozül: 
236
+#define MSG_FILAMENT_CHANGE_NOZZLE          _UxGT("  Nozül: ")                                          //   Nozül:
237
 
237
 
238
 #if LCD_HEIGHT >= 4
238
 #if LCD_HEIGHT >= 4
239
   // Up to 3 lines allowed
239
   // Up to 3 lines allowed

+ 36
- 48
Marlin/least_squares_fit.cpp View File

21
  */
21
  */
22
 
22
 
23
 /**
23
 /**
24
- * Least Squares Best Fit  By Roxy and Ed Williams
24
+ * Least Squares Best Fit by Roxy and Ed Williams
25
  *
25
  *
26
  * This algorithm is high speed and has a very small code footprint.
26
  * This algorithm is high speed and has a very small code footprint.
27
  * Its results are identical to both the Iterative Least-Squares published
27
  * Its results are identical to both the Iterative Least-Squares published
28
  * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE
28
  * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE
29
- * it saves roughly 10K of program memory.   It also does not require all of 
30
- * coordinates to be present during the calculations.  Each point can be 
29
+ * it saves roughly 10K of program memory. It also does not require all of
30
+ * coordinates to be present during the calculations. Each point can be
31
  * probed and then discarded.
31
  * probed and then discarded.
32
  *
32
  *
33
  */
33
  */
41
 
41
 
42
 #include "least_squares_fit.h"
42
 #include "least_squares_fit.h"
43
 
43
 
44
-void incremental_LSF_reset(struct linear_fit_data *lsf) {
45
-	lsf->n = 0;
46
-	lsf->A = 0.0;					// probably a memset() can be done to zero 
47
-	lsf->B = 0.0;                                   // this whole structure
48
-	lsf->D = 0.0;
49
-	lsf->xbar = lsf->ybar = lsf->zbar = 0.0;
50
-	lsf->x2bar = lsf->y2bar = lsf->z2bar = 0.0;
51
-	lsf->xybar = lsf->xzbar = lsf->yzbar = 0.0;
52
-	lsf->max_absx = lsf->max_absy = 0.0;
53
-    }
44
+void incremental_LSF_reset(struct linear_fit_data *lsf) { ZERO(lsf); }
54
 
45
 
55
 void incremental_LSF(struct linear_fit_data *lsf, float x, float y, float z) {
46
 void incremental_LSF(struct linear_fit_data *lsf, float x, float y, float z) {
56
-	lsf->xbar += x;
57
-	lsf->ybar += y;
58
-	lsf->zbar += z;
59
-	lsf->x2bar += x*x;
60
-	lsf->y2bar += y*y;
61
-	lsf->z2bar += z*z;
62
-	lsf->xybar += x*y;
63
-	lsf->xzbar += x*z;
64
-	lsf->yzbar += y*z;
65
-	lsf->max_absx = (fabs(x) > lsf->max_absx) ? fabs(x) : lsf->max_absx;
66
-	lsf->max_absy = (fabs(y) > lsf->max_absy) ? fabs(y) : lsf->max_absy;
67
-	lsf->n++;
68
-	return;
69
-  }
47
+  lsf->xbar += x;
48
+  lsf->ybar += y;
49
+  lsf->zbar += z;
50
+  lsf->x2bar += sq(x);
51
+  lsf->y2bar += sq(y);
52
+  lsf->z2bar += sq(z);
53
+  lsf->xybar += sq(x);
54
+  lsf->xzbar += sq(x);
55
+  lsf->yzbar += sq(y);
56
+  lsf->max_absx = max(fabs(x), lsf->max_absx);
57
+  lsf->max_absy = max(fabs(y), lsf->max_absy);
58
+  lsf->n++;
59
+}
70
 
60
 
71
 int finish_incremental_LSF(struct linear_fit_data *lsf) {
61
 int finish_incremental_LSF(struct linear_fit_data *lsf) {
72
-	float DD, N;
62
+  const float N = (float)lsf->n;
73
 
63
 
74
-	N = (float) lsf->n;
75
-	lsf->xbar /= N;
76
-	lsf->ybar /= N;
77
-	lsf->zbar /= N;
78
-	lsf->x2bar = lsf->x2bar/N - lsf->xbar*lsf->xbar;
79
-	lsf->y2bar = lsf->y2bar/N - lsf->ybar*lsf->ybar;
80
-	lsf->z2bar = lsf->z2bar/N - lsf->zbar*lsf->zbar;
81
-	lsf->xybar = lsf->xybar/N - lsf->xbar*lsf->ybar;
82
-	lsf->yzbar = lsf->yzbar/N - lsf->ybar*lsf->zbar;
83
-	lsf->xzbar = lsf->xzbar/N - lsf->xbar*lsf->zbar;
64
+  lsf->xbar /= N;
65
+  lsf->ybar /= N;
66
+  lsf->zbar /= N;
67
+  lsf->x2bar = lsf->x2bar / N - lsf->xbar * lsf->xbar;
68
+  lsf->y2bar = lsf->y2bar / N - lsf->ybar * lsf->ybar;
69
+  lsf->z2bar = lsf->z2bar / N - lsf->zbar * lsf->zbar;
70
+  lsf->xybar = lsf->xybar / N - lsf->xbar * lsf->ybar;
71
+  lsf->yzbar = lsf->yzbar / N - lsf->ybar * lsf->zbar;
72
+  lsf->xzbar = lsf->xzbar / N - lsf->xbar * lsf->zbar;
84
 
73
 
85
-	DD = lsf->x2bar*lsf->y2bar - lsf->xybar*lsf->xybar;
86
-	if (fabs(DD) <= 1e-10*(lsf->max_absx+lsf->max_absy)) 
87
-	  return -1;
88
-	
89
-	lsf->A = (lsf->yzbar*lsf->xybar - lsf->xzbar*lsf->y2bar) / DD;
90
-	lsf->B = (lsf->xzbar*lsf->xybar - lsf->yzbar*lsf->x2bar) / DD;
91
-	lsf->D = -(lsf->zbar + lsf->A*lsf->xbar + lsf->B*lsf->ybar);
92
-	return 0;
93
-}
94
-#endif
74
+  const float DD = lsf->x2bar * lsf->y2bar - sq(lsf->xybar);
75
+  if (fabs(DD) <= 1e-10 * (lsf->max_absx + lsf->max_absy))
76
+    return -1;
95
 
77
 
78
+  lsf->A = (lsf->yzbar * lsf->xybar - lsf->xzbar * lsf->y2bar) / DD;
79
+  lsf->B = (lsf->xzbar * lsf->xybar - lsf->yzbar * lsf->x2bar) / DD;
80
+  lsf->D = -(lsf->zbar + lsf->A * lsf->xbar + lsf->B * lsf->ybar);
81
+  return 0;
82
+}
96
 
83
 
84
+#endif // AUTO_BED_LEVELING_UBL

+ 7
- 7
Marlin/least_squares_fit.h View File

27
  * Its results are identical to both the Iterative Least-Squares published
27
  * Its results are identical to both the Iterative Least-Squares published
28
  * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE
28
  * earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE
29
  * it saves roughly 10K of program memory.   And even better...  the data
29
  * it saves roughly 10K of program memory.   And even better...  the data
30
- * fed into the algorithm does not need to all be present at the same time.  
30
+ * fed into the algorithm does not need to all be present at the same time.
31
  * A point can be probed and its values fed into the algorithm and then discarded.
31
  * A point can be probed and its values fed into the algorithm and then discarded.
32
  *
32
  *
33
  */
33
  */
42
 
42
 
43
 struct linear_fit_data {
43
 struct linear_fit_data {
44
   int n;
44
   int n;
45
-  float xbar, ybar, zbar;
46
-  float x2bar, y2bar, z2bar;
47
-  float xybar, xzbar, yzbar;
48
-  float max_absx, max_absy;
49
-  float A, B, D;
45
+  float xbar, ybar, zbar,
46
+        x2bar, y2bar, z2bar,
47
+        xybar, xzbar, yzbar,
48
+        max_absx, max_absy,
49
+        A, B, D;
50
 };
50
 };
51
 
51
 
52
-void incremental_LSF_reset(struct linear_fit_data *); 
52
+void incremental_LSF_reset(struct linear_fit_data *);
53
 void incremental_LSF(struct linear_fit_data *, float x, float y, float z);
53
 void incremental_LSF(struct linear_fit_data *, float x, float y, float z);
54
 int finish_incremental_LSF(struct linear_fit_data *);
54
 int finish_incremental_LSF(struct linear_fit_data *);
55
 
55
 

+ 6
- 6
Marlin/softspi.h View File

19
  */
19
  */
20
 static inline __attribute__((always_inline))
20
 static inline __attribute__((always_inline))
21
 void fastDigitalWrite(uint8_t pin, bool value) {
21
 void fastDigitalWrite(uint8_t pin, bool value) {
22
-	if (value) {
23
-		*portSetRegister(pin) = 1;
24
-	} else {
25
-		*portClearRegister(pin) = 1;
26
-	}
22
+  if (value) {
23
+    *portSetRegister(pin) = 1;
24
+  } else {
25
+    *portClearRegister(pin) = 1;
26
+  }
27
 }
27
 }
28
 #else  // CORE_TEENSY
28
 #else  // CORE_TEENSY
29
 //------------------------------------------------------------------------------
29
 //------------------------------------------------------------------------------
574
   /** Parenthesis operator
574
   /** Parenthesis operator
575
    * @return Pin's level
575
    * @return Pin's level
576
    */
576
    */
577
-	inline operator bool () const __attribute__((always_inline)) {
577
+  inline operator bool () const __attribute__((always_inline)) {
578
     return read();
578
     return read();
579
   }
579
   }
580
   //----------------------------------------------------------------------------
580
   //----------------------------------------------------------------------------

+ 22
- 50
Marlin/ubl.h View File

91
 
91
 
92
     public:
92
     public:
93
 
93
 
94
-//
95
-// Please do not put STATIC qualifiers in front of ANYTHING in this file.   You WILL cause problems by doing that.
96
-// The GCC optimizer inlines static functions and this DRAMATICALLY increases the size of the stack frame of 
97
-// functions that call STATIC functions.
98
-//
99
       void find_mean_mesh_height();
94
       void find_mean_mesh_height();
100
       void shift_mesh_height();
95
       void shift_mesh_height();
101
       void probe_entire_mesh(const float &lx, const float &ly, const bool do_ubl_mesh_map, const bool stow_probe, bool do_furthest);
96
       void probe_entire_mesh(const float &lx, const float &ly, const bool do_ubl_mesh_map, const bool stow_probe, bool do_furthest);
104
       void manually_probe_remaining_mesh(const float &lx, const float &ly, const float &z_clearance, const float &card_thickness, const bool do_ubl_mesh_map);
99
       void manually_probe_remaining_mesh(const float &lx, const float &ly, const float &z_clearance, const float &card_thickness, const bool do_ubl_mesh_map);
105
       void save_ubl_active_state_and_disable();
100
       void save_ubl_active_state_and_disable();
106
       void restore_ubl_active_state_and_leave();
101
       void restore_ubl_active_state_and_leave();
107
-      void g29_what_command(); 
108
-//
109
-// Please do not put STATIC qualifiers in front of ANYTHING in this file.   You WILL cause problems by doing that.
110
-// The GCC optimizer inlines static functions and this DRAMATICALLY increases the size of the stack frame of 
111
-// functions that call STATIC functions.
112
-//
102
+      void g29_what_command();
113
       void g29_eeprom_dump() ;
103
       void g29_eeprom_dump() ;
114
       void g29_compare_current_mesh_to_stored_mesh();
104
       void g29_compare_current_mesh_to_stored_mesh();
115
       void fine_tune_mesh(const float &lx, const float &ly, const bool do_ubl_mesh_map);
105
       void fine_tune_mesh(const float &lx, const float &ly, const bool do_ubl_mesh_map);
116
       void smart_fill_mesh();
106
       void smart_fill_mesh();
117
       void display_map(const int);
107
       void display_map(const int);
118
       void reset();
108
       void reset();
119
-//
120
-// Please do not put STATIC qualifiers in front of ANYTHING in this file.   You WILL cause problems by doing that.
121
-// The GCC optimizer inlines static functions and this DRAMATICALLY increases the size of the stack frame of 
122
-// functions that call STATIC functions.
123
-//
124
       void invalidate();
109
       void invalidate();
125
       void store_state();
110
       void store_state();
126
       void load_state();
111
       void load_state();
134
 
119
 
135
       // 15 is the maximum nubmer of grid points supported + 1 safety margin for now,
120
       // 15 is the maximum nubmer of grid points supported + 1 safety margin for now,
136
       // until determinism prevails
121
       // until determinism prevails
137
-      constexpr static float mesh_index_to_xpos[16] PROGMEM = { UBL_MESH_MIN_X+0*(MESH_X_DIST),
138
-                                UBL_MESH_MIN_X+1*(MESH_X_DIST), UBL_MESH_MIN_X+2*(MESH_X_DIST),
139
-                                UBL_MESH_MIN_X+3*(MESH_X_DIST), UBL_MESH_MIN_X+4*(MESH_X_DIST),
140
-                                UBL_MESH_MIN_X+5*(MESH_X_DIST), UBL_MESH_MIN_X+6*(MESH_X_DIST),
141
-                                UBL_MESH_MIN_X+7*(MESH_X_DIST), UBL_MESH_MIN_X+8*(MESH_X_DIST),
142
-                                UBL_MESH_MIN_X+9*(MESH_X_DIST), UBL_MESH_MIN_X+10*(MESH_X_DIST),
143
-                                UBL_MESH_MIN_X+11*(MESH_X_DIST), UBL_MESH_MIN_X+12*(MESH_X_DIST),
144
-                                UBL_MESH_MIN_X+13*(MESH_X_DIST), UBL_MESH_MIN_X+14*(MESH_X_DIST),
145
-                                UBL_MESH_MIN_X+15*(MESH_X_DIST) };
146
-
147
-      constexpr static float mesh_index_to_ypos[16] PROGMEM = { UBL_MESH_MIN_Y+0*(MESH_Y_DIST),
148
-                                UBL_MESH_MIN_Y+1*(MESH_Y_DIST), UBL_MESH_MIN_Y+2*(MESH_Y_DIST),
149
-                                UBL_MESH_MIN_Y+3*(MESH_Y_DIST), UBL_MESH_MIN_Y+4*(MESH_Y_DIST),
150
-                                UBL_MESH_MIN_Y+5*(MESH_Y_DIST), UBL_MESH_MIN_Y+6*(MESH_Y_DIST),
151
-                                UBL_MESH_MIN_Y+7*(MESH_Y_DIST), UBL_MESH_MIN_Y+8*(MESH_Y_DIST),
152
-                                UBL_MESH_MIN_Y+9*(MESH_Y_DIST), UBL_MESH_MIN_Y+10*(MESH_Y_DIST),
153
-                                UBL_MESH_MIN_Y+11*(MESH_Y_DIST), UBL_MESH_MIN_Y+12*(MESH_Y_DIST),
154
-                                UBL_MESH_MIN_Y+13*(MESH_Y_DIST), UBL_MESH_MIN_Y+14*(MESH_Y_DIST),
155
-                                UBL_MESH_MIN_Y+15*(MESH_Y_DIST) };
122
+      constexpr static float mesh_index_to_xpos[16] PROGMEM = {
123
+                                UBL_MESH_MIN_X +  0 * (MESH_X_DIST), UBL_MESH_MIN_X +  1 * (MESH_X_DIST),
124
+                                UBL_MESH_MIN_X +  2 * (MESH_X_DIST), UBL_MESH_MIN_X +  3 * (MESH_X_DIST),
125
+                                UBL_MESH_MIN_X +  4 * (MESH_X_DIST), UBL_MESH_MIN_X +  5 * (MESH_X_DIST),
126
+                                UBL_MESH_MIN_X +  6 * (MESH_X_DIST), UBL_MESH_MIN_X +  7 * (MESH_X_DIST),
127
+                                UBL_MESH_MIN_X +  8 * (MESH_X_DIST), UBL_MESH_MIN_X +  9 * (MESH_X_DIST),
128
+                                UBL_MESH_MIN_X + 10 * (MESH_X_DIST), UBL_MESH_MIN_X + 11 * (MESH_X_DIST),
129
+                                UBL_MESH_MIN_X + 12 * (MESH_X_DIST), UBL_MESH_MIN_X + 13 * (MESH_X_DIST),
130
+                                UBL_MESH_MIN_X + 14 * (MESH_X_DIST), UBL_MESH_MIN_X + 15 * (MESH_X_DIST)
131
+                              };
132
+
133
+      constexpr static float mesh_index_to_ypos[16] PROGMEM = {
134
+                                UBL_MESH_MIN_Y +  0 * (MESH_Y_DIST), UBL_MESH_MIN_Y +  1 * (MESH_Y_DIST),
135
+                                UBL_MESH_MIN_Y +  2 * (MESH_Y_DIST), UBL_MESH_MIN_Y +  3 * (MESH_Y_DIST),
136
+                                UBL_MESH_MIN_Y +  4 * (MESH_Y_DIST), UBL_MESH_MIN_Y +  5 * (MESH_Y_DIST),
137
+                                UBL_MESH_MIN_Y +  6 * (MESH_Y_DIST), UBL_MESH_MIN_Y +  7 * (MESH_Y_DIST),
138
+                                UBL_MESH_MIN_Y +  8 * (MESH_Y_DIST), UBL_MESH_MIN_Y +  9 * (MESH_Y_DIST),
139
+                                UBL_MESH_MIN_Y + 10 * (MESH_Y_DIST), UBL_MESH_MIN_Y + 11 * (MESH_Y_DIST),
140
+                                UBL_MESH_MIN_Y + 12 * (MESH_Y_DIST), UBL_MESH_MIN_Y + 13 * (MESH_Y_DIST),
141
+                                UBL_MESH_MIN_Y + 14 * (MESH_Y_DIST), UBL_MESH_MIN_Y + 15 * (MESH_Y_DIST)
142
+                              };
156
 
143
 
157
       static bool g26_debug_flag, has_control_of_lcd_panel;
144
       static bool g26_debug_flag, has_control_of_lcd_panel;
158
 
145
 
163
 
150
 
164
       unified_bed_leveling();
151
       unified_bed_leveling();
165
 
152
 
166
-//
167
-// Please do not put STATIC qualifiers in front of ANYTHING in this file.   You WILL cause problems by doing that.
168
-// The GCC optimizer inlines static functions and this DRAMATICALLY increases the size of the stack frame of 
169
-// functions that call STATIC functions.
170
-//
171
       FORCE_INLINE void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; }
153
       FORCE_INLINE void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; }
172
         int8_t get_cell_index_x(const float &x) {
154
         int8_t get_cell_index_x(const float &x) {
173
         const int8_t cx = (x - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST));
155
         const int8_t cx = (x - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST));
184
                                                             // that is OK because something else should be keeping that from
166
                                                             // that is OK because something else should be keeping that from
185
                                                             // happening and should not be worried about at this level.
167
                                                             // happening and should not be worried about at this level.
186
 
168
 
187
-//
188
-// Please do not put STATIC qualifiers in front of ANYTHING in this file.   You WILL cause problems by doing that.
189
-// The GCC optimizer inlines static functions and this DRAMATICALLY increases the size of the stack frame of 
190
-// functions that call STATIC functions.
191
-//
192
       int8_t find_closest_x_index(const float &x) {
169
       int8_t find_closest_x_index(const float &x) {
193
         const int8_t px = (x - (UBL_MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST));
170
         const int8_t px = (x - (UBL_MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST));
194
         return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1;
171
         return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1;
217
       FORCE_INLINE float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) {
194
       FORCE_INLINE float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) {
218
         return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1);
195
         return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1);
219
       }
196
       }
220
-//
221
-// Please do not put STATIC qualifiers in front of ANYTHING in this file.   You WILL cause problems by doing that.
222
-// The GCC optimizer inlines static functions and this DRAMATICALLY increases the size of the stack frame of 
223
-// functions that call STATIC functions.
224
-//
225
 
197
 
226
       /**
198
       /**
227
        * z_correction_for_x_on_horizontal_mesh_line is an optimization for
199
        * z_correction_for_x_on_horizontal_mesh_line is an optimization for

+ 32
- 33
Marlin/ubl_G29.cpp View File

50
   extern bool code_has_value();
50
   extern bool code_has_value();
51
   extern float probe_pt(float x, float y, bool, int);
51
   extern float probe_pt(float x, float y, bool, int);
52
   extern bool set_probe_deployed(bool);
52
   extern bool set_probe_deployed(bool);
53
-  void smart_fill_mesh();  
53
+  void smart_fill_mesh();
54
 
54
 
55
   bool ProbeStay = true;
55
   bool ProbeStay = true;
56
 
56
 
57
-
58
   #define SIZE_OF_LITTLE_RAISE 0
57
   #define SIZE_OF_LITTLE_RAISE 0
59
   #define BIG_RAISE_NOT_NEEDED 0
58
   #define BIG_RAISE_NOT_NEEDED 0
60
   extern void lcd_quick_feedback();
59
   extern void lcd_quick_feedback();
189
    *   P3    Phase 3    Fill the unpopulated regions of the Mesh with a fixed value. There are two different paths the
188
    *   P3    Phase 3    Fill the unpopulated regions of the Mesh with a fixed value. There are two different paths the
190
    *                    user can go down.  If the user specifies the value using the C parameter, the closest invalid
189
    *                    user can go down.  If the user specifies the value using the C parameter, the closest invalid
191
    *                    mesh points to the nozzle will be filled.   The user can specify a repeat count using the R
190
    *                    mesh points to the nozzle will be filled.   The user can specify a repeat count using the R
192
-   *                    parameter with the C version of the command. 
191
+   *                    parameter with the C version of the command.
193
    *
192
    *
194
-   *                    A second version of the fill command is available if no C constant is specified.  Not 
193
+   *                    A second version of the fill command is available if no C constant is specified.  Not
195
    *                    specifying a C constant will invoke the 'Smart Fill' algorithm.  The G29 P3 command will search
194
    *                    specifying a C constant will invoke the 'Smart Fill' algorithm.  The G29 P3 command will search
196
    *                    from the edges of the mesh inward looking for invalid mesh points.  It will look at the next
195
    *                    from the edges of the mesh inward looking for invalid mesh points.  It will look at the next
197
    *                    several mesh points to determine if the print bed is sloped up or down.  If the bed is sloped
196
    *                    several mesh points to determine if the print bed is sloped up or down.  If the bed is sloped
198
-   *                    upward from the invalid mesh point, it will be replaced with the value of the nearest mesh point. 
197
+   *                    upward from the invalid mesh point, it will be replaced with the value of the nearest mesh point.
199
    *                    If the bed is sloped downward from the invalid mesh point, it will be replaced with a value that
198
    *                    If the bed is sloped downward from the invalid mesh point, it will be replaced with a value that
200
    *                    puts all three points in a line.   The second version of the G29 P3 command is a quick, easy and
199
    *                    puts all three points in a line.   The second version of the G29 P3 command is a quick, easy and
201
    *                    usually safe way to populate the unprobed regions of your mesh so you can continue to the G26
200
    *                    usually safe way to populate the unprobed regions of your mesh so you can continue to the G26
336
       repetition_cnt = code_has_value() ? code_value_int() : 1;
335
       repetition_cnt = code_has_value() ? code_value_int() : 1;
337
       while (repetition_cnt--) {
336
       while (repetition_cnt--) {
338
         if (cnt > 20) { cnt = 0; idle(); }
337
         if (cnt > 20) { cnt = 0; idle(); }
339
-        const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, x_pos, y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false); 
338
+        const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, x_pos, y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false);
340
         if (location.x_index < 0) {
339
         if (location.x_index < 0) {
341
           SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n");
340
           SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n");
342
           break;            // No more invalid Mesh Points to populate
341
           break;            // No more invalid Mesh Points to populate
461
 
460
 
462
         case 3: {
461
         case 3: {
463
           //
462
           //
464
-          // Populate invalid Mesh areas.  Two choices are available to the user.  The user can 
463
+          // Populate invalid Mesh areas.  Two choices are available to the user.  The user can
465
           // specify the constant to be used with a C # paramter.   Or the user can allow the G29 P3 command to
464
           // specify the constant to be used with a C # paramter.   Or the user can allow the G29 P3 command to
466
           // apply a 'reasonable' constant to the invalid mesh point.  Some caution and scrutiny should be used
465
           // apply a 'reasonable' constant to the invalid mesh point.  Some caution and scrutiny should be used
467
           // on either of these paths!
466
           // on either of these paths!
812
      * Z is negative, we need to invert the sign of all components of the vector
811
      * Z is negative, we need to invert the sign of all components of the vector
813
      */
812
      */
814
     if ( normal.z < 0.0 ) {
813
     if ( normal.z < 0.0 ) {
815
-      normal.x = -normal.x; 
816
-      normal.y = -normal.y; 
817
-      normal.z = -normal.z; 
814
+      normal.x = -normal.x;
815
+      normal.y = -normal.y;
816
+      normal.z = -normal.z;
818
     }
817
     }
819
 
818
 
820
     rotation = matrix_3x3::create_look_at( vector_3( normal.x,  normal.y, 1));
819
     rotation = matrix_3x3::create_look_at( vector_3( normal.x,  normal.y, 1));
864
     for (i = 0; i < GRID_MAX_POINTS_X; i++) {
863
     for (i = 0; i < GRID_MAX_POINTS_X; i++) {
865
       for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
864
       for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
866
         float x_tmp, y_tmp, z_tmp;
865
         float x_tmp, y_tmp, z_tmp;
867
-          x_tmp = pgm_read_float(ubl.mesh_index_to_xpos[i]); 
866
+          x_tmp = pgm_read_float(ubl.mesh_index_to_xpos[i]);
868
           y_tmp = pgm_read_float(ubl.mesh_index_to_ypos[j]);
867
           y_tmp = pgm_read_float(ubl.mesh_index_to_ypos[j]);
869
           z_tmp = ubl.z_values[i][j];
868
           z_tmp = ubl.z_values[i][j];
870
           #if ENABLED(DEBUG_LEVELING_FEATURE)
869
           #if ENABLED(DEBUG_LEVELING_FEATURE)
948
     float last_x = -9999.99, last_y = -9999.99;
947
     float last_x = -9999.99, last_y = -9999.99;
949
     mesh_index_pair location;
948
     mesh_index_pair location;
950
     do {
949
     do {
951
-      location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_NOZZLE_AS_REFERENCE, NULL, false); 
950
+      location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_NOZZLE_AS_REFERENCE, NULL, false);
952
       // It doesn't matter if the probe can't reach the NAN location. This is a manual probe.
951
       // It doesn't matter if the probe can't reach the NAN location. This is a manual probe.
953
       if (location.x_index < 0 && location.y_index < 0) continue;
952
       if (location.x_index < 0 && location.y_index < 0) continue;
954
 
953
 
1416
     do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
1415
     do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
1417
     do_blocking_move_to_xy(lx, ly);
1416
     do_blocking_move_to_xy(lx, ly);
1418
     do {
1417
     do {
1419
-      location = find_closest_mesh_point_of_type(SET_IN_BITMAP, lx, ly, USE_NOZZLE_AS_REFERENCE, not_done, false); 
1418
+      location = find_closest_mesh_point_of_type(SET_IN_BITMAP, lx, ly, USE_NOZZLE_AS_REFERENCE, not_done, false);
1420
                                                                                               // It doesn't matter if the probe can not reach this
1419
                                                                                               // It doesn't matter if the probe can not reach this
1421
                                                                                               // location. This is a manual edit of the Mesh Point.
1420
                                                                                               // location. This is a manual edit of the Mesh Point.
1422
       if (location.x_index < 0 && location.y_index < 0) continue; // abort if we can't find any more points.
1421
       if (location.x_index < 0 && location.y_index < 0) continue; // abort if we can't find any more points.
1501
   }
1500
   }
1502
 
1501
 
1503
   //
1502
   //
1504
-  // The routine provides the 'Smart Fill' capability.  It scans from the 
1503
+  // The routine provides the 'Smart Fill' capability.  It scans from the
1505
   // outward edges of the mesh towards the center.  If it finds an invalid
1504
   // outward edges of the mesh towards the center.  If it finds an invalid
1506
   // location, it uses the next two points (assumming they are valid) to
1505
   // location, it uses the next two points (assumming they are valid) to
1507
   // calculate a 'reasonable' value for the unprobed mesh point.
1506
   // calculate a 'reasonable' value for the unprobed mesh point.
1511
     for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {             // Bottom of the mesh looking up
1510
     for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {             // Bottom of the mesh looking up
1512
       for (uint8_t y = 0; y < GRID_MAX_POINTS_Y-2; y++) {
1511
       for (uint8_t y = 0; y < GRID_MAX_POINTS_Y-2; y++) {
1513
         if (isnan(ubl.z_values[x][y])) {
1512
         if (isnan(ubl.z_values[x][y])) {
1514
-          if (isnan(ubl.z_values[x][y+1]))                        // we only deal with the first NAN next to a block of 
1513
+          if (isnan(ubl.z_values[x][y+1]))                        // we only deal with the first NAN next to a block of
1515
             continue;                                             // good numbers.  we want 2 good numbers to extrapolate off of.
1514
             continue;                                             // good numbers.  we want 2 good numbers to extrapolate off of.
1516
-          if (isnan(ubl.z_values[x][y+2]))  
1517
-            continue;                      
1515
+          if (isnan(ubl.z_values[x][y+2]))
1516
+            continue;
1518
           if (ubl.z_values[x][y+1] < ubl.z_values[x][y+2])        // The bed is angled down near this edge. So to be safe, we
1517
           if (ubl.z_values[x][y+1] < ubl.z_values[x][y+2])        // The bed is angled down near this edge. So to be safe, we
1519
             ubl.z_values[x][y] = ubl.z_values[x][y+1];            // use the closest value, which is probably a little too high
1518
             ubl.z_values[x][y] = ubl.z_values[x][y+1];            // use the closest value, which is probably a little too high
1520
           else {
1519
           else {
1521
-            diff = ubl.z_values[x][y+1] - ubl.z_values[x][y+2];   // The bed is angled up near this edge. So we will use the closest 
1520
+            diff = ubl.z_values[x][y+1] - ubl.z_values[x][y+2];   // The bed is angled up near this edge. So we will use the closest
1522
             ubl.z_values[x][y] = ubl.z_values[x][y+1] + diff;     // height and add in the difference between that and the next point
1521
             ubl.z_values[x][y] = ubl.z_values[x][y+1] + diff;     // height and add in the difference between that and the next point
1523
           }
1522
           }
1524
           break;
1523
           break;
1528
     for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {             // Top of the mesh looking down
1527
     for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) {             // Top of the mesh looking down
1529
       for (uint8_t y=GRID_MAX_POINTS_Y-1; y>=1; y--) {
1528
       for (uint8_t y=GRID_MAX_POINTS_Y-1; y>=1; y--) {
1530
         if (isnan(ubl.z_values[x][y])) {
1529
         if (isnan(ubl.z_values[x][y])) {
1531
-          if (isnan(ubl.z_values[x][y-1]))                        // we only deal with the first NAN next to a block of 
1530
+          if (isnan(ubl.z_values[x][y-1]))                        // we only deal with the first NAN next to a block of
1532
             continue;                                             // good numbers.  we want 2 good numbers to extrapolate off of.
1531
             continue;                                             // good numbers.  we want 2 good numbers to extrapolate off of.
1533
-          if (isnan(ubl.z_values[x][y-2]))  
1534
-            continue;                      
1532
+          if (isnan(ubl.z_values[x][y-2]))
1533
+            continue;
1535
           if (ubl.z_values[x][y-1] < ubl.z_values[x][y-2])        // The bed is angled down near this edge. So to be safe, we
1534
           if (ubl.z_values[x][y-1] < ubl.z_values[x][y-2])        // The bed is angled down near this edge. So to be safe, we
1536
             ubl.z_values[x][y] = ubl.z_values[x][y-1];            // use the closest value, which is probably a little too high
1535
             ubl.z_values[x][y] = ubl.z_values[x][y-1];            // use the closest value, which is probably a little too high
1537
           else {
1536
           else {
1538
-            diff = ubl.z_values[x][y-1] - ubl.z_values[x][y-2];   // The bed is angled up near this edge. So we will use the closest 
1537
+            diff = ubl.z_values[x][y-1] - ubl.z_values[x][y-2];   // The bed is angled up near this edge. So we will use the closest
1539
             ubl.z_values[x][y] = ubl.z_values[x][y-1] + diff;     // height and add in the difference between that and the next point
1538
             ubl.z_values[x][y] = ubl.z_values[x][y-1] + diff;     // height and add in the difference between that and the next point
1540
           }
1539
           }
1541
           break;
1540
           break;
1545
     for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
1544
     for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
1546
       for (uint8_t x = 0; x < GRID_MAX_POINTS_X-2; x++) {         // Left side of the mesh looking right
1545
       for (uint8_t x = 0; x < GRID_MAX_POINTS_X-2; x++) {         // Left side of the mesh looking right
1547
         if (isnan(ubl.z_values[x][y])) {
1546
         if (isnan(ubl.z_values[x][y])) {
1548
-          if (isnan(ubl.z_values[x+1][y]))                        // we only deal with the first NAN next to a block of 
1547
+          if (isnan(ubl.z_values[x+1][y]))                        // we only deal with the first NAN next to a block of
1549
             continue;                                             // good numbers.  we want 2 good numbers to extrapolate off of.
1548
             continue;                                             // good numbers.  we want 2 good numbers to extrapolate off of.
1550
-          if (isnan(ubl.z_values[x+2][y]))  
1551
-            continue;                      
1549
+          if (isnan(ubl.z_values[x+2][y]))
1550
+            continue;
1552
           if (ubl.z_values[x+1][y] < ubl.z_values[x+2][y])        // The bed is angled down near this edge. So to be safe, we
1551
           if (ubl.z_values[x+1][y] < ubl.z_values[x+2][y])        // The bed is angled down near this edge. So to be safe, we
1553
             ubl.z_values[x][y] = ubl.z_values[x][y+1];            // use the closest value, which is probably a little too high
1552
             ubl.z_values[x][y] = ubl.z_values[x][y+1];            // use the closest value, which is probably a little too high
1554
           else {
1553
           else {
1555
-            diff = ubl.z_values[x+1][y] - ubl.z_values[x+2][y];   // The bed is angled up near this edge. So we will use the closest 
1554
+            diff = ubl.z_values[x+1][y] - ubl.z_values[x+2][y];   // The bed is angled up near this edge. So we will use the closest
1556
             ubl.z_values[x][y] = ubl.z_values[x+1][y] + diff;     // height and add in the difference between that and the next point
1555
             ubl.z_values[x][y] = ubl.z_values[x+1][y] + diff;     // height and add in the difference between that and the next point
1557
           }
1556
           }
1558
           break;
1557
           break;
1562
     for (uint8_t y=0; y < GRID_MAX_POINTS_Y; y++) {
1561
     for (uint8_t y=0; y < GRID_MAX_POINTS_Y; y++) {
1563
       for (uint8_t x=GRID_MAX_POINTS_X-1; x>=1; x--) {            // Right side of the mesh looking left
1562
       for (uint8_t x=GRID_MAX_POINTS_X-1; x>=1; x--) {            // Right side of the mesh looking left
1564
         if (isnan(ubl.z_values[x][y])) {
1563
         if (isnan(ubl.z_values[x][y])) {
1565
-          if (isnan(ubl.z_values[x-1][y]))                        // we only deal with the first NAN next to a block of 
1564
+          if (isnan(ubl.z_values[x-1][y]))                        // we only deal with the first NAN next to a block of
1566
             continue;                                             // good numbers.  we want 2 good numbers to extrapolate off of.
1565
             continue;                                             // good numbers.  we want 2 good numbers to extrapolate off of.
1567
-          if (isnan(ubl.z_values[x-2][y]))  
1568
-            continue;                      
1566
+          if (isnan(ubl.z_values[x-2][y]))
1567
+            continue;
1569
           if (ubl.z_values[x-1][y] < ubl.z_values[x-2][y])        // The bed is angled down near this edge. So to be safe, we
1568
           if (ubl.z_values[x-1][y] < ubl.z_values[x-2][y])        // The bed is angled down near this edge. So to be safe, we
1570
             ubl.z_values[x][y] = ubl.z_values[x-1][y];            // use the closest value, which is probably a little too high
1569
             ubl.z_values[x][y] = ubl.z_values[x-1][y];            // use the closest value, which is probably a little too high
1571
           else {
1570
           else {
1572
-            diff = ubl.z_values[x-1][y] - ubl.z_values[x-2][y];   // The bed is angled up near this edge. So we will use the closest 
1571
+            diff = ubl.z_values[x-1][y] - ubl.z_values[x-2][y];   // The bed is angled up near this edge. So we will use the closest
1573
             ubl.z_values[x][y] = ubl.z_values[x-1][y] + diff;     // height and add in the difference between that and the next point
1572
             ubl.z_values[x][y] = ubl.z_values[x-1][y] + diff;     // height and add in the difference between that and the next point
1574
           }
1573
           }
1575
           break;
1574
           break;
1576
-        } 
1575
+        }
1577
       }
1576
       }
1578
     }
1577
     }
1579
   }
1578
   }
1600
     for(ix=0; ix<grid_size; ix++) {
1599
     for(ix=0; ix<grid_size; ix++) {
1601
       x = ((float)x_min) + ix*dx;
1600
       x = ((float)x_min) + ix*dx;
1602
       for(iy=0; iy<grid_size; iy++) {
1601
       for(iy=0; iy<grid_size; iy++) {
1603
-        if (zig_zag) 
1602
+        if (zig_zag)
1604
           y = ((float)y_min) + (grid_size-iy-1)*dy;
1603
           y = ((float)y_min) + (grid_size-iy-1)*dy;
1605
         else
1604
         else
1606
           y = ((float)y_min) + iy*dy;
1605
           y = ((float)y_min) + iy*dy;
1666
     for (i = 0; i < GRID_MAX_POINTS_X; i++) {
1665
     for (i = 0; i < GRID_MAX_POINTS_X; i++) {
1667
       for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
1666
       for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
1668
         float x_tmp, y_tmp, z_tmp;
1667
         float x_tmp, y_tmp, z_tmp;
1669
-          x_tmp = pgm_read_float(&(ubl.mesh_index_to_xpos[i])); 
1668
+          x_tmp = pgm_read_float(&(ubl.mesh_index_to_xpos[i]));
1670
           y_tmp = pgm_read_float(&(ubl.mesh_index_to_ypos[j]));
1669
           y_tmp = pgm_read_float(&(ubl.mesh_index_to_ypos[j]));
1671
           z_tmp = ubl.z_values[i][j];
1670
           z_tmp = ubl.z_values[i][j];
1672
           #if ENABLED(DEBUG_LEVELING_FEATURE)
1671
           #if ENABLED(DEBUG_LEVELING_FEATURE)

+ 23
- 6
Marlin/ultralcd.cpp View File

34
   #include "buzzer.h"
34
   #include "buzzer.h"
35
 #endif
35
 #endif
36
 
36
 
37
-#if ENABLED(BLTOUCH)
38
-  #include "endstops.h"
39
-#endif
40
-
41
 #if ENABLED(PRINTCOUNTER)
37
 #if ENABLED(PRINTCOUNTER)
42
   #include "printcounter.h"
38
   #include "printcounter.h"
43
   #include "duration_t.h"
39
   #include "duration_t.h"
723
 
719
 
724
   #endif // MENU_ITEM_CASE_LIGHT
720
   #endif // MENU_ITEM_CASE_LIGHT
725
 
721
 
722
+  #if ENABLED(BLTOUCH)
723
+
724
+    /**
725
+     *
726
+     * "BLTouch" submenu
727
+     *
728
+     */
729
+    static void bltouch_menu() {
730
+      START_MENU();
731
+      //
732
+      // ^ Main
733
+      //
734
+      MENU_BACK(MSG_MAIN);
735
+      MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET)));
736
+      MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST)));
737
+      MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY)));
738
+      MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW)));
739
+      END_MENU();
740
+    }
741
+
742
+  #endif // BLTOUCH
743
+
726
   #if ENABLED(LCD_PROGRESS_BAR_TEST)
744
   #if ENABLED(LCD_PROGRESS_BAR_TEST)
727
 
745
 
728
     static void progress_bar_test() {
746
     static void progress_bar_test() {
792
     #endif
810
     #endif
793
 
811
 
794
     #if ENABLED(BLTOUCH)
812
     #if ENABLED(BLTOUCH)
795
-      if (!endstops.z_probe_enabled && TEST_BLTOUCH())
796
-        MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET)));
813
+      MENU_ITEM(submenu, MSG_BLTOUCH, bltouch_menu);
797
     #endif
814
     #endif
798
 
815
 
799
     if (planner.movesplanned() || IS_SD_PRINTING) {
816
     if (planner.movesplanned() || IS_SD_PRINTING) {

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h View File

533
     lcd.clear();
533
     lcd.clear();
534
 
534
 
535
     safe_delay(100);
535
     safe_delay(100);
536
-    
536
+
537
     lcd_set_custom_characters(
537
     lcd_set_custom_characters(
538
       #if ENABLED(LCD_PROGRESS_BAR)
538
       #if ENABLED(LCD_PROGRESS_BAR)
539
         false
539
         false

+ 1
- 1
Marlin/utility.cpp View File

31
     thermalManager.manage_heater();
31
     thermalManager.manage_heater();
32
   }
32
   }
33
   delay(ms);
33
   delay(ms);
34
-  thermalManager.manage_heater();	// This keeps us safe if too many small safe_delay() calls are made
34
+  thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made
35
 }
35
 }
36
 
36
 
37
 #if ENABLED(ULTRA_LCD)
37
 #if ENABLED(ULTRA_LCD)

Loading…
Cancel
Save