소스 검색

🚸 More flexible Probe Temperature Compensation (#23033)

tombrazier 2 년 전
부모
커밋
296a6137cd
No account linked to committer's email address

+ 52
- 48
Marlin/Configuration_adv.h 파일 보기

@@ -1988,65 +1988,69 @@
1988 1988
 
1989 1989
 /**
1990 1990
  * Thermal Probe Compensation
1991
- * Probe measurements are adjusted to compensate for temperature distortion.
1992
- * Use G76 to calibrate this feature. Use M871 to set values manually.
1993
- * For a more detailed explanation of the process see G76_M871.cpp.
1991
+ *
1992
+ * Adjust probe measurements to compensate for distortion associated with the temperature
1993
+ * of the probe, bed, and/or hotend.
1994
+ * Use G76 to automatically calibrate this feature for probe and bed temperatures.
1995
+ * (Extruder temperature/offset values must be calibrated manually.)
1996
+ * Use M871 to set temperature/offset values manually.
1997
+ * For more details see https://marlinfw.org/docs/features/probe_temp_compensation.html
1994 1998
  */
1995
-#if HAS_BED_PROBE && TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
1996
-  // Enable thermal first layer compensation using bed and probe temperatures
1997
-  #define PROBE_TEMP_COMPENSATION
1999
+//#define PTC_PROBE    // Compensate based on probe temperature
2000
+//#define PTC_BED      // Compensate based on bed temperature
2001
+//#define PTC_HOTEND   // Compensate based on hotend temperature
2002
+
2003
+#if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND)
2004
+  /**
2005
+   * If the probe is outside the defined range, use linear extrapolation with the closest
2006
+   * point and the point with index PTC_LINEAR_EXTRAPOLATION. e.g., If set to 4 it will use the
2007
+   * linear extrapolation between data[0] and data[4] for values below PTC_PROBE_START.
2008
+   */
2009
+  //#define PTC_LINEAR_EXTRAPOLATION 4
2010
+
2011
+  #if ENABLED(PTC_PROBE)
2012
+    // Probe temperature calibration generates a table of values starting at PTC_PROBE_START
2013
+    // (e.g., 30), in steps of PTC_PROBE_RES (e.g., 5) with PTC_PROBE_COUNT (e.g., 10) samples.
2014
+    #define PTC_PROBE_START   30    // (°C)
2015
+    #define PTC_PROBE_RES      5    // (°C)
2016
+    #define PTC_PROBE_COUNT   10
2017
+    #define PTC_PROBE_ZOFFS   { 0 } // (µm) Z adjustments per sample
2018
+  #endif
2019
+
2020
+  #if ENABLED(PTC_BED)
2021
+    // Bed temperature calibration builds a similar table.
2022
+    #define PTC_BED_START     60    // (°C)
2023
+    #define PTC_BED_RES        5    // (°C)
2024
+    #define PTC_BED_COUNT     10
2025
+    #define PTC_BED_ZOFFS     { 0 } // (µm) Z adjustments per sample
2026
+  #endif
2027
+
2028
+  #if ENABLED(PTC_HOTEND)
2029
+    // Note: There is no automatic calibration for the hotend. Use M871.
2030
+    #define PTC_HOTEND_START 180    // (°C)
2031
+    #define PTC_HOTEND_RES     5    // (°C)
2032
+    #define PTC_HOTEND_COUNT  20
2033
+    #define PTC_HOTEND_ZOFFS  { 0 } // (µm) Z adjustments per sample
2034
+  #endif
1998 2035
 
1999
-  // Add additional compensation depending on hotend temperature
2000
-  // Note: this values cannot be calibrated and have to be set manually
2001
-  #if ENABLED(PROBE_TEMP_COMPENSATION)
2036
+  // G76 options
2037
+  #if BOTH(PTC_PROBE, PTC_BED)
2002 2038
     // Park position to wait for probe cooldown
2003 2039
     #define PTC_PARK_POS   { 0, 0, 100 }
2004 2040
 
2005 2041
     // Probe position to probe and wait for probe to reach target temperature
2042
+    //#define PTC_PROBE_POS  { 12.0f, 7.3f } // Example: MK52 magnetic heatbed
2006 2043
     #define PTC_PROBE_POS  { 90, 100 }
2007 2044
 
2008
-    // Enable additional compensation using hotend temperature
2009
-    // Note: this values cannot be calibrated automatically but have to be set manually via M871.
2010
-    //#define USE_TEMP_EXT_COMPENSATION
2011
-
2012
-    // Probe temperature calibration generates a table of values starting at PTC_SAMPLE_START
2013
-    // (e.g., 30), in steps of PTC_SAMPLE_RES (e.g., 5) with PTC_SAMPLE_COUNT (e.g., 10) samples.
2014
-
2015
-    //#define PTC_SAMPLE_START  30  // (°C)
2016
-    //#define PTC_SAMPLE_RES     5  // (°C)
2017
-    //#define PTC_SAMPLE_COUNT  10
2018
-
2019
-    // Bed temperature calibration builds a similar table.
2020
-
2021
-    //#define BTC_SAMPLE_START  60  // (°C)
2022
-    //#define BTC_SAMPLE_RES     5  // (°C)
2023
-    //#define BTC_SAMPLE_COUNT  10
2024
-
2025
-    #if ENABLED(USE_TEMP_EXT_COMPENSATION)
2026
-      //#define ETC_SAMPLE_START 180  // (°C)
2027
-      //#define ETC_SAMPLE_RES     5  // (°C)
2028
-      //#define ETC_SAMPLE_COUNT  20
2029
-    #endif
2030
-
2031
-    // The temperature the probe should be at while taking measurements during bed temperature
2032
-    // calibration.
2033
-    //#define BTC_PROBE_TEMP    30  // (°C)
2045
+    // The temperature the probe should be at while taking measurements during
2046
+    // bed temperature calibration.
2047
+    #define PTC_PROBE_TEMP    30  // (°C)
2034 2048
 
2035 2049
     // Height above Z=0.0 to raise the nozzle. Lowering this can help the probe to heat faster.
2036
-    // Note: the Z=0.0 offset is determined by the probe offset which can be set using M851.
2037
-    //#define PTC_PROBE_HEATING_OFFSET 0.5
2038
-
2039
-    // Height to raise the Z-probe between heating and taking the next measurement. Some probes
2040
-    // may fail to untrigger if they have been triggered for a long time, which can be solved by
2041
-    // increasing the height the probe is raised to.
2042
-    //#define PTC_PROBE_RAISE 15
2043
-
2044
-    // If the probe is outside of the defined range, use linear extrapolation using the closest
2045
-    // point and the PTC_LINEAR_EXTRAPOLATION'th next point. E.g. if set to 4 it will use data[0]
2046
-    // and data[4] to perform linear extrapolation for values below PTC_SAMPLE_START.
2047
-    //#define PTC_LINEAR_EXTRAPOLATION 4
2050
+    // Note: The Z=0.0 offset is determined by the probe Z offset (e.g., as set with M851 Z).
2051
+    #define PTC_PROBE_HEATING_OFFSET 0.5
2048 2052
   #endif
2049
-#endif
2053
+#endif // PTC_PROBE || PTC_BED || PTC_HOTEND
2050 2054
 
2051 2055
 // @section extras
2052 2056
 

+ 44
- 42
Marlin/src/feature/probe_temp_comp.cpp 파일 보기

@@ -22,39 +22,53 @@
22 22
 
23 23
 #include "../inc/MarlinConfigPre.h"
24 24
 
25
-#if ENABLED(PROBE_TEMP_COMPENSATION)
25
+#if HAS_PTC
26 26
 
27 27
 //#define DEBUG_PTC   // Print extra debug output with 'M871'
28 28
 
29 29
 #include "probe_temp_comp.h"
30 30
 #include <math.h>
31 31
 
32
-ProbeTempComp temp_comp;
32
+ProbeTempComp ptc;
33 33
 
34
-int16_t ProbeTempComp::z_offsets_probe[cali_info_init[TSI_PROBE].measurements],  // = {0}
35
-        ProbeTempComp::z_offsets_bed[cali_info_init[TSI_BED].measurements];      // = {0}
34
+#if ENABLED(PTC_PROBE)
35
+  constexpr int16_t z_offsets_probe_default[PTC_PROBE_COUNT] = PTC_PROBE_ZOFFS;
36
+  int16_t ProbeTempComp::z_offsets_probe[PTC_PROBE_COUNT] = PTC_PROBE_ZOFFS;
37
+#endif
36 38
 
37
-#if ENABLED(USE_TEMP_EXT_COMPENSATION)
38
-  int16_t ProbeTempComp::z_offsets_ext[cali_info_init[TSI_EXT].measurements];    // = {0}
39
+#if ENABLED(PTC_BED)
40
+  constexpr int16_t z_offsets_bed_default[PTC_BED_COUNT] = PTC_BED_ZOFFS;
41
+  int16_t ProbeTempComp::z_offsets_bed[PTC_BED_COUNT] = PTC_BED_ZOFFS;
39 42
 #endif
40 43
 
41
-int16_t *ProbeTempComp::sensor_z_offsets[TSI_COUNT] = {
42
-  ProbeTempComp::z_offsets_probe, ProbeTempComp::z_offsets_bed
43
-  OPTARG(USE_TEMP_EXT_COMPENSATION, ProbeTempComp::z_offsets_ext)
44
-};
44
+#if ENABLED(PTC_HOTEND)
45
+  constexpr int16_t z_offsets_hotend_default[PTC_HOTEND_COUNT] = PTC_HOTEND_ZOFFS;
46
+  int16_t ProbeTempComp::z_offsets_hotend[PTC_HOTEND_COUNT] = PTC_HOTEND_ZOFFS;
47
+#endif
45 48
 
46
-const temp_calib_t ProbeTempComp::cali_info[TSI_COUNT] = {
47
-  cali_info_init[TSI_PROBE], cali_info_init[TSI_BED]
48
-  OPTARG(USE_TEMP_EXT_COMPENSATION, cali_info_init[TSI_EXT])
49
+int16_t *ProbeTempComp::sensor_z_offsets[TSI_COUNT] = {
50
+  #if ENABLED(PTC_PROBE)
51
+    ProbeTempComp::z_offsets_probe,
52
+  #endif
53
+  #if ENABLED(PTC_BED)
54
+    ProbeTempComp::z_offsets_bed,
55
+  #endif
56
+  #if ENABLED(PTC_HOTEND)
57
+    ProbeTempComp::z_offsets_hotend,
58
+  #endif
49 59
 };
50 60
 
51
-constexpr xyz_pos_t ProbeTempComp::park_point;
52
-constexpr xy_pos_t ProbeTempComp::measure_point;
53
-constexpr celsius_t ProbeTempComp::probe_calib_bed_temp;
61
+constexpr temp_calib_t ProbeTempComp::cali_info[TSI_COUNT];
54 62
 
55 63
 uint8_t ProbeTempComp::calib_idx; // = 0
56 64
 float ProbeTempComp::init_measurement; // = 0.0
57 65
 
66
+void ProbeTempComp::reset() {
67
+  TERN_(PTC_PROBE, LOOP_L_N(i, PTC_PROBE_COUNT) z_offsets_probe[i] = z_offsets_probe_default[i]);
68
+  TERN_(PTC_BED, LOOP_L_N(i, PTC_BED_COUNT) z_offsets_bed[i] = z_offsets_bed_default[i]);
69
+  TERN_(PTC_HOTEND, LOOP_L_N(i, PTC_HOTEND_COUNT) z_offsets_hotend[i] = z_offsets_hotend_default[i]);
70
+}
71
+
58 72
 void ProbeTempComp::clear_offsets(const TempSensorID tsi) {
59 73
   LOOP_L_N(i, cali_info[tsi].measurements)
60 74
     sensor_z_offsets[tsi][i] = 0;
@@ -71,10 +85,9 @@ void ProbeTempComp::print_offsets() {
71 85
   LOOP_L_N(s, TSI_COUNT) {
72 86
     celsius_t temp = cali_info[s].start_temp;
73 87
     for (int16_t i = -1; i < cali_info[s].measurements; ++i) {
74
-      SERIAL_ECHOF(s == TSI_BED ? F("Bed") :
75
-        #if ENABLED(USE_TEMP_EXT_COMPENSATION)
76
-          s == TSI_EXT ? F("Extruder") :
77
-        #endif
88
+      SERIAL_ECHOF(
89
+        TERN_(PTC_BED, s == TSI_BED ? F("Bed") :)
90
+        TERN_(PTC_HOTEND, s == TSI_EXT ? F("Extruder") :)
78 91
         F("Probe")
79 92
       );
80 93
       SERIAL_ECHOLNPGM(
@@ -100,21 +113,13 @@ void ProbeTempComp::prepare_new_calibration(const_float_t init_meas_z) {
100 113
 }
101 114
 
102 115
 void ProbeTempComp::push_back_new_measurement(const TempSensorID tsi, const_float_t meas_z) {
103
-  switch (tsi) {
104
-    case TSI_PROBE:
105
-    case TSI_BED:
106
-    //case TSI_EXT:
107
-      if (calib_idx >= cali_info[tsi].measurements) return;
108
-      sensor_z_offsets[tsi][calib_idx++] = static_cast<int16_t>(meas_z * 1000.0f - init_measurement * 1000.0f);
109
-    default: break;
110
-  }
116
+  if (calib_idx >= cali_info[tsi].measurements) return;
117
+  sensor_z_offsets[tsi][calib_idx++] = static_cast<int16_t>((meas_z - init_measurement) * 1000.0f);
111 118
 }
112 119
 
113 120
 bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
114
-  if (tsi != TSI_PROBE && tsi != TSI_BED) return false;
115
-
116
-  if (calib_idx < 3) {
117
-    SERIAL_ECHOLNPGM("!Insufficient measurements (min. 3).");
121
+  if (!calib_idx) {
122
+    SERIAL_ECHOLNPGM("!No measurements.");
118 123
     clear_offsets(tsi);
119 124
     return false;
120 125
   }
@@ -130,16 +135,15 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
130 135
     SERIAL_ECHOLNPGM("Got ", calib_idx, " measurements. ");
131 136
     if (linear_regression(tsi, k, d)) {
132 137
       SERIAL_ECHOPGM("Applying linear extrapolation");
133
-      calib_idx--;
134 138
       for (; calib_idx < measurements; ++calib_idx) {
135
-        const celsius_float_t temp = start_temp + float(calib_idx) * res_temp;
139
+        const celsius_float_t temp = start_temp + float(calib_idx + 1) * res_temp;
136 140
         data[calib_idx] = static_cast<int16_t>(k * temp + d);
137 141
       }
138 142
     }
139 143
     else {
140 144
       // Simply use the last measured value for higher temperatures
141 145
       SERIAL_ECHOPGM("Failed to extrapolate");
142
-      const int16_t last_val = data[calib_idx];
146
+      const int16_t last_val = data[calib_idx-1];
143 147
       for (; calib_idx < measurements; ++calib_idx)
144 148
         data[calib_idx] = last_val;
145 149
     }
@@ -157,7 +161,7 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
157 161
     // Restrict the max. offset difference between two probings
158 162
     if (calib_idx > 0 && ABS(data[calib_idx - 1] - data[calib_idx]) > 800) {
159 163
       SERIAL_ECHOLNPGM("!Invalid Z-offset between two probings detected (0-0.8).");
160
-      clear_offsets(TSI_PROBE);
164
+      clear_offsets(tsi);
161 165
       return false;
162 166
     }
163 167
   }
@@ -168,8 +172,8 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
168 172
 void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const celsius_t temp, float &meas_z) {
169 173
   const uint8_t measurements = cali_info[tsi].measurements;
170 174
   const celsius_t start_temp = cali_info[tsi].start_temp,
171
-                    end_temp = cali_info[tsi].end_temp,
172
-                    res_temp = cali_info[tsi].temp_resolution;
175
+                  res_temp = cali_info[tsi].temp_resolution,
176
+                  end_temp = start_temp + measurements * res_temp;
173 177
   const int16_t * const data = sensor_z_offsets[tsi];
174 178
 
175 179
   // Given a data index, return { celsius, zoffset } in the form { x, y }
@@ -208,9 +212,7 @@ void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const celsius
208 212
 }
209 213
 
210 214
 bool ProbeTempComp::linear_regression(const TempSensorID tsi, float &k, float &d) {
211
-  if (tsi != TSI_PROBE && tsi != TSI_BED) return false;
212
-
213
-  if (!WITHIN(calib_idx, 2, cali_info[tsi].measurements)) return false;
215
+  if (!WITHIN(calib_idx, 1, cali_info[tsi].measurements)) return false;
214 216
 
215 217
   const celsius_t start_temp = cali_info[tsi].start_temp,
216 218
                     res_temp = cali_info[tsi].temp_resolution;
@@ -243,4 +245,4 @@ bool ProbeTempComp::linear_regression(const TempSensorID tsi, float &k, float &d
243 245
   return true;
244 246
 }
245 247
 
246
-#endif // PROBE_TEMP_COMPENSATION
248
+#endif // HAS_PTC

+ 34
- 84
Marlin/src/feature/probe_temp_comp.h 파일 보기

@@ -24,9 +24,13 @@
24 24
 #include "../inc/MarlinConfig.h"
25 25
 
26 26
 enum TempSensorID : uint8_t {
27
-  TSI_PROBE,
28
-  TSI_BED,
29
-  #if ENABLED(USE_TEMP_EXT_COMPENSATION)
27
+  #if ENABLED(PTC_PROBE)
28
+    TSI_PROBE,
29
+  #endif
30
+  #if ENABLED(PTC_BED)
31
+    TSI_BED,
32
+  #endif
33
+  #if ENABLED(PTC_HOTEND)
30 34
     TSI_EXT,
31 35
   #endif
32 36
   TSI_COUNT
@@ -35,8 +39,7 @@ enum TempSensorID : uint8_t {
35 39
 typedef struct {
36 40
   uint8_t measurements;       // Max. number of measurements to be stored (35 - 80°C)
37 41
   celsius_t temp_resolution,  // Resolution in °C between measurements
38
-            start_temp,       // Base measurement; z-offset == 0
39
-            end_temp;
42
+            start_temp;       // Base measurement; z-offset == 0
40 43
 } temp_calib_t;
41 44
 
42 45
 /**
@@ -45,93 +48,40 @@ typedef struct {
45 48
  * measurement errors/shifts due to changed temperature.
46 49
  */
47 50
 
48
-// Probe temperature calibration constants
49
-#ifndef PTC_SAMPLE_COUNT
50
-  #define PTC_SAMPLE_COUNT 10
51
-#endif
52
-#ifndef PTC_SAMPLE_RES
53
-  #define PTC_SAMPLE_RES 5
54
-#endif
55
-#ifndef PTC_SAMPLE_START
56
-  #define PTC_SAMPLE_START 30
57
-#endif
58
-#define PTC_SAMPLE_END (PTC_SAMPLE_START + (PTC_SAMPLE_COUNT) * PTC_SAMPLE_RES)
59
-
60
-// Bed temperature calibration constants
61
-#ifndef BTC_PROBE_TEMP
62
-  #define BTC_PROBE_TEMP 30
63
-#endif
64
-#ifndef BTC_SAMPLE_COUNT
65
-  #define BTC_SAMPLE_COUNT 10
66
-#endif
67
-#ifndef BTC_SAMPLE_RES
68
-  #define BTC_SAMPLE_RES 5
69
-#endif
70
-#ifndef BTC_SAMPLE_START
71
-  #define BTC_SAMPLE_START 60
72
-#endif
73
-#define BTC_SAMPLE_END (BTC_SAMPLE_START + (BTC_SAMPLE_COUNT) * BTC_SAMPLE_RES)
74
-
75
-// Extruder temperature calibration constants
76
-#if ENABLED(USE_TEMP_EXT_COMPENSATION)
77
-  #ifndef ETC_SAMPLE_COUNT
78
-    #define ETC_SAMPLE_COUNT 20
79
-  #endif
80
-  #ifndef ETC_SAMPLE_RES
81
-    #define ETC_SAMPLE_RES 5
82
-  #endif
83
-  #ifndef ETC_SAMPLE_START
84
-    #define ETC_SAMPLE_START 180
85
-  #endif
86
-  #define ETC_SAMPLE_END (ETC_SAMPLE_START + (ETC_SAMPLE_COUNT) * ETC_SAMPLE_RES)
87
-#endif
88
-
89
-#ifndef PTC_PROBE_HEATING_OFFSET
90
-  #define PTC_PROBE_HEATING_OFFSET 0.5f
91
-#endif
92
-
93
-#ifndef PTC_PROBE_RAISE
94
-  #define PTC_PROBE_RAISE 10
95
-#endif
96
-
97
-static constexpr temp_calib_t cali_info_init[TSI_COUNT] = {
98
-  { PTC_SAMPLE_COUNT, PTC_SAMPLE_RES, PTC_SAMPLE_START, PTC_SAMPLE_END },   // Probe
99
-  { BTC_SAMPLE_COUNT, BTC_SAMPLE_RES, BTC_SAMPLE_START, BTC_SAMPLE_END },   // Bed
100
-  #if ENABLED(USE_TEMP_EXT_COMPENSATION)
101
-    { ETC_SAMPLE_COUNT, ETC_SAMPLE_RES, ETC_SAMPLE_START, ETC_SAMPLE_END }, // Extruder
102
-  #endif
103
-};
104
-
105 51
 class ProbeTempComp {
106 52
   public:
107 53
 
108
-    static const temp_calib_t cali_info[TSI_COUNT];
109
-
110
-    // Where to park nozzle to wait for probe cooldown
111
-    static constexpr xyz_pos_t park_point = PTC_PARK_POS;
112
-
113
-    // XY coordinates of nozzle for probing the bed
114
-    static constexpr xy_pos_t measure_point    = PTC_PROBE_POS;     // Coordinates to probe
115
-                            //measure_point    = { 12.0f, 7.3f };   // Coordinates for the MK52 magnetic heatbed
116
-
117
-    static constexpr celsius_t probe_calib_bed_temp = BED_MAX_TARGET,  // Bed temperature while calibrating probe
118
-                               bed_calib_probe_temp = BTC_PROBE_TEMP;  // Probe temperature while calibrating bed
119
-
120
-    static int16_t *sensor_z_offsets[TSI_COUNT],
121
-                   z_offsets_probe[cali_info_init[TSI_PROBE].measurements], // (µm)
122
-                   z_offsets_bed[cali_info_init[TSI_BED].measurements];     // (µm)
123
-
124
-    #if ENABLED(USE_TEMP_EXT_COMPENSATION)
125
-      static int16_t z_offsets_ext[cali_info_init[TSI_EXT].measurements];   // (µm)
54
+    static constexpr temp_calib_t cali_info[TSI_COUNT] = {
55
+      #if ENABLED(PTC_PROBE)
56
+        { PTC_PROBE_COUNT, PTC_PROBE_RES, PTC_PROBE_START },   // Probe
57
+      #endif
58
+      #if ENABLED(PTC_BED)
59
+        { PTC_BED_COUNT, PTC_BED_RES, PTC_BED_START },   // Bed
60
+      #endif
61
+      #if ENABLED(PTC_HOTEND)
62
+        { PTC_HOTEND_COUNT, PTC_HOTEND_RES, PTC_HOTEND_START }, // Extruder
63
+      #endif
64
+    };
65
+
66
+    static int16_t *sensor_z_offsets[TSI_COUNT];
67
+    #if ENABLED(PTC_PROBE)
68
+      static int16_t z_offsets_probe[PTC_PROBE_COUNT]; // (µm)
69
+    #endif
70
+    #if ENABLED(PTC_BED)
71
+      static int16_t z_offsets_bed[PTC_BED_COUNT];   // (µm)
72
+    #endif
73
+    #if ENABLED(PTC_HOTEND)
74
+      static int16_t z_offsets_hotend[PTC_HOTEND_COUNT];   // (µm)
126 75
     #endif
127 76
 
128 77
     static inline void reset_index() { calib_idx = 0; };
129 78
     static inline uint8_t get_index() { return calib_idx; }
79
+    static void reset();
130 80
     static void clear_offsets(const TempSensorID tsi);
131 81
     static inline void clear_all_offsets() {
132
-      clear_offsets(TSI_BED);
133
-      clear_offsets(TSI_PROBE);
134
-      TERN_(USE_TEMP_EXT_COMPENSATION, clear_offsets(TSI_EXT));
82
+      TERN_(PTC_PROBE, clear_offsets(TSI_PROBE));
83
+      TERN_(PTC_BED, clear_offsets(TSI_BED));
84
+      TERN_(PTC_HOTEND, clear_offsets(TSI_EXT));
135 85
     }
136 86
     static bool set_offset(const TempSensorID tsi, const uint8_t idx, const int16_t offset);
137 87
     static void print_offsets();
@@ -156,4 +106,4 @@ class ProbeTempComp {
156 106
     static bool linear_regression(const TempSensorID tsi, float &k, float &d);
157 107
 };
158 108
 
159
-extern ProbeTempComp temp_comp;
109
+extern ProbeTempComp ptc;

+ 4
- 6
Marlin/src/gcode/bedlevel/abl/G29.cpp 파일 보기

@@ -36,7 +36,7 @@
36 36
 #include "../../../module/probe.h"
37 37
 #include "../../queue.h"
38 38
 
39
-#if ENABLED(PROBE_TEMP_COMPENSATION)
39
+#if HAS_PTC
40 40
   #include "../../../feature/probe_temp_comp.h"
41 41
   #include "../../../module/temperature.h"
42 42
 #endif
@@ -645,11 +645,9 @@ G29_TYPE GcodeSuite::G29() {
645 645
             break; // Breaks out of both loops
646 646
           }
647 647
 
648
-          #if ENABLED(PROBE_TEMP_COMPENSATION)
649
-            temp_comp.compensate_measurement(TSI_BED, thermalManager.degBed(), abl.measured_z);
650
-            temp_comp.compensate_measurement(TSI_PROBE, thermalManager.degProbe(), abl.measured_z);
651
-            TERN_(USE_TEMP_EXT_COMPENSATION, temp_comp.compensate_measurement(TSI_EXT, thermalManager.degHotend(0), abl.measured_z));
652
-          #endif
648
+          TERN_(PTC_BED,    ptc.compensate_measurement(TSI_BED,   thermalManager.degBed(),     abl.measured_z));
649
+          TERN_(PTC_PROBE,  ptc.compensate_measurement(TSI_PROBE, thermalManager.degProbe(),   abl.measured_z));
650
+          TERN_(PTC_HOTEND, ptc.compensate_measurement(TSI_EXT,   thermalManager.degHotend(0), abl.measured_z));
653 651
 
654 652
           #if ENABLED(AUTO_BED_LEVELING_LINEAR)
655 653
 

+ 0
- 358
Marlin/src/gcode/calibrate/G76_M192_M871.cpp 파일 보기

@@ -1,358 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * Based on Sprinter and grbl.
6
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-/**
24
- * G76_M871.cpp - Temperature calibration/compensation for z-probing
25
- */
26
-
27
-#include "../../inc/MarlinConfig.h"
28
-
29
-#if ENABLED(PROBE_TEMP_COMPENSATION)
30
-
31
-#include "../gcode.h"
32
-#include "../../module/motion.h"
33
-#include "../../module/planner.h"
34
-#include "../../module/probe.h"
35
-#include "../../feature/bedlevel/bedlevel.h"
36
-#include "../../module/temperature.h"
37
-#include "../../module/probe.h"
38
-#include "../../feature/probe_temp_comp.h"
39
-#include "../../lcd/marlinui.h"
40
-
41
-/**
42
- * G76: calibrate probe and/or bed temperature offsets
43
- *  Notes:
44
- *  - When calibrating probe, bed temperature is held constant.
45
- *    Compensation values are deltas to first probe measurement at probe temp. = 30°C.
46
- *  - When calibrating bed, probe temperature is held constant.
47
- *    Compensation values are deltas to first probe measurement at bed temp. = 60°C.
48
- *  - The hotend will not be heated at any time.
49
- *  - On my Průša MK3S clone I put a piece of paper between the probe and the hotend
50
- *    so the hotend fan would not cool my probe constantly. Alternatively you could just
51
- *    make sure the fan is not running while running the calibration process.
52
- *
53
- *  Probe calibration:
54
- *  - Moves probe to cooldown point.
55
- *  - Heats up bed to 100°C.
56
- *  - Moves probe to probing point (1mm above heatbed).
57
- *  - Waits until probe reaches target temperature (30°C).
58
- *  - Does a z-probing (=base value) and increases target temperature by 5°C.
59
- *  - Waits until probe reaches increased target temperature.
60
- *  - Does a z-probing (delta to base value will be a compensation value) and increases target temperature by 5°C.
61
- *  - Repeats last two steps until max. temperature reached or timeout (i.e. probe does not heat up any further).
62
- *  - Compensation values of higher temperatures will be extrapolated (using linear regression first).
63
- *    While this is not exact by any means it is still better than simply using the last compensation value.
64
- *
65
- *  Bed calibration:
66
- *  - Moves probe to cooldown point.
67
- *  - Heats up bed to 60°C.
68
- *  - Moves probe to probing point (1mm above heatbed).
69
- *  - Waits until probe reaches target temperature (30°C).
70
- *  - Does a z-probing (=base value) and increases bed temperature by 5°C.
71
- *  - Moves probe to cooldown point.
72
- *  - Waits until probe is below 30°C and bed has reached target temperature.
73
- *  - Moves probe to probing point and waits until it reaches target temperature (30°C).
74
- *  - Does a z-probing (delta to base value will be a compensation value) and increases bed temperature by 5°C.
75
- *  - Repeats last four points until max. bed temperature reached (110°C) or timeout.
76
- *  - Compensation values of higher temperatures will be extrapolated (using linear regression first).
77
- *    While this is not exact by any means it is still better than simply using the last compensation value.
78
- *
79
- *  G76 [B | P]
80
- *  - no flag - Both calibration procedures will be run.
81
- *  - `B` - Run bed temperature calibration.
82
- *  - `P` - Run probe temperature calibration.
83
- */
84
-
85
-static void say_waiting_for()               { SERIAL_ECHOPGM("Waiting for "); }
86
-static void say_waiting_for_probe_heating() { say_waiting_for(); SERIAL_ECHOLNPGM("probe heating."); }
87
-static void say_successfully_calibrated()   { SERIAL_ECHOPGM("Successfully calibrated"); }
88
-static void say_failed_to_calibrate()       { SERIAL_ECHOPGM("!Failed to calibrate"); }
89
-
90
-void GcodeSuite::G76() {
91
-  // Check if heated bed is available and z-homing is done with probe
92
-  #if TEMP_SENSOR_BED == 0 || !(HOMING_Z_WITH_PROBE)
93
-    return;
94
-  #endif
95
-
96
-  auto report_temps = [](millis_t &ntr, millis_t timeout=0) {
97
-    idle_no_sleep();
98
-    const millis_t ms = millis();
99
-    if (ELAPSED(ms, ntr)) {
100
-      ntr = ms + 1000;
101
-      thermalManager.print_heater_states(active_extruder);
102
-    }
103
-    return (timeout && ELAPSED(ms, timeout));
104
-  };
105
-
106
-  auto wait_for_temps = [&](const celsius_t tb, const celsius_t tp, millis_t &ntr, const millis_t timeout=0) {
107
-    say_waiting_for(); SERIAL_ECHOLNPGM("bed and probe temperature.");
108
-    while (thermalManager.wholeDegBed() != tb || thermalManager.wholeDegProbe() > tp)
109
-      if (report_temps(ntr, timeout)) return true;
110
-    return false;
111
-  };
112
-
113
-  auto g76_probe = [](const TempSensorID sid, celsius_t &targ, const xy_pos_t &nozpos) {
114
-    do_z_clearance(5.0); // Raise nozzle before probing
115
-    const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false);  // verbose=0, probe_relative=false
116
-    if (isnan(measured_z))
117
-      SERIAL_ECHOLNPGM("!Received NAN. Aborting.");
118
-    else {
119
-      SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
120
-      if (targ == cali_info_init[sid].start_temp)
121
-        temp_comp.prepare_new_calibration(measured_z);
122
-      else
123
-        temp_comp.push_back_new_measurement(sid, measured_z);
124
-      targ += cali_info_init[sid].temp_resolution;
125
-    }
126
-    return measured_z;
127
-  };
128
-
129
-  #if ENABLED(BLTOUCH)
130
-    // Make sure any BLTouch error condition is cleared
131
-    bltouch_command(BLTOUCH_RESET, BLTOUCH_RESET_DELAY);
132
-    set_bltouch_deployed(false);
133
-  #endif
134
-
135
-  bool do_bed_cal = parser.boolval('B'), do_probe_cal = parser.boolval('P');
136
-  if (!do_bed_cal && !do_probe_cal) do_bed_cal = do_probe_cal = true;
137
-
138
-  // Synchronize with planner
139
-  planner.synchronize();
140
-
141
-  const xyz_pos_t parkpos = temp_comp.park_point,
142
-            probe_pos_xyz = xyz_pos_t(temp_comp.measure_point) + xyz_pos_t({ 0.0f, 0.0f, PTC_PROBE_HEATING_OFFSET }),
143
-              noz_pos_xyz = probe_pos_xyz - probe.offset_xy;  // Nozzle position based on probe position
144
-
145
-  if (do_bed_cal || do_probe_cal) {
146
-    // Ensure park position is reachable
147
-    bool reachable = position_is_reachable(parkpos) || WITHIN(parkpos.z, Z_MIN_POS - fslop, Z_MAX_POS + fslop);
148
-    if (!reachable)
149
-      SERIAL_ECHOLNPGM("!Park");
150
-    else {
151
-      // Ensure probe position is reachable
152
-      reachable = probe.can_reach(probe_pos_xyz);
153
-      if (!reachable) SERIAL_ECHOLNPGM("!Probe");
154
-    }
155
-
156
-    if (!reachable) {
157
-      SERIAL_ECHOLNPGM(" position unreachable - aborting.");
158
-      return;
159
-    }
160
-
161
-    process_subcommands_now(FPSTR(G28_STR));
162
-  }
163
-
164
-  remember_feedrate_scaling_off();
165
-
166
-  /******************************************
167
-   * Calibrate bed temperature offsets
168
-   ******************************************/
169
-
170
-  // Report temperatures every second and handle heating timeouts
171
-  millis_t next_temp_report = millis() + 1000;
172
-
173
-  auto report_targets = [&](const celsius_t tb, const celsius_t tp) {
174
-    SERIAL_ECHOLNPGM("Target Bed:", tb, " Probe:", tp);
175
-  };
176
-
177
-  if (do_bed_cal) {
178
-
179
-    celsius_t target_bed = cali_info_init[TSI_BED].start_temp,
180
-            target_probe = temp_comp.bed_calib_probe_temp;
181
-
182
-    say_waiting_for(); SERIAL_ECHOLNPGM(" cooling.");
183
-    while (thermalManager.wholeDegBed() > target_bed || thermalManager.wholeDegProbe() > target_probe)
184
-      report_temps(next_temp_report);
185
-
186
-    // Disable leveling so it won't mess with us
187
-    TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
188
-
189
-    for (;;) {
190
-      thermalManager.setTargetBed(target_bed);
191
-
192
-      report_targets(target_bed, target_probe);
193
-
194
-      // Park nozzle
195
-      do_blocking_move_to(parkpos);
196
-
197
-      // Wait for heatbed to reach target temp and probe to cool below target temp
198
-      if (wait_for_temps(target_bed, target_probe, next_temp_report, millis() + MIN_TO_MS(15))) {
199
-        SERIAL_ECHOLNPGM("!Bed heating timeout.");
200
-        break;
201
-      }
202
-
203
-      // Move the nozzle to the probing point and wait for the probe to reach target temp
204
-      do_blocking_move_to(noz_pos_xyz);
205
-      say_waiting_for_probe_heating();
206
-      SERIAL_EOL();
207
-      while (thermalManager.wholeDegProbe() < target_probe)
208
-        report_temps(next_temp_report);
209
-
210
-      const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
211
-      if (isnan(measured_z) || target_bed > (BED_MAX_TARGET)) break;
212
-    }
213
-
214
-    SERIAL_ECHOLNPGM("Retrieved measurements: ", temp_comp.get_index());
215
-    if (temp_comp.finish_calibration(TSI_BED)) {
216
-      say_successfully_calibrated();
217
-      SERIAL_ECHOLNPGM(" bed.");
218
-    }
219
-    else {
220
-      say_failed_to_calibrate();
221
-      SERIAL_ECHOLNPGM(" bed. Values reset.");
222
-    }
223
-
224
-    // Cleanup
225
-    thermalManager.setTargetBed(0);
226
-    TERN_(HAS_LEVELING, set_bed_leveling_enabled(true));
227
-  } // do_bed_cal
228
-
229
-  /********************************************
230
-   * Calibrate probe temperature offsets
231
-   ********************************************/
232
-
233
-  if (do_probe_cal) {
234
-
235
-    // Park nozzle
236
-    do_blocking_move_to(parkpos);
237
-
238
-    // Initialize temperatures
239
-    const celsius_t target_bed = temp_comp.probe_calib_bed_temp;
240
-    thermalManager.setTargetBed(target_bed);
241
-
242
-    celsius_t target_probe = cali_info_init[TSI_PROBE].start_temp;
243
-
244
-    report_targets(target_bed, target_probe);
245
-
246
-    // Wait for heatbed to reach target temp and probe to cool below target temp
247
-    wait_for_temps(target_bed, target_probe, next_temp_report);
248
-
249
-    // Disable leveling so it won't mess with us
250
-    TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
251
-
252
-    bool timeout = false;
253
-    for (;;) {
254
-      // Move probe to probing point and wait for it to reach target temperature
255
-      do_blocking_move_to(noz_pos_xyz);
256
-
257
-      say_waiting_for_probe_heating();
258
-      SERIAL_ECHOLNPGM(" Bed:", target_bed, " Probe:", target_probe);
259
-      const millis_t probe_timeout_ms = millis() + SEC_TO_MS(900UL);
260
-      while (thermalManager.degProbe() < target_probe) {
261
-        if (report_temps(next_temp_report, probe_timeout_ms)) {
262
-          SERIAL_ECHOLNPGM("!Probe heating timed out.");
263
-          timeout = true;
264
-          break;
265
-        }
266
-      }
267
-      if (timeout) break;
268
-
269
-      const float measured_z = g76_probe(TSI_PROBE, target_probe, noz_pos_xyz);
270
-      if (isnan(measured_z) || target_probe > cali_info_init[TSI_PROBE].end_temp) break;
271
-    }
272
-
273
-    SERIAL_ECHOLNPGM("Retrieved measurements: ", temp_comp.get_index());
274
-    if (temp_comp.finish_calibration(TSI_PROBE))
275
-      say_successfully_calibrated();
276
-    else
277
-      say_failed_to_calibrate();
278
-    SERIAL_ECHOLNPGM(" probe.");
279
-
280
-    // Cleanup
281
-    thermalManager.setTargetBed(0);
282
-    TERN_(HAS_LEVELING, set_bed_leveling_enabled(true));
283
-
284
-    SERIAL_ECHOLNPGM("Final compensation values:");
285
-    temp_comp.print_offsets();
286
-  } // do_probe_cal
287
-
288
-  restore_feedrate_and_scaling();
289
-}
290
-
291
-/**
292
- * M871: Report / reset temperature compensation offsets.
293
- *       Note: This does not affect values in EEPROM until M500.
294
- *
295
- *   M871 [ R | B | P | E ]
296
- *
297
- *    No Parameters - Print current offset values.
298
- *
299
- * Select only one of these flags:
300
- *    R - Reset all offsets to zero (i.e., disable compensation).
301
- *    B - Manually set offset for bed
302
- *    P - Manually set offset for probe
303
- *    E - Manually set offset for extruder
304
- *
305
- * With B, P, or E:
306
- *    I[index] - Index in the array
307
- *    V[value] - Adjustment in µm
308
- */
309
-void GcodeSuite::M871() {
310
-
311
-  if (parser.seen('R')) {
312
-    // Reset z-probe offsets to factory defaults
313
-    temp_comp.clear_all_offsets();
314
-    SERIAL_ECHOLNPGM("Offsets reset to default.");
315
-  }
316
-  else if (parser.seen("BPE")) {
317
-    if (!parser.seenval('V')) return;
318
-    const int16_t offset_val = parser.value_int();
319
-    if (!parser.seenval('I')) return;
320
-    const int16_t idx = parser.value_int();
321
-    const TempSensorID mod = (parser.seen('B') ? TSI_BED :
322
-                                #if ENABLED(USE_TEMP_EXT_COMPENSATION)
323
-                                  parser.seen('E') ? TSI_EXT :
324
-                                #endif
325
-                                TSI_PROBE
326
-                              );
327
-    if (idx > 0 && temp_comp.set_offset(mod, idx - 1, offset_val))
328
-      SERIAL_ECHOLNPGM("Set value: ", offset_val);
329
-    else
330
-      SERIAL_ECHOLNPGM("!Invalid index. Failed to set value (note: value at index 0 is constant).");
331
-
332
-  }
333
-  else // Print current Z-probe adjustments. Note: Values in EEPROM might differ.
334
-    temp_comp.print_offsets();
335
-}
336
-
337
-/**
338
- * M192: Wait for probe temperature sensor to reach a target
339
- *
340
- * Select only one of these flags:
341
- *    R - Wait for heating or cooling
342
- *    S - Wait only for heating
343
- */
344
-void GcodeSuite::M192() {
345
-  if (DEBUGGING(DRYRUN)) return;
346
-
347
-  const bool no_wait_for_cooling = parser.seenval('S');
348
-  if (!no_wait_for_cooling && ! parser.seenval('R')) {
349
-    SERIAL_ERROR_MSG("No target temperature set.");
350
-    return;
351
-  }
352
-
353
-  const celsius_t target_temp = parser.value_celsius();
354
-  ui.set_status(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT_F(MSG_PROBE_HEATING) : GET_TEXT_F(MSG_PROBE_COOLING));
355
-  thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
356
-}
357
-
358
-#endif // PROBE_TEMP_COMPENSATION

+ 337
- 0
Marlin/src/gcode/calibrate/G76_M871.cpp 파일 보기

@@ -0,0 +1,337 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * G76_M871.cpp - Temperature calibration/compensation for z-probing
25
+ */
26
+
27
+#include "../../inc/MarlinConfig.h"
28
+
29
+#if HAS_PTC
30
+
31
+#include "../gcode.h"
32
+#include "../../module/motion.h"
33
+#include "../../module/planner.h"
34
+#include "../../module/probe.h"
35
+#include "../../feature/bedlevel/bedlevel.h"
36
+#include "../../module/temperature.h"
37
+#include "../../module/probe.h"
38
+#include "../../feature/probe_temp_comp.h"
39
+#include "../../lcd/marlinui.h"
40
+
41
+/**
42
+ * G76: calibrate probe and/or bed temperature offsets
43
+ *  Notes:
44
+ *  - When calibrating probe, bed temperature is held constant.
45
+ *    Compensation values are deltas to first probe measurement at probe temp. = 30°C.
46
+ *  - When calibrating bed, probe temperature is held constant.
47
+ *    Compensation values are deltas to first probe measurement at bed temp. = 60°C.
48
+ *  - The hotend will not be heated at any time.
49
+ *  - On my Průša MK3S clone I put a piece of paper between the probe and the hotend
50
+ *    so the hotend fan would not cool my probe constantly. Alternatively you could just
51
+ *    make sure the fan is not running while running the calibration process.
52
+ *
53
+ *  Probe calibration:
54
+ *  - Moves probe to cooldown point.
55
+ *  - Heats up bed to 100°C.
56
+ *  - Moves probe to probing point (1mm above heatbed).
57
+ *  - Waits until probe reaches target temperature (30°C).
58
+ *  - Does a z-probing (=base value) and increases target temperature by 5°C.
59
+ *  - Waits until probe reaches increased target temperature.
60
+ *  - Does a z-probing (delta to base value will be a compensation value) and increases target temperature by 5°C.
61
+ *  - Repeats last two steps until max. temperature reached or timeout (i.e. probe does not heat up any further).
62
+ *  - Compensation values of higher temperatures will be extrapolated (using linear regression first).
63
+ *    While this is not exact by any means it is still better than simply using the last compensation value.
64
+ *
65
+ *  Bed calibration:
66
+ *  - Moves probe to cooldown point.
67
+ *  - Heats up bed to 60°C.
68
+ *  - Moves probe to probing point (1mm above heatbed).
69
+ *  - Waits until probe reaches target temperature (30°C).
70
+ *  - Does a z-probing (=base value) and increases bed temperature by 5°C.
71
+ *  - Moves probe to cooldown point.
72
+ *  - Waits until probe is below 30°C and bed has reached target temperature.
73
+ *  - Moves probe to probing point and waits until it reaches target temperature (30°C).
74
+ *  - Does a z-probing (delta to base value will be a compensation value) and increases bed temperature by 5°C.
75
+ *  - Repeats last four points until max. bed temperature reached (110°C) or timeout.
76
+ *  - Compensation values of higher temperatures will be extrapolated (using linear regression first).
77
+ *    While this is not exact by any means it is still better than simply using the last compensation value.
78
+ *
79
+ *  G76 [B | P]
80
+ *  - no flag - Both calibration procedures will be run.
81
+ *  - `B` - Run bed temperature calibration.
82
+ *  - `P` - Run probe temperature calibration.
83
+ */
84
+
85
+static void say_waiting_for()               { SERIAL_ECHOPGM("Waiting for "); }
86
+static void say_waiting_for_probe_heating() { say_waiting_for(); SERIAL_ECHOLNPGM("probe heating."); }
87
+static void say_successfully_calibrated()   { SERIAL_ECHOPGM("Successfully calibrated"); }
88
+static void say_failed_to_calibrate()       { SERIAL_ECHOPGM("!Failed to calibrate"); }
89
+
90
+#if BOTH(PTC_PROBE, PTC_BED)
91
+
92
+  void GcodeSuite::G76() {
93
+    auto report_temps = [](millis_t &ntr, millis_t timeout=0) {
94
+      idle_no_sleep();
95
+      const millis_t ms = millis();
96
+      if (ELAPSED(ms, ntr)) {
97
+        ntr = ms + 1000;
98
+        thermalManager.print_heater_states(active_extruder);
99
+      }
100
+      return (timeout && ELAPSED(ms, timeout));
101
+    };
102
+
103
+    auto wait_for_temps = [&](const celsius_t tb, const celsius_t tp, millis_t &ntr, const millis_t timeout=0) {
104
+      say_waiting_for(); SERIAL_ECHOLNPGM("bed and probe temperature.");
105
+      while (thermalManager.wholeDegBed() != tb || thermalManager.wholeDegProbe() > tp)
106
+        if (report_temps(ntr, timeout)) return true;
107
+      return false;
108
+    };
109
+
110
+    auto g76_probe = [](const TempSensorID sid, celsius_t &targ, const xy_pos_t &nozpos) {
111
+      do_z_clearance(5.0); // Raise nozzle before probing
112
+      const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false);  // verbose=0, probe_relative=false
113
+      if (isnan(measured_z))
114
+        SERIAL_ECHOLNPGM("!Received NAN. Aborting.");
115
+      else {
116
+        SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
117
+        if (targ == ProbeTempComp::cali_info[sid].start_temp)
118
+          ptc.prepare_new_calibration(measured_z);
119
+        else
120
+          ptc.push_back_new_measurement(sid, measured_z);
121
+        targ += ProbeTempComp::cali_info[sid].temp_resolution;
122
+      }
123
+      return measured_z;
124
+    };
125
+
126
+    #if ENABLED(BLTOUCH)
127
+      // Make sure any BLTouch error condition is cleared
128
+      bltouch_command(BLTOUCH_RESET, BLTOUCH_RESET_DELAY);
129
+      set_bltouch_deployed(false);
130
+    #endif
131
+
132
+    bool do_bed_cal = parser.boolval('B'), do_probe_cal = parser.boolval('P');
133
+    if (!do_bed_cal && !do_probe_cal) do_bed_cal = do_probe_cal = true;
134
+
135
+    // Synchronize with planner
136
+    planner.synchronize();
137
+
138
+    #ifndef PTC_PROBE_HEATING_OFFSET
139
+      #define PTC_PROBE_HEATING_OFFSET 0
140
+    #endif
141
+    const xyz_pos_t parkpos = PTC_PARK_POS,
142
+              probe_pos_xyz = xyz_pos_t(PTC_PROBE_POS) + xyz_pos_t({ 0.0f, 0.0f, PTC_PROBE_HEATING_OFFSET }),
143
+                noz_pos_xyz = probe_pos_xyz - probe.offset_xy;  // Nozzle position based on probe position
144
+
145
+    if (do_bed_cal || do_probe_cal) {
146
+      // Ensure park position is reachable
147
+      bool reachable = position_is_reachable(parkpos) || WITHIN(parkpos.z, Z_MIN_POS - fslop, Z_MAX_POS + fslop);
148
+      if (!reachable)
149
+        SERIAL_ECHOLNPGM("!Park");
150
+      else {
151
+        // Ensure probe position is reachable
152
+        reachable = probe.can_reach(probe_pos_xyz);
153
+        if (!reachable) SERIAL_ECHOLNPGM("!Probe");
154
+      }
155
+
156
+      if (!reachable) {
157
+        SERIAL_ECHOLNPGM(" position unreachable - aborting.");
158
+        return;
159
+      }
160
+
161
+      process_subcommands_now(FPSTR(G28_STR));
162
+    }
163
+
164
+    remember_feedrate_scaling_off();
165
+
166
+    /******************************************
167
+     * Calibrate bed temperature offsets
168
+     ******************************************/
169
+
170
+    // Report temperatures every second and handle heating timeouts
171
+    millis_t next_temp_report = millis() + 1000;
172
+
173
+    auto report_targets = [&](const celsius_t tb, const celsius_t tp) {
174
+      SERIAL_ECHOLNPGM("Target Bed:", tb, " Probe:", tp);
175
+    };
176
+
177
+    if (do_bed_cal) {
178
+
179
+      celsius_t target_bed = PTC_BED_START,
180
+                target_probe = PTC_PROBE_TEMP;
181
+
182
+      say_waiting_for(); SERIAL_ECHOLNPGM(" cooling.");
183
+      while (thermalManager.wholeDegBed() > target_bed || thermalManager.wholeDegProbe() > target_probe)
184
+        report_temps(next_temp_report);
185
+
186
+      // Disable leveling so it won't mess with us
187
+      TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
188
+
189
+      for (uint8_t idx = 0; idx <= PTC_BED_COUNT; idx++) {
190
+        thermalManager.setTargetBed(target_bed);
191
+
192
+        report_targets(target_bed, target_probe);
193
+
194
+        // Park nozzle
195
+        do_blocking_move_to(parkpos);
196
+
197
+        // Wait for heatbed to reach target temp and probe to cool below target temp
198
+        if (wait_for_temps(target_bed, target_probe, next_temp_report, millis() + MIN_TO_MS(15))) {
199
+          SERIAL_ECHOLNPGM("!Bed heating timeout.");
200
+          break;
201
+        }
202
+
203
+        // Move the nozzle to the probing point and wait for the probe to reach target temp
204
+        do_blocking_move_to(noz_pos_xyz);
205
+        say_waiting_for_probe_heating();
206
+        SERIAL_EOL();
207
+        while (thermalManager.wholeDegProbe() < target_probe)
208
+          report_temps(next_temp_report);
209
+
210
+        const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
211
+        if (isnan(measured_z) || target_bed > (BED_MAX_TARGET)) break;
212
+      }
213
+
214
+      SERIAL_ECHOLNPGM("Retrieved measurements: ", ptc.get_index());
215
+      if (ptc.finish_calibration(TSI_BED)) {
216
+        say_successfully_calibrated();
217
+        SERIAL_ECHOLNPGM(" bed.");
218
+      }
219
+      else {
220
+        say_failed_to_calibrate();
221
+        SERIAL_ECHOLNPGM(" bed. Values reset.");
222
+      }
223
+
224
+      // Cleanup
225
+      thermalManager.setTargetBed(0);
226
+      TERN_(HAS_LEVELING, set_bed_leveling_enabled(true));
227
+    } // do_bed_cal
228
+
229
+    /********************************************
230
+     * Calibrate probe temperature offsets
231
+     ********************************************/
232
+
233
+    if (do_probe_cal) {
234
+
235
+      // Park nozzle
236
+      do_blocking_move_to(parkpos);
237
+
238
+      // Initialize temperatures
239
+      const celsius_t target_bed = BED_MAX_TARGET;
240
+      thermalManager.setTargetBed(target_bed);
241
+
242
+      celsius_t target_probe = PTC_PROBE_START;
243
+
244
+      report_targets(target_bed, target_probe);
245
+
246
+      // Wait for heatbed to reach target temp and probe to cool below target temp
247
+      wait_for_temps(target_bed, target_probe, next_temp_report);
248
+
249
+      // Disable leveling so it won't mess with us
250
+      TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
251
+
252
+      bool timeout = false;
253
+      for (uint8_t idx = 0; idx <= PTC_PROBE_COUNT; idx++) {
254
+        // Move probe to probing point and wait for it to reach target temperature
255
+        do_blocking_move_to(noz_pos_xyz);
256
+
257
+        say_waiting_for_probe_heating();
258
+        SERIAL_ECHOLNPGM(" Bed:", target_bed, " Probe:", target_probe);
259
+        const millis_t probe_timeout_ms = millis() + SEC_TO_MS(900UL);
260
+        while (thermalManager.degProbe() < target_probe) {
261
+          if (report_temps(next_temp_report, probe_timeout_ms)) {
262
+            SERIAL_ECHOLNPGM("!Probe heating timed out.");
263
+            timeout = true;
264
+            break;
265
+          }
266
+        }
267
+        if (timeout) break;
268
+
269
+        const float measured_z = g76_probe(TSI_PROBE, target_probe, noz_pos_xyz);
270
+        if (isnan(measured_z)) break;
271
+      }
272
+
273
+      SERIAL_ECHOLNPGM("Retrieved measurements: ", ptc.get_index());
274
+      if (ptc.finish_calibration(TSI_PROBE))
275
+        say_successfully_calibrated();
276
+      else
277
+        say_failed_to_calibrate();
278
+      SERIAL_ECHOLNPGM(" probe.");
279
+
280
+      // Cleanup
281
+      thermalManager.setTargetBed(0);
282
+      TERN_(HAS_LEVELING, set_bed_leveling_enabled(true));
283
+
284
+      SERIAL_ECHOLNPGM("Final compensation values:");
285
+      ptc.print_offsets();
286
+    } // do_probe_cal
287
+
288
+    restore_feedrate_and_scaling();
289
+  }
290
+
291
+#endif // PTC_PROBE && PTC_BED
292
+
293
+/**
294
+ * M871: Report / reset temperature compensation offsets.
295
+ *       Note: This does not affect values in EEPROM until M500.
296
+ *
297
+ *   M871 [ R | B | P | E ]
298
+ *
299
+ *    No Parameters - Print current offset values.
300
+ *
301
+ * Select only one of these flags:
302
+ *    R - Reset all offsets to zero (i.e., disable compensation).
303
+ *    B - Manually set offset for bed
304
+ *    P - Manually set offset for probe
305
+ *    E - Manually set offset for extruder
306
+ *
307
+ * With B, P, or E:
308
+ *    I[index] - Index in the array
309
+ *    V[value] - Adjustment in µm
310
+ */
311
+void GcodeSuite::M871() {
312
+
313
+  if (parser.seen('R')) {
314
+    // Reset z-probe offsets to factory defaults
315
+    ptc.clear_all_offsets();
316
+    SERIAL_ECHOLNPGM("Offsets reset to default.");
317
+  }
318
+  else if (parser.seen("BPE")) {
319
+    if (!parser.seenval('V')) return;
320
+    const int16_t offset_val = parser.value_int();
321
+    if (!parser.seenval('I')) return;
322
+    const int16_t idx = parser.value_int();
323
+    const TempSensorID mod = TERN_(PTC_BED,    parser.seen_test('B') ? TSI_BED   :)
324
+                             TERN_(PTC_HOTEND, parser.seen_test('E') ? TSI_EXT   :)
325
+                             TERN_(PTC_PROBE,  parser.seen_test('P') ? TSI_PROBE :) TSI_COUNT;
326
+    if (mod == TSI_COUNT)
327
+      SERIAL_ECHOLNPGM("!Invalid sensor.");
328
+    else if (idx > 0 && ptc.set_offset(mod, idx - 1, offset_val))
329
+      SERIAL_ECHOLNPGM("Set value: ", offset_val);
330
+    else
331
+      SERIAL_ECHOLNPGM("!Invalid index. Failed to set value (note: value at index 0 is constant).");
332
+  }
333
+  else // Print current Z-probe adjustments. Note: Values in EEPROM might differ.
334
+    ptc.print_offsets();
335
+}
336
+
337
+#endif // HAS_PTC

+ 6
- 3
Marlin/src/gcode/gcode.cpp 파일 보기

@@ -424,7 +424,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
424 424
         case 61: G61(); break;                                    // G61:  Apply/restore saved coordinates.
425 425
       #endif
426 426
 
427
-      #if ENABLED(PROBE_TEMP_COMPENSATION)
427
+      #if BOTH(PTC_PROBE, PTC_BED)
428 428
         case 76: G76(); break;                                    // G76: Calibrate first layer compensation values
429 429
       #endif
430 430
 
@@ -587,6 +587,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
587 587
         case 191: M191(); break;                                  // M191: Wait for chamber temperature to reach target
588 588
       #endif
589 589
 
590
+      #if HAS_TEMP_PROBE
591
+        case 192: M192(); break;                                  // M192: Wait for probe temp
592
+      #endif
593
+
590 594
       #if HAS_COOLER
591 595
         case 143: M143(); break;                                  // M143: Set cooler temperature
592 596
         case 193: M193(); break;                                  // M193: Wait for cooler temperature to reach target
@@ -921,8 +925,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
921 925
         case 852: M852(); break;                                  // M852: Set Skew factors
922 926
       #endif
923 927
 
924
-      #if ENABLED(PROBE_TEMP_COMPENSATION)
925
-        case 192: M192(); break;                                  // M192: Wait for probe temp
928
+      #if HAS_PTC
926 929
         case 871: M871(); break;                                  // M871: Print/reset/clear first layer temperature offset values
927 930
       #endif
928 931
 

+ 39
- 18
Marlin/src/gcode/gcode.h 파일 보기

@@ -66,7 +66,7 @@
66 66
  * G42  - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL)
67 67
  * G60  - Save current position. (Requires SAVED_POSITIONS)
68 68
  * G61  - Apply/restore saved coordinates. (Requires SAVED_POSITIONS)
69
- * G76  - Calibrate first layer temperature offsets. (Requires PROBE_TEMP_COMPENSATION)
69
+ * G76  - Calibrate first layer temperature offsets. (Requires PTC_PROBE and PTC_BED)
70 70
  * G80  - Cancel current motion mode (Requires GCODE_MOTION_MODES)
71 71
  * G90  - Use Absolute Coordinates
72 72
  * G91  - Use Relative Coordinates
@@ -88,6 +88,8 @@
88 88
  * M16  - Expected printer check. (Requires EXPECTED_PRINTER_CHECK)
89 89
  * M17  - Enable/Power all stepper motors
90 90
  * M18  - Disable all stepper motors; same as M84
91
+ *
92
+ *** Print from Media (SDSUPPORT) ***
91 93
  * M20  - List SD card. (Requires SDSUPPORT)
92 94
  * M21  - Init SD card. (Requires SDSUPPORT)
93 95
  * M22  - Release SD card. (Requires SDSUPPORT)
@@ -100,30 +102,36 @@
100 102
  *        OR, with 'C' get the current filename.
101 103
  * M28  - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
102 104
  * M29  - Stop SD write. (Requires SDSUPPORT)
103
- * M30  - Delete file from SD: "M30 /path/file.gco"
105
+ * M30  - Delete file from SD: "M30 /path/file.gco" (Requires SDSUPPORT)
104 106
  * M31  - Report time since last M109 or SD card start to serial.
105 107
  * M32  - Select file and start SD print: "M32 [S<bytepos>] !/path/file.gco#". (Requires SDSUPPORT)
106 108
  *        Use P to run other files as sub-programs: "M32 P !filename#"
107 109
  *        The '#' is necessary when calling from within sd files, as it stops buffer prereading
108 110
  * M33  - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT)
109 111
  * M34  - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA)
112
+ *
110 113
  * M42  - Change pin status via gcode: M42 P<pin> S<value>. LED pin assumed if P is omitted. (Requires DIRECT_PIN_CONTROL)
111
- * M43  - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
114
+ * M43  - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins (Requires PINS_DEBUGGING)
112 115
  * M48  - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
116
+ *
113 117
  * M73  - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY)
114 118
  * M75  - Start the print job timer.
115 119
  * M76  - Pause the print job timer.
116 120
  * M77  - Stop the print job timer.
117 121
  * M78  - Show statistical information about the print jobs. (Requires PRINTCOUNTER)
122
+ *
118 123
  * M80  - Turn on Power Supply. (Requires PSU_CONTROL)
119 124
  * M81  - Turn off Power Supply. (Requires PSU_CONTROL)
125
+ *
120 126
  * M82  - Set E codes absolute (default).
121 127
  * M83  - Set E codes relative while in Absolute (G90) mode.
122 128
  * M84  - Disable steppers until next move, or use S<seconds> to specify an idle
123 129
  *        duration after which steppers should turn off. S0 disables the timeout.
124 130
  * M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
125 131
  * M92  - Set planner.settings.axis_steps_per_mm for one or more axes.
132
+ *
126 133
  * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
134
+ *
127 135
  * M104 - Set extruder target temp.
128 136
  * M105 - Report current temperatures.
129 137
  * M106 - Set print fan speed.
@@ -132,23 +140,29 @@
132 140
  * M109 - S<temp> Wait for extruder current temp to reach target temp. ** Wait only when heating! **
133 141
  *        R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
134 142
  *        If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
143
+ *
135 144
  * M110 - Set the current line number. (Used by host printing)
136 145
  * M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
137 146
  * M112 - Full Shutdown.
147
+ *
138 148
  * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
139 149
  * M114 - Report current position.
140 150
  * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
141 151
  * M117 - Display a message on the controller screen. (Requires an LCD)
142 152
  * M118 - Display a message in the host console.
153
+ *
143 154
  * M119 - Report endstops status.
144 155
  * M120 - Enable endstops detection.
145 156
  * M121 - Disable endstops detection.
157
+ *
146 158
  * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470)
147 159
  * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
160
+ *
148 161
  * M126 - Solenoid Air Valve Open. (Requires BARICUDA)
149 162
  * M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
150 163
  * M128 - EtoP Open. (Requires BARICUDA)
151 164
  * M129 - EtoP Closed. (Requires BARICUDA)
165
+ *
152 166
  * M140 - Set bed target temp. S<temp>
153 167
  * M141 - Set heated chamber target temp. S<temp> (Requires a chamber heater)
154 168
  * M143 - Set cooler target temp. S<temp> (Requires a laser cooling device)
@@ -161,9 +175,9 @@
161 175
  * M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)
162 176
  * M165 - Set the mix for the mixing extruder (and current virtual tool) with parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1)
163 177
  * M166 - Set the Gradient Mix for the mixing extruder. (Requires GRADIENT_MIX)
164
- * M190 - S<temp> Wait for bed current temp to reach target temp. ** Wait only when heating! **
165
- *        R<temp> Wait for bed current temp to reach target temp. ** Wait for heating or cooling. **
166
- * M193 - R<temp> Wait for cooler temp to reach target temp. ** Wait for cooling. **
178
+ * M190 - Set bed target temperature and wait. R<temp> Set target temperature and wait. S<temp> Set, but only wait when heating. (Requires TEMP_SENSOR_BED)
179
+ * M192 - Wait for probe to reach target temperature. (Requires TEMP_SENSOR_PROBE)
180
+ * M193 - R<temp> Wait for cooler to reach target temp. ** Wait for cooling. **
167 181
  * M200 - Set filament diameter, D<diameter>, setting E axis units to cubic. (Use S0 to revert to linear units.)
168 182
  * M201 - Set max acceleration in units/s^2 for print moves: "M201 X<accel> Y<accel> Z<accel> E<accel>"
169 183
  * M202 - Set max acceleration in units/s^2 for travel moves: "M202 X<accel> Y<accel> Z<accel> E<accel>" ** UNUSED IN MARLIN! **
@@ -183,7 +197,7 @@
183 197
  * M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
184 198
  * M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
185 199
  *        Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires an MMU_MODEL version 2 or 2S)
186
- * M221 - Set Flow Percentage: "M221 S<percent>"
200
+ * M221 - Set Flow Percentage: "M221 S<percent>" (Requires an extruder)
187 201
  * M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>" (Requires DIRECT_PIN_CONTROL)
188 202
  * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)
189 203
  * M250 - Set LCD contrast: "M250 C<contrast>" (0-63). (Requires LCD support)
@@ -230,9 +244,9 @@
230 244
  * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
231 245
  * M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
232 246
  * M504 - Validate EEPROM contents. (Requires EEPROM_SETTINGS)
233
- * M510 - Lock Printer
234
- * M511 - Unlock Printer
235
- * M512 - Set/Change/Remove Password
247
+ * M510 - Lock Printer (Requires PASSWORD_FEATURE)
248
+ * M511 - Unlock Printer (Requires PASSWORD_UNLOCK_GCODE)
249
+ * M512 - Set/Change/Remove Password (Requires PASSWORD_CHANGE_GCODE)
236 250
  * M524 - Abort the current SD print job started with M24. (Requires SDSUPPORT)
237 251
  * M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires SD_ABORT_ON_ENDSTOP_HIT)
238 252
  * M552 - Get or set IP address. Enable/disable network interface. (Requires enabled Ethernet port)
@@ -252,7 +266,9 @@
252 266
  * M808 - Set or Goto a Repeat Marker (Requires GCODE_REPEAT_MARKERS)
253 267
  * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS)
254 268
  * M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below)
255
- * M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ)
269
+ * M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, plus SKEW_CORRECTION_FOR_Z for IJ)
270
+ *
271
+ *** I2C_POSITION_ENCODERS ***
256 272
  * M860 - Report the position of position encoder modules.
257 273
  * M861 - Report the status of position encoder modules.
258 274
  * M862 - Perform an axis continuity test for position encoder modules.
@@ -263,8 +279,8 @@
263 279
  * M867 - Enable/disable or toggle error correction for position encoder modules.
264 280
  * M868 - Report or set position encoder module error correction threshold.
265 281
  * M869 - Report position encoder module error.
266
- * M871 - Print/reset/clear first layer temperature offset values. (Requires PROBE_TEMP_COMPENSATION)
267
- * M192 - Wait for probe temp (Requires PROBE_TEMP_COMPENSATION)
282
+ *
283
+ * M871 - Print/reset/clear first layer temperature offset values. (Requires PTC_PROBE, PTC_BED, or PTC_HOTEND)
268 284
  * M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER)
269 285
  * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
270 286
  * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470)
@@ -282,13 +298,14 @@
282 298
  * M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER)
283 299
  * M7219 - Control Max7219 Matrix LEDs. (Requires MAX7219_GCODE)
284 300
  *
301
+ *** SCARA ***
285 302
  * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
286 303
  * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
287 304
  * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
288 305
  * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
289 306
  * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
290 307
  *
291
- * ************ Custom codes - This can change to suit future G-code regulations
308
+ *** Custom codes (can be changed to suit future G-code standards) ***
292 309
  * G425 - Calibrate using a conductive object. (Requires CALIBRATION_GCODE)
293 310
  * M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT)
294 311
  * M993 - Backup SPI Flash to SD
@@ -296,10 +313,11 @@
296 313
  * M995 - Touch screen calibration for TFT display
297 314
  * M997 - Perform in-application firmware update
298 315
  * M999 - Restart after being stopped by error
316
+ *
299 317
  * D... - Custom Development G-code. Add hooks to 'gcode_D.cpp' for developers to test features. (Requires MARLIN_DEV_MODE)
300 318
  *        D576 - Set buffer monitoring options. (Requires BUFFER_MONITORING)
301 319
  *
302
- * "T" Codes
320
+ *** "T" Codes ***
303 321
  *
304 322
  * T0-T3 - Select an extruder (tool) by index: "T<n> F<units/min>"
305 323
  */
@@ -551,7 +569,7 @@ private:
551 569
     static void G59();
552 570
   #endif
553 571
 
554
-  #if ENABLED(PROBE_TEMP_COMPENSATION)
572
+  #if BOTH(PTC_PROBE, PTC_BED)
555 573
     static void G76();
556 574
   #endif
557 575
 
@@ -744,6 +762,10 @@ private:
744 762
     static void M191();
745 763
   #endif
746 764
 
765
+  #if HAS_TEMP_PROBE
766
+    static void M192();
767
+  #endif
768
+
747 769
   #if HAS_COOLER
748 770
     static void M143();
749 771
     static void M193();
@@ -1087,8 +1109,7 @@ private:
1087 1109
     FORCE_INLINE static void M869() { I2CPEM.M869(); }
1088 1110
   #endif
1089 1111
 
1090
-  #if ENABLED(PROBE_TEMP_COMPENSATION)
1091
-    static void M192();
1112
+  #if HAS_PTC
1092 1113
     static void M871();
1093 1114
   #endif
1094 1115
 

+ 56
- 0
Marlin/src/gcode/temp/M192.cpp 파일 보기

@@ -0,0 +1,56 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * M192.cpp - Wait for probe to reach temperature
25
+ */
26
+
27
+#include "../../inc/MarlinConfig.h"
28
+
29
+#if HAS_TEMP_PROBE
30
+
31
+#include "../gcode.h"
32
+#include "../../module/temperature.h"
33
+#include "../../lcd/marlinui.h"
34
+
35
+/**
36
+ * M192: Wait for probe temperature sensor to reach a target
37
+ *
38
+ * Select only one of these flags:
39
+ *    R - Wait for heating or cooling
40
+ *    S - Wait only for heating
41
+ */
42
+void GcodeSuite::M192() {
43
+  if (DEBUGGING(DRYRUN)) return;
44
+
45
+  const bool no_wait_for_cooling = parser.seenval('S');
46
+  if (!no_wait_for_cooling && !parser.seenval('R')) {
47
+    SERIAL_ERROR_MSG("No target temperature set.");
48
+    return;
49
+  }
50
+
51
+  const celsius_t target_temp = parser.value_celsius();
52
+  ui.set_status(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT_F(MSG_PROBE_HEATING) : GET_TEXT_F(MSG_PROBE_COOLING));
53
+  thermalManager.wait_for_probe(target_temp, no_wait_for_cooling);
54
+}
55
+
56
+#endif // HAS_TEMP_PROBE

+ 14
- 0
Marlin/src/inc/Conditionals_adv.h 파일 보기

@@ -550,6 +550,20 @@
550 550
   #endif
551 551
 #endif
552 552
 
553
+// Probe Temperature Compensation
554
+#if !TEMP_SENSOR_PROBE
555
+  #undef PTC_PROBE
556
+#endif
557
+#if !TEMP_SENSOR_BED
558
+  #undef PTC_BED
559
+#endif
560
+#if !HAS_EXTRUDERS
561
+  #undef PTC_HOTEND
562
+#endif
563
+#if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND)
564
+  #define HAS_PTC 1
565
+#endif
566
+
553 567
 // Let SD_FINISHED_RELEASECOMMAND stand in for SD_FINISHED_STEPPERRELEASE
554 568
 #if ENABLED(SD_FINISHED_STEPPERRELEASE)
555 569
   #ifndef SD_FINISHED_RELEASECOMMAND

+ 41
- 37
Marlin/src/inc/SanityCheck.h 파일 보기

@@ -597,6 +597,10 @@
597 597
   #error "SPINDLE_LASER_PWM (true) is now set with SPINDLE_LASER_USE_PWM (enabled)."
598 598
 #elif ANY(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF)
599 599
   #error "The IS_RAMPS_* conditionals (for heater/fan/bed pins) are now called FET_ORDER_*."
600
+#elif defined(PROBE_TEMP_COMPENSATION)
601
+  #error "PROBE_TEMP_COMPENSATION is now set using the PTC_PROBE, PTC_BED, PTC_HOTEND options."
602
+#elif defined(BTC_PROBE_TEMP)
603
+  #error "BTC_PROBE_TEMP is now PTC_PROBE_TEMP."
600 604
 #endif
601 605
 
602 606
 #if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD)
@@ -611,60 +615,60 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
611 615
 /**
612 616
  * Probe temp compensation requirements
613 617
  */
614
-
615
-#if ENABLED(PROBE_TEMP_COMPENSATION)
616
-  #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
617
-    #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
618
-  #elif !defined(PTC_PARK_POS)
619
-    #error "PROBE_TEMP_COMPENSATION requires PTC_PARK_POS."
620
-  #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
621
-    #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
622
-  #elif !defined(PTC_PROBE_POS)
623
-    #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS."
618
+#if HAS_PTC
619
+  #if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
620
+    #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
621
+      #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
622
+    #elif !defined(PTC_PARK_POS)
623
+      #error "PTC_PARK_POS is required for Probe Temperature Compensation."
624
+    #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
625
+      #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
626
+    #elif !defined(PTC_PROBE_POS)
627
+      #error "PTC_PROBE_POS is required for Probe Temperature Compensation."
628
+    #endif
624 629
   #endif
625 630
 
626
-  #ifdef PTC_SAMPLE_START
627
-    constexpr auto _ptc_sample_start = PTC_SAMPLE_START;
631
+  #ifdef PTC_PROBE_START
632
+    constexpr auto _ptc_sample_start = PTC_PROBE_START;
628 633
     constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f;
629
-    static_assert(_test_ptc_sample_start != 12.3f, "PTC_SAMPLE_START must be a whole number.");
634
+    static_assert(_test_ptc_sample_start != 12.3f, "PTC_PROBE_START must be a whole number.");
630 635
   #endif
631
-  #ifdef PTC_SAMPLE_RES
632
-    constexpr auto _ptc_sample_res = PTC_SAMPLE_RES;
636
+  #ifdef PTC_PROBE_RES
637
+    constexpr auto _ptc_sample_res = PTC_PROBE_RES;
633 638
     constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
634
-    static_assert(_test_ptc_sample_res != 12.3f, "PTC_SAMPLE_RES must be a whole number.");
639
+    static_assert(_test_ptc_sample_res != 12.3f, "PTC_PROBE_RES must be a whole number.");
635 640
   #endif
636
-  #ifdef BTC_SAMPLE_START
637
-    constexpr auto _btc_sample_start = BTC_SAMPLE_START;
641
+  #ifdef PTC_BED_START
642
+    constexpr auto _btc_sample_start = PTC_BED_START;
638 643
     constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f;
639
-    static_assert(_test_btc_sample_start != 12.3f, "BTC_SAMPLE_START must be a whole number.");
644
+    static_assert(_test_btc_sample_start != 12.3f, "PTC_BED_START must be a whole number.");
640 645
   #endif
641
-  #ifdef BTC_SAMPLE_RES
642
-    constexpr auto _btc_sample_res = BTC_SAMPLE_RES;
646
+  #ifdef PTC_BED_RES
647
+    constexpr auto _btc_sample_res = PTC_BED_RES;
643 648
     constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
644
-    static_assert(_test_btc_sample_res != 12.3f, "BTC_SAMPLE_RES must be a whole number.");
649
+    static_assert(_test_btc_sample_res != 12.3f, "PTC_BED_RES must be a whole number.");
645 650
   #endif
646
-  #ifdef BTC_PROBE_TEMP
647
-    constexpr auto _btc_probe_temp = BTC_PROBE_TEMP;
651
+  #ifdef PTC_PROBE_TEMP
652
+    constexpr auto _btc_probe_temp = PTC_PROBE_TEMP;
648 653
     constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f;
649
-    static_assert(_test_btc_probe_temp != 12.3f, "BTC_PROBE_TEMP must be a whole number.");
654
+    static_assert(_test_btc_probe_temp != 12.3f, "PTC_PROBE_TEMP must be a whole number.");
650 655
   #endif
651
-  #if ENABLED(USE_TEMP_EXT_COMPENSATION)
652
-    #ifdef ETC_SAMPLE_START
653
-      constexpr auto _etc_sample_start = ETC_SAMPLE_START;
656
+  #if ENABLED(PTC_HOTEND)
657
+    #if EXTRUDERS != 1
658
+      #error "PTC_HOTEND only works with a single extruder."
659
+    #endif
660
+    #ifdef PTC_HOTEND_START
661
+      constexpr auto _etc_sample_start = PTC_HOTEND_START;
654 662
       constexpr decltype(_etc_sample_start) _test_etc_sample_start = 12.3f;
655
-      static_assert(_test_etc_sample_start != 12.3f, "ETC_SAMPLE_START must be a whole number.");
663
+      static_assert(_test_etc_sample_start != 12.3f, "PTC_HOTEND_START must be a whole number.");
656 664
     #endif
657
-    #ifdef ETC_SAMPLE_RES
658
-      constexpr auto _etc_sample_res = ETC_SAMPLE_RES;
665
+    #ifdef PTC_HOTEND_RES
666
+      constexpr auto _etc_sample_res = PTC_HOTEND_RES;
659 667
       constexpr decltype(_etc_sample_res) _test_etc_sample_res = 12.3f;
660
-      static_assert(_test_etc_sample_res != 12.3f, "ETC_SAMPLE_RES must be a whole number.");
668
+      static_assert(_test_etc_sample_res != 12.3f, "PTC_HOTEND_RES must be a whole number.");
661 669
     #endif
662 670
   #endif
663
-
664
-  #if ENABLED(USE_TEMP_EXT_COMPENSATION) && EXTRUDERS != 1
665
-    #error "USE_TEMP_EXT_COMPENSATION only works with a single extruder."
666
-  #endif
667
-#endif
671
+#endif // HAS_PTC
668 672
 
669 673
 /**
670 674
  * Marlin release, version and default string

+ 35
- 19
Marlin/src/module/settings.cpp 파일 보기

@@ -128,7 +128,7 @@
128 128
   #include "../feature/tmc_util.h"
129 129
 #endif
130 130
 
131
-#if ENABLED(PROBE_TEMP_COMPENSATION)
131
+#if HAS_PTC
132 132
   #include "../feature/probe_temp_comp.h"
133 133
 #endif
134 134
 
@@ -264,13 +264,16 @@ typedef struct SettingsDataStruct {
264 264
   //
265 265
   // Temperature first layer compensation values
266 266
   //
267
-  #if ENABLED(PROBE_TEMP_COMPENSATION)
268
-    int16_t z_offsets_probe[COUNT(temp_comp.z_offsets_probe)], // M871 P I V
269
-            z_offsets_bed[COUNT(temp_comp.z_offsets_bed)]      // M871 B I V
270
-            #if ENABLED(USE_TEMP_EXT_COMPENSATION)
271
-              , z_offsets_ext[COUNT(temp_comp.z_offsets_ext)]  // M871 E I V
272
-            #endif
273
-            ;
267
+  #if HAS_PTC
268
+    #if ENABLED(PTC_PROBE)
269
+      int16_t z_offsets_probe[COUNT(ptc.z_offsets_probe)]; // M871 P I V
270
+    #endif
271
+    #if ENABLED(PTC_BED)
272
+      int16_t z_offsets_bed[COUNT(ptc.z_offsets_bed)];     // M871 B I V
273
+    #endif
274
+    #if ENABLED(PTC_HOTEND)
275
+      int16_t z_offsets_hotend[COUNT(ptc.z_offsets_hotend)];     // M871 E I V
276
+    #endif
274 277
   #endif
275 278
 
276 279
   //
@@ -844,11 +847,15 @@ void MarlinSettings::postprocess() {
844 847
     //
845 848
     // Thermal first layer compensation values
846 849
     //
847
-    #if ENABLED(PROBE_TEMP_COMPENSATION)
848
-      EEPROM_WRITE(temp_comp.z_offsets_probe);
849
-      EEPROM_WRITE(temp_comp.z_offsets_bed);
850
-      #if ENABLED(USE_TEMP_EXT_COMPENSATION)
851
-        EEPROM_WRITE(temp_comp.z_offsets_ext);
850
+    #if HAS_PTC
851
+      #if ENABLED(PTC_PROBE)
852
+        EEPROM_WRITE(ptc.z_offsets_probe);
853
+      #endif
854
+      #if ENABLED(PTC_BED)
855
+        EEPROM_WRITE(ptc.z_offsets_bed);
856
+      #endif
857
+      #if ENABLED(PTC_HOTEND)
858
+        EEPROM_WRITE(ptc.z_offsets_hotend);
852 859
       #endif
853 860
     #else
854 861
       // No placeholder data for this feature
@@ -1710,13 +1717,17 @@ void MarlinSettings::postprocess() {
1710 1717
       //
1711 1718
       // Thermal first layer compensation values
1712 1719
       //
1713
-      #if ENABLED(PROBE_TEMP_COMPENSATION)
1714
-        EEPROM_READ(temp_comp.z_offsets_probe);
1715
-        EEPROM_READ(temp_comp.z_offsets_bed);
1716
-        #if ENABLED(USE_TEMP_EXT_COMPENSATION)
1717
-          EEPROM_READ(temp_comp.z_offsets_ext);
1720
+      #if HAS_PTC
1721
+        #if ENABLED(PTC_PROBE)
1722
+          EEPROM_READ(ptc.z_offsets_probe);
1718 1723
         #endif
1719
-        temp_comp.reset_index();
1724
+        # if ENABLED(PTC_BED)
1725
+          EEPROM_READ(ptc.z_offsets_bed);
1726
+        #endif
1727
+        #if ENABLED(PTC_HOTEND)
1728
+          EEPROM_READ(ptc.z_offsets_hotend);
1729
+        #endif
1730
+        ptc.reset_index();
1720 1731
       #else
1721 1732
         // No placeholder data for this feature
1722 1733
       #endif
@@ -2729,6 +2740,11 @@ void MarlinSettings::reset() {
2729 2740
   TERN_(EDITABLE_SERVO_ANGLES, COPY(servo_angles, base_servo_angles)); // When not editable only one copy of servo angles exists
2730 2741
 
2731 2742
   //
2743
+  // Probe Temperature Compensation
2744
+  //
2745
+  TERN_(HAS_PTC, ptc.reset());
2746
+
2747
+  //
2732 2748
   // BLTOUCH
2733 2749
   //
2734 2750
   //#if ENABLED(BLTOUCH)

+ 4
- 4
buildroot/tests/rambo 파일 보기

@@ -18,7 +18,7 @@ opt_set MOTHERBOARD BOARD_RAMBO \
18 18
         FANMUX0_PIN 53
19 19
 opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN USE_WATCHDOG
20 20
 opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \
21
-           FIX_MOUNTED_PROBE CODEPENDENT_XY_HOMING PIDTEMPBED PROBE_TEMP_COMPENSATION \
21
+           FIX_MOUNTED_PROBE CODEPENDENT_XY_HOMING PIDTEMPBED PTC_PROBE PTC_BED \
22 22
            PREHEAT_BEFORE_PROBING PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \
23 23
            EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \
24 24
            BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \
@@ -61,16 +61,16 @@ opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS
61 61
 exec_test $1 $2 "Rambo CNC Configuration" "$3"
62 62
 
63 63
 #
64
-# Rambo heated bed only
64
+# Rambo heated bed and probe temp sensor
65 65
 #
66 66
 restore_configs
67
-opt_set MOTHERBOARD BOARD_RAMBO EXTRUDERS 0 TEMP_SENSOR_BED 1 \
67
+opt_set MOTHERBOARD BOARD_RAMBO EXTRUDERS 0 TEMP_SENSOR_BED 1 TEMP_SENSOR_PROBE 1 TEMP_PROBE_PIN 12 \
68 68
         DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 4000 }' \
69 69
         DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \
70 70
         DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \
71 71
         MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \
72 72
         AXIS_RELATIVE_MODES '{ false, false, false }'
73
-opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
73
+opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER FIX_MOUNTED_PROBE Z_SAFE_HOMING
74 74
 exec_test $1 $2 "Rambo heated bed only" "$3"
75 75
 
76 76
 #

+ 5
- 4
ini/features.ini 파일 보기

@@ -136,20 +136,20 @@ ADVANCED_PAUSE_FEATURE                 = src_filter=+<src/feature/pause.cpp> +<s
136 136
 PSU_CONTROL                            = src_filter=+<src/feature/power.cpp>
137 137
 HAS_POWER_MONITOR                      = src_filter=+<src/feature/power_monitor.cpp> +<src/gcode/feature/power_monitor>
138 138
 POWER_LOSS_RECOVERY                    = src_filter=+<src/feature/powerloss.cpp> +<src/gcode/feature/powerloss>
139
-PROBE_TEMP_COMPENSATION                = src_filter=+<src/feature/probe_temp_comp.cpp> +<src/gcode/calibrate/G76_M192_M871.cpp>
139
+HAS_PTC                                = src_filter=+<src/feature/probe_temp_comp.cpp> +<src/gcode/calibrate/G76_M871.cpp>
140 140
 HAS_FILAMENT_SENSOR                    = src_filter=+<src/feature/runout.cpp> +<src/gcode/feature/runout>
141 141
 (EXT|MANUAL)_SOLENOID.*                = src_filter=+<src/feature/solenoid.cpp> +<src/gcode/control/M380_M381.cpp>
142 142
 MK2_MULTIPLEXER                        = src_filter=+<src/feature/snmm.cpp>
143 143
 HAS_CUTTER                             = src_filter=+<src/feature/spindle_laser.cpp> +<src/gcode/control/M3-M5.cpp>
144 144
 HAS_DRIVER_SAFE_POWER_PROTECT          = src_filter=+<src/feature/stepper_driver_safety.cpp>
145 145
 EXPERIMENTAL_I2CBUS                    = src_filter=+<src/feature/twibus.cpp> +<src/gcode/feature/i2c>
146
-MECHANICAL_GANTRY_CAL.+                = src_filter=+<src/gcode/calibrate/G34.cpp>
147
-Z_MULTI_ENDSTOPS                       = src_filter=+<src/gcode/calibrate/G34_M422.cpp>
148
-Z_STEPPER_AUTO_ALIGN                   = src_filter=+<src/feature/z_stepper_align.cpp> +<src/gcode/calibrate/G34_M422.cpp>
149 146
 G26_MESH_VALIDATION                    = src_filter=+<src/gcode/bedlevel/G26.cpp>
150 147
 ASSISTED_TRAMMING                      = src_filter=+<src/feature/tramming.cpp> +<src/gcode/bedlevel/G35.cpp>
151 148
 HAS_MESH                               = src_filter=+<src/gcode/bedlevel/G42.cpp>
152 149
 HAS_LEVELING                           = src_filter=+<src/gcode/bedlevel/M420.cpp> +<src/feature/bedlevel/bedlevel.cpp>
150
+MECHANICAL_GANTRY_CAL.+                = src_filter=+<src/gcode/calibrate/G34.cpp>
151
+Z_MULTI_ENDSTOPS|Z_STEPPER_AUTO_ALIGN  = src_filter=+<src/gcode/calibrate/G34_M422.cpp>
152
+Z_STEPPER_AUTO_ALIGN                   = src_filter=+<src/feature/z_stepper_align.cpp>
153 153
 DELTA_AUTO_CALIBRATION                 = src_filter=+<src/gcode/calibrate/G33.cpp>
154 154
 CALIBRATION_GCODE                      = src_filter=+<src/gcode/calibrate/G425.cpp>
155 155
 Z_MIN_PROBE_REPEATABILITY_TEST         = src_filter=+<src/gcode/calibrate/M48.cpp>
@@ -209,6 +209,7 @@ SDSUPPORT                              = src_filter=+<src/sd/cardreader.cpp> +<s
209 209
 HAS_MEDIA_SUBCALLS                     = src_filter=+<src/gcode/sd/M32.cpp>
210 210
 GCODE_REPEAT_MARKERS                   = src_filter=+<src/feature/repeat.cpp> +<src/gcode/sd/M808.cpp>
211 211
 HAS_EXTRUDERS                          = src_filter=+<src/gcode/units/M82_M83.cpp> +<src/gcode/temp/M104_M109.cpp> +<src/gcode/config/M221.cpp>
212
+HAS_TEMP_PROBE                         = src_filter=+<src/gcode/temp/M192.cpp>
212 213
 HAS_COOLER                             = src_filter=+<src/gcode/temp/M143_M193.cpp>
213 214
 HAS_COOLER|LASER_COOLANT_FLOW_METER    = src_filter=+<src/feature/cooler.cpp>
214 215
 AUTO_REPORT_TEMPERATURES               = src_filter=+<src/gcode/temp/M155.cpp>

+ 2
- 1
platformio.ini 파일 보기

@@ -152,7 +152,7 @@ default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
152 152
   -<src/gcode/calibrate/G33.cpp>
153 153
   -<src/gcode/calibrate/G34.cpp>
154 154
   -<src/gcode/calibrate/G34_M422.cpp>
155
-  -<src/gcode/calibrate/G76_M192_M871.cpp>
155
+  -<src/gcode/calibrate/G76_M871.cpp>
156 156
   -<src/gcode/calibrate/G425.cpp>
157 157
   -<src/gcode/calibrate/M12.cpp>
158 158
   -<src/gcode/calibrate/M48.cpp>
@@ -229,6 +229,7 @@ default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
229 229
   -<src/gcode/sd/M808.cpp>
230 230
   -<src/gcode/temp/M104_M109.cpp>
231 231
   -<src/gcode/temp/M155.cpp>
232
+  -<src/gcode/temp/M192.cpp>
232 233
   -<src/gcode/units/G20_G21.cpp>
233 234
   -<src/gcode/units/M82_M83.cpp>
234 235
   -<src/gcode/units/M149.cpp>

Loading…
취소
저장