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,11 +124,11 @@ script:
124 124
   - build_marlin
125 125
   # Enable filament sensor
126 126
   - restore_configs
127
-  - opt_enable FILAMENT_SENSOR
127
+  - opt_enable FILAMENT_WIDTH_SENSOR
128 128
   - build_marlin
129 129
   # Enable filament sensor with LCD display
130 130
   - restore_configs
131
-  - opt_enable ULTIMAKERCONTROLLER FILAMENT_SENSOR FILAMENT_LCD_DISPLAY
131
+  - opt_enable ULTIMAKERCONTROLLER FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY
132 132
   - build_marlin
133 133
   # Enable COREXY
134 134
   - restore_configs

+ 1
- 1
Marlin/Conditionals.h View File

@@ -513,7 +513,7 @@
513 513
   #define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
514 514
   #define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
515 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 517
   #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT))
518 518
   #define HAS_HOME (PIN_EXISTS(HOME))
519 519
   #define HAS_KILL (PIN_EXISTS(KILL))

+ 2
- 2
Marlin/Configuration.h View File

@@ -920,11 +920,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
920 920
  * Note may require analog pins to be defined for different motherboards
921 921
  **********************************************************************/
922 922
 // Uncomment below to enable
923
-//#define FILAMENT_SENSOR
923
+//#define FILAMENT_WIDTH_SENSOR
924 924
 
925 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 928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
929 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,7 +336,7 @@ extern bool axis_homed[3]; // axis[n].is_homed
336 336
   extern int EtoPPressure;
337 337
 #endif
338 338
 
339
-#if ENABLED(FILAMENT_SENSOR)
339
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
340 340
   extern float filament_width_nominal;  //holds the theoretical filament diameter i.e., 3.00 or 1.75
341 341
   extern bool filament_sensor;  //indicates that filament sensor readings should control extrusion
342 342
   extern float filament_width_meas; //holds the filament diameter as accurately measured

+ 12
- 14
Marlin/Marlin_main.cpp View File

@@ -405,7 +405,7 @@ static uint8_t target_extruder;
405 405
   float axis_scaling[3] = { 1, 1, 1 };    // Build size scaling, default to 1
406 406
 #endif
407 407
 
408
-#if ENABLED(FILAMENT_SENSOR)
408
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
409 409
   //Variables for Filament Sensor input
410 410
   float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA;  //Set nominal filament width, can be changed with M404
411 411
   bool filament_sensor = false;  //M405 turns on filament_sensor control, M406 turns it off
@@ -5454,21 +5454,19 @@ inline void gcode_M400() { st_synchronize(); }
5454 5454
 
5455 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 5460
    * M404: Display or set the nominal filament width (3mm, 1.75mm ) W<3.0>
5461 5461
    */
5462 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,7 +5506,7 @@ inline void gcode_M400() { st_synchronize(); }
5508 5506
     SERIAL_PROTOCOLLN(filament_width_meas);
5509 5507
   }
5510 5508
 
5511
-#endif // FILAMENT_SENSOR
5509
+#endif // FILAMENT_WIDTH_SENSOR
5512 5510
 
5513 5511
 /**
5514 5512
  * M410: Quickstop - Abort all planned moves
@@ -6550,7 +6548,7 @@ void process_next_command() {
6550 6548
           break;
6551 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 6552
         case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width
6555 6553
           gcode_M404();
6556 6554
           break;
@@ -6563,7 +6561,7 @@ void process_next_command() {
6563 6561
         case 407:   //M407 Display measured filament diameter
6564 6562
           gcode_M407();
6565 6563
           break;
6566
-      #endif // FILAMENT_SENSOR
6564
+      #endif // ENABLED(FILAMENT_WIDTH_SENSOR)
6567 6565
 
6568 6566
       case 410: // M410 quickstop - Abort all the planned moves.
6569 6567
         gcode_M410();

+ 16
- 6
Marlin/SanityCheck.h View File

@@ -169,9 +169,9 @@
169 169
  * Probes
170 170
  */
171 171
 
172
-  /**
173
-   * A probe needs a pin
174
-   */
172
+/**
173
+ * A probe needs a pin
174
+ */
175 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 176
   #error A probe needs a pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
177 177
 #endif
@@ -180,9 +180,9 @@
180 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 181
 #endif
182 182
 
183
-  /**
184
-    * Require one kind of probe
185
-    */
183
+/**
184
+  * Require one kind of probe
185
+  */
186 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 187
   #error For AUTO_BED_LEVELING_FEATURE define one kind of probe! {Servo | Z_PROBE_ALLEN_KEY | Z_PROBE_SLED | FIX_MOUNTED_PROBE]
188 188
 #endif
@@ -276,6 +276,14 @@
276 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 287
  * ULTIPANEL encoder
280 288
  */
281 289
 #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
@@ -446,6 +454,8 @@
446 454
   #error SDEXTRASLOW deprecated - set SPI_SPEED to SPI_QUARTER_SPEED instead
447 455
 #elif defined(Z_RAISE_BEFORE_HOMING)
448 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 459
 #endif
450 460
 
451 461
 #endif //SANITYCHECK_H

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

@@ -903,11 +903,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
903 903
  * Note may require analog pins to be defined for different motherboards
904 904
  **********************************************************************/
905 905
 // Uncomment below to enable
906
-//#define FILAMENT_SENSOR
906
+//#define FILAMENT_WIDTH_SENSOR
907 907
 
908 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 911
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
912 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,11 +900,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
900 900
  * Note may require analog pins to be defined for different motherboards
901 901
  **********************************************************************/
902 902
 // Uncomment below to enable
903
-//#define FILAMENT_SENSOR
903
+//#define FILAMENT_WIDTH_SENSOR
904 904
 
905 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 908
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
909 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,11 +915,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
915 915
  * Note may require analog pins to be defined for different motherboards
916 916
  **********************************************************************/
917 917
 // Uncomment below to enable
918
-//#define FILAMENT_SENSOR
918
+//#define FILAMENT_WIDTH_SENSOR
919 919
 
920 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 923
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
924 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,11 +917,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
917 917
  * Note may require analog pins to be defined for different motherboards
918 918
  **********************************************************************/
919 919
 // Uncomment below to enable
920
-//#define FILAMENT_SENSOR
920
+//#define FILAMENT_WIDTH_SENSOR
921 921
 
922 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 925
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
926 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,11 +937,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
937 937
  * Note may require analog pins to be defined for different motherboards
938 938
  **********************************************************************/
939 939
 // Uncomment below to enable
940
-//#define FILAMENT_SENSOR
940
+//#define FILAMENT_WIDTH_SENSOR
941 941
 
942 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 945
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
946 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,11 +920,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
920 920
  * Note may require analog pins to be defined for different motherboards
921 921
  **********************************************************************/
922 922
 // Uncomment below to enable
923
-//#define FILAMENT_SENSOR
923
+//#define FILAMENT_WIDTH_SENSOR
924 924
 
925 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 928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
929 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,11 +922,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
922 922
  * Note may require analog pins to be defined for different motherboards
923 923
  **********************************************************************/
924 924
 // Uncomment below to enable
925
-//#define FILAMENT_SENSOR
925
+//#define FILAMENT_WIDTH_SENSOR
926 926
 
927 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 930
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
931 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,11 +928,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
928 928
  * Note may require analog pins to be defined for different motherboards
929 929
  **********************************************************************/
930 930
 // Uncomment below to enable
931
-//#define FILAMENT_SENSOR
931
+//#define FILAMENT_WIDTH_SENSOR
932 932
 
933 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 936
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
937 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,11 +941,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
941 941
  * Note may require analog pins to be defined for different motherboards
942 942
  **********************************************************************/
943 943
 // Uncomment below to enable
944
-//#define FILAMENT_SENSOR
944
+//#define FILAMENT_WIDTH_SENSOR
945 945
 
946 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 949
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
950 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,11 +912,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
912 912
  * Note may require analog pins to be defined for different motherboards
913 913
  **********************************************************************/
914 914
 // Uncomment below to enable
915
-//#define FILAMENT_SENSOR
915
+//#define FILAMENT_WIDTH_SENSOR
916 916
 
917 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 920
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
921 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,11 +920,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
920 920
  * Note may require analog pins to be defined for different motherboards
921 921
  **********************************************************************/
922 922
 // Uncomment below to enable
923
-//#define FILAMENT_SENSOR
923
+//#define FILAMENT_WIDTH_SENSOR
924 924
 
925 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 928
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
929 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,11 +1049,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
1049 1049
  * Note may require analog pins to be defined for different motherboards
1050 1050
  **********************************************************************/
1051 1051
 // Uncomment below to enable
1052
-//#define FILAMENT_SENSOR
1052
+//#define FILAMENT_WIDTH_SENSOR
1053 1053
 
1054 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 1057
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1058 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,11 +1049,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
1049 1049
  * Note may require analog pins to be defined for different motherboards
1050 1050
  **********************************************************************/
1051 1051
 // Uncomment below to enable
1052
-//#define FILAMENT_SENSOR
1052
+//#define FILAMENT_WIDTH_SENSOR
1053 1053
 
1054 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 1057
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1058 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,11 +1053,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
1053 1053
  * Note may require analog pins to be defined for different motherboards
1054 1054
  **********************************************************************/
1055 1055
 // Uncomment below to enable
1056
-//#define FILAMENT_SENSOR
1056
+//#define FILAMENT_WIDTH_SENSOR
1057 1057
 
1058 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 1061
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1062 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,11 +1046,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
1046 1046
  * Note may require analog pins to be defined for different motherboards
1047 1047
  **********************************************************************/
1048 1048
 // Uncomment below to enable
1049
-//#define FILAMENT_SENSOR
1049
+//#define FILAMENT_WIDTH_SENSOR
1050 1050
 
1051 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 1054
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
1055 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,11 +956,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
956 956
  * Note may require analog pins to be defined for different motherboards
957 957
  **********************************************************************/
958 958
 // Uncomment below to enable
959
-//#define FILAMENT_SENSOR
959
+//#define FILAMENT_WIDTH_SENSOR
960 960
 
961 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 964
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
965 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,11 +923,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
923 923
  * Note may require analog pins to be defined for different motherboards
924 924
  **********************************************************************/
925 925
 // Uncomment below to enable
926
-//#define FILAMENT_SENSOR
926
+//#define FILAMENT_WIDTH_SENSOR
927 927
 
928 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 931
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
932 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,11 +914,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
914 914
  * Note may require analog pins to be defined for different motherboards
915 915
  **********************************************************************/
916 916
 // Uncomment below to enable
917
-//#define FILAMENT_SENSOR
917
+//#define FILAMENT_WIDTH_SENSOR
918 918
 
919 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 922
   #define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
923 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,10 +74,7 @@
74 74
   #endif
75 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 80
  * Rambo pin assignments old

+ 1
- 3
Marlin/pins_PRINTRBOARD.h View File

@@ -79,9 +79,7 @@
79 79
 #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
80 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 84
 #define TEMP_1_PIN         -1
87 85
 #define TEMP_2_PIN         -1

+ 1
- 3
Marlin/pins_PRINTRBOARD_REVF.h View File

@@ -73,9 +73,7 @@
73 73
 #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
74 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 78
 #define TEMP_1_PIN         -1
81 79
 #define TEMP_2_PIN         -1

+ 2
- 4
Marlin/pins_RAMBO.h View File

@@ -112,6 +112,8 @@
112 112
 #define LED_PIN            13
113 113
 #define FAN_PIN            8
114 114
 
115
+#define FILWIDTH_PIN        3  // ANALOG NUMBERING
116
+
115 117
 /**********************************************************
116 118
   Fan Pins
117 119
   Fan_0 8
@@ -201,7 +203,3 @@
201 203
   #endif
202 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,11 +91,8 @@
91 91
 #define SDSS               53
92 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 97
 #if ENABLED(Z_MIN_PROBE_ENDSTOP)
101 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,7 +851,7 @@ float junction_deviation = 0.1;
851 851
   block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
852 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 855
     //FMM update ring buffer used for delay with filament measurements
856 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,7 +93,7 @@ unsigned char soft_pwm_bed;
93 93
   volatile int babystepsTodo[3] = { 0 };
94 94
 #endif
95 95
 
96
-#if ENABLED(FILAMENT_SENSOR)
96
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
97 97
   int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
98 98
 #endif
99 99
 
@@ -209,7 +209,7 @@ static void updateTemperaturesFromRawValues();
209 209
   #define SOFT_PWM_SCALE 0
210 210
 #endif
211 211
 
212
-#if ENABLED(FILAMENT_SENSOR)
212
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
213 213
   static int meas_shift_index;  //used to point to a delayed sample in buffer for filament width sensor
214 214
 #endif
215 215
 
@@ -703,7 +703,7 @@ void manage_heater() {
703 703
   #endif
704 704
 
705 705
   // Control the extruder rate based on the width sensor
706
-  #if ENABLED(FILAMENT_SENSOR)
706
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
707 707
     if (filament_sensor) {
708 708
       meas_shift_index = delay_index1 - meas_delay_cm;
709 709
       if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1;  //loop around buffer if needed
@@ -715,7 +715,7 @@ void manage_heater() {
715 715
       NOLESS(vm, 0.01);
716 716
       volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm;
717 717
     }
718
-  #endif //FILAMENT_SENSOR
718
+  #endif //FILAMENT_WIDTH_SENSOR
719 719
 
720 720
   #if DISABLED(PIDTEMPBED)
721 721
     if (ms < next_bed_check_ms) return;
@@ -849,7 +849,7 @@ static void updateTemperaturesFromRawValues() {
849 849
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
850 850
     redundant_temperature = analog2temp(redundant_temperature_raw, 1);
851 851
   #endif
852
-  #if HAS_FILAMENT_SENSOR
852
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
853 853
     filament_width_meas = analog2widthFil();
854 854
   #endif
855 855
 
@@ -864,7 +864,7 @@ static void updateTemperaturesFromRawValues() {
864 864
 }
865 865
 
866 866
 
867
-#if ENABLED(FILAMENT_SENSOR)
867
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
868 868
 
869 869
   // Convert raw Filament Width to millimeters
870 870
   float analog2widthFil() {
@@ -1003,7 +1003,7 @@ void tp_init() {
1003 1003
   #if HAS_TEMP_BED
1004 1004
     ANALOG_SELECT(TEMP_BED_PIN);
1005 1005
   #endif
1006
-  #if HAS_FILAMENT_SENSOR
1006
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
1007 1007
     ANALOG_SELECT(FILWIDTH_PIN);
1008 1008
   #endif
1009 1009
 
@@ -1354,7 +1354,7 @@ ISR(TIMER0_COMPB_vect) {
1354 1354
     ISR_STATICS(BED);
1355 1355
   #endif
1356 1356
 
1357
-  #if HAS_FILAMENT_SENSOR
1357
+  #if ENABLED(FILAMENT_WIDTH_SENSOR)
1358 1358
     static unsigned long raw_filwidth_value = 0;
1359 1359
   #endif
1360 1360
 
@@ -1636,14 +1636,14 @@ ISR(TIMER0_COMPB_vect) {
1636 1636
       break;
1637 1637
 
1638 1638
     case Prepare_FILWIDTH:
1639
-      #if HAS_FILAMENT_SENSOR
1639
+      #if ENABLED(FILAMENT_WIDTH_SENSOR)
1640 1640
         START_ADC(FILWIDTH_PIN);
1641 1641
       #endif
1642 1642
       lcd_buttons_update();
1643 1643
       temp_state = Measure_FILWIDTH;
1644 1644
       break;
1645 1645
     case Measure_FILWIDTH:
1646
-      #if HAS_FILAMENT_SENSOR
1646
+      #if ENABLED(FILAMENT_WIDTH_SENSOR)
1647 1647
         // raw_filwidth_value += ADC;  //remove to use an IIR filter approach
1648 1648
         if (ADC > 102) { //check that ADC is reading a voltage > 0.5 volts, otherwise don't take in the data.
1649 1649
           raw_filwidth_value -= (raw_filwidth_value >> 7); //multiply raw_filwidth_value by 127/128
@@ -1669,7 +1669,7 @@ ISR(TIMER0_COMPB_vect) {
1669 1669
     if (!temp_meas_ready) set_current_temp_raw();
1670 1670
 
1671 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 1673
       current_raw_filwidth = raw_filwidth_value >> 10;  // Divide to get to 0-16384 range since we used 1/128 IIR filter approach
1674 1674
     #endif
1675 1675
 

+ 1
- 1
Marlin/temperature.h View File

@@ -53,7 +53,7 @@
53 53
 void tp_init();  //initialize the heating
54 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 57
   // For converting raw Filament Width to milimeters
58 58
   float analog2widthFil();
59 59
 

Loading…
Cancel
Save