Browse Source

Merge pull request #3279 from thinkyhead/rc_filament_width_sensor

FILAMENT_SENSOR -> FILAMENT_WIDTH_SENSOR
Scott Lahteine 8 years ago
parent
commit
de333c4fea
32 changed files with 90 additions and 94 deletions
  1. 2
    2
      .travis.yml
  2. 1
    1
      Marlin/Conditionals.h
  3. 2
    2
      Marlin/Configuration.h
  4. 1
    1
      Marlin/Marlin.h
  5. 12
    14
      Marlin/Marlin_main.cpp
  6. 16
    6
      Marlin/SanityCheck.h
  7. 2
    2
      Marlin/example_configurations/Felix/Configuration.h
  8. 2
    2
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  9. 2
    2
      Marlin/example_configurations/Hephestos/Configuration.h
  10. 2
    2
      Marlin/example_configurations/Hephestos_2/Configuration.h
  11. 2
    2
      Marlin/example_configurations/K8200/Configuration.h
  12. 2
    2
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  13. 2
    2
      Marlin/example_configurations/RigidBot/Configuration.h
  14. 2
    2
      Marlin/example_configurations/SCARA/Configuration.h
  15. 2
    2
      Marlin/example_configurations/TAZ4/Configuration.h
  16. 2
    2
      Marlin/example_configurations/WITBOX/Configuration.h
  17. 2
    2
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  18. 2
    2
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  19. 2
    2
      Marlin/example_configurations/delta/generic/Configuration.h
  20. 2
    2
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  21. 2
    2
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  22. 2
    2
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  23. 2
    2
      Marlin/example_configurations/makibox/Configuration.h
  24. 2
    2
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  25. 1
    4
      Marlin/pins_A4JP.h
  26. 1
    3
      Marlin/pins_PRINTRBOARD.h
  27. 1
    3
      Marlin/pins_PRINTRBOARD_REVF.h
  28. 2
    4
      Marlin/pins_RAMBO.h
  29. 2
    5
      Marlin/pins_RAMPS_14.h
  30. 1
    1
      Marlin/planner.cpp
  31. 11
    11
      Marlin/temperature.cpp
  32. 1
    1
      Marlin/temperature.h

+ 2
- 2
.travis.yml View File

124
   - build_marlin
124
   - build_marlin
125
   # Enable filament sensor
125
   # Enable filament sensor
126
   - restore_configs
126
   - restore_configs
127
-  - opt_enable FILAMENT_SENSOR
127
+  - opt_enable FILAMENT_WIDTH_SENSOR
128
   - build_marlin
128
   - build_marlin
129
   # Enable filament sensor with LCD display
129
   # Enable filament sensor with LCD display
130
   - restore_configs
130
   - restore_configs
131
-  - opt_enable ULTIMAKERCONTROLLER FILAMENT_SENSOR FILAMENT_LCD_DISPLAY
131
+  - opt_enable ULTIMAKERCONTROLLER FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY
132
   - build_marlin
132
   - build_marlin
133
   # Enable COREXY
133
   # Enable COREXY
134
   - restore_configs
134
   - restore_configs

+ 1
- 1
Marlin/Conditionals.h View File

513
   #define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
513
   #define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
514
   #define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
514
   #define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
515
   #define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
515
   #define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
516
-  #define HAS_FILAMENT_SENSOR (ENABLED(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH))
516
+  #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH))
517
   #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT))
517
   #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT))
518
   #define HAS_HOME (PIN_EXISTS(HOME))
518
   #define HAS_HOME (PIN_EXISTS(HOME))
519
   #define HAS_KILL (PIN_EXISTS(KILL))
519
   #define HAS_KILL (PIN_EXISTS(KILL))

+ 2
- 2
Marlin/Configuration.h View File

920
  * Note may require analog pins to be defined for different motherboards
920
  * Note may require analog pins to be defined for different motherboards
921
  **********************************************************************/
921
  **********************************************************************/
922
 // Uncomment below to enable
922
 // Uncomment below to enable
923
-//#define FILAMENT_SENSOR
923
+//#define FILAMENT_WIDTH_SENSOR
924
 
924
 
925
 #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
925
 #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
926
 
926
 
927
-#if ENABLED(FILAMENT_SENSOR)
927
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
929
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
929
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
930
 
930
 

+ 1
- 1
Marlin/Marlin.h View File

336
   extern int EtoPPressure;
336
   extern int EtoPPressure;
337
 #endif
337
 #endif
338
 
338
 
339
-#if ENABLED(FILAMENT_SENSOR)
339
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
340
   extern float filament_width_nominal;  //holds the theoretical filament diameter i.e., 3.00 or 1.75
340
   extern float filament_width_nominal;  //holds the theoretical filament diameter i.e., 3.00 or 1.75
341
   extern bool filament_sensor;  //indicates that filament sensor readings should control extrusion
341
   extern bool filament_sensor;  //indicates that filament sensor readings should control extrusion
342
   extern float filament_width_meas; //holds the filament diameter as accurately measured
342
   extern float filament_width_meas; //holds the filament diameter as accurately measured

+ 12
- 14
Marlin/Marlin_main.cpp View File

405
   float axis_scaling[3] = { 1, 1, 1 };    // Build size scaling, default to 1
405
   float axis_scaling[3] = { 1, 1, 1 };    // Build size scaling, default to 1
406
 #endif
406
 #endif
407
 
407
 
408
-#if ENABLED(FILAMENT_SENSOR)
408
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
409
   //Variables for Filament Sensor input
409
   //Variables for Filament Sensor input
410
   float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA;  //Set nominal filament width, can be changed with M404
410
   float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA;  //Set nominal filament width, can be changed with M404
411
   bool filament_sensor = false;  //M405 turns on filament_sensor control, M406 turns it off
411
   bool filament_sensor = false;  //M405 turns on filament_sensor control, M406 turns it off
5454
 
5454
 
5455
 #endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
5455
 #endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
5456
 
5456
 
5457
-#if ENABLED(FILAMENT_SENSOR)
5457
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
5458
 
5458
 
5459
   /**
5459
   /**
5460
    * M404: Display or set the nominal filament width (3mm, 1.75mm ) W<3.0>
5460
    * M404: Display or set the nominal filament width (3mm, 1.75mm ) W<3.0>
5461
    */
5461
    */
5462
   inline void gcode_M404() {
5462
   inline void gcode_M404() {
5463
-    #if HAS_FILWIDTH
5464
-      if (code_seen('W')) {
5465
-        filament_width_nominal = code_value();
5466
-      }
5467
-      else {
5468
-        SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");
5469
-        SERIAL_PROTOCOLLN(filament_width_nominal);
5470
-      }
5471
-    #endif
5463
+    if (code_seen('W')) {
5464
+      filament_width_nominal = code_value();
5465
+    }
5466
+    else {
5467
+      SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");
5468
+      SERIAL_PROTOCOLLN(filament_width_nominal);
5469
+    }
5472
   }
5470
   }
5473
 
5471
 
5474
   /**
5472
   /**
5508
     SERIAL_PROTOCOLLN(filament_width_meas);
5506
     SERIAL_PROTOCOLLN(filament_width_meas);
5509
   }
5507
   }
5510
 
5508
 
5511
-#endif // FILAMENT_SENSOR
5509
+#endif // FILAMENT_WIDTH_SENSOR
5512
 
5510
 
5513
 /**
5511
 /**
5514
  * M410: Quickstop - Abort all planned moves
5512
  * M410: Quickstop - Abort all planned moves
6550
           break;
6548
           break;
6551
       #endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
6549
       #endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
6552
 
6550
 
6553
-      #if ENABLED(FILAMENT_SENSOR)
6551
+      #if ENABLED(FILAMENT_WIDTH_SENSOR)
6554
         case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width
6552
         case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width
6555
           gcode_M404();
6553
           gcode_M404();
6556
           break;
6554
           break;
6563
         case 407:   //M407 Display measured filament diameter
6561
         case 407:   //M407 Display measured filament diameter
6564
           gcode_M407();
6562
           gcode_M407();
6565
           break;
6563
           break;
6566
-      #endif // FILAMENT_SENSOR
6564
+      #endif // ENABLED(FILAMENT_WIDTH_SENSOR)
6567
 
6565
 
6568
       case 410: // M410 quickstop - Abort all the planned moves.
6566
       case 410: // M410 quickstop - Abort all the planned moves.
6569
         gcode_M410();
6567
         gcode_M410();

+ 16
- 6
Marlin/SanityCheck.h View File

169
  * Probes
169
  * Probes
170
  */
170
  */
171
 
171
 
172
-  /**
173
-   * A probe needs a pin
174
-   */
172
+/**
173
+ * A probe needs a pin
174
+ */
175
 #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))
175
 #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))
176
   #error A probe needs a pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
176
   #error A probe needs a pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
177
 #endif
177
 #endif
180
   #error A probe should not be connected to more then one pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
180
   #error A probe should not be connected to more then one pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
181
 #endif
181
 #endif
182
 
182
 
183
-  /**
184
-    * Require one kind of probe
185
-    */
183
+/**
184
+  * Require one kind of probe
185
+  */
186
 #if ENABLED(AUTO_BED_LEVELING_FEATURE) && !( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED))
186
 #if ENABLED(AUTO_BED_LEVELING_FEATURE) && !( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED))
187
   #error For AUTO_BED_LEVELING_FEATURE define one kind of probe! {Servo | Z_PROBE_ALLEN_KEY | Z_PROBE_SLED | FIX_MOUNTED_PROBE]
187
   #error For AUTO_BED_LEVELING_FEATURE define one kind of probe! {Servo | Z_PROBE_ALLEN_KEY | Z_PROBE_SLED | FIX_MOUNTED_PROBE]
188
 #endif
188
 #endif
276
 #endif // AUTO_BED_LEVELING_FEATURE
276
 #endif // AUTO_BED_LEVELING_FEATURE
277
 
277
 
278
 /**
278
 /**
279
+ * Filament Width Sensor
280
+ */
281
+#if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR
282
+  #error FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined.
283
+#endif
284
+
285
+
286
+/**
279
  * ULTIPANEL encoder
287
  * ULTIPANEL encoder
280
  */
288
  */
281
 #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
289
 #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
446
   #error SDEXTRASLOW deprecated - set SPI_SPEED to SPI_QUARTER_SPEED instead
454
   #error SDEXTRASLOW deprecated - set SPI_SPEED to SPI_QUARTER_SPEED instead
447
 #elif defined(Z_RAISE_BEFORE_HOMING)
455
 #elif defined(Z_RAISE_BEFORE_HOMING)
448
   #error Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead.
456
   #error Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead.
457
+#elif defined(FILAMENT_SENSOR)
458
+  #error FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead.
449
 #endif
459
 #endif
450
 
460
 
451
 #endif //SANITYCHECK_H
461
 #endif //SANITYCHECK_H

+ 2
- 2
Marlin/example_configurations/Felix/Configuration.h View File

903
  * Note may require analog pins to be defined for different motherboards
903
  * Note may require analog pins to be defined for different motherboards
904
  **********************************************************************/
904
  **********************************************************************/
905
 // Uncomment below to enable
905
 // Uncomment below to enable
906
-//#define FILAMENT_SENSOR
906
+//#define FILAMENT_WIDTH_SENSOR
907
 
907
 
908
 #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
908
 #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
909
 
909
 
910
-#if ENABLED(FILAMENT_SENSOR)
910
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
911
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
911
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
912
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
912
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
913
 
913
 

+ 2
- 2
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

900
  * Note may require analog pins to be defined for different motherboards
900
  * Note may require analog pins to be defined for different motherboards
901
  **********************************************************************/
901
  **********************************************************************/
902
 // Uncomment below to enable
902
 // Uncomment below to enable
903
-//#define FILAMENT_SENSOR
903
+//#define FILAMENT_WIDTH_SENSOR
904
 
904
 
905
 #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
905
 #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
906
 
906
 
907
-#if ENABLED(FILAMENT_SENSOR)
907
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
908
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
908
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
909
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
909
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
910
 
910
 

+ 2
- 2
Marlin/example_configurations/Hephestos/Configuration.h View File

915
  * Note may require analog pins to be defined for different motherboards
915
  * Note may require analog pins to be defined for different motherboards
916
  **********************************************************************/
916
  **********************************************************************/
917
 // Uncomment below to enable
917
 // Uncomment below to enable
918
-//#define FILAMENT_SENSOR
918
+//#define FILAMENT_WIDTH_SENSOR
919
 
919
 
920
 #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
920
 #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
921
 
921
 
922
-#if ENABLED(FILAMENT_SENSOR)
922
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
923
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
923
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
924
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
924
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
925
 
925
 

+ 2
- 2
Marlin/example_configurations/Hephestos_2/Configuration.h View File

917
  * Note may require analog pins to be defined for different motherboards
917
  * Note may require analog pins to be defined for different motherboards
918
  **********************************************************************/
918
  **********************************************************************/
919
 // Uncomment below to enable
919
 // Uncomment below to enable
920
-//#define FILAMENT_SENSOR
920
+//#define FILAMENT_WIDTH_SENSOR
921
 
921
 
922
 #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
922
 #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
923
 
923
 
924
-#if ENABLED(FILAMENT_SENSOR)
924
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
925
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
925
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
926
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
926
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
927
 
927
 

+ 2
- 2
Marlin/example_configurations/K8200/Configuration.h View File

937
  * Note may require analog pins to be defined for different motherboards
937
  * Note may require analog pins to be defined for different motherboards
938
  **********************************************************************/
938
  **********************************************************************/
939
 // Uncomment below to enable
939
 // Uncomment below to enable
940
-//#define FILAMENT_SENSOR
940
+//#define FILAMENT_WIDTH_SENSOR
941
 
941
 
942
 #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
942
 #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
943
 
943
 
944
-#if ENABLED(FILAMENT_SENSOR)
944
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
945
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
945
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
946
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
946
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
947
 
947
 

+ 2
- 2
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

920
  * Note may require analog pins to be defined for different motherboards
920
  * Note may require analog pins to be defined for different motherboards
921
  **********************************************************************/
921
  **********************************************************************/
922
 // Uncomment below to enable
922
 // Uncomment below to enable
923
-//#define FILAMENT_SENSOR
923
+//#define FILAMENT_WIDTH_SENSOR
924
 
924
 
925
 #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
925
 #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
926
 
926
 
927
-#if ENABLED(FILAMENT_SENSOR)
927
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
929
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
929
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
930
 
930
 

+ 2
- 2
Marlin/example_configurations/RigidBot/Configuration.h View File

922
  * Note may require analog pins to be defined for different motherboards
922
  * Note may require analog pins to be defined for different motherboards
923
  **********************************************************************/
923
  **********************************************************************/
924
 // Uncomment below to enable
924
 // Uncomment below to enable
925
-//#define FILAMENT_SENSOR
925
+//#define FILAMENT_WIDTH_SENSOR
926
 
926
 
927
 #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
927
 #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
928
 
928
 
929
-#if ENABLED(FILAMENT_SENSOR)
929
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
930
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
930
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
931
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
931
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
932
 
932
 

+ 2
- 2
Marlin/example_configurations/SCARA/Configuration.h View File

928
  * Note may require analog pins to be defined for different motherboards
928
  * Note may require analog pins to be defined for different motherboards
929
  **********************************************************************/
929
  **********************************************************************/
930
 // Uncomment below to enable
930
 // Uncomment below to enable
931
-//#define FILAMENT_SENSOR
931
+//#define FILAMENT_WIDTH_SENSOR
932
 
932
 
933
 #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
933
 #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
934
 
934
 
935
-#if ENABLED(FILAMENT_SENSOR)
935
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
936
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
936
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
937
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
937
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
938
 
938
 

+ 2
- 2
Marlin/example_configurations/TAZ4/Configuration.h View File

941
  * Note may require analog pins to be defined for different motherboards
941
  * Note may require analog pins to be defined for different motherboards
942
  **********************************************************************/
942
  **********************************************************************/
943
 // Uncomment below to enable
943
 // Uncomment below to enable
944
-//#define FILAMENT_SENSOR
944
+//#define FILAMENT_WIDTH_SENSOR
945
 
945
 
946
 #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
946
 #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
947
 
947
 
948
-#if ENABLED(FILAMENT_SENSOR)
948
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
949
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
949
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
950
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
950
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
951
 
951
 

+ 2
- 2
Marlin/example_configurations/WITBOX/Configuration.h View File

912
  * Note may require analog pins to be defined for different motherboards
912
  * Note may require analog pins to be defined for different motherboards
913
  **********************************************************************/
913
  **********************************************************************/
914
 // Uncomment below to enable
914
 // Uncomment below to enable
915
-//#define FILAMENT_SENSOR
915
+//#define FILAMENT_WIDTH_SENSOR
916
 
916
 
917
 #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
917
 #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
918
 
918
 
919
-#if ENABLED(FILAMENT_SENSOR)
919
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
920
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
920
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
921
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
921
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
922
 
922
 

+ 2
- 2
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

920
  * Note may require analog pins to be defined for different motherboards
920
  * Note may require analog pins to be defined for different motherboards
921
  **********************************************************************/
921
  **********************************************************************/
922
 // Uncomment below to enable
922
 // Uncomment below to enable
923
-//#define FILAMENT_SENSOR
923
+//#define FILAMENT_WIDTH_SENSOR
924
 
924
 
925
 #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
925
 #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
926
 
926
 
927
-#if ENABLED(FILAMENT_SENSOR)
927
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
929
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
929
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
930
 
930
 

+ 2
- 2
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

1049
  * Note may require analog pins to be defined for different motherboards
1049
  * Note may require analog pins to be defined for different motherboards
1050
  **********************************************************************/
1050
  **********************************************************************/
1051
 // Uncomment below to enable
1051
 // Uncomment below to enable
1052
-//#define FILAMENT_SENSOR
1052
+//#define FILAMENT_WIDTH_SENSOR
1053
 
1053
 
1054
 #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
1054
 #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
1055
 
1055
 
1056
-#if ENABLED(FILAMENT_SENSOR)
1056
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
1057
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1057
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1058
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
1058
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
1059
 
1059
 

+ 2
- 2
Marlin/example_configurations/delta/generic/Configuration.h View File

1049
  * Note may require analog pins to be defined for different motherboards
1049
  * Note may require analog pins to be defined for different motherboards
1050
  **********************************************************************/
1050
  **********************************************************************/
1051
 // Uncomment below to enable
1051
 // Uncomment below to enable
1052
-//#define FILAMENT_SENSOR
1052
+//#define FILAMENT_WIDTH_SENSOR
1053
 
1053
 
1054
 #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
1054
 #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
1055
 
1055
 
1056
-#if ENABLED(FILAMENT_SENSOR)
1056
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
1057
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1057
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1058
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
1058
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
1059
 
1059
 

+ 2
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

1053
  * Note may require analog pins to be defined for different motherboards
1053
  * Note may require analog pins to be defined for different motherboards
1054
  **********************************************************************/
1054
  **********************************************************************/
1055
 // Uncomment below to enable
1055
 // Uncomment below to enable
1056
-//#define FILAMENT_SENSOR
1056
+//#define FILAMENT_WIDTH_SENSOR
1057
 
1057
 
1058
 #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
1058
 #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
1059
 
1059
 
1060
-#if ENABLED(FILAMENT_SENSOR)
1060
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
1061
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1061
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1062
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
1062
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
1063
 
1063
 

+ 2
- 2
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

1046
  * Note may require analog pins to be defined for different motherboards
1046
  * Note may require analog pins to be defined for different motherboards
1047
  **********************************************************************/
1047
  **********************************************************************/
1048
 // Uncomment below to enable
1048
 // Uncomment below to enable
1049
-//#define FILAMENT_SENSOR
1049
+//#define FILAMENT_WIDTH_SENSOR
1050
 
1050
 
1051
 #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
1051
 #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
1052
 
1052
 
1053
-#if ENABLED(FILAMENT_SENSOR)
1053
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
1054
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1054
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1055
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
1055
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
1056
 
1056
 

+ 2
- 2
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

956
  * Note may require analog pins to be defined for different motherboards
956
  * Note may require analog pins to be defined for different motherboards
957
  **********************************************************************/
957
  **********************************************************************/
958
 // Uncomment below to enable
958
 // Uncomment below to enable
959
-//#define FILAMENT_SENSOR
959
+//#define FILAMENT_WIDTH_SENSOR
960
 
960
 
961
 #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
961
 #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
962
 
962
 
963
-#if ENABLED(FILAMENT_SENSOR)
963
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
964
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
964
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
965
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
965
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
966
 
966
 

+ 2
- 2
Marlin/example_configurations/makibox/Configuration.h View File

923
  * Note may require analog pins to be defined for different motherboards
923
  * Note may require analog pins to be defined for different motherboards
924
  **********************************************************************/
924
  **********************************************************************/
925
 // Uncomment below to enable
925
 // Uncomment below to enable
926
-//#define FILAMENT_SENSOR
926
+//#define FILAMENT_WIDTH_SENSOR
927
 
927
 
928
 #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
928
 #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
929
 
929
 
930
-#if ENABLED(FILAMENT_SENSOR)
930
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
931
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
931
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
932
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
932
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
933
 
933
 

+ 2
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

914
  * Note may require analog pins to be defined for different motherboards
914
  * Note may require analog pins to be defined for different motherboards
915
  **********************************************************************/
915
  **********************************************************************/
916
 // Uncomment below to enable
916
 // Uncomment below to enable
917
-//#define FILAMENT_SENSOR
917
+//#define FILAMENT_WIDTH_SENSOR
918
 
918
 
919
 #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
919
 #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
920
 
920
 
921
-#if ENABLED(FILAMENT_SENSOR)
921
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
922
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
922
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
923
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
923
   #define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
924
 
924
 

+ 1
- 4
Marlin/pins_A4JP.h View File

74
   #endif
74
   #endif
75
 #endif // VIKI2/miniVIKI
75
 #endif // VIKI2/miniVIKI
76
 
76
 
77
-#if ENABLED(FILAMENT_SENSOR)
78
-  //Filip added pin for Filament sensor analog input
79
-  #define FILWIDTH_PIN        3
80
-#endif
77
+#define FILWIDTH_PIN        3  // ANALOG NUMBERING
81
 
78
 
82
 /************************************************
79
 /************************************************
83
  * Rambo pin assignments old
80
  * Rambo pin assignments old

+ 1
- 3
Marlin/pins_PRINTRBOARD.h View File

79
 #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
79
 #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
80
 #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
80
 #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
81
 
81
 
82
-#if ENABLED(FILAMENT_SENSOR)
83
-  #define FILWIDTH_PIN      2
84
-#endif
82
+#define FILWIDTH_PIN        2  // ANALOG NUMBERING
85
 
83
 
86
 #define TEMP_1_PIN         -1
84
 #define TEMP_1_PIN         -1
87
 #define TEMP_2_PIN         -1
85
 #define TEMP_2_PIN         -1

+ 1
- 3
Marlin/pins_PRINTRBOARD_REVF.h View File

73
 #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
73
 #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
74
 #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
74
 #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
75
 
75
 
76
-#if ENABLED(FILAMENT_SENSOR)
77
-  #define FILWIDTH_PIN      2
78
-#endif
76
+#define FILWIDTH_PIN        2  // ANALOG NUMBERING
79
 
77
 
80
 #define TEMP_1_PIN         -1
78
 #define TEMP_1_PIN         -1
81
 #define TEMP_2_PIN         -1
79
 #define TEMP_2_PIN         -1

+ 2
- 4
Marlin/pins_RAMBO.h View File

112
 #define LED_PIN            13
112
 #define LED_PIN            13
113
 #define FAN_PIN            8
113
 #define FAN_PIN            8
114
 
114
 
115
+#define FILWIDTH_PIN        3  // ANALOG NUMBERING
116
+
115
 /**********************************************************
117
 /**********************************************************
116
   Fan Pins
118
   Fan Pins
117
   Fan_0 8
119
   Fan_0 8
201
   #endif
203
   #endif
202
 #endif // VIKI2/miniVIKI
204
 #endif // VIKI2/miniVIKI
203
 
205
 
204
-#if ENABLED(FILAMENT_SENSOR)
205
-  //Filip added pin for Filament sensor analog input
206
-  #define FILWIDTH_PIN        3
207
-#endif

+ 2
- 5
Marlin/pins_RAMPS_14.h View File

91
 #define SDSS               53
91
 #define SDSS               53
92
 #define LED_PIN            13
92
 #define LED_PIN            13
93
 
93
 
94
-#if ENABLED(FILAMENT_SENSOR)  // FMM added for Filament Extruder
95
-  // define analog pin for the filament width sensor input
96
-  // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
97
-  #define FILWIDTH_PIN      5
98
-#endif
94
+// Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
95
+#define FILWIDTH_PIN        5 // ANALOG NUMBERING
99
 
96
 
100
 #if ENABLED(Z_MIN_PROBE_ENDSTOP)
97
 #if ENABLED(Z_MIN_PROBE_ENDSTOP)
101
   // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
98
   // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.

+ 1
- 1
Marlin/planner.cpp View File

851
   block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
851
   block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
852
   block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0
852
   block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0
853
 
853
 
854
-  #if ENABLED(FILAMENT_SENSOR)
854
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
855
     //FMM update ring buffer used for delay with filament measurements
855
     //FMM update ring buffer used for delay with filament measurements
856
     if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM && delay_index2 > -1) {  //only for extruder with filament sensor and if ring buffer is initialized
856
     if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM && delay_index2 > -1) {  //only for extruder with filament sensor and if ring buffer is initialized
857
 
857
 

+ 11
- 11
Marlin/temperature.cpp View File

93
   volatile int babystepsTodo[3] = { 0 };
93
   volatile int babystepsTodo[3] = { 0 };
94
 #endif
94
 #endif
95
 
95
 
96
-#if ENABLED(FILAMENT_SENSOR)
96
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
97
   int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
97
   int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
98
 #endif
98
 #endif
99
 
99
 
209
   #define SOFT_PWM_SCALE 0
209
   #define SOFT_PWM_SCALE 0
210
 #endif
210
 #endif
211
 
211
 
212
-#if ENABLED(FILAMENT_SENSOR)
212
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
213
   static int meas_shift_index;  //used to point to a delayed sample in buffer for filament width sensor
213
   static int meas_shift_index;  //used to point to a delayed sample in buffer for filament width sensor
214
 #endif
214
 #endif
215
 
215
 
703
   #endif
703
   #endif
704
 
704
 
705
   // Control the extruder rate based on the width sensor
705
   // Control the extruder rate based on the width sensor
706
-  #if ENABLED(FILAMENT_SENSOR)
706
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
707
     if (filament_sensor) {
707
     if (filament_sensor) {
708
       meas_shift_index = delay_index1 - meas_delay_cm;
708
       meas_shift_index = delay_index1 - meas_delay_cm;
709
       if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1;  //loop around buffer if needed
709
       if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1;  //loop around buffer if needed
715
       NOLESS(vm, 0.01);
715
       NOLESS(vm, 0.01);
716
       volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm;
716
       volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm;
717
     }
717
     }
718
-  #endif //FILAMENT_SENSOR
718
+  #endif //FILAMENT_WIDTH_SENSOR
719
 
719
 
720
   #if DISABLED(PIDTEMPBED)
720
   #if DISABLED(PIDTEMPBED)
721
     if (ms < next_bed_check_ms) return;
721
     if (ms < next_bed_check_ms) return;
849
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
849
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
850
     redundant_temperature = analog2temp(redundant_temperature_raw, 1);
850
     redundant_temperature = analog2temp(redundant_temperature_raw, 1);
851
   #endif
851
   #endif
852
-  #if HAS_FILAMENT_SENSOR
852
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
853
     filament_width_meas = analog2widthFil();
853
     filament_width_meas = analog2widthFil();
854
   #endif
854
   #endif
855
 
855
 
864
 }
864
 }
865
 
865
 
866
 
866
 
867
-#if ENABLED(FILAMENT_SENSOR)
867
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
868
 
868
 
869
   // Convert raw Filament Width to millimeters
869
   // Convert raw Filament Width to millimeters
870
   float analog2widthFil() {
870
   float analog2widthFil() {
1003
   #if HAS_TEMP_BED
1003
   #if HAS_TEMP_BED
1004
     ANALOG_SELECT(TEMP_BED_PIN);
1004
     ANALOG_SELECT(TEMP_BED_PIN);
1005
   #endif
1005
   #endif
1006
-  #if HAS_FILAMENT_SENSOR
1006
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
1007
     ANALOG_SELECT(FILWIDTH_PIN);
1007
     ANALOG_SELECT(FILWIDTH_PIN);
1008
   #endif
1008
   #endif
1009
 
1009
 
1354
     ISR_STATICS(BED);
1354
     ISR_STATICS(BED);
1355
   #endif
1355
   #endif
1356
 
1356
 
1357
-  #if HAS_FILAMENT_SENSOR
1357
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
1358
     static unsigned long raw_filwidth_value = 0;
1358
     static unsigned long raw_filwidth_value = 0;
1359
   #endif
1359
   #endif
1360
 
1360
 
1636
       break;
1636
       break;
1637
 
1637
 
1638
     case Prepare_FILWIDTH:
1638
     case Prepare_FILWIDTH:
1639
-      #if HAS_FILAMENT_SENSOR
1639
+      #if ENABLED(FILAMENT_WIDTH_SENSOR)
1640
         START_ADC(FILWIDTH_PIN);
1640
         START_ADC(FILWIDTH_PIN);
1641
       #endif
1641
       #endif
1642
       lcd_buttons_update();
1642
       lcd_buttons_update();
1643
       temp_state = Measure_FILWIDTH;
1643
       temp_state = Measure_FILWIDTH;
1644
       break;
1644
       break;
1645
     case Measure_FILWIDTH:
1645
     case Measure_FILWIDTH:
1646
-      #if HAS_FILAMENT_SENSOR
1646
+      #if ENABLED(FILAMENT_WIDTH_SENSOR)
1647
         // raw_filwidth_value += ADC;  //remove to use an IIR filter approach
1647
         // raw_filwidth_value += ADC;  //remove to use an IIR filter approach
1648
         if (ADC > 102) { //check that ADC is reading a voltage > 0.5 volts, otherwise don't take in the data.
1648
         if (ADC > 102) { //check that ADC is reading a voltage > 0.5 volts, otherwise don't take in the data.
1649
           raw_filwidth_value -= (raw_filwidth_value >> 7); //multiply raw_filwidth_value by 127/128
1649
           raw_filwidth_value -= (raw_filwidth_value >> 7); //multiply raw_filwidth_value by 127/128
1669
     if (!temp_meas_ready) set_current_temp_raw();
1669
     if (!temp_meas_ready) set_current_temp_raw();
1670
 
1670
 
1671
     // Filament Sensor - can be read any time since IIR filtering is used
1671
     // Filament Sensor - can be read any time since IIR filtering is used
1672
-    #if HAS_FILAMENT_SENSOR
1672
+    #if ENABLED(FILAMENT_WIDTH_SENSOR)
1673
       current_raw_filwidth = raw_filwidth_value >> 10;  // Divide to get to 0-16384 range since we used 1/128 IIR filter approach
1673
       current_raw_filwidth = raw_filwidth_value >> 10;  // Divide to get to 0-16384 range since we used 1/128 IIR filter approach
1674
     #endif
1674
     #endif
1675
 
1675
 

+ 1
- 1
Marlin/temperature.h View File

53
 void tp_init();  //initialize the heating
53
 void tp_init();  //initialize the heating
54
 void manage_heater(); //it is critical that this is called periodically.
54
 void manage_heater(); //it is critical that this is called periodically.
55
 
55
 
56
-#if ENABLED(FILAMENT_SENSOR)
56
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
57
   // For converting raw Filament Width to milimeters
57
   // For converting raw Filament Width to milimeters
58
   float analog2widthFil();
58
   float analog2widthFil();
59
 
59
 

Loading…
Cancel
Save