Neil Darlow 10 år sedan
förälder
incheckning
b81021f475

+ 32
- 2
Marlin/Configuration.h Visa fil

@@ -31,7 +31,6 @@
31 31
 #define SERIAL_PORT 0
32 32
 
33 33
 // This determines the communication speed of the printer
34
-// This determines the communication speed of the printer
35 34
 #define BAUDRATE 250000
36 35
 
37 36
 // This enables the serial port associated to the Bluetooth interface
@@ -49,6 +48,7 @@
49 48
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
50 49
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
51 50
 // 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
51
+// 36 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan)
52 52
 // 4  = Duemilanove w/ ATMega328P pin assignment
53 53
 // 5  = Gen6
54 54
 // 51 = Gen6 deluxe
@@ -127,6 +127,7 @@
127 127
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
128 128
 // 11 is 100k beta 3950 1% thermistor (4.7k pullup)
129 129
 // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
130
+// 13 is 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" 
130 131
 // 20 is the PT100 circuit found in the Ultimainboard V2.x
131 132
 // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
132 133
 //
@@ -192,7 +193,7 @@
192 193
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
193 194
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
194 195
   #define K1 0.95 //smoothing factor within the PID
195
-  #define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
196
+  #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
196 197
 
197 198
 // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
198 199
 // Ultimaker
@@ -765,6 +766,35 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
765 766
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
766 767
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
767 768
 
769
+/**********************************************************************\
770
+ * Support for a filament diameter sensor
771
+ * Also allows adjustment of diameter at print time (vs  at slicing)
772
+ * Single extruder only at this point (extruder 0)
773
+ * 
774
+ * Motherboards
775
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector 
776
+ * 81 - Printrboard - Uses Analog input 2 on the Aux 2 connector
777
+ * 301 - Rambo  - uses Analog input 3
778
+ * Note may require analog pins to be defined for different motherboards
779
+ **********************************************************************/
780
+#define FILAMENT_SENSOR
781
+#define FILAMENT_SENSOR_EXTRUDER_NUM	0  //The number of the extruder that has the filament sensor (0,1,2)
782
+#define MEASUREMENT_DELAY_CM			14  //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
783
+
784
+#define DEFAULT_NOMINAL_FILAMENT_DIA  3.0  //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
785
+#define MEASURED_UPPER_LIMIT          3.30  //upper limit factor used for sensor reading validation in mm
786
+#define MEASURED_LOWER_LIMIT          1.90  //lower limit factor for sensor reading validation in mm
787
+#define MAX_MEASUREMENT_DELAY			20  //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM  and lower number saves RAM)
788
+
789
+//defines used in the code
790
+#define DEFAULT_MEASURED_FILAMENT_DIA  DEFAULT_NOMINAL_FILAMENT_DIA  //set measured to nominal initially 
791
+
792
+
793
+
794
+
795
+
796
+
797
+
768 798
 #include "Configuration_adv.h"
769 799
 #include "thermistortables.h"
770 800
 

+ 6
- 6
Marlin/ConfigurationStore.cpp Visa fil

@@ -65,7 +65,7 @@ void Config_StoreSettings()
65 65
   EEPROM_WRITE_VAR(i,max_xy_jerk);
66 66
   EEPROM_WRITE_VAR(i,max_z_jerk);
67 67
   EEPROM_WRITE_VAR(i,max_e_jerk);
68
-  EEPROM_WRITE_VAR(i,add_homeing);
68
+  EEPROM_WRITE_VAR(i,add_homing);
69 69
   #ifdef DELTA
70 70
   EEPROM_WRITE_VAR(i,endstop_adj);
71 71
   EEPROM_WRITE_VAR(i,delta_radius);
@@ -170,9 +170,9 @@ SERIAL_ECHOLNPGM("Scaling factors:");
170 170
     SERIAL_ECHO_START;
171 171
     SERIAL_ECHOLNPGM("Home offset (mm):");
172 172
     SERIAL_ECHO_START;
173
-    SERIAL_ECHOPAIR("  M206 X",add_homeing[0] );
174
-    SERIAL_ECHOPAIR(" Y" ,add_homeing[1] );
175
-    SERIAL_ECHOPAIR(" Z" ,add_homeing[2] );
173
+    SERIAL_ECHOPAIR("  M206 X",add_homing[0] );
174
+    SERIAL_ECHOPAIR(" Y" ,add_homing[1] );
175
+    SERIAL_ECHOPAIR(" Z" ,add_homing[2] );
176 176
     SERIAL_ECHOLN("");
177 177
 #ifdef DELTA
178 178
     SERIAL_ECHO_START;
@@ -229,7 +229,7 @@ void Config_RetrieveSettings()
229 229
         EEPROM_READ_VAR(i,max_xy_jerk);
230 230
         EEPROM_READ_VAR(i,max_z_jerk);
231 231
         EEPROM_READ_VAR(i,max_e_jerk);
232
-        EEPROM_READ_VAR(i,add_homeing);
232
+        EEPROM_READ_VAR(i,add_homing);
233 233
         #ifdef DELTA
234 234
 		EEPROM_READ_VAR(i,endstop_adj);
235 235
 		EEPROM_READ_VAR(i,delta_radius);
@@ -303,7 +303,7 @@ void Config_ResetDefault()
303 303
     max_xy_jerk=DEFAULT_XYJERK;
304 304
     max_z_jerk=DEFAULT_ZJERK;
305 305
     max_e_jerk=DEFAULT_EJERK;
306
-    add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
306
+    add_homing[0] = add_homing[1] = add_homing[2] = 0;
307 307
 #ifdef DELTA
308 308
 	endstop_adj[0] = endstop_adj[1] = endstop_adj[2] = 0;
309 309
 	delta_radius= DELTA_RADIUS;

+ 11
- 1
Marlin/Marlin.h Visa fil

@@ -211,7 +211,7 @@ extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all
211 211
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
212 212
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
213 213
 extern float current_position[NUM_AXIS] ;
214
-extern float add_homeing[3];
214
+extern float add_homing[3];
215 215
 #ifdef DELTA
216 216
 extern float endstop_adj[3];
217 217
 extern float delta_radius;
@@ -236,6 +236,16 @@ extern int EtoPPressure;
236 236
 extern unsigned char fanSpeedSoftPwm;
237 237
 #endif
238 238
 
239
+#ifdef FILAMENT_SENSOR
240
+  extern float filament_width_nominal;  //holds the theoretical filament diameter ie., 3.00 or 1.75 
241
+  extern bool filament_sensor;  //indicates that filament sensor readings should control extrusion  
242
+  extern float filament_width_meas; //holds the filament diameter as accurately measured 
243
+  extern signed char measurement_delay[];  //ring buffer to delay measurement
244
+  extern int delay_index1, delay_index2;  //index into ring buffer
245
+  extern float delay_dist; //delay distance counter
246
+  extern int meas_delay_cm; //delay distance
247
+#endif
248
+
239 249
 #ifdef FWRETRACT
240 250
 extern bool autoretract_enabled;
241 251
 extern bool retracted[EXTRUDERS];

+ 1
- 1
Marlin/MarlinSerial.cpp Visa fil

@@ -73,7 +73,7 @@ void MarlinSerial::begin(long baud)
73 73
   bool useU2X = true;
74 74
 
75 75
 #if F_CPU == 16000000UL && SERIAL_PORT == 0
76
-  // hard coded exception for compatibility with the bootloader shipped
76
+  // hard-coded exception for compatibility with the bootloader shipped
77 77
   // with the Duemilanove and previous boards and the firmware on the 8U2
78 78
   // on the Uno and Mega 2560.
79 79
   if (baud == 57600) {

+ 116
- 28
Marlin/Marlin_main.cpp Visa fil

@@ -159,6 +159,10 @@
159 159
 // M400 - Finish all moves
160 160
 // M401 - Lower z-probe if present
161 161
 // M402 - Raise z-probe if present
162
+// M404 - N<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
163
+// M405 - Turn on Filament Sensor extrusion control.  Optional D<delay in cm> to set delay in centimeters between sensor and extruder 
164
+// M406 - Turn off Filament Sensor extrusion control 
165
+// M407 - Displays measured filament diameter 
162 166
 // M500 - stores parameters in EEPROM
163 167
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
164 168
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
@@ -220,7 +224,7 @@ float volumetric_multiplier[EXTRUDERS] = {1.0
220 224
   #endif
221 225
 };
222 226
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
223
-float add_homeing[3]={0,0,0};
227
+float add_homing[3]={0,0,0};
224 228
 #ifdef DELTA
225 229
 float endstop_adj[3]={0,0,0};
226 230
 #endif
@@ -313,12 +317,28 @@ float axis_scaling[3]={1,1,1};  // Build size scaling, default to 1
313 317
 
314 318
 bool cancel_heatup = false ;
315 319
 
320
+#ifdef FILAMENT_SENSOR
321
+  //Variables for Filament Sensor input 
322
+  float filament_width_nominal=DEFAULT_NOMINAL_FILAMENT_DIA;  //Set nominal filament width, can be changed with M404 
323
+  bool filament_sensor=false;  //M405 turns on filament_sensor control, M406 turns it off 
324
+  float filament_width_meas=DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter 
325
+  signed char measurement_delay[MAX_MEASUREMENT_DELAY+1];  //ring buffer to delay measurement  store extruder factor after subtracting 100 
326
+  int delay_index1=0;  //index into ring buffer
327
+  int delay_index2=-1;  //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized
328
+  float delay_dist=0; //delay distance counter  
329
+  int meas_delay_cm = MEASUREMENT_DELAY_CM;  //distance delay setting
330
+#endif
331
+
316 332
 //===========================================================================
317 333
 //=============================Private Variables=============================
318 334
 //===========================================================================
319 335
 const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
320 336
 static float destination[NUM_AXIS] = {  0.0, 0.0, 0.0, 0.0};
337
+
338
+#ifndef DELTA
321 339
 static float delta[3] = {0.0, 0.0, 0.0};
340
+#endif
341
+
322 342
 static float offset[3] = {0.0, 0.0, 0.0};
323 343
 static bool home_all_axis = true;
324 344
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;
@@ -506,6 +526,7 @@ void servo_init()
506 526
   #endif
507 527
 }
508 528
 
529
+
509 530
 void setup()
510 531
 {
511 532
   setup_killpin();
@@ -555,6 +576,7 @@ void setup()
555 576
   st_init();    // Initialize stepper, this enables interrupts!
556 577
   setup_photpin();
557 578
   servo_init();
579
+  
558 580
 
559 581
   lcd_init();
560 582
   _delay_ms(1000);	// wait 1sec to display the splash screen
@@ -852,7 +874,7 @@ static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
852 874
 
853 875
 static float x_home_pos(int extruder) {
854 876
   if (extruder == 0)
855
-    return base_home_pos(X_AXIS) + add_homeing[X_AXIS];
877
+    return base_home_pos(X_AXIS) + add_homing[X_AXIS];
856 878
   else
857 879
     // In dual carriage mode the extruder offset provides an override of the
858 880
     // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
@@ -884,9 +906,9 @@ static void axis_is_at_home(int axis) {
884 906
       return;
885 907
     }
886 908
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
887
-      current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homeing[X_AXIS];
888
-      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + add_homeing[X_AXIS];
889
-      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + add_homeing[X_AXIS],
909
+      current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homing[X_AXIS];
910
+      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + add_homing[X_AXIS];
911
+      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + add_homing[X_AXIS],
890 912
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
891 913
       return;
892 914
     }
@@ -914,11 +936,11 @@ static void axis_is_at_home(int axis) {
914 936
      
915 937
      for (i=0; i<2; i++)
916 938
      {
917
-        delta[i] -= add_homeing[i];
939
+        delta[i] -= add_homing[i];
918 940
      } 
919 941
      
920
-    // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(add_homeing[X_AXIS]);
921
-	// SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(add_homeing[Y_AXIS]);
942
+    // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(add_homing[X_AXIS]);
943
+	// SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(add_homing[Y_AXIS]);
922 944
     // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
923 945
     // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
924 946
       
@@ -936,14 +958,14 @@ static void axis_is_at_home(int axis) {
936 958
    } 
937 959
    else
938 960
    {
939
-      current_position[axis] = base_home_pos(axis) + add_homeing[axis];
940
-      min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
941
-      max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
961
+      current_position[axis] = base_home_pos(axis) + add_homing[axis];
962
+      min_pos[axis] =          base_min_pos(axis) + add_homing[axis];
963
+      max_pos[axis] =          base_max_pos(axis) + add_homing[axis];
942 964
    }
943 965
 #else
944
-  current_position[axis] = base_home_pos(axis) + add_homeing[axis];
945
-  min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
946
-  max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
966
+  current_position[axis] = base_home_pos(axis) + add_homing[axis];
967
+  min_pos[axis] =          base_min_pos(axis) + add_homing[axis];
968
+  max_pos[axis] =          base_max_pos(axis) + add_homing[axis];
947 969
 #endif
948 970
 }
949 971
 
@@ -1432,12 +1454,12 @@ void process_commands()
1432 1454
           HOMEAXIS(Z);
1433 1455
 
1434 1456
           calculate_delta(current_position);
1435
-          plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);		  
1436
-		  
1457
+          plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1458
+
1437 1459
 #else // NOT DELTA
1438 1460
 
1439 1461
       home_all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])));
1440
-	  
1462
+
1441 1463
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
1442 1464
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
1443 1465
         HOMEAXIS(Z);
@@ -1516,7 +1538,7 @@ void process_commands()
1516 1538
 		#ifdef SCARA
1517 1539
 		   current_position[X_AXIS]=code_value();
1518 1540
 		#else
1519
-		   current_position[X_AXIS]=code_value()+add_homeing[0];
1541
+		   current_position[X_AXIS]=code_value()+add_homing[0];
1520 1542
 		#endif
1521 1543
         }
1522 1544
       }
@@ -1526,7 +1548,7 @@ void process_commands()
1526 1548
          #ifdef SCARA
1527 1549
 		   current_position[Y_AXIS]=code_value();
1528 1550
 		#else
1529
-		   current_position[Y_AXIS]=code_value()+add_homeing[1];
1551
+		   current_position[Y_AXIS]=code_value()+add_homing[1];
1530 1552
 		#endif
1531 1553
         }
1532 1554
       }
@@ -1591,7 +1613,7 @@ void process_commands()
1591 1613
 
1592 1614
       if(code_seen(axis_codes[Z_AXIS])) {
1593 1615
         if(code_value_long() != 0) {
1594
-          current_position[Z_AXIS]=code_value()+add_homeing[2];
1616
+          current_position[Z_AXIS]=code_value()+add_homing[2];
1595 1617
         }
1596 1618
       }
1597 1619
       #ifdef ENABLE_AUTO_BED_LEVELING
@@ -1820,10 +1842,10 @@ void process_commands()
1820 1842
                 	current_position[i] = code_value();  
1821 1843
 		}
1822 1844
 		else {
1823
-                current_position[i] = code_value()+add_homeing[i];  
1845
+                current_position[i] = code_value()+add_homing[i];  
1824 1846
             	}  
1825 1847
 #else
1826
-		current_position[i] = code_value()+add_homeing[i];
1848
+		current_position[i] = code_value()+add_homing[i];
1827 1849
 #endif
1828 1850
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1829 1851
            }
@@ -2702,9 +2724,9 @@ Sigma_Exit:
2702 2724
       SERIAL_PROTOCOLLN("");
2703 2725
       
2704 2726
       SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
2705
-      SERIAL_PROTOCOL(delta[X_AXIS]+add_homeing[0]);
2727
+      SERIAL_PROTOCOL(delta[X_AXIS]+add_homing[0]);
2706 2728
       SERIAL_PROTOCOLPGM("   Psi+Theta (90):");
2707
-      SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homeing[1]);
2729
+      SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homing[1]);
2708 2730
       SERIAL_PROTOCOLLN("");
2709 2731
       
2710 2732
       SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
@@ -2778,6 +2800,8 @@ Sigma_Exit:
2778 2800
         } else {
2779 2801
           //reserved for setting filament diameter via UFID or filament measuring device
2780 2802
           break;
2803
+        
2804
+          
2781 2805
         }
2782 2806
         tmp_extruder = active_extruder;
2783 2807
         if(code_seen('T')) {
@@ -2830,19 +2854,19 @@ Sigma_Exit:
2830 2854
       if(code_seen('E')) max_e_jerk = code_value() ;
2831 2855
     }
2832 2856
     break;
2833
-    case 206: // M206 additional homeing offset
2857
+    case 206: // M206 additional homing offset
2834 2858
       for(int8_t i=0; i < 3; i++)
2835 2859
       {
2836
-        if(code_seen(axis_codes[i])) add_homeing[i] = code_value();
2860
+        if(code_seen(axis_codes[i])) add_homing[i] = code_value();
2837 2861
       }
2838 2862
 	  #ifdef SCARA
2839 2863
 	   if(code_seen('T'))       // Theta
2840 2864
       {
2841
-        add_homeing[0] = code_value() ;
2865
+        add_homing[0] = code_value() ;
2842 2866
       }
2843 2867
       if(code_seen('P'))       // Psi
2844 2868
       {
2845
-        add_homeing[1] = code_value() ;
2869
+        add_homing[1] = code_value() ;
2846 2870
       }
2847 2871
 	  #endif
2848 2872
       break;
@@ -3340,6 +3364,70 @@ Sigma_Exit:
3340 3364
     }
3341 3365
     break;
3342 3366
 #endif
3367
+
3368
+#ifdef FILAMENT_SENSOR
3369
+case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width 
3370
+    {
3371
+    #if (FILWIDTH_PIN > -1) 
3372
+    if(code_seen('N')) filament_width_nominal=code_value();
3373
+    else{
3374
+    SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); 
3375
+    SERIAL_PROTOCOLLN(filament_width_nominal); 
3376
+    }
3377
+    #endif
3378
+    }
3379
+    break; 
3380
+    
3381
+    case 405:  //M405 Turn on filament sensor for control 
3382
+    {
3383
+    
3384
+    
3385
+    if(code_seen('D')) meas_delay_cm=code_value();
3386
+       
3387
+       if(meas_delay_cm> MAX_MEASUREMENT_DELAY)
3388
+       	meas_delay_cm = MAX_MEASUREMENT_DELAY;
3389
+    
3390
+       if(delay_index2 == -1)  //initialize the ring buffer if it has not been done since startup
3391
+    	   {
3392
+    	   int temp_ratio = widthFil_to_size_ratio(); 
3393
+       	    
3394
+       	    for (delay_index1=0; delay_index1<(MAX_MEASUREMENT_DELAY+1); ++delay_index1 ){
3395
+       	              measurement_delay[delay_index1]=temp_ratio-100;  //subtract 100 to scale within a signed byte
3396
+       	        }
3397
+       	    delay_index1=0;
3398
+       	    delay_index2=0;	
3399
+    	   }
3400
+    
3401
+    filament_sensor = true ; 
3402
+    
3403
+    //SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); 
3404
+    //SERIAL_PROTOCOL(filament_width_meas); 
3405
+    //SERIAL_PROTOCOLPGM("Extrusion ratio(%):"); 
3406
+    //SERIAL_PROTOCOL(extrudemultiply); 
3407
+    } 
3408
+    break; 
3409
+    
3410
+    case 406:  //M406 Turn off filament sensor for control 
3411
+    {      
3412
+    filament_sensor = false ; 
3413
+    } 
3414
+    break; 
3415
+  
3416
+    case 407:   //M407 Display measured filament diameter 
3417
+    { 
3418
+     
3419
+    
3420
+    
3421
+    SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); 
3422
+    SERIAL_PROTOCOLLN(filament_width_meas);   
3423
+    } 
3424
+    break; 
3425
+    #endif
3426
+    
3427
+
3428
+
3429
+
3430
+
3343 3431
     case 500: // M500 Store settings in EEPROM
3344 3432
     {
3345 3433
         Config_StoreSettings();

+ 30
- 21
Marlin/example_configurations/delta/Configuration.h Visa fil

@@ -8,7 +8,7 @@
8 8
 //===========================================================================
9 9
 //============================= DELTA Printer ===============================
10 10
 //===========================================================================
11
-// For a Delta printer rplace the configuration files wilth the files in the
11
+// For a Delta printer replace the configuration files with the files in the
12 12
 // example_configurations/delta directory.
13 13
 //
14 14
 
@@ -66,7 +66,7 @@
66 66
 // 702= Minitronics v1.0
67 67
 // 90 = Alpha OMCA board
68 68
 // 91 = Final OMCA board
69
-// 301 = Rambo
69
+// 301= Rambo
70 70
 // 21 = Elefu Ra Board (v3)
71 71
 
72 72
 #ifndef MOTHERBOARD
@@ -89,7 +89,7 @@
89 89
 
90 90
 #define POWER_SUPPLY 1
91 91
 
92
-// Define this to have the electronics keep the powersupply off on startup. If you don't know what this is leave it.
92
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
93 93
 // #define PS_DEFAULT_OFF
94 94
 
95 95
 //===========================================================================
@@ -103,7 +103,7 @@
103 103
 // and processor overload (too many expensive sqrt calls).
104 104
 #define DELTA_SEGMENTS_PER_SECOND 200
105 105
 
106
-// NOTE NB all values for DELTA_* values MOUST be floating point, so always have a decimal point in them
106
+// NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them
107 107
 
108 108
 // Center-to-center distance of the holes in the diagonal push rods.
109 109
 #define DELTA_DIAGONAL_ROD 250.0 // mm
@@ -132,7 +132,7 @@
132 132
 // 0 is not used
133 133
 // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
134 134
 // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
135
-// 3 is mendel-parts thermistor (4.7k pullup)
135
+// 3 is Mendel-parts thermistor (4.7k pullup)
136 136
 // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
137 137
 // 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
138 138
 // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
@@ -141,13 +141,18 @@
141 141
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
142 142
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
143 143
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
144
-// 60 is 100k Maker's Tool Works Kapton Bed Thermister
144
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor
145 145
 //
146 146
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
147 147
 //                          (but gives greater accuracy and more stable PID)
148 148
 // 51 is 100k thermistor - EPCOS (1k pullup)
149 149
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
150 150
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
151
+//
152
+// 1047 is Pt1000 with 4k7 pullup
153
+// 1010 is Pt1000 with 1k pullup (non standard)
154
+// 147 is Pt100 with 4k7 pullup
155
+// 110 is Pt100 with 1k pullup (non standard)
151 156
 
152 157
 #define TEMP_SENSOR_0 -1
153 158
 #define TEMP_SENSOR_1 -1
@@ -184,6 +189,10 @@
184 189
 // HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
185 190
 //#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
186 191
 
192
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
193
+//#define EXTRUDER_WATTS (12.0*12.0/6.7) //  P=I^2/R
194
+//#define BED_WATTS (12.0*12.0/1.1)      // P=I^2/R
195
+
187 196
 // PID settings:
188 197
 // Comment the following line to disable PID and enable bang-bang.
189 198
 #define PIDTEMP
@@ -198,13 +207,13 @@
198 207
   #define K1 0.95 //smoothing factor within the PID
199 208
   #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
200 209
 
201
-// If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
210
+// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
202 211
 // Ultimaker
203 212
     #define  DEFAULT_Kp 22.2
204 213
     #define  DEFAULT_Ki 1.08
205 214
     #define  DEFAULT_Kd 114
206 215
 
207
-// Makergear
216
+// MakerGear
208 217
 //    #define  DEFAULT_Kp 7.0
209 218
 //    #define  DEFAULT_Ki 0.1
210 219
 //    #define  DEFAULT_Kd 12
@@ -273,7 +282,7 @@
273 282
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
274 283
 
275 284
 #ifndef ENDSTOPPULLUPS
276
-  // fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined
285
+  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
277 286
   // #define ENDSTOPPULLUP_XMAX
278 287
   // #define ENDSTOPPULLUP_YMAX
279 288
   // #define ENDSTOPPULLUP_ZMAX
@@ -359,7 +368,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
359 368
   #define BACK_PROBE_BED_POSITION 180
360 369
   #define FRONT_PROBE_BED_POSITION 20
361 370
 
362
-  // these are the offsets to the prob relative to the extruder tip (Hotend - Probe)
371
+  // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
363 372
   #define X_PROBE_OFFSET_FROM_EXTRUDER -25
364 373
   #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
365 374
   #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
@@ -380,7 +389,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
380 389
 //  #define PROBE_SERVO_DEACTIVATION_DELAY 300
381 390
 
382 391
 
383
-//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing,
392
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
384 393
 //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
385 394
 
386 395
   #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
@@ -407,7 +416,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
407 416
 //Manual homing switch locations:
408 417
 
409 418
 #define MANUAL_HOME_POSITIONS  // MANUAL_*_HOME_POS below will be used
410
-// For deltabots this means top and center of the cartesian print volume.
419
+// For deltabots this means top and center of the Cartesian print volume.
411 420
 #define MANUAL_X_HOME_POS 0
412 421
 #define MANUAL_Y_HOME_POS 0
413 422
 #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
@@ -443,11 +452,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
443 452
 //===========================================================================
444 453
 
445 454
 // EEPROM
446
-// the microcontroller can store settings in the EEPROM, e.g. max velocity...
447
-// M500 - stores paramters in EEPROM
455
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
456
+// M500 - stores parameters in EEPROM
448 457
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
449 458
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
450
-//define this to enable eeprom support
459
+//define this to enable EEPROM support
451 460
 //#define EEPROM_SETTINGS
452 461
 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
453 462
 // please keep turned on if you can.
@@ -463,14 +472,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
463 472
 #define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
464 473
 
465 474
 //LCD and SD support
466
-//#define ULTRA_LCD  //general lcd support, also 16x2
475
+//#define ULTRA_LCD  //general LCD support, also 16x2
467 476
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
468 477
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
469 478
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
470 479
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
471 480
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
472
-//#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
473
-//#define ULTIPANEL  //the ultipanel as on thingiverse
481
+//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
482
+//#define ULTIPANEL  //the UltiPanel as on Thingiverse
474 483
 
475 484
 // The MaKr3d Makr-Panel with graphic controller and SD support
476 485
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
@@ -594,7 +603,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
594 603
     #define LCD_WIDTH 20
595 604
     #define LCD_HEIGHT 4
596 605
   #endif
597
-#else //no panel but just lcd
606
+#else //no panel but just LCD
598 607
   #ifdef ULTRA_LCD
599 608
   #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
600 609
     #define LCD_WIDTH 20
@@ -616,8 +625,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
616 625
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
617 626
 //#define FAST_PWM_FAN
618 627
 
619
-// Temperature status leds that display the hotend and bet temperature.
620
-// If alle hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
628
+// Temperature status LEDs that display the hotend and bet temperature.
629
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
621 630
 // Otherwise the RED led is on. There is 1C hysteresis.
622 631
 //#define TEMP_STAT_LEDS
623 632
 

+ 14
- 3
Marlin/language.h Visa fil

@@ -155,6 +155,7 @@
155 155
 	#define MSG_AUTOSTART "Autostart"
156 156
 	#define MSG_DISABLE_STEPPERS "Disable steppers"
157 157
 	#define MSG_AUTO_HOME "Auto home"
158
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
158 159
 	#define MSG_SET_ORIGIN "Set origin"
159 160
 	#define MSG_PREHEAT_PLA "Preheat PLA"
160 161
 	#define MSG_PREHEAT_PLA0 "Preheat PLA 1"
@@ -279,6 +280,7 @@
279 280
 	#define MSG_AUTOSTART "Autostart"
280 281
 	#define MSG_DISABLE_STEPPERS "Wylacz silniki"
281 282
 	#define MSG_AUTO_HOME "Auto. poz. zerowa"
283
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
282 284
 	#define MSG_SET_ORIGIN "Ustaw punkt zero"
283 285
 	#define MSG_PREHEAT_PLA "Rozgrzej PLA"
284 286
 	#define MSG_PREHEAT_PLA0 "Rozgrzej PLA 1"
@@ -406,10 +408,11 @@
406 408
 	#define MSG_AUTOSTART "Demarrage auto"
407 409
 	#define MSG_DISABLE_STEPPERS "Arreter moteurs"
408 410
 	#define MSG_AUTO_HOME "Home auto."
411
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
409 412
 	#define MSG_SET_ORIGIN "Regler origine"
410 413
 	#define MSG_PREHEAT_PLA " Prechauffage PLA"
411 414
 	#define MSG_PREHEAT_PLA0 "Prechauff. PLA 1"
412
-        #define MSG_PREHEAT_PLA1 "Prechauff. PLA 2"
415
+    #define MSG_PREHEAT_PLA1 "Prechauff. PLA 2"
413 416
 	#define MSG_PREHEAT_PLA2 "Prechauff. PLA 3"
414 417
 	#define MSG_PREHEAT_PLA012 "Prech. PLA Tout"
415 418
 	#define MSG_PREHEAT_PLA_BEDONLY "Prech. PLA Plateau"
@@ -534,6 +537,7 @@
534 537
 	#define MSG_AUTOSTART        "Autostart"
535 538
 	#define MSG_DISABLE_STEPPERS "Stepper abschalt."
536 539
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
540
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
537 541
 	#define MSG_SET_ORIGIN       "Setze Nullpunkt"
538 542
 	#define MSG_PREHEAT_PLA      "Vorwärmen PLA"
539 543
 	#define MSG_PREHEAT_PLA0     "Vorwärmen PLA 1"
@@ -661,6 +665,7 @@
661 665
 	#define MSG_AUTOSTART " Autostart"
662 666
 	#define MSG_DISABLE_STEPPERS "Apagar motores"
663 667
 	#define MSG_AUTO_HOME "Llevar al origen"
668
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
664 669
 	#define MSG_SET_ORIGIN "Establecer cero"
665 670
 	#define MSG_PREHEAT_PLA "Precalentar PLA"
666 671
 	#define MSG_PREHEAT_PLA0 "Precalentar PLA 1"
@@ -794,6 +799,7 @@
794 799
 	#define MSG_AUTOSTART						"Автостарт"
795 800
 	#define MSG_DISABLE_STEPPERS 				"Выкл. двигатели"
796 801
 	#define MSG_AUTO_HOME						"Парковка"
802
+	#define MSG_SET_HOME_OFFSETS				"Set home offsets"
797 803
 	#define MSG_SET_ORIGIN						"Запомнить ноль"
798 804
 	#define MSG_PREHEAT_PLA 					"Преднагрев PLA"
799 805
 	#define MSG_PREHEAT_PLA0					"Преднагрев PLA0"
@@ -885,11 +891,11 @@
885 891
 	#define MSG_KILLED							"УБИТО."
886 892
 	#define MSG_STOPPED							"ОСТАНОВЛЕНО."
887 893
 	#define MSG_CONTROL_RETRACT					"Откат mm:"
888
-	#define MSG_CONTROL_RETRACT_SWAP				"своп Откат mm:"
894
+	#define MSG_CONTROL_RETRACT_SWAP			"своп Откат mm:"
889 895
 	#define MSG_CONTROL_RETRACTF				"Откат  V:"
890 896
 	#define MSG_CONTROL_RETRACT_ZLIFT			"Прыжок mm:"
891 897
 	#define MSG_CONTROL_RETRACT_RECOVER			"Возврат +mm:"
892
-	#define MSG_CONTROL_RETRACT_RECOVER_SWAP		"своп Возврат +mm:"
898
+	#define MSG_CONTROL_RETRACT_RECOVER_SWAP	"своп Возврат +mm:"
893 899
 	#define MSG_CONTROL_RETRACT_RECOVERF		"Возврат  V:"
894 900
 	#define MSG_AUTORETRACT						"АвтоОткат:"
895 901
 	#define MSG_FILAMENTCHANGE 					"Change filament"
@@ -919,6 +925,7 @@
919 925
 	#define MSG_AUTOSTART            "Autostart"
920 926
 	#define MSG_DISABLE_STEPPERS     "Disabilita Motori"
921 927
 	#define MSG_AUTO_HOME            "Auto Home"
928
+	#define MSG_SET_HOME_OFFSETS     "Set home offsets"
922 929
 	#define MSG_SET_ORIGIN           "Imposta Origine"
923 930
 	#define MSG_PREHEAT_PLA          "Preriscalda PLA"
924 931
 	#define MSG_PREHEAT_PLA0         "Preriscalda PLA 1"
@@ -1044,6 +1051,7 @@
1044 1051
 	#define MSG_AUTOSTART "Autostart"
1045 1052
 	#define MSG_DISABLE_STEPPERS " Apagar motores"
1046 1053
 	#define MSG_AUTO_HOME "Ir para origen"
1054
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
1047 1055
 	#define MSG_SET_ORIGIN "Estabelecer orig."
1048 1056
 	#define MSG_PREHEAT_PLA "Pre-aquecer PLA"
1049 1057
 	#define MSG_PREHEAT_PLA0 " pre-aquecer PLA 1"
@@ -1176,6 +1184,7 @@
1176 1184
 	#define MSG_AUTOSTART "Automaatti"
1177 1185
 	#define MSG_DISABLE_STEPPERS "Vapauta moottorit"
1178 1186
 	#define MSG_AUTO_HOME "Aja referenssiin"
1187
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
1179 1188
 	#define MSG_SET_ORIGIN "Aseta origo"
1180 1189
 	#define MSG_PREHEAT_PLA "Esilammita PLA"
1181 1190
 	#define MSG_PREHEAT_PLA0 "Esilammita PLA 1"
@@ -1299,6 +1308,7 @@
1299 1308
 	#define MSG_AUTOSTART " Autostart"
1300 1309
 	#define MSG_DISABLE_STEPPERS "Amortar motors"
1301 1310
 	#define MSG_AUTO_HOME "Levar a l'orichen"
1311
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
1302 1312
 	#define MSG_SET_ORIGIN "Establir zero"
1303 1313
 	#define MSG_PREHEAT_PLA "Precalentar PLA"
1304 1314
 	#define MSG_PREHEAT_PLA0 "Precalentar PLA0"
@@ -1431,6 +1441,7 @@
1431 1441
 	#define MSG_AUTOSTART "Autostart"
1432 1442
 	#define MSG_DISABLE_STEPPERS "Motoren uit"
1433 1443
 	#define MSG_AUTO_HOME "Auto home"
1444
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
1434 1445
 	#define MSG_SET_ORIGIN "Nulpunt instellen"
1435 1446
 	#define MSG_PREHEAT_PLA "PLA voorverwarmen"
1436 1447
 	#define MSG_PREHEAT_PLA0 "PLA voorverw. 0"

+ 8
- 0
Marlin/motion_control.cpp Visa fil

@@ -44,6 +44,14 @@ void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8
44 44
   if (angular_travel < 0) { angular_travel += 2*M_PI; }
45 45
   if (isclockwise) { angular_travel -= 2*M_PI; }
46 46
   
47
+  //20141002:full circle for G03 did not work, e.g. G03 X80 Y80 I20 J0 F2000 is giving an Angle of zero so head is not moving
48
+  //to compensate when start pos = target pos && angle is zero -> angle = 2Pi
49
+  if (position[axis_0] == target[axis_0] && position[axis_1] == target[axis_1] && angular_travel == 0)
50
+  {
51
+	  angular_travel += 2*M_PI;
52
+  }
53
+  //end fix G03
54
+  
47 55
   float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
48 56
   if (millimeters_of_travel < 0.001) { return; }
49 57
   uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);

+ 22
- 6
Marlin/pins.h Visa fil

@@ -531,7 +531,7 @@
531 531
 * Arduino Mega pin assignment
532 532
 *
533 533
 ****************************************************************************************/
534
-#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
534
+#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 36 || MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
535 535
 #define KNOWN_BOARD 1
536 536
 
537 537
 //////////////////FIX THIS//////////////
@@ -547,7 +547,7 @@
547 547
 // #define RAMPS_V_1_0
548 548
 
549 549
 
550
-#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
550
+#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 36 ||  MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
551 551
 
552 552
   #define LARGE_FLASH true
553 553
 
@@ -628,6 +628,15 @@
628 628
     #define E1_DIR_PIN         34
629 629
     #define E1_ENABLE_PIN      30
630 630
 
631
+#if MOTHERBOARD == 34  //FMM added for Filament Extruder
632
+#ifdef FILAMENT_SENSOR
633
+	  //define analog pin for the filament width sensor input
634
+	  //Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
635
+      #define FILWIDTH_PIN        5
636
+#endif
637
+#endif
638
+
639
+
631 640
     #if MOTHERBOARD == 68
632 641
       #define E2_STEP_PIN        23
633 642
       #define E2_DIR_PIN         25
@@ -653,7 +662,7 @@
653 662
     #define FAN_PIN            4 // IO pin. Buffer needed
654 663
   #endif
655 664
 
656
-  #if MOTHERBOARD == 77
665
+  #if MOTHERBOARD == 77 || MOTHERBOARD == 36
657 666
     #define FAN_PIN            8
658 667
   #endif
659 668
 
@@ -709,7 +718,7 @@
709 718
     #define TEMP_2_PIN         -1   // ANALOG NUMBERING
710 719
   #endif
711 720
 
712
-  #if MOTHERBOARD == 35
721
+  #if MOTHERBOARD == 35 || MOTHERBOARD == 36
713 722
     #define HEATER_BED_PIN     -1    // NO BED
714 723
   #else
715 724
     #if MOTHERBOARD == 77
@@ -1762,6 +1771,9 @@
1762 1771
   #define Z_STOP_PIN         36
1763 1772
   #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
1764 1773
   #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
1774
+  #ifdef FILAMENT_SENSOR
1775
+   #define FILWIDTH_PIN        2
1776
+  #endif //FILAMENT_SENSOR
1765 1777
 #endif
1766 1778
 
1767 1779
 #define TEMP_1_PIN         -1
@@ -2078,8 +2090,8 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
2078 2090
 #define Z_DIR_PIN          28
2079 2091
 #define Z_STOP_PIN         30
2080 2092
 
2081
-#define E0_STEP_PIN         17
2082
-#define E0_DIR_PIN          21
2093
+#define E0_STEP_PIN        17
2094
+#define E0_DIR_PIN         21
2083 2095
 
2084 2096
 #define LED_PIN            -1
2085 2097
 
@@ -2396,6 +2408,10 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
2396 2408
   #endif
2397 2409
 #endif //ULTRA_LCD
2398 2410
 
2411
+#ifdef FILAMENT_SENSOR
2412
+  //Filip added pin for Filament sensor analog input 
2413
+  #define FILWIDTH_PIN        3
2414
+#endif //FILAMENT_SENSOR
2399 2415
 
2400 2416
 #endif
2401 2417
 

+ 47
- 0
Marlin/planner.cpp Visa fil

@@ -119,6 +119,10 @@ static long x_segment_time[3]={MAX_FREQ_TIME + 1,0,0};     // Segment times (in
119 119
 static long y_segment_time[3]={MAX_FREQ_TIME + 1,0,0};
120 120
 #endif
121 121
 
122
+#ifdef FILAMENT_SENSOR
123
+ static char meas_sample; //temporary variable to hold filament measurement sample
124
+#endif
125
+
122 126
 // Returns the index of the next block in the ring buffer
123 127
 // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication.
124 128
 static int8_t next_block_index(int8_t block_index) {
@@ -762,6 +766,49 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
762 766
   block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
763 767
   block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0
764 768
 
769
+#ifdef FILAMENT_SENSOR
770
+  //FMM update ring buffer used for delay with filament measurements
771
+  
772
+  
773
+    if((extruder==FILAMENT_SENSOR_EXTRUDER_NUM) && (delay_index2 > -1))  //only for extruder with filament sensor and if ring buffer is initialized
774
+  	  {
775
+    delay_dist = delay_dist + delta_mm[E_AXIS];  //increment counter with next move in e axis
776
+  
777
+    while (delay_dist >= (10*(MAX_MEASUREMENT_DELAY+1)))  //check if counter is over max buffer size in mm
778
+      	  delay_dist = delay_dist - 10*(MAX_MEASUREMENT_DELAY+1);  //loop around the buffer
779
+    while (delay_dist<0)
780
+    	  delay_dist = delay_dist + 10*(MAX_MEASUREMENT_DELAY+1); //loop around the buffer
781
+      
782
+    delay_index1=delay_dist/10.0;  //calculate index
783
+    
784
+    //ensure the number is within range of the array after converting from floating point
785
+    if(delay_index1<0)
786
+    	delay_index1=0;
787
+    else if (delay_index1>MAX_MEASUREMENT_DELAY)
788
+    	delay_index1=MAX_MEASUREMENT_DELAY;
789
+    	
790
+    if(delay_index1 != delay_index2)  //moved index
791
+  	  {
792
+    	meas_sample=widthFil_to_size_ratio()-100;  //subtract off 100 to reduce magnitude - to store in a signed char
793
+  	  }
794
+    while( delay_index1 != delay_index2)
795
+  	  {
796
+  	  delay_index2 = delay_index2 + 1;
797
+  	if(delay_index2>MAX_MEASUREMENT_DELAY)
798
+  			  delay_index2=delay_index2-(MAX_MEASUREMENT_DELAY+1);  //loop around buffer when incrementing
799
+  	  if(delay_index2<0)
800
+  		delay_index2=0;
801
+  	  else if (delay_index2>MAX_MEASUREMENT_DELAY)
802
+  		delay_index2=MAX_MEASUREMENT_DELAY;  
803
+  	  
804
+  	  measurement_delay[delay_index2]=meas_sample;
805
+  	  }
806
+    	
807
+    
808
+  	  }
809
+#endif
810
+
811
+
765 812
   // Calculate and limit speed in mm/sec for each axis
766 813
   float current_speed[4];
767 814
   float speed_factor = 1.0; //factor <=1 do decrease speed

+ 1
- 1
Marlin/stepper.cpp Visa fil

@@ -1241,7 +1241,7 @@ void microstep_init()
1241 1241
   pinMode(Y_MS1_PIN,OUTPUT);
1242 1242
   pinMode(Y_MS2_PIN,OUTPUT);
1243 1243
   pinMode(Z_MS1_PIN,OUTPUT);
1244
-  pinMode(Z_MS2_PIN,OUTPUT);  
1244
+  pinMode(Z_MS2_PIN,OUTPUT);
1245 1245
   pinMode(E0_MS1_PIN,OUTPUT);
1246 1246
   pinMode(E0_MS2_PIN,OUTPUT);
1247 1247
   for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]);

+ 117
- 6
Marlin/temperature.cpp Visa fil

@@ -74,7 +74,10 @@ unsigned char soft_pwm_bed;
74 74
 #ifdef BABYSTEPPING
75 75
   volatile int babystepsTodo[3]={0,0,0};
76 76
 #endif
77
-  
77
+
78
+#ifdef FILAMENT_SENSOR
79
+  int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
80
+#endif  
78 81
 //===========================================================================
79 82
 //=============================private variables============================
80 83
 //===========================================================================
@@ -161,6 +164,9 @@ unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0);
161 164
 #define SOFT_PWM_SCALE 0
162 165
 #endif
163 166
 
167
+#ifdef FILAMENT_SENSOR
168
+  static int meas_shift_index;  //used to point to a delayed sample in buffer for filament width sensor
169
+#endif
164 170
 //===========================================================================
165 171
 //=============================   functions      ============================
166 172
 //===========================================================================
@@ -604,6 +610,28 @@ void manage_heater()
604 610
       }
605 611
     #endif
606 612
   #endif
613
+  
614
+//code for controlling the extruder rate based on the width sensor 
615
+#ifdef FILAMENT_SENSOR
616
+  if(filament_sensor) 
617
+	{
618
+	meas_shift_index=delay_index1-meas_delay_cm;
619
+		  if(meas_shift_index<0)
620
+			  meas_shift_index = meas_shift_index + (MAX_MEASUREMENT_DELAY+1);  //loop around buffer if needed
621
+		  
622
+		  //get the delayed info and add 100 to reconstitute to a percent of the nominal filament diameter
623
+		  //then square it to get an area
624
+		  
625
+		  if(meas_shift_index<0)
626
+			  meas_shift_index=0;
627
+		  else if (meas_shift_index>MAX_MEASUREMENT_DELAY)
628
+			  meas_shift_index=MAX_MEASUREMENT_DELAY;
629
+		  
630
+		     volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = pow((float)(100+measurement_delay[meas_shift_index])/100.0,2);
631
+		     if (volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] <0.01)
632
+		    	 volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]=0.01;
633
+	}
634
+#endif
607 635
 }
608 636
 
609 637
 #define PGM_RD_W(x)   (short)pgm_read_word(&x)
@@ -697,6 +725,9 @@ static void updateTemperaturesFromRawValues()
697 725
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
698 726
       redundant_temperature = analog2temp(redundant_temperature_raw, 1);
699 727
     #endif
728
+    #ifdef FILAMENT_SENSOR  && (FILWIDTH_PIN > -1)    //check if a sensor is supported 
729
+      filament_width_meas = analog2widthFil();
730
+    #endif  
700 731
     //Reset the watchdog after we know we have a temperature measurement.
701 732
     watchdog_reset();
702 733
 
@@ -705,6 +736,36 @@ static void updateTemperaturesFromRawValues()
705 736
     CRITICAL_SECTION_END;
706 737
 }
707 738
 
739
+
740
+// For converting raw Filament Width to milimeters 
741
+#ifdef FILAMENT_SENSOR
742
+float analog2widthFil() { 
743
+return current_raw_filwidth/16383.0*5.0; 
744
+//return current_raw_filwidth; 
745
+} 
746
+ 
747
+// For converting raw Filament Width to a ratio 
748
+int widthFil_to_size_ratio() { 
749
+ 
750
+float temp; 
751
+      
752
+temp=filament_width_meas;
753
+if(filament_width_meas<MEASURED_LOWER_LIMIT)
754
+	temp=filament_width_nominal;  //assume sensor cut out
755
+else if (filament_width_meas>MEASURED_UPPER_LIMIT)
756
+	temp= MEASURED_UPPER_LIMIT;
757
+
758
+
759
+return(filament_width_nominal/temp*100); 
760
+
761
+
762
+} 
763
+#endif
764
+
765
+
766
+
767
+
768
+
708 769
 void tp_init()
709 770
 {
710 771
 #if (MOTHERBOARD == 80) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1))
@@ -804,6 +865,17 @@ void tp_init()
804 865
     #endif
805 866
   #endif
806 867
   
868
+  //Added for Filament Sensor 
869
+  #ifdef FILAMENT_SENSOR
870
+   #if defined(FILWIDTH_PIN) && (FILWIDTH_PIN > -1) 
871
+	#if FILWIDTH_PIN < 8 
872
+       	   DIDR0 |= 1<<FILWIDTH_PIN;  
873
+	#else 
874
+       	   DIDR2 |= 1<<(FILWIDTH_PIN - 8);  
875
+	#endif 
876
+   #endif
877
+  #endif
878
+  
807 879
   // Use timer0 for temperature measurement
808 880
   // Interleave temperature interrupt with millies interrupt
809 881
   OCR0B = 128;
@@ -1116,7 +1188,7 @@ ISR(TIMER0_COMPB_vect)
1116 1188
   static unsigned long raw_temp_1_value = 0;
1117 1189
   static unsigned long raw_temp_2_value = 0;
1118 1190
   static unsigned long raw_temp_bed_value = 0;
1119
-  static unsigned char temp_state = 8;
1191
+  static unsigned char temp_state = 10;
1120 1192
   static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1121 1193
   static unsigned char soft_pwm_0;
1122 1194
   #if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
@@ -1129,6 +1201,10 @@ ISR(TIMER0_COMPB_vect)
1129 1201
   static unsigned char soft_pwm_b;
1130 1202
   #endif
1131 1203
   
1204
+  #if defined(FILWIDTH_PIN) &&(FILWIDTH_PIN > -1)
1205
+   static unsigned long raw_filwidth_value = 0;  //added for filament width sensor
1206
+  #endif
1207
+  
1132 1208
   if(pwm_count == 0){
1133 1209
     soft_pwm_0 = soft_pwm[0];
1134 1210
     if(soft_pwm_0 > 0) { 
@@ -1255,10 +1331,39 @@ ISR(TIMER0_COMPB_vect)
1255 1331
       #if defined(TEMP_2_PIN) && (TEMP_2_PIN > -1)
1256 1332
         raw_temp_2_value += ADC;
1257 1333
       #endif
1258
-      temp_state = 0;
1259
-      temp_count++;
1334
+      temp_state = 8;//change so that Filament Width is also measured
1335
+      
1260 1336
       break;
1261
-    case 8: //Startup, delay initial temp reading a tiny bit so the hardware can settle.
1337
+    case 8: //Prepare FILWIDTH 
1338
+     #if defined(FILWIDTH_PIN) && (FILWIDTH_PIN> -1) 
1339
+      #if FILWIDTH_PIN>7 
1340
+         ADCSRB = 1<<MUX5;
1341
+      #else
1342
+         ADCSRB = 0; 
1343
+      #endif 
1344
+      ADMUX = ((1 << REFS0) | (FILWIDTH_PIN & 0x07)); 
1345
+      ADCSRA |= 1<<ADSC; // Start conversion 
1346
+     #endif 
1347
+     lcd_buttons_update();       
1348
+     temp_state = 9; 
1349
+     break; 
1350
+    case 9:   //Measure FILWIDTH 
1351
+     #if defined(FILWIDTH_PIN) &&(FILWIDTH_PIN > -1) 
1352
+     //raw_filwidth_value += ADC;  //remove to use an IIR filter approach 
1353
+      if(ADC>102)  //check that ADC is reading a voltage > 0.5 volts, otherwise don't take in the data.
1354
+        {
1355
+    	raw_filwidth_value= raw_filwidth_value-(raw_filwidth_value>>7);  //multipliy raw_filwidth_value by 127/128
1356
+        
1357
+        raw_filwidth_value= raw_filwidth_value + ((unsigned long)ADC<<7);  //add new ADC reading 
1358
+        }
1359
+     #endif 
1360
+     temp_state = 0;   
1361
+      
1362
+     temp_count++;
1363
+     break;      
1364
+      
1365
+      
1366
+    case 10: //Startup, delay initial temp reading a tiny bit so the hardware can settle.
1262 1367
       temp_state = 0;
1263 1368
       break;
1264 1369
 //    default:
@@ -1267,7 +1372,7 @@ ISR(TIMER0_COMPB_vect)
1267 1372
 //      break;
1268 1373
   }
1269 1374
     
1270
-  if(temp_count >= OVERSAMPLENR) // 8 * 16 * 1/(16000000/64/256)  = 131ms.
1375
+  if(temp_count >= OVERSAMPLENR) // 10 * 16 * 1/(16000000/64/256)  = 164ms.
1271 1376
   {
1272 1377
     if (!temp_meas_ready) //Only update the raw values if they have been read. Else we could be updating them during reading.
1273 1378
     {
@@ -1283,6 +1388,12 @@ ISR(TIMER0_COMPB_vect)
1283 1388
 #endif
1284 1389
       current_temperature_bed_raw = raw_temp_bed_value;
1285 1390
     }
1391
+
1392
+//Add similar code for Filament Sensor - can be read any time since IIR filtering is used 
1393
+#if defined(FILWIDTH_PIN) &&(FILWIDTH_PIN > -1)
1394
+  current_raw_filwidth = raw_filwidth_value>>10;  //need to divide to get to 0-16384 range since we used 1/128 IIR filter approach 
1395
+#endif
1396
+    
1286 1397
     
1287 1398
     temp_meas_ready = true;
1288 1399
     temp_count = 0;

+ 8
- 0
Marlin/temperature.h Visa fil

@@ -31,6 +31,14 @@
31 31
 void tp_init();  //initialize the heating
32 32
 void manage_heater(); //it is critical that this is called periodically.
33 33
 
34
+#ifdef FILAMENT_SENSOR
35
+// For converting raw Filament Width to milimeters 
36
+ float analog2widthFil(); 
37
+ 
38
+// For converting raw Filament Width to an extrusion ratio 
39
+ int widthFil_to_size_ratio();
40
+#endif
41
+
34 42
 // low level conversion routines
35 43
 // do not use these routines and variables outside of temperature.cpp
36 44
 extern int target_temperature[EXTRUDERS];  

+ 69
- 0
Marlin/thermistortables.h Visa fil

@@ -621,6 +621,75 @@ const short temptable_11[][2] PROGMEM = {
621 621
 };
622 622
 #endif
623 623
 
624
+#if (THERMISTORHEATER_0 == 13) || (THERMISTORHEATER_1 == 13) || (THERMISTORHEATER_2 == 13) || (THERMISTORBED == 13)
625
+// Hisens thermistor B25/50 =3950 +/-1%
626
+
627
+const short temptable_13[][2] PROGMEM = {
628
+ {	22.5*OVERSAMPLENR,	300	},
629
+{	24.125*OVERSAMPLENR,	295	},
630
+{	25.875*OVERSAMPLENR,	290	},
631
+{	27.8125*OVERSAMPLENR,	285	},
632
+{	29.9375*OVERSAMPLENR,	280	},
633
+{	32.25*OVERSAMPLENR,	275	},
634
+{	34.8125*OVERSAMPLENR,	270	},
635
+{	37.625*OVERSAMPLENR,	265	},
636
+{	40.6875*OVERSAMPLENR,	260	},
637
+{	44.0625*OVERSAMPLENR,	255	},
638
+{	47.75*OVERSAMPLENR,	250	},
639
+{	51.8125*OVERSAMPLENR,	245	},
640
+{	56.3125*OVERSAMPLENR,	240	},
641
+{	61.25*OVERSAMPLENR,	235	},
642
+{	66.75*OVERSAMPLENR,	230	},
643
+{	72.8125*OVERSAMPLENR,	225	},
644
+{	79.5*OVERSAMPLENR,	220	},
645
+{	87*OVERSAMPLENR,	215	},
646
+{	95.3125*OVERSAMPLENR,	210	},
647
+{	104.1875*OVERSAMPLENR,	205	},
648
+{	112.75*OVERSAMPLENR,	200	},
649
+{	123.125*OVERSAMPLENR,	195	},
650
+{	135.75*OVERSAMPLENR,	190	},
651
+{	148.3125*OVERSAMPLENR,	185	},
652
+{	163.8125*OVERSAMPLENR,	180	},
653
+{	179*OVERSAMPLENR,	175	},
654
+{	211.125*OVERSAMPLENR,	170	},
655
+{	216.125*OVERSAMPLENR,	165	},
656
+{	236.5625*OVERSAMPLENR,	160	},
657
+{	258.5*OVERSAMPLENR,	155	},
658
+{	279.875*OVERSAMPLENR,	150	},
659
+{	305.375*OVERSAMPLENR,	145	},
660
+{	333.25*OVERSAMPLENR,	140	},
661
+{	362.5625*OVERSAMPLENR,	135	},
662
+{	393.6875*OVERSAMPLENR,	130	},
663
+{	425*OVERSAMPLENR,	125	},
664
+{	460.625*OVERSAMPLENR,	120	},
665
+{	495.1875*OVERSAMPLENR,	115	},
666
+{	530.875*OVERSAMPLENR,	110	},
667
+{	567.25*OVERSAMPLENR,	105	},
668
+{	601.625*OVERSAMPLENR,	100	},
669
+{	637.875*OVERSAMPLENR,	95	},
670
+{	674.5625*OVERSAMPLENR,	90	},
671
+{	710*OVERSAMPLENR,	85	},
672
+{	744.125*OVERSAMPLENR,	80	},
673
+{	775.9375*OVERSAMPLENR,	75	},
674
+{	806.875*OVERSAMPLENR,	70	},
675
+{	835.1875*OVERSAMPLENR,	65	},
676
+{	861.125*OVERSAMPLENR,	60	},
677
+{	884.375*OVERSAMPLENR,	55	},
678
+{	904.5625*OVERSAMPLENR,	50	},
679
+{	923.8125*OVERSAMPLENR,	45	},
680
+{	940.375*OVERSAMPLENR,	40	},
681
+{	954.625*OVERSAMPLENR,	35	},
682
+{	966.875*OVERSAMPLENR,	30	},
683
+{	977.0625*OVERSAMPLENR,	25	},
684
+{	986*OVERSAMPLENR,	20	},
685
+{	993.375*OVERSAMPLENR,	15	},
686
+{	999.5*OVERSAMPLENR,	10	},
687
+{	1004.5*OVERSAMPLENR,	5	},
688
+{	1008.5*OVERSAMPLENR,	0	}
689
+
690
+ };
691
+#endif
692
+
624 693
 #if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
625 694
 /* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
626 695
 This does not match the normal thermistor behaviour so we need to set the following defines */

+ 27
- 1
Marlin/ultralcd.cpp Visa fil

@@ -307,6 +307,23 @@ static void lcd_autostart_sd()
307 307
 }
308 308
 #endif
309 309
 
310
+void lcd_set_home_offsets()
311
+{
312
+    for(int8_t i=0; i < NUM_AXIS; i++) {
313
+      if (i != E_AXIS) {
314
+        add_homing[i] -= current_position[i];
315
+        current_position[i] = 0.0;
316
+      }
317
+    }
318
+    plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
319
+
320
+    // Audio feedback
321
+    enquecommand_P(PSTR("M300 S659 P200"));
322
+    enquecommand_P(PSTR("M300 S698 P200"));
323
+    lcd_return_to_status();
324
+}
325
+
326
+
310 327
 #ifdef BABYSTEPPING
311 328
 static void lcd_babystep_x()
312 329
 {
@@ -374,7 +391,9 @@ static void lcd_tune_menu()
374 391
     START_MENU();
375 392
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
376 393
     MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999);
394
+#if TEMP_SENSOR_0 != 0
377 395
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
396
+#endif
378 397
 #if TEMP_SENSOR_1 != 0
379 398
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
380 399
 #endif
@@ -566,6 +585,7 @@ static void lcd_prepare_menu()
566 585
 #endif
567 586
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
568 587
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
588
+    MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
569 589
     //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
570 590
 #if TEMP_SENSOR_0 != 0
571 591
   #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0
@@ -780,7 +800,9 @@ static void lcd_control_temperature_menu()
780 800
 
781 801
     START_MENU();
782 802
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
803
+#if TEMP_SENSOR_0 != 0
783 804
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
805
+#endif
784 806
 #if TEMP_SENSOR_1 != 0
785 807
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
786 808
 #endif
@@ -791,7 +813,7 @@ static void lcd_control_temperature_menu()
791 813
     MENU_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
792 814
 #endif
793 815
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
794
-#ifdef AUTOTEMP
816
+#if defined AUTOTEMP && (TEMP_SENSOR_0 != 0)
795 817
     MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
796 818
     MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
797 819
     MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15);
@@ -816,7 +838,9 @@ static void lcd_control_temperature_preheat_pla_settings_menu()
816 838
     START_MENU();
817 839
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
818 840
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255);
841
+#if TEMP_SENSOR_0 != 0
819 842
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
843
+#endif
820 844
 #if TEMP_SENSOR_BED != 0
821 845
     MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, 0, BED_MAXTEMP - 15);
822 846
 #endif
@@ -831,7 +855,9 @@ static void lcd_control_temperature_preheat_abs_settings_menu()
831 855
     START_MENU();
832 856
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
833 857
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255);
858
+#if TEMP_SENSOR_0 != 0
834 859
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
860
+#endif
835 861
 #if TEMP_SENSOR_BED != 0
836 862
     MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, 0, BED_MAXTEMP - 15);
837 863
 #endif

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h Visa fil

@@ -475,7 +475,7 @@ static void lcd_implementation_status_screen()
475 475
 # endif//LCD_WIDTH > 19
476 476
     lcd.setCursor(LCD_WIDTH - 8, 1);
477 477
     lcd.print('Z');
478
-    lcd.print(ftostr32(current_position[Z_AXIS]));
478
+    lcd.print(ftostr32(current_position[Z_AXIS] + 0.00001));
479 479
 #endif//LCD_HEIGHT > 2
480 480
 
481 481
 #if LCD_HEIGHT > 3

+ 4
- 0
README.md Visa fil

@@ -233,6 +233,10 @@ M Codes
233 233
 *  M400 - Finish all moves
234 234
 *  M401 - Lower z-probe if present
235 235
 *  M402 - Raise z-probe if present
236
+*  M404 - N<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
237
+*  M405 - Turn on Filament Sensor extrusion control.  Optional D<delay in cm> to set delay in centimeters between sensor and extruder
238
+*  M406 - Turn off Filament Sensor extrusion control
239
+*  M407 - Displays measured filament diameter
236 240
 *  M500 - stores paramters in EEPROM
237 241
 *  M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
238 242
 *  M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.

Laddar…
Avbryt
Spara