diff --git a/.travis.yml b/.travis.yml index cfcee4f775..a7c220d067 100644 --- a/.travis.yml +++ b/.travis.yml @@ -124,11 +124,11 @@ script: - build_marlin # Enable filament sensor - restore_configs - - opt_enable FILAMENT_SENSOR + - opt_enable FILAMENT_WIDTH_SENSOR - build_marlin # Enable filament sensor with LCD display - restore_configs - - opt_enable ULTIMAKERCONTROLLER FILAMENT_SENSOR FILAMENT_LCD_DISPLAY + - opt_enable ULTIMAKERCONTROLLER FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY - build_marlin # Enable COREXY - restore_configs diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index a1ab07d891..66861b62f1 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -513,7 +513,7 @@ #define HAS_SERVO_1 (PIN_EXISTS(SERVO1)) #define HAS_SERVO_2 (PIN_EXISTS(SERVO2)) #define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) - #define HAS_FILAMENT_SENSOR (ENABLED(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH)) + #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT)) #define HAS_HOME (PIN_EXISTS(HOME)) #define HAS_KILL (PIN_EXISTS(KILL)) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index fc884523cd..82c95a5f11 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -920,11 +920,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 06420d30e8..ea940f59cc 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -334,7 +334,7 @@ extern bool axis_homed[3]; // axis[n].is_homed extern int EtoPPressure; #endif -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) extern float filament_width_nominal; //holds the theoretical filament diameter i.e., 3.00 or 1.75 extern bool filament_sensor; //indicates that filament sensor readings should control extrusion extern float filament_width_meas; //holds the filament diameter as accurately measured diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e0c5307584..647ec99030 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -405,7 +405,7 @@ static uint8_t target_extruder; float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 #endif -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) //Variables for Filament Sensor input float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA; //Set nominal filament width, can be changed with M404 bool filament_sensor = false; //M405 turns on filament_sensor control, M406 turns it off @@ -5437,7 +5437,7 @@ inline void gcode_M400() { st_synchronize(); } #endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) /** * M404: Display or set the nominal filament width (3mm, 1.75mm ) W<3.0> @@ -5491,7 +5491,7 @@ inline void gcode_M400() { st_synchronize(); } SERIAL_PROTOCOLLN(filament_width_meas); } -#endif // FILAMENT_SENSOR +#endif // FILAMENT_WIDTH_SENSOR /** * M410: Quickstop - Abort all planned moves @@ -6533,7 +6533,7 @@ void process_next_command() { break; #endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED - #if ENABLED(FILAMENT_SENSOR) + #if ENABLED(FILAMENT_WIDTH_SENSOR) case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width gcode_M404(); break; @@ -6546,7 +6546,7 @@ void process_next_command() { case 407: //M407 Display measured filament diameter gcode_M407(); break; - #endif // FILAMENT_SENSOR + #endif // ENABLED(FILAMENT_WIDTH_SENSOR) case 410: // M410 quickstop - Abort all the planned moves. gcode_M410(); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 728320c31a..5a9c669b4e 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -159,9 +159,9 @@ * Probes */ - /** - * A probe needs a pin - */ +/** + * A probe needs a pin + */ #if (!((HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) || HAS_Z_PROBE )) && ( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED)) #error A probe needs a pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE] #endif @@ -170,9 +170,9 @@ #error A probe should not be connected to more then one pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE] #endif - /** - * Require one kind of probe - */ +/** + * Require one kind of probe + */ #if ENABLED(AUTO_BED_LEVELING_FEATURE) && !( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED)) #error For AUTO_BED_LEVELING_FEATURE define one kind of probe! {Servo | Z_PROBE_ALLEN_KEY | Z_PROBE_SLED | FIX_MOUNTED_PROBE] #endif @@ -265,6 +265,14 @@ #endif // AUTO_BED_LEVELING_FEATURE +/** + * Filament Width Sensor + */ +#if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR + #error FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined. +#endif + + /** * ULTIPANEL encoder */ @@ -436,6 +444,8 @@ #error SDEXTRASLOW deprecated - set SPI_SPEED to SPI_QUARTER_SPEED instead #elif defined(Z_RAISE_BEFORE_HOMING) #error Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead. +#elif defined(FILAMENT_SENSOR) + #error FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead. #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index e593e3fffa..dfaf3e521b 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -903,11 +903,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 4dd08e697f..aa8425ec35 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -900,11 +900,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 28f31bc8dd..022dc4b241 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -915,11 +915,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index fd68d6b921..e2e10d8944 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -917,11 +917,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index a339ca7ccb..507919b8c4 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -937,11 +937,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index bd2eeede27..c0d10717f5 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -920,11 +920,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index a9c7f836a3..f9a43c1e3f 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -922,11 +922,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 6b90f968a9..e66a2bd370 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -928,11 +928,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index e59b53a48d..f6d8204ea6 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -941,11 +941,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 48bad33e47..9dd089ceb5 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -912,11 +912,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 8a9f1b86b3..e974fe6798 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -920,11 +920,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 7e721e450b..e1b151bd2e 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1049,11 +1049,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index c4f201056b..8b97bed38a 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1049,11 +1049,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 625b999e29..fe466f2fad 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1053,11 +1053,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 1c27135ebc..2e0ba0d02f 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1046,11 +1046,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 4ca1d71f1e..b7f948c8c8 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -956,11 +956,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 9dc34cf619..da3b428229 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -923,11 +923,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 8204cf28ef..bcfd95c4ec 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -914,11 +914,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo * Note may require analog pins to be defined for different motherboards **********************************************************************/ // Uncomment below to enable -//#define FILAMENT_SENSOR +//#define FILAMENT_WIDTH_SENSOR #define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index fd756d477f..059e831766 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -851,7 +851,7 @@ float junction_deviation = 0.1; block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0 - #if ENABLED(FILAMENT_SENSOR) + #if ENABLED(FILAMENT_WIDTH_SENSOR) //FMM update ring buffer used for delay with filament measurements if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM && delay_index2 > -1) { //only for extruder with filament sensor and if ring buffer is initialized diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index e36a114010..d20b6e7054 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -93,7 +93,7 @@ unsigned char soft_pwm_bed; volatile int babystepsTodo[3] = { 0 }; #endif -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) int current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only #endif @@ -209,7 +209,7 @@ static void updateTemperaturesFromRawValues(); #define SOFT_PWM_SCALE 0 #endif -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) static int meas_shift_index; //used to point to a delayed sample in buffer for filament width sensor #endif @@ -703,7 +703,7 @@ void manage_heater() { #endif // Control the extruder rate based on the width sensor - #if ENABLED(FILAMENT_SENSOR) + #if ENABLED(FILAMENT_WIDTH_SENSOR) if (filament_sensor) { meas_shift_index = delay_index1 - meas_delay_cm; if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1; //loop around buffer if needed @@ -715,7 +715,7 @@ void manage_heater() { NOLESS(vm, 0.01); volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm; } - #endif //FILAMENT_SENSOR + #endif //FILAMENT_WIDTH_SENSOR #if DISABLED(PIDTEMPBED) if (ms < next_bed_check_ms) return; @@ -849,7 +849,7 @@ static void updateTemperaturesFromRawValues() { #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature = analog2temp(redundant_temperature_raw, 1); #endif - #if HAS_FILAMENT_SENSOR + #if ENABLED(FILAMENT_WIDTH_SENSOR) filament_width_meas = analog2widthFil(); #endif @@ -864,7 +864,7 @@ static void updateTemperaturesFromRawValues() { } -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) // Convert raw Filament Width to millimeters float analog2widthFil() { @@ -1003,7 +1003,7 @@ void tp_init() { #if HAS_TEMP_BED ANALOG_SELECT(TEMP_BED_PIN); #endif - #if HAS_FILAMENT_SENSOR + #if ENABLED(FILAMENT_WIDTH_SENSOR) ANALOG_SELECT(FILWIDTH_PIN); #endif @@ -1354,7 +1354,7 @@ ISR(TIMER0_COMPB_vect) { ISR_STATICS(BED); #endif - #if HAS_FILAMENT_SENSOR + #if ENABLED(FILAMENT_WIDTH_SENSOR) static unsigned long raw_filwidth_value = 0; #endif @@ -1636,14 +1636,14 @@ ISR(TIMER0_COMPB_vect) { break; case Prepare_FILWIDTH: - #if HAS_FILAMENT_SENSOR + #if ENABLED(FILAMENT_WIDTH_SENSOR) START_ADC(FILWIDTH_PIN); #endif lcd_buttons_update(); temp_state = Measure_FILWIDTH; break; case Measure_FILWIDTH: - #if HAS_FILAMENT_SENSOR + #if ENABLED(FILAMENT_WIDTH_SENSOR) // raw_filwidth_value += ADC; //remove to use an IIR filter approach if (ADC > 102) { //check that ADC is reading a voltage > 0.5 volts, otherwise don't take in the data. raw_filwidth_value -= (raw_filwidth_value >> 7); //multiply raw_filwidth_value by 127/128 @@ -1669,7 +1669,7 @@ ISR(TIMER0_COMPB_vect) { if (!temp_meas_ready) set_current_temp_raw(); // Filament Sensor - can be read any time since IIR filtering is used - #if HAS_FILAMENT_SENSOR + #if ENABLED(FILAMENT_WIDTH_SENSOR) current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach #endif diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 084b6344db..d6674b5a7c 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -53,7 +53,7 @@ void tp_init(); //initialize the heating void manage_heater(); //it is critical that this is called periodically. -#if ENABLED(FILAMENT_SENSOR) +#if ENABLED(FILAMENT_WIDTH_SENSOR) // For converting raw Filament Width to milimeters float analog2widthFil();