🐛 Use whole PROBE_TEMP_COMPENSATION values (#22130)

This commit is contained in:
Katelyn Schiesser 2021-06-13 14:56:18 -07:00 committed by Scott Lahteine
parent 2aa35577f2
commit 68c52673d6
4 changed files with 43 additions and 15 deletions

View file

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

View file

@ -47,7 +47,7 @@ typedef struct {
// Probe temperature calibration constants // Probe temperature calibration constants
#ifndef PTC_SAMPLE_COUNT #ifndef PTC_SAMPLE_COUNT
#define PTC_SAMPLE_COUNT 10U #define PTC_SAMPLE_COUNT 10
#endif #endif
#ifndef PTC_SAMPLE_RES #ifndef PTC_SAMPLE_RES
#define PTC_SAMPLE_RES 5 #define PTC_SAMPLE_RES 5
@ -55,14 +55,14 @@ typedef struct {
#ifndef PTC_SAMPLE_START #ifndef PTC_SAMPLE_START
#define PTC_SAMPLE_START 30 #define PTC_SAMPLE_START 30
#endif #endif
#define PTC_SAMPLE_END ((PTC_SAMPLE_START) + (PTC_SAMPLE_COUNT) * (PTC_SAMPLE_RES)) #define PTC_SAMPLE_END (PTC_SAMPLE_START + (PTC_SAMPLE_COUNT) * PTC_SAMPLE_RES)
// Bed temperature calibration constants // Bed temperature calibration constants
#ifndef BTC_PROBE_TEMP #ifndef BTC_PROBE_TEMP
#define BTC_PROBE_TEMP 30 #define BTC_PROBE_TEMP 30
#endif #endif
#ifndef BTC_SAMPLE_COUNT #ifndef BTC_SAMPLE_COUNT
#define BTC_SAMPLE_COUNT 10U #define BTC_SAMPLE_COUNT 10
#endif #endif
#ifndef BTC_SAMPLE_RES #ifndef BTC_SAMPLE_RES
#define BTC_SAMPLE_RES 5 #define BTC_SAMPLE_RES 5
@ -70,7 +70,7 @@ typedef struct {
#ifndef BTC_SAMPLE_START #ifndef BTC_SAMPLE_START
#define BTC_SAMPLE_START 60 #define BTC_SAMPLE_START 60
#endif #endif
#define BTC_SAMPLE_END ((BTC_SAMPLE_START) + (BTC_SAMPLE_COUNT) * (BTC_SAMPLE_RES)) #define BTC_SAMPLE_END (BTC_SAMPLE_START + (BTC_SAMPLE_COUNT) * BTC_SAMPLE_RES)
#ifndef PTC_PROBE_HEATING_OFFSET #ifndef PTC_PROBE_HEATING_OFFSET
#define PTC_PROBE_HEATING_OFFSET 0.5f #define PTC_PROBE_HEATING_OFFSET 0.5f

View file

@ -580,6 +580,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
/** /**
* Probe temp compensation requirements * Probe temp compensation requirements
*/ */
#if ENABLED(PROBE_TEMP_COMPENSATION) #if ENABLED(PROBE_TEMP_COMPENSATION)
#if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z) #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
#error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)." #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
#elif !defined(PTC_PROBE_POS) #elif !defined(PTC_PROBE_POS)
#error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS." #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS."
#endif #endif
#ifdef PTC_SAMPLE_START
constexpr int _ptc_sample_start = PTC_SAMPLE_START;
static_assert(_test_ptc_sample_start != PTC_SAMPLE_START, "PTC_SAMPLE_START must be a whole number.");
#endif
#ifdef PTC_SAMPLE_RES
constexpr int _ptc_sample_res = PTC_SAMPLE_END;
static_assert(_test_ptc_sample_res != PTC_SAMPLE_END, "PTC_SAMPLE_RES must be a whole number.");
#endif
#ifdef BTC_SAMPLE_START
constexpr int _btc_sample_start = BTC_SAMPLE_START;
static_assert(_test_btc_sample_start != BTC_SAMPLE_START, "BTC_SAMPLE_START must be a whole number.");
#endif
#ifdef BTC_SAMPLE_RES
constexpr int _btc_sample_res = BTC_SAMPLE_END;
static_assert(_test_btc_sample_res != BTC_SAMPLE_END, "BTC_SAMPLE_RES must be a whole number.");
#endif
#ifdef BTC_PROBE_TEMP
constexpr int _btc_probe_temp = BTC_PROBE_TEMP;
static_assert(_test_btc_probe_temp != BTC_PROBE_TEMP, "BTC_PROBE_TEMP must be a whole number.");
#endif
#endif #endif
/** /**

View file

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