diff --git a/.travis.yml b/.travis.yml index cfcee4f77..a7c220d06 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 a1ab07d89..66861b62f 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 fc884523c..82c95a5f1 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 1e3ccea85..c425a3b04 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -336,7 +336,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 9234f4e14..a7618eaf7 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 @@ -5454,21 +5454,19 @@ 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> */ inline void gcode_M404() { - #if HAS_FILWIDTH - if (code_seen('W')) { - filament_width_nominal = code_value(); - } - else { - SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); - SERIAL_PROTOCOLLN(filament_width_nominal); - } - #endif + if (code_seen('W')) { + filament_width_nominal = code_value(); + } + else { + SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); + SERIAL_PROTOCOLLN(filament_width_nominal); + } } /** @@ -5508,7 +5506,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 @@ -6550,7 +6548,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; @@ -6563,7 +6561,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 8244a76bf..fb45e77b9 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -169,9 +169,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 @@ -180,9 +180,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 @@ -275,6 +275,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 */ @@ -446,6 +454,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 e593e3fff..dfaf3e521 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 4dd08e697..aa8425ec3 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 28f31bc8d..022dc4b24 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 fd68d6b92..e2e10d894 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 a339ca7cc..507919b8c 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 bd2eeede2..c0d10717f 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 a9c7f836a..f9a43c1e3 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 6b90f968a..e66a2bd37 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 e59b53a48..f6d8204ea 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 48bad33e4..9dd089ceb 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 8a9f1b86b..e974fe679 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 7e721e450..e1b151bd2 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 c4f201056..8b97bed38 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 625b999e2..fe466f2fa 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 1c27135eb..2e0ba0d02 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 4ca1d71f1..b7f948c8c 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 9dc34cf61..da3b42822 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 8204cf28e..bcfd95c4e 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/pins_A4JP.h b/Marlin/pins_A4JP.h index 2e36db595..5cd0d3897 100644 --- a/Marlin/pins_A4JP.h +++ b/Marlin/pins_A4JP.h @@ -74,10 +74,7 @@ #endif #endif // VIKI2/miniVIKI -#if ENABLED(FILAMENT_SENSOR) - //Filip added pin for Filament sensor analog input - #define FILWIDTH_PIN 3 -#endif +#define FILWIDTH_PIN 3 // ANALOG NUMBERING /************************************************ * Rambo pin assignments old diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h index 893351710..bd269fc92 100644 --- a/Marlin/pins_PRINTRBOARD.h +++ b/Marlin/pins_PRINTRBOARD.h @@ -79,9 +79,7 @@ #define TEMP_0_PIN 1 // Extruder / Analog pin numbering #define TEMP_BED_PIN 0 // Bed / Analog pin numbering -#if ENABLED(FILAMENT_SENSOR) - #define FILWIDTH_PIN 2 -#endif +#define FILWIDTH_PIN 2 // ANALOG NUMBERING #define TEMP_1_PIN -1 #define TEMP_2_PIN -1 diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h index d0c6fdb9e..3120e04e7 100644 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ b/Marlin/pins_PRINTRBOARD_REVF.h @@ -73,9 +73,7 @@ #define TEMP_0_PIN 1 // Extruder / Analog pin numbering #define TEMP_BED_PIN 0 // Bed / Analog pin numbering -#if ENABLED(FILAMENT_SENSOR) - #define FILWIDTH_PIN 2 -#endif +#define FILWIDTH_PIN 2 // ANALOG NUMBERING #define TEMP_1_PIN -1 #define TEMP_2_PIN -1 diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index b74869316..39da6c75d 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -112,6 +112,8 @@ #define LED_PIN 13 #define FAN_PIN 8 +#define FILWIDTH_PIN 3 // ANALOG NUMBERING + /********************************************************** Fan Pins Fan_0 8 @@ -201,7 +203,3 @@ #endif #endif // VIKI2/miniVIKI -#if ENABLED(FILAMENT_SENSOR) - //Filip added pin for Filament sensor analog input - #define FILWIDTH_PIN 3 -#endif diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 9354cc245..dc1f219d3 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -91,11 +91,8 @@ #define SDSS 53 #define LED_PIN 13 -#if ENABLED(FILAMENT_SENSOR) // FMM added for Filament Extruder - // define analog pin for the filament width sensor input - // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector - #define FILWIDTH_PIN 5 -#endif +// Use the RAMPS 1.4 Analog input 5 on the AUX2 connector +#define FILWIDTH_PIN 5 // ANALOG NUMBERING #if ENABLED(Z_MIN_PROBE_ENDSTOP) // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop. diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index f7d4579a0..ed3aa78a9 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 e36a11401..d20b6e705 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 084b6344d..d6674b5a7 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();