Parcourir la source

🐛 Use whole PROBE_TEMP_COMPENSATION values (#22130)

Katelyn Schiesser il y a 2 ans
Parent
révision
31d84bac4c
Aucun compte lié à l'adresse e-mail de l'auteur

+ 11
- 11
Marlin/Configuration_adv.h Voir le fichier

@@ -202,7 +202,7 @@
202 202
   #define COOLER_MAXTEMP          26  // (°C)
203 203
   #define COOLER_DEFAULT_TEMP     16  // (°C)
204 204
   #define TEMP_COOLER_HYSTERESIS   1  // (°C) Temperature proximity considered "close enough" to the target
205
-  #define COOLER_PIN               8  // Laser cooler on/off pin used to control power to the cooling element e.g. TEC, External chiller via relay
205
+  #define COOLER_PIN               8  // Laser cooler on/off pin used to control power to the cooling element (e.g., TEC, External chiller via relay)
206 206
   #define COOLER_INVERTING     false
207 207
   #define TEMP_COOLER_PIN         15  // Laser/Cooler temperature sensor pin. ADC is required.
208 208
   #define COOLER_FAN                  // Enable a fan on the cooler, Fan# 0,1,2,3 etc.
@@ -1961,21 +1961,21 @@
1961 1961
     //#define USE_TEMP_EXT_COMPENSATION
1962 1962
 
1963 1963
     // Probe temperature calibration generates a table of values starting at PTC_SAMPLE_START
1964
-    // (e.g. 30), in steps of PTC_SAMPLE_RES (e.g. 5) with PTC_SAMPLE_COUNT (e.g. 10) samples.
1964
+    // (e.g., 30), in steps of PTC_SAMPLE_RES (e.g., 5) with PTC_SAMPLE_COUNT (e.g., 10) samples.
1965 1965
 
1966
-    //#define PTC_SAMPLE_START  30.0f
1967
-    //#define PTC_SAMPLE_RES    5.0f
1968
-    //#define PTC_SAMPLE_COUNT  10U
1966
+    //#define PTC_SAMPLE_START  30  // (°C)
1967
+    //#define PTC_SAMPLE_RES     5  // (°C)
1968
+    //#define PTC_SAMPLE_COUNT  10
1969 1969
 
1970 1970
     // Bed temperature calibration builds a similar table.
1971 1971
 
1972
-    //#define BTC_SAMPLE_START  60.0f
1973
-    //#define BTC_SAMPLE_RES    5.0f
1974
-    //#define BTC_SAMPLE_COUNT  10U
1972
+    //#define BTC_SAMPLE_START  60  // (°C)
1973
+    //#define BTC_SAMPLE_RES     5  // (°C)
1974
+    //#define BTC_SAMPLE_COUNT  10
1975 1975
 
1976 1976
     // The temperature the probe should be at while taking measurements during bed temperature
1977 1977
     // calibration.
1978
-    //#define BTC_PROBE_TEMP 30.0f
1978
+    //#define BTC_PROBE_TEMP    30  // (°C)
1979 1979
 
1980 1980
     // Height above Z=0.0f to raise the nozzle. Lowering this can help the probe to heat faster.
1981 1981
     // Note: the Z=0.0f offset is determined by the probe offset which can be set using M851.
@@ -1984,7 +1984,7 @@
1984 1984
     // Height to raise the Z-probe between heating and taking the next measurement. Some probes
1985 1985
     // may fail to untrigger if they have been triggered for a long time, which can be solved by
1986 1986
     // increasing the height the probe is raised to.
1987
-    //#define PTC_PROBE_RAISE 15U
1987
+    //#define PTC_PROBE_RAISE 15
1988 1988
 
1989 1989
     // If the probe is outside of the defined range, use linear extrapolation using the closest
1990 1990
     // point and the PTC_LINEAR_EXTRAPOLATION'th next point. E.g. if set to 4 it will use data[0]
@@ -2099,7 +2099,7 @@
2099 2099
 // @section motion
2100 2100
 
2101 2101
 // The number of linear moves that can be in the planner at once.
2102
-// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g. 8, 16, 32)
2102
+// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g., 8, 16, 32)
2103 2103
 #if BOTH(SDSUPPORT, DIRECT_STEPPING)
2104 2104
   #define BLOCK_BUFFER_SIZE  8
2105 2105
 #elif ENABLED(SDSUPPORT)

+ 4
- 4
Marlin/src/feature/probe_temp_comp.h Voir le fichier

@@ -47,7 +47,7 @@ typedef struct {
47 47
 
48 48
 // Probe temperature calibration constants
49 49
 #ifndef PTC_SAMPLE_COUNT
50
-  #define PTC_SAMPLE_COUNT 10U
50
+  #define PTC_SAMPLE_COUNT 10
51 51
 #endif
52 52
 #ifndef PTC_SAMPLE_RES
53 53
   #define PTC_SAMPLE_RES 5
@@ -55,14 +55,14 @@ typedef struct {
55 55
 #ifndef PTC_SAMPLE_START
56 56
   #define PTC_SAMPLE_START 30
57 57
 #endif
58
-#define PTC_SAMPLE_END ((PTC_SAMPLE_START) + (PTC_SAMPLE_COUNT) * (PTC_SAMPLE_RES))
58
+#define PTC_SAMPLE_END (PTC_SAMPLE_START + (PTC_SAMPLE_COUNT) * PTC_SAMPLE_RES)
59 59
 
60 60
 // Bed temperature calibration constants
61 61
 #ifndef BTC_PROBE_TEMP
62 62
   #define BTC_PROBE_TEMP 30
63 63
 #endif
64 64
 #ifndef BTC_SAMPLE_COUNT
65
-  #define BTC_SAMPLE_COUNT 10U
65
+  #define BTC_SAMPLE_COUNT 10
66 66
 #endif
67 67
 #ifndef BTC_SAMPLE_RES
68 68
   #define BTC_SAMPLE_RES 5
@@ -70,7 +70,7 @@ typedef struct {
70 70
 #ifndef BTC_SAMPLE_START
71 71
   #define BTC_SAMPLE_START 60
72 72
 #endif
73
-#define BTC_SAMPLE_END ((BTC_SAMPLE_START) + (BTC_SAMPLE_COUNT) * (BTC_SAMPLE_RES))
73
+#define BTC_SAMPLE_END (BTC_SAMPLE_START + (BTC_SAMPLE_COUNT) * BTC_SAMPLE_RES)
74 74
 
75 75
 #ifndef PTC_PROBE_HEATING_OFFSET
76 76
   #define PTC_PROBE_HEATING_OFFSET 0.5f

+ 22
- 0
Marlin/src/inc/SanityCheck.h Voir le fichier

@@ -580,6 +580,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
580 580
 /**
581 581
  * Probe temp compensation requirements
582 582
  */
583
+
583 584
 #if ENABLED(PROBE_TEMP_COMPENSATION)
584 585
   #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
585 586
     #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
@@ -590,6 +591,27 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
590 591
   #elif !defined(PTC_PROBE_POS)
591 592
     #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS."
592 593
   #endif
594
+
595
+  #ifdef PTC_SAMPLE_START
596
+    constexpr int _ptc_sample_start = PTC_SAMPLE_START;
597
+    static_assert(_test_ptc_sample_start != PTC_SAMPLE_START, "PTC_SAMPLE_START must be a whole number.");
598
+  #endif
599
+  #ifdef PTC_SAMPLE_RES
600
+    constexpr int _ptc_sample_res = PTC_SAMPLE_END;
601
+    static_assert(_test_ptc_sample_res != PTC_SAMPLE_END, "PTC_SAMPLE_RES must be a whole number.");
602
+  #endif
603
+  #ifdef BTC_SAMPLE_START
604
+    constexpr int _btc_sample_start = BTC_SAMPLE_START;
605
+    static_assert(_test_btc_sample_start != BTC_SAMPLE_START, "BTC_SAMPLE_START must be a whole number.");
606
+  #endif
607
+  #ifdef BTC_SAMPLE_RES
608
+    constexpr int _btc_sample_res = BTC_SAMPLE_END;
609
+    static_assert(_test_btc_sample_res != BTC_SAMPLE_END, "BTC_SAMPLE_RES must be a whole number.");
610
+  #endif
611
+  #ifdef BTC_PROBE_TEMP
612
+    constexpr int _btc_probe_temp = BTC_PROBE_TEMP;
613
+    static_assert(_test_btc_probe_temp != BTC_PROBE_TEMP, "BTC_PROBE_TEMP must be a whole number.");
614
+  #endif
593 615
 #endif
594 616
 
595 617
 /**

+ 6
- 0
buildroot/tests/BIGTREE_BTT002 Voir le fichier

@@ -16,5 +16,11 @@ opt_set MOTHERBOARD BOARD_BTT_BTT002_V1_0 \
16 16
         Y_DRIVER_TYPE TMC2130
17 17
 exec_test $1 $2 "BigTreeTech BTT002 Default Configuration plus TMC steppers" "$3"
18 18
 
19
+#
20
+# A test with Probe Temperature Compensation enabled
21
+#
22
+use_example_configs Prusa/MK3S-BigTreeTech-BTT002
23
+exec_test $1 $2 "BigTreeTech BTT002 with Prusa MK3S and related options" "$3"
24
+
19 25
 # clean up
20 26
 restore_configs

Chargement…
Annuler
Enregistrer