Browse Source

get latest Marlin_v1 changes

Scott Lahteine 10 years ago
parent
commit
5714f64927

+ 14
- 0
.travis.yml View File

1
+---
2
+language: c
3
+
4
+before_install:
5
+  - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
6
+  - sudo apt-get update -qq
7
+install:
8
+  - sudo apt-get install -qq gcc-avr binutils-avr avr-libc gcc-4.8 g++-4.8 arduino
9
+  - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90
10
+  - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
11
+  - gcc --version
12
+  - g++ --version
13
+
14
+script: "cd Marlin && make HARDWARE_MOTHERBOARD=70 ARDUINO_INSTALL_DIR=/usr/share/arduino"

+ 53
- 0
DEADJOE View File

1
+
2
+*** These modified files were found in JOE when it aborted on Wed Nov 26 20:52:44 2014
3
+*** JOE was aborted because the terminal closed
4
+
5
+*** File '/Volumes/Projects/MAKER/Firmware/Marlin-thinkyhead/.git/MERGE_MSG'
6
+Merge remote-tracking branch 'upstream/Marlin_v1' into lcd_wait_better
7
+
8
+# Please enter a commit message to explain why this merge is necessary,
9
+# especially if it merges an updated upstream into a topic branch.
10
+#
11
+# Lines starting with '#' will be ignored, and an empty message aborts
12
+# the commit.
13
+
14
+*** File '(Unnamed)'
15
+sort
16
+echo
17
+
18
+*** File '(Unnamed)'
19
+d7
20
+/drupal7
21
+3bl-justmeans-wp/editorial
22
+SLICER_HOME
23
+remindmeinbox
24
+&>
25
+8
26
+alchemist
27
+/Users/lordscott/Sites/git.loc
28
+goth
29
+
30
+*** File '(Unnamed)'
31
+mysql
32
+socket
33
+.sock
34
+error_repo
35
+zone
36
+ini_set
37
+localhost
38
+/Library/WebServer/Documents/gitprojects
39
+mydemoproject1
40
+alias
41
+
42
+*** File '(Unnamed)'
43
+/Users/lordscott/bin/clean
44
+thinkyhead.conf
45
+/etc/hosts
46
+thinkyhead.conf
47
+drupal7.conf
48
+thinkyhead.conf
49
+thinkyhead.conf
50
+thinkyhead.conf
51
+drupal7.conf
52
+thinkyhead.conf
53
+/Volumes/Projects/MAKER/Firmware/Marlin-thinkyhead/.git/MERGE_MSG

+ 34
- 2
Marlin/Configuration.h View File

31
 #define SERIAL_PORT 0
31
 #define SERIAL_PORT 0
32
 
32
 
33
 // This determines the communication speed of the printer
33
 // This determines the communication speed of the printer
34
-// This determines the communication speed of the printer
35
 #define BAUDRATE 250000
34
 #define BAUDRATE 250000
36
 
35
 
37
 // This enables the serial port associated to the Bluetooth interface
36
 // This enables the serial port associated to the Bluetooth interface
49
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
48
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
50
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
49
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
51
 // 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
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
 // 4  = Duemilanove w/ ATMega328P pin assignment
52
 // 4  = Duemilanove w/ ATMega328P pin assignment
53
 // 5  = Gen6
53
 // 5  = Gen6
54
 // 51 = Gen6 deluxe
54
 // 51 = Gen6 deluxe
127
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
127
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
128
 // 11 is 100k beta 3950 1% thermistor (4.7k pullup)
128
 // 11 is 100k beta 3950 1% thermistor (4.7k pullup)
129
 // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
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
 // 20 is the PT100 circuit found in the Ultimainboard V2.x
131
 // 20 is the PT100 circuit found in the Ultimainboard V2.x
131
 // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
132
 // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
132
 //
133
 //
192
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
193
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
193
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
194
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
194
   #define K1 0.95 //smoothing factor within the PID
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
 // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
198
 // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
198
 // Ultimaker
199
 // Ultimaker
765
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
766
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
766
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
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
+// Uncomment below to enable
781
+//#define FILAMENT_SENSOR
782
+
783
+#define FILAMENT_SENSOR_EXTRUDER_NUM	0  //The number of the extruder that has the filament sensor (0,1,2)
784
+#define MEASUREMENT_DELAY_CM			14  //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
785
+
786
+#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
787
+#define MEASURED_UPPER_LIMIT          3.30  //upper limit factor used for sensor reading validation in mm
788
+#define MEASURED_LOWER_LIMIT          1.90  //lower limit factor for sensor reading validation in mm
789
+#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)
790
+
791
+//defines used in the code
792
+#define DEFAULT_MEASURED_FILAMENT_DIA  DEFAULT_NOMINAL_FILAMENT_DIA  //set measured to nominal initially 
793
+
794
+
795
+
796
+
797
+
798
+
799
+
768
 #include "Configuration_adv.h"
800
 #include "Configuration_adv.h"
769
 #include "thermistortables.h"
801
 #include "thermistortables.h"
770
 
802
 

+ 6
- 6
Marlin/ConfigurationStore.cpp View File

65
   EEPROM_WRITE_VAR(i,max_xy_jerk);
65
   EEPROM_WRITE_VAR(i,max_xy_jerk);
66
   EEPROM_WRITE_VAR(i,max_z_jerk);
66
   EEPROM_WRITE_VAR(i,max_z_jerk);
67
   EEPROM_WRITE_VAR(i,max_e_jerk);
67
   EEPROM_WRITE_VAR(i,max_e_jerk);
68
-  EEPROM_WRITE_VAR(i,add_homeing);
68
+  EEPROM_WRITE_VAR(i,add_homing);
69
   #ifdef DELTA
69
   #ifdef DELTA
70
   EEPROM_WRITE_VAR(i,endstop_adj);
70
   EEPROM_WRITE_VAR(i,endstop_adj);
71
   EEPROM_WRITE_VAR(i,delta_radius);
71
   EEPROM_WRITE_VAR(i,delta_radius);
170
     SERIAL_ECHO_START;
170
     SERIAL_ECHO_START;
171
     SERIAL_ECHOLNPGM("Home offset (mm):");
171
     SERIAL_ECHOLNPGM("Home offset (mm):");
172
     SERIAL_ECHO_START;
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
     SERIAL_ECHOLN("");
176
     SERIAL_ECHOLN("");
177
 #ifdef DELTA
177
 #ifdef DELTA
178
     SERIAL_ECHO_START;
178
     SERIAL_ECHO_START;
229
         EEPROM_READ_VAR(i,max_xy_jerk);
229
         EEPROM_READ_VAR(i,max_xy_jerk);
230
         EEPROM_READ_VAR(i,max_z_jerk);
230
         EEPROM_READ_VAR(i,max_z_jerk);
231
         EEPROM_READ_VAR(i,max_e_jerk);
231
         EEPROM_READ_VAR(i,max_e_jerk);
232
-        EEPROM_READ_VAR(i,add_homeing);
232
+        EEPROM_READ_VAR(i,add_homing);
233
         #ifdef DELTA
233
         #ifdef DELTA
234
 		EEPROM_READ_VAR(i,endstop_adj);
234
 		EEPROM_READ_VAR(i,endstop_adj);
235
 		EEPROM_READ_VAR(i,delta_radius);
235
 		EEPROM_READ_VAR(i,delta_radius);
303
     max_xy_jerk=DEFAULT_XYJERK;
303
     max_xy_jerk=DEFAULT_XYJERK;
304
     max_z_jerk=DEFAULT_ZJERK;
304
     max_z_jerk=DEFAULT_ZJERK;
305
     max_e_jerk=DEFAULT_EJERK;
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
 #ifdef DELTA
307
 #ifdef DELTA
308
 	endstop_adj[0] = endstop_adj[1] = endstop_adj[2] = 0;
308
 	endstop_adj[0] = endstop_adj[1] = endstop_adj[2] = 0;
309
 	delta_radius= DELTA_RADIUS;
309
 	delta_radius= DELTA_RADIUS;

+ 156
- 48
Marlin/DOGMbitmaps.h View File

68
 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0
68
 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0
69
 };
69
 };
70
 
70
 
71
-#define STATUS_SCREENWIDTH 		115	//Width in pixels
72
-#define STATUS_SCREENHEIGHT 	19	//Height in pixels
73
-#define STATUS_SCREENBYTEWIDTH 	15	//Width in bytes
74
-const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
75
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
76
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
77
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x0C,0x60,
78
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x0E,0x20,
79
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4F,0x0F,0x20,
80
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0x0F,0xA0,
81
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5E,0x07,0xA0,
82
-0x7F,0x80,0x00,0x3F,0xC0,0x00,0x3F,0xC0,0x00,0x41,0x04,0x00,0x40,0x60,0x20,
83
-0xFB,0xC0,0x00,0x79,0xE0,0x00,0x79,0xE0,0x00,0x20,0x82,0x00,0x40,0xF0,0x20,
84
-0xF3,0xC0,0x00,0x76,0xE0,0x00,0x76,0xE0,0x00,0x20,0x82,0x00,0x40,0xF0,0x20,
85
-0xEB,0xC0,0x00,0x7E,0xE0,0x00,0x7E,0xE0,0x00,0x41,0x04,0x00,0x40,0x60,0x20,
86
-0x7B,0x80,0x00,0x3D,0xC0,0x00,0x39,0xC0,0x00,0x82,0x08,0x00,0x5E,0x07,0xA0,
87
-0x7B,0x80,0x00,0x3B,0xC0,0x00,0x3E,0xC0,0x01,0x04,0x10,0x00,0x5F,0x0F,0xA0,
88
-0xFB,0xC0,0x00,0x77,0xE0,0x00,0x76,0xE0,0x01,0x04,0x10,0x00,0x4F,0x0F,0x20,
89
-0xFB,0xC0,0x00,0x70,0xE0,0x00,0x79,0xE0,0x00,0x82,0x08,0x00,0x47,0x0E,0x20,
90
-0xFF,0xC0,0x00,0x7F,0xE0,0x00,0x7F,0xE0,0x00,0x41,0x04,0x00,0x63,0x0C,0x60,
91
-0x3F,0x00,0x00,0x1F,0x80,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
92
-0x1E,0x00,0x00,0x0F,0x00,0x00,0x0F,0x00,0x01,0xFF,0xFF,0x80,0x7F,0xFF,0xE0,
93
-0x0C,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00
94
-};
71
+// Here comes a compile-time operation to match the extruder symbols 
72
+// on the info screen to the set number of extruders in configuration.h
73
+// 
74
+// When only one extruder is selected, the "1" on the symbol will not 
75
+// be displayed.
95
 
76
 
96
-#define STATUS_SCREENWIDTH 		115	//Width in pixels
97
-#define STATUS_SCREENHEIGHT 	19	//Height in pixels
98
-#define STATUS_SCREENBYTEWIDTH 	15	//Width in bytes
99
-const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
100
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
101
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
102
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0xF8,0x60,
103
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0xF8,0x20,
104
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xF0,0x20,
105
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x60,0x20,
106
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x01,0xA0,
107
-0x7F,0x80,0x00,0x3F,0xC0,0x00,0x3F,0xC0,0x00,0x41,0x04,0x00,0x5C,0x63,0xA0,
108
-0xFB,0xC0,0x00,0x79,0xE0,0x00,0x79,0xE0,0x00,0x20,0x82,0x00,0x5E,0xF7,0xA0,
109
-0xF3,0xC0,0x00,0x76,0xE0,0x00,0x76,0xE0,0x00,0x20,0x82,0x00,0x5E,0xF7,0xA0,
110
-0xEB,0xC0,0x00,0x7E,0xE0,0x00,0x7E,0xE0,0x00,0x41,0x04,0x00,0x5C,0x63,0xA0,
111
-0x7B,0x80,0x00,0x3D,0xC0,0x00,0x39,0xC0,0x00,0x82,0x08,0x00,0x58,0x01,0xA0,
112
-0x7B,0x80,0x00,0x3B,0xC0,0x00,0x3E,0xC0,0x01,0x04,0x10,0x00,0x40,0x60,0x20,
113
-0xFB,0xC0,0x00,0x77,0xE0,0x00,0x76,0xE0,0x01,0x04,0x10,0x00,0x40,0xF0,0x20,
114
-0xFB,0xC0,0x00,0x70,0xE0,0x00,0x79,0xE0,0x00,0x82,0x08,0x00,0x41,0xF8,0x20,
115
-0xFF,0xC0,0x00,0x7F,0xE0,0x00,0x7F,0xE0,0x00,0x41,0x04,0x00,0x61,0xF8,0x60,
116
-0x3F,0x00,0x00,0x1F,0x80,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
117
-0x1E,0x00,0x00,0x0F,0x00,0x00,0x0F,0x00,0x01,0xFF,0xFF,0x80,0x7F,0xFF,0xE0,
118
-0x0C,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00
119
-};
77
+#if EXTRUDERS == 1
78
+	#define STATUS_SCREENWIDTH 		115	//Width in pixels
79
+	#define STATUS_SCREENHEIGHT 	19	//Height in pixels
80
+	#define STATUS_SCREENBYTEWIDTH 	15	//Width in bytes
81
+	const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
82
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
83
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
84
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x0C,0x60,
85
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x0E,0x20,
86
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4F,0x0F,0x20,
87
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0x0F,0xA0,
88
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5E,0x07,0xA0,
89
+	0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x40,0x60,0x20,
90
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x82,0x00,0x40,0xF0,0x20,
91
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x82,0x00,0x40,0xF0,0x20,
92
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x40,0x60,0x20,
93
+	0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x08,0x00,0x5E,0x07,0xA0,
94
+	0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x10,0x00,0x5F,0x0F,0xA0,
95
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x10,0x00,0x4F,0x0F,0x20,
96
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x08,0x00,0x47,0x0E,0x20,
97
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x63,0x0C,0x60,
98
+	0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
99
+	0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x80,0x7F,0xFF,0xE0,
100
+	0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00
101
+	};
102
+
103
+	#define STATUS_SCREENWIDTH 		115	//Width in pixels
104
+	#define STATUS_SCREENHEIGHT 	19	//Height in pixels
105
+	#define STATUS_SCREENBYTEWIDTH 	15	//Width in bytes
106
+	const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
107
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
108
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
109
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0xF8,0x60,
110
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0xF8,0x20,
111
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xF0,0x20,
112
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x60,0x20,
113
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x01,0xA0,
114
+	0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x5C,0x63,0xA0,
115
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x82,0x00,0x5E,0xF7,0xA0,
116
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x82,0x00,0x5E,0xF7,0xA0,
117
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x5C,0x63,0xA0,
118
+	0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x08,0x00,0x58,0x01,0xA0,
119
+	0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x10,0x00,0x40,0x60,0x20,
120
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x10,0x00,0x40,0xF0,0x20,
121
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x08,0x00,0x41,0xF8,0x20,
122
+	0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x61,0xF8,0x60,
123
+	0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
124
+	0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x80,0x7F,0xFF,0xE0,
125
+	0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00
126
+	};
127
+#elif EXTRUDERS == 2
128
+	#define STATUS_SCREENWIDTH 		115	//Width in pixels
129
+	#define STATUS_SCREENHEIGHT 	19	//Height in pixels
130
+	#define STATUS_SCREENBYTEWIDTH 	15	//Width in bytes
131
+	const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
132
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
133
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
134
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x0C,0x60,
135
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x0E,0x20,
136
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4F,0x0F,0x20,
137
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0x0F,0xA0,
138
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5E,0x07,0xA0,
139
+	0x7F,0x80,0x00,0x3F,0xC0,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x40,0x60,0x20,
140
+	0xFB,0xC0,0x00,0x79,0xE0,0x00,0x00,0x00,0x00,0x20,0x82,0x00,0x40,0xF0,0x20,
141
+	0xF3,0xC0,0x00,0x76,0xE0,0x00,0x00,0x00,0x00,0x20,0x82,0x00,0x40,0xF0,0x20,
142
+	0xEB,0xC0,0x00,0x7E,0xE0,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x40,0x60,0x20,
143
+	0x7B,0x80,0x00,0x3D,0xC0,0x00,0x00,0x00,0x00,0x82,0x08,0x00,0x5E,0x07,0xA0,
144
+	0x7B,0x80,0x00,0x3B,0xC0,0x00,0x00,0x00,0x01,0x04,0x10,0x00,0x5F,0x0F,0xA0,
145
+	0xFB,0xC0,0x00,0x77,0xE0,0x00,0x00,0x00,0x01,0x04,0x10,0x00,0x4F,0x0F,0x20,
146
+	0xFB,0xC0,0x00,0x70,0xE0,0x00,0x00,0x00,0x00,0x82,0x08,0x00,0x47,0x0E,0x20,
147
+	0xFF,0xC0,0x00,0x7F,0xE0,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x63,0x0C,0x60,
148
+	0x3F,0x00,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
149
+	0x1E,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x80,0x7F,0xFF,0xE0,
150
+	0x0C,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00
151
+	};
152
+
153
+	#define STATUS_SCREENWIDTH 		115	//Width in pixels
154
+	#define STATUS_SCREENHEIGHT 	19	//Height in pixels
155
+	#define STATUS_SCREENBYTEWIDTH 	15	//Width in bytes
156
+	const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
157
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
158
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
159
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0xF8,0x60,
160
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0xF8,0x20,
161
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xF0,0x20,
162
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x60,0x20,
163
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x01,0xA0,
164
+	0x7F,0x80,0x00,0x3F,0xC0,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x5C,0x63,0xA0,
165
+	0xFB,0xC0,0x00,0x79,0xE0,0x00,0x00,0x00,0x00,0x20,0x82,0x00,0x5E,0xF7,0xA0,
166
+	0xF3,0xC0,0x00,0x76,0xE0,0x00,0x00,0x00,0x00,0x20,0x82,0x00,0x5E,0xF7,0xA0,
167
+	0xEB,0xC0,0x00,0x7E,0xE0,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x5C,0x63,0xA0,
168
+	0x7B,0x80,0x00,0x3D,0xC0,0x00,0x00,0x00,0x00,0x82,0x08,0x00,0x58,0x01,0xA0,
169
+	0x7B,0x80,0x00,0x3B,0xC0,0x00,0x00,0x00,0x01,0x04,0x10,0x00,0x40,0x60,0x20,
170
+	0xFB,0xC0,0x00,0x77,0xE0,0x00,0x00,0x00,0x01,0x04,0x10,0x00,0x40,0xF0,0x20,
171
+	0xFB,0xC0,0x00,0x70,0xE0,0x00,0x00,0x00,0x00,0x82,0x08,0x00,0x41,0xF8,0x20,
172
+	0xFF,0xC0,0x00,0x7F,0xE0,0x00,0x00,0x00,0x00,0x41,0x04,0x00,0x61,0xF8,0x60,
173
+	0x3F,0x00,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
174
+	0x1E,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x80,0x7F,0xFF,0xE0,
175
+	0x0C,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00
176
+	};
177
+#else
178
+	#define STATUS_SCREENWIDTH 		115	//Width in pixels
179
+	#define STATUS_SCREENHEIGHT 	19	//Height in pixels
180
+	#define STATUS_SCREENBYTEWIDTH 	15	//Width in bytes
181
+	const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
182
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
183
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
184
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x0C,0x60,
185
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x0E,0x20,
186
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4F,0x0F,0x20,
187
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0x0F,0xA0,
188
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5E,0x07,0xA0,
189
+	0x7F,0x80,0x00,0x3F,0xC0,0x00,0x3F,0xC0,0x00,0x41,0x04,0x00,0x40,0x60,0x20,
190
+	0xFB,0xC0,0x00,0x79,0xE0,0x00,0x79,0xE0,0x00,0x20,0x82,0x00,0x40,0xF0,0x20,
191
+	0xF3,0xC0,0x00,0x76,0xE0,0x00,0x76,0xE0,0x00,0x20,0x82,0x00,0x40,0xF0,0x20,
192
+	0xEB,0xC0,0x00,0x7E,0xE0,0x00,0x7E,0xE0,0x00,0x41,0x04,0x00,0x40,0x60,0x20,
193
+	0x7B,0x80,0x00,0x3D,0xC0,0x00,0x39,0xC0,0x00,0x82,0x08,0x00,0x5E,0x07,0xA0,
194
+	0x7B,0x80,0x00,0x3B,0xC0,0x00,0x3E,0xC0,0x01,0x04,0x10,0x00,0x5F,0x0F,0xA0,
195
+	0xFB,0xC0,0x00,0x77,0xE0,0x00,0x76,0xE0,0x01,0x04,0x10,0x00,0x4F,0x0F,0x20,
196
+	0xFB,0xC0,0x00,0x70,0xE0,0x00,0x79,0xE0,0x00,0x82,0x08,0x00,0x47,0x0E,0x20,
197
+	0xFF,0xC0,0x00,0x7F,0xE0,0x00,0x7F,0xE0,0x00,0x41,0x04,0x00,0x63,0x0C,0x60,
198
+	0x3F,0x00,0x00,0x1F,0x80,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
199
+	0x1E,0x00,0x00,0x0F,0x00,0x00,0x0F,0x00,0x01,0xFF,0xFF,0x80,0x7F,0xFF,0xE0,
200
+	0x0C,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00
201
+	};
202
+
203
+	#define STATUS_SCREENWIDTH 		115	//Width in pixels
204
+	#define STATUS_SCREENHEIGHT 	19	//Height in pixels
205
+	#define STATUS_SCREENBYTEWIDTH 	15	//Width in bytes
206
+	const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
207
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
208
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
209
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0xF8,0x60,
210
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0xF8,0x20,
211
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xF0,0x20,
212
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x60,0x20,
213
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x01,0xA0,
214
+	0x7F,0x80,0x00,0x3F,0xC0,0x00,0x3F,0xC0,0x00,0x41,0x04,0x00,0x5C,0x63,0xA0,
215
+	0xFB,0xC0,0x00,0x79,0xE0,0x00,0x79,0xE0,0x00,0x20,0x82,0x00,0x5E,0xF7,0xA0,
216
+	0xF3,0xC0,0x00,0x76,0xE0,0x00,0x76,0xE0,0x00,0x20,0x82,0x00,0x5E,0xF7,0xA0,
217
+	0xEB,0xC0,0x00,0x7E,0xE0,0x00,0x7E,0xE0,0x00,0x41,0x04,0x00,0x5C,0x63,0xA0,
218
+	0x7B,0x80,0x00,0x3D,0xC0,0x00,0x39,0xC0,0x00,0x82,0x08,0x00,0x58,0x01,0xA0,
219
+	0x7B,0x80,0x00,0x3B,0xC0,0x00,0x3E,0xC0,0x01,0x04,0x10,0x00,0x40,0x60,0x20,
220
+	0xFB,0xC0,0x00,0x77,0xE0,0x00,0x76,0xE0,0x01,0x04,0x10,0x00,0x40,0xF0,0x20,
221
+	0xFB,0xC0,0x00,0x70,0xE0,0x00,0x79,0xE0,0x00,0x82,0x08,0x00,0x41,0xF8,0x20,
222
+	0xFF,0xC0,0x00,0x7F,0xE0,0x00,0x7F,0xE0,0x00,0x41,0x04,0x00,0x61,0xF8,0x60,
223
+	0x3F,0x00,0x00,0x1F,0x80,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,
224
+	0x1E,0x00,0x00,0x0F,0x00,0x00,0x0F,0x00,0x01,0xFF,0xFF,0x80,0x7F,0xFF,0xE0,
225
+	0x0C,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00
226
+	};
227
+#endif // Extruders 
120
 
228
 
121
 
229
 

+ 11
- 1
Marlin/Marlin.h View File

211
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
211
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
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
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
 extern float current_position[NUM_AXIS] ;
213
 extern float current_position[NUM_AXIS] ;
214
-extern float add_homeing[3];
214
+extern float add_homing[3];
215
 #ifdef DELTA
215
 #ifdef DELTA
216
 extern float endstop_adj[3];
216
 extern float endstop_adj[3];
217
 extern float delta_radius;
217
 extern float delta_radius;
236
 extern unsigned char fanSpeedSoftPwm;
236
 extern unsigned char fanSpeedSoftPwm;
237
 #endif
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
 #ifdef FWRETRACT
249
 #ifdef FWRETRACT
240
 extern bool autoretract_enabled;
250
 extern bool autoretract_enabled;
241
 extern bool retracted[EXTRUDERS];
251
 extern bool retracted[EXTRUDERS];

+ 1
- 1
Marlin/MarlinSerial.cpp View File

73
   bool useU2X = true;
73
   bool useU2X = true;
74
 
74
 
75
 #if F_CPU == 16000000UL && SERIAL_PORT == 0
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
   // with the Duemilanove and previous boards and the firmware on the 8U2
77
   // with the Duemilanove and previous boards and the firmware on the 8U2
78
   // on the Uno and Mega 2560.
78
   // on the Uno and Mega 2560.
79
   if (baud == 57600) {
79
   if (baud == 57600) {

+ 115
- 27
Marlin/Marlin_main.cpp View File

159
 // M400 - Finish all moves
159
 // M400 - Finish all moves
160
 // M401 - Lower z-probe if present
160
 // M401 - Lower z-probe if present
161
 // M402 - Raise z-probe if present
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
 // M500 - stores parameters in EEPROM
166
 // M500 - stores parameters in EEPROM
163
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
167
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
164
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
168
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
220
   #endif
224
   #endif
221
 };
225
 };
222
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
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
 #ifdef DELTA
228
 #ifdef DELTA
225
 float endstop_adj[3]={0,0,0};
229
 float endstop_adj[3]={0,0,0};
226
 #endif
230
 #endif
313
 
317
 
314
 bool cancel_heatup = false ;
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
 //=============================Private Variables=============================
333
 //=============================Private Variables=============================
318
 //===========================================================================
334
 //===========================================================================
319
 const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
335
 const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
320
 static float destination[NUM_AXIS] = {  0.0, 0.0, 0.0, 0.0};
336
 static float destination[NUM_AXIS] = {  0.0, 0.0, 0.0, 0.0};
337
+
338
+#ifndef DELTA
321
 static float delta[3] = {0.0, 0.0, 0.0};
339
 static float delta[3] = {0.0, 0.0, 0.0};
340
+#endif
341
+
322
 static float offset[3] = {0.0, 0.0, 0.0};
342
 static float offset[3] = {0.0, 0.0, 0.0};
323
 static bool home_all_axis = true;
343
 static bool home_all_axis = true;
324
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;
344
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;
506
   #endif
526
   #endif
507
 }
527
 }
508
 
528
 
529
+
509
 void setup()
530
 void setup()
510
 {
531
 {
511
   setup_killpin();
532
   setup_killpin();
555
   st_init();    // Initialize stepper, this enables interrupts!
576
   st_init();    // Initialize stepper, this enables interrupts!
556
   setup_photpin();
577
   setup_photpin();
557
   servo_init();
578
   servo_init();
579
+  
558
 
580
 
559
   lcd_init();
581
   lcd_init();
560
   _delay_ms(1000);	// wait 1sec to display the splash screen
582
   _delay_ms(1000);	// wait 1sec to display the splash screen
852
 
874
 
853
 static float x_home_pos(int extruder) {
875
 static float x_home_pos(int extruder) {
854
   if (extruder == 0)
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
   else
878
   else
857
     // In dual carriage mode the extruder offset provides an override of the
879
     // In dual carriage mode the extruder offset provides an override of the
858
     // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
880
     // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
884
       return;
906
       return;
885
     }
907
     }
886
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
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
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
912
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
891
       return;
913
       return;
892
     }
914
     }
914
      
936
      
915
      for (i=0; i<2; i++)
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
     // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
944
     // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
923
     // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
945
     // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
924
       
946
       
936
    } 
958
    } 
937
    else
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
 #else
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
 #endif
969
 #endif
948
 }
970
 }
949
 
971
 
1431
           HOMEAXIS(Z);
1453
           HOMEAXIS(Z);
1432
 
1454
 
1433
           calculate_delta(current_position);
1455
           calculate_delta(current_position);
1434
-          plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);		  
1435
-		  
1456
+          plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1457
+
1436
 #else // NOT DELTA
1458
 #else // NOT DELTA
1437
 
1459
 
1438
       home_all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])));
1460
       home_all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])));
1515
 		#ifdef SCARA
1537
 		#ifdef SCARA
1516
 		   current_position[X_AXIS]=code_value();
1538
 		   current_position[X_AXIS]=code_value();
1517
 		#else
1539
 		#else
1518
-		   current_position[X_AXIS]=code_value()+add_homeing[0];
1540
+		   current_position[X_AXIS]=code_value()+add_homing[0];
1519
 		#endif
1541
 		#endif
1520
         }
1542
         }
1521
       }
1543
       }
1525
          #ifdef SCARA
1547
          #ifdef SCARA
1526
 		   current_position[Y_AXIS]=code_value();
1548
 		   current_position[Y_AXIS]=code_value();
1527
 		#else
1549
 		#else
1528
-		   current_position[Y_AXIS]=code_value()+add_homeing[1];
1550
+		   current_position[Y_AXIS]=code_value()+add_homing[1];
1529
 		#endif
1551
 		#endif
1530
         }
1552
         }
1531
       }
1553
       }
1590
 
1612
 
1591
       if(code_seen(axis_codes[Z_AXIS])) {
1613
       if(code_seen(axis_codes[Z_AXIS])) {
1592
         if(code_value_long() != 0) {
1614
         if(code_value_long() != 0) {
1593
-          current_position[Z_AXIS]=code_value()+add_homeing[2];
1615
+          current_position[Z_AXIS]=code_value()+add_homing[2];
1594
         }
1616
         }
1595
       }
1617
       }
1596
       #ifdef ENABLE_AUTO_BED_LEVELING
1618
       #ifdef ENABLE_AUTO_BED_LEVELING
1819
                 	current_position[i] = code_value();  
1841
                 	current_position[i] = code_value();  
1820
 		}
1842
 		}
1821
 		else {
1843
 		else {
1822
-                current_position[i] = code_value()+add_homeing[i];  
1844
+                current_position[i] = code_value()+add_homing[i];  
1823
             	}  
1845
             	}  
1824
 #else
1846
 #else
1825
-		current_position[i] = code_value()+add_homeing[i];
1847
+		current_position[i] = code_value()+add_homing[i];
1826
 #endif
1848
 #endif
1827
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1849
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1828
            }
1850
            }
2721
       SERIAL_PROTOCOLLN("");
2743
       SERIAL_PROTOCOLLN("");
2722
       
2744
       
2723
       SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
2745
       SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
2724
-      SERIAL_PROTOCOL(delta[X_AXIS]+add_homeing[0]);
2746
+      SERIAL_PROTOCOL(delta[X_AXIS]+add_homing[0]);
2725
       SERIAL_PROTOCOLPGM("   Psi+Theta (90):");
2747
       SERIAL_PROTOCOLPGM("   Psi+Theta (90):");
2726
-      SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homeing[1]);
2748
+      SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homing[1]);
2727
       SERIAL_PROTOCOLLN("");
2749
       SERIAL_PROTOCOLLN("");
2728
       
2750
       
2729
       SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
2751
       SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
2797
         } else {
2819
         } else {
2798
           //reserved for setting filament diameter via UFID or filament measuring device
2820
           //reserved for setting filament diameter via UFID or filament measuring device
2799
           break;
2821
           break;
2822
+        
2823
+          
2800
         }
2824
         }
2801
         tmp_extruder = active_extruder;
2825
         tmp_extruder = active_extruder;
2802
         if(code_seen('T')) {
2826
         if(code_seen('T')) {
2849
       if(code_seen('E')) max_e_jerk = code_value() ;
2873
       if(code_seen('E')) max_e_jerk = code_value() ;
2850
     }
2874
     }
2851
     break;
2875
     break;
2852
-    case 206: // M206 additional homeing offset
2876
+    case 206: // M206 additional homing offset
2853
       for(int8_t i=0; i < 3; i++)
2877
       for(int8_t i=0; i < 3; i++)
2854
       {
2878
       {
2855
-        if(code_seen(axis_codes[i])) add_homeing[i] = code_value();
2879
+        if(code_seen(axis_codes[i])) add_homing[i] = code_value();
2856
       }
2880
       }
2857
 	  #ifdef SCARA
2881
 	  #ifdef SCARA
2858
 	   if(code_seen('T'))       // Theta
2882
 	   if(code_seen('T'))       // Theta
2859
       {
2883
       {
2860
-        add_homeing[0] = code_value() ;
2884
+        add_homing[0] = code_value() ;
2861
       }
2885
       }
2862
       if(code_seen('P'))       // Psi
2886
       if(code_seen('P'))       // Psi
2863
       {
2887
       {
2864
-        add_homeing[1] = code_value() ;
2888
+        add_homing[1] = code_value() ;
2865
       }
2889
       }
2866
 	  #endif
2890
 	  #endif
2867
       break;
2891
       break;
3359
     }
3383
     }
3360
     break;
3384
     break;
3361
 #endif
3385
 #endif
3386
+
3387
+#ifdef FILAMENT_SENSOR
3388
+case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width 
3389
+    {
3390
+    #if (FILWIDTH_PIN > -1) 
3391
+    if(code_seen('N')) filament_width_nominal=code_value();
3392
+    else{
3393
+    SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); 
3394
+    SERIAL_PROTOCOLLN(filament_width_nominal); 
3395
+    }
3396
+    #endif
3397
+    }
3398
+    break; 
3399
+    
3400
+    case 405:  //M405 Turn on filament sensor for control 
3401
+    {
3402
+    
3403
+    
3404
+    if(code_seen('D')) meas_delay_cm=code_value();
3405
+       
3406
+       if(meas_delay_cm> MAX_MEASUREMENT_DELAY)
3407
+       	meas_delay_cm = MAX_MEASUREMENT_DELAY;
3408
+    
3409
+       if(delay_index2 == -1)  //initialize the ring buffer if it has not been done since startup
3410
+    	   {
3411
+    	   int temp_ratio = widthFil_to_size_ratio(); 
3412
+       	    
3413
+       	    for (delay_index1=0; delay_index1<(MAX_MEASUREMENT_DELAY+1); ++delay_index1 ){
3414
+       	              measurement_delay[delay_index1]=temp_ratio-100;  //subtract 100 to scale within a signed byte
3415
+       	        }
3416
+       	    delay_index1=0;
3417
+       	    delay_index2=0;	
3418
+    	   }
3419
+    
3420
+    filament_sensor = true ; 
3421
+    
3422
+    //SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); 
3423
+    //SERIAL_PROTOCOL(filament_width_meas); 
3424
+    //SERIAL_PROTOCOLPGM("Extrusion ratio(%):"); 
3425
+    //SERIAL_PROTOCOL(extrudemultiply); 
3426
+    } 
3427
+    break; 
3428
+    
3429
+    case 406:  //M406 Turn off filament sensor for control 
3430
+    {      
3431
+    filament_sensor = false ; 
3432
+    } 
3433
+    break; 
3434
+  
3435
+    case 407:   //M407 Display measured filament diameter 
3436
+    { 
3437
+     
3438
+    
3439
+    
3440
+    SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); 
3441
+    SERIAL_PROTOCOLLN(filament_width_meas);   
3442
+    } 
3443
+    break; 
3444
+    #endif
3445
+    
3446
+
3447
+
3448
+
3449
+
3362
     case 500: // M500 Store settings in EEPROM
3450
     case 500: // M500 Store settings in EEPROM
3363
     {
3451
     {
3364
         Config_StoreSettings();
3452
         Config_StoreSettings();

+ 0
- 6
Marlin/dogm_lcd_implementation.h View File

245
 		 u8g.drawBox(38,17,2,2);
245
 		 u8g.drawBox(38,17,2,2);
246
 		 u8g.setColorIndex(1);	// black on white
246
 		 u8g.setColorIndex(1);	// black on white
247
 		}
247
 		}
248
- #else
249
- u8g.setPrintPos(31,27);
250
- u8g.print("---");
251
  #endif
248
  #endif
252
  
249
  
253
  // Extruder 3
250
  // Extruder 3
266
 		 u8g.drawBox(62,17,2,2);
263
 		 u8g.drawBox(62,17,2,2);
267
 		 u8g.setColorIndex(1);	// black on white
264
 		 u8g.setColorIndex(1);	// black on white
268
 		}
265
 		}
269
- #else
270
- u8g.setPrintPos(55,27);
271
- u8g.print("---");
272
  #endif
266
  #endif
273
  
267
  
274
  // Heatbed
268
  // Heatbed

+ 183
- 29
Marlin/example_configurations/delta/Configuration.h View File

8
 //===========================================================================
8
 //===========================================================================
9
 //============================= DELTA Printer ===============================
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
 // example_configurations/delta directory.
12
 // example_configurations/delta directory.
13
 //
13
 //
14
 
14
 
41
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
41
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
42
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
42
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
43
 // 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
43
 // 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
44
+// 36 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan)
44
 // 4  = Duemilanove w/ ATMega328P pin assignment
45
 // 4  = Duemilanove w/ ATMega328P pin assignment
45
 // 5  = Gen6
46
 // 5  = Gen6
46
 // 51 = Gen6 deluxe
47
 // 51 = Gen6 deluxe
54
 // 68 = Azteeg X3 Pro
55
 // 68 = Azteeg X3 Pro
55
 // 7  = Ultimaker
56
 // 7  = Ultimaker
56
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
57
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
58
+// 72 = Ultimainboard 2.x (Uses TEMP_SENSOR 20)
57
 // 77 = 3Drag Controller
59
 // 77 = 3Drag Controller
58
 // 8  = Teensylu
60
 // 8  = Teensylu
59
 // 80 = Rumba
61
 // 80 = Rumba
60
 // 81 = Printrboard (AT90USB1286)
62
 // 81 = Printrboard (AT90USB1286)
61
 // 82 = Brainwave (AT90USB646)
63
 // 82 = Brainwave (AT90USB646)
62
 // 83 = SAV Mk-I (AT90USB1286)
64
 // 83 = SAV Mk-I (AT90USB1286)
65
+// 84 = Teensy++2.0 (AT90USB1286) // CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84  make
63
 // 9  = Gen3+
66
 // 9  = Gen3+
64
 // 70 = Megatronics
67
 // 70 = Megatronics
65
 // 701= Megatronics v2.0
68
 // 701= Megatronics v2.0
66
 // 702= Minitronics v1.0
69
 // 702= Minitronics v1.0
67
 // 90 = Alpha OMCA board
70
 // 90 = Alpha OMCA board
68
 // 91 = Final OMCA board
71
 // 91 = Final OMCA board
69
-// 301 = Rambo
72
+// 301= Rambo
70
 // 21 = Elefu Ra Board (v3)
73
 // 21 = Elefu Ra Board (v3)
74
+// 88 = 5DPrint D8 Driver Board
75
+// 999 = Leapfrog
71
 
76
 
72
 #ifndef MOTHERBOARD
77
 #ifndef MOTHERBOARD
73
 #define MOTHERBOARD 33
78
 #define MOTHERBOARD 33
89
 
94
 
90
 #define POWER_SUPPLY 1
95
 #define POWER_SUPPLY 1
91
 
96
 
92
-// Define this to have the electronics keep the powersupply off on startup. If you don't know what this is leave it.
97
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
93
 // #define PS_DEFAULT_OFF
98
 // #define PS_DEFAULT_OFF
94
 
99
 
95
 //===========================================================================
100
 //===========================================================================
103
 // and processor overload (too many expensive sqrt calls).
108
 // and processor overload (too many expensive sqrt calls).
104
 #define DELTA_SEGMENTS_PER_SECOND 200
109
 #define DELTA_SEGMENTS_PER_SECOND 200
105
 
110
 
106
-// NOTE NB all values for DELTA_* values MOUST be floating point, so always have a decimal point in them
111
+// NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them
107
 
112
 
108
 // Center-to-center distance of the holes in the diagonal push rods.
113
 // Center-to-center distance of the holes in the diagonal push rods.
109
 #define DELTA_DIAGONAL_ROD 250.0 // mm
114
 #define DELTA_DIAGONAL_ROD 250.0 // mm
132
 // 0 is not used
137
 // 0 is not used
133
 // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
138
 // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
134
 // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
139
 // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
135
-// 3 is mendel-parts thermistor (4.7k pullup)
140
+// 3 is Mendel-parts thermistor (4.7k pullup)
136
 // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
141
 // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
137
 // 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
142
 // 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
138
 // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
143
 // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
141
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
146
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
142
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
147
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
143
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
148
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
144
-// 60 is 100k Maker's Tool Works Kapton Bed Thermister
149
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
150
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
151
+// 13 is 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" 
152
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
153
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
145
 //
154
 //
146
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
155
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
147
 //                          (but gives greater accuracy and more stable PID)
156
 //                          (but gives greater accuracy and more stable PID)
148
 // 51 is 100k thermistor - EPCOS (1k pullup)
157
 // 51 is 100k thermistor - EPCOS (1k pullup)
149
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
158
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
150
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
159
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
160
+//
161
+// 1047 is Pt1000 with 4k7 pullup
162
+// 1010 is Pt1000 with 1k pullup (non standard)
163
+// 147 is Pt100 with 4k7 pullup
164
+// 110 is Pt100 with 1k pullup (non standard)
151
 
165
 
152
 #define TEMP_SENSOR_0 -1
166
 #define TEMP_SENSOR_0 -1
153
 #define TEMP_SENSOR_1 -1
167
 #define TEMP_SENSOR_1 -1
184
 // HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
198
 // HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
185
 //#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
199
 //#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
186
 
200
 
201
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
202
+//#define EXTRUDER_WATTS (12.0*12.0/6.7) //  P=I^2/R
203
+//#define BED_WATTS (12.0*12.0/1.1)      // P=I^2/R
204
+
187
 // PID settings:
205
 // PID settings:
188
 // Comment the following line to disable PID and enable bang-bang.
206
 // Comment the following line to disable PID and enable bang-bang.
189
 #define PIDTEMP
207
 #define PIDTEMP
196
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
214
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
197
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
215
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
198
   #define K1 0.95 //smoothing factor within the PID
216
   #define K1 0.95 //smoothing factor within the PID
199
-  #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
217
+  #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
200
 
218
 
201
-// If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
219
+// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
202
 // Ultimaker
220
 // Ultimaker
203
     #define  DEFAULT_Kp 22.2
221
     #define  DEFAULT_Kp 22.2
204
     #define  DEFAULT_Ki 1.08
222
     #define  DEFAULT_Ki 1.08
205
     #define  DEFAULT_Kd 114
223
     #define  DEFAULT_Kd 114
206
 
224
 
207
-// Makergear
225
+// MakerGear
208
 //    #define  DEFAULT_Kp 7.0
226
 //    #define  DEFAULT_Kp 7.0
209
 //    #define  DEFAULT_Ki 0.1
227
 //    #define  DEFAULT_Ki 0.1
210
 //    #define  DEFAULT_Kd 12
228
 //    #define  DEFAULT_Kd 12
262
 #define EXTRUDE_MINTEMP 170
280
 #define EXTRUDE_MINTEMP 170
263
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
281
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
264
 
282
 
283
+/*================== Thermal Runaway Protection ==============================
284
+This is a feature to protect your printer from burn up in flames if it has
285
+a thermistor coming off place (this happened to a friend of mine recently and
286
+motivated me writing this feature).
287
+
288
+The issue: If a thermistor come off, it will read a lower temperature than actual.
289
+The system will turn the heater on forever, burning up the filament and anything
290
+else around.
291
+
292
+After the temperature reaches the target for the first time, this feature will 
293
+start measuring for how long the current temperature stays below the target 
294
+minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
295
+
296
+If it stays longer than _PERIOD, it means the thermistor temperature
297
+cannot catch up with the target, so something *may be* wrong. Then, to be on the
298
+safe side, the system will he halt.
299
+
300
+Bear in mind the count down will just start AFTER the first time the 
301
+thermistor temperature is over the target, so you will have no problem if
302
+your extruder heater takes 2 minutes to hit the target on heating.
303
+
304
+*/
305
+// If you want to enable this feature for all your extruder heaters,
306
+// uncomment the 2 defines below:
307
+
308
+// Parameters for all extruder heaters
309
+//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
310
+//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
311
+
312
+// If you want to enable this feature for your bed heater,
313
+// uncomment the 2 defines below:
314
+
315
+// Parameters for the bed heater
316
+//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
317
+//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
318
+//===========================================================================
319
+
320
+
265
 //===========================================================================
321
 //===========================================================================
266
 //=============================Mechanical Settings===========================
322
 //=============================Mechanical Settings===========================
267
 //===========================================================================
323
 //===========================================================================
273
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
329
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
274
 
330
 
275
 #ifndef ENDSTOPPULLUPS
331
 #ifndef ENDSTOPPULLUPS
276
-  // fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined
332
+  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
277
   // #define ENDSTOPPULLUP_XMAX
333
   // #define ENDSTOPPULLUP_XMAX
278
   // #define ENDSTOPPULLUP_YMAX
334
   // #define ENDSTOPPULLUP_YMAX
279
   // #define ENDSTOPPULLUP_ZMAX
335
   // #define ENDSTOPPULLUP_ZMAX
317
 #define DISABLE_Y false
373
 #define DISABLE_Y false
318
 #define DISABLE_Z false
374
 #define DISABLE_Z false
319
 #define DISABLE_E false // For all extruders
375
 #define DISABLE_E false // For all extruders
376
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
320
 
377
 
321
 #define INVERT_X_DIR false // DELTA does not invert
378
 #define INVERT_X_DIR false // DELTA does not invert
322
 #define INVERT_Y_DIR false
379
 #define INVERT_Y_DIR false
350
 //============================= Bed Auto Leveling ===========================
407
 //============================= Bed Auto Leveling ===========================
351
 
408
 
352
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
409
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
410
+#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
353
 
411
 
354
 #ifdef ENABLE_AUTO_BED_LEVELING
412
 #ifdef ENABLE_AUTO_BED_LEVELING
355
 
413
 
356
-  // these are the positions on the bed to do the probing
357
-  #define LEFT_PROBE_BED_POSITION 15
358
-  #define RIGHT_PROBE_BED_POSITION 170
359
-  #define BACK_PROBE_BED_POSITION 180
360
-  #define FRONT_PROBE_BED_POSITION 20
414
+// There are 2 different ways to pick the X and Y locations to probe:
415
+
416
+//  - "grid" mode
417
+//    Probe every point in a rectangular grid
418
+//    You must specify the rectangle, and the density of sample points
419
+//    This mode is preferred because there are more measurements.
420
+//    It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
421
+
422
+//  - "3-point" mode
423
+//    Probe 3 arbitrary points on the bed (that aren't colinear)
424
+//    You must specify the X & Y coordinates of all 3 points
425
+
426
+  #define AUTO_BED_LEVELING_GRID
427
+  // with AUTO_BED_LEVELING_GRID, the bed is sampled in a
428
+  // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
429
+  // and least squares solution is calculated
430
+  // Note: this feature occupies 10'206 byte
431
+  #ifdef AUTO_BED_LEVELING_GRID
432
+
433
+    // set the rectangle in which to probe
434
+    #define LEFT_PROBE_BED_POSITION 15
435
+    #define RIGHT_PROBE_BED_POSITION 170
436
+    #define BACK_PROBE_BED_POSITION 180
437
+    #define FRONT_PROBE_BED_POSITION 20
438
+
439
+     // set the number of grid points per dimension
440
+     // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
441
+    #define AUTO_BED_LEVELING_GRID_POINTS 2
442
+
443
+
444
+  #else  // not AUTO_BED_LEVELING_GRID
445
+    // with no grid, just probe 3 arbitrary points.  A simple cross-product
446
+    // is used to esimate the plane of the print bed
447
+
448
+      #define ABL_PROBE_PT_1_X 15
449
+      #define ABL_PROBE_PT_1_Y 180
450
+      #define ABL_PROBE_PT_2_X 15
451
+      #define ABL_PROBE_PT_2_Y 20
452
+      #define ABL_PROBE_PT_3_X 170
453
+      #define ABL_PROBE_PT_3_Y 20
454
+
455
+  #endif // AUTO_BED_LEVELING_GRID
361
 
456
 
362
-  // these are the offsets to the prob relative to the extruder tip (Hotend - Probe)
457
+
458
+  // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
363
   #define X_PROBE_OFFSET_FROM_EXTRUDER -25
459
   #define X_PROBE_OFFSET_FROM_EXTRUDER -25
364
   #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
460
   #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
365
   #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
461
   #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
372
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
468
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
373
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
469
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
374
 
470
 
471
+  //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
472
+  //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
375
 
473
 
376
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
474
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
377
   //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
475
   //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
380
 //  #define PROBE_SERVO_DEACTIVATION_DELAY 300
478
 //  #define PROBE_SERVO_DEACTIVATION_DELAY 300
381
 
479
 
382
 
480
 
383
-//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing,
481
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
384
 //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
482
 //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
385
 
483
 
386
   #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
484
   #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
397
 
495
 
398
   #endif
496
   #endif
399
 
497
 
400
-#endif
498
+#endif // ENABLE_AUTO_BED_LEVELING
401
 
499
 
402
 
500
 
403
 // The position of the homing switches
501
 // The position of the homing switches
407
 //Manual homing switch locations:
505
 //Manual homing switch locations:
408
 
506
 
409
 #define MANUAL_HOME_POSITIONS  // MANUAL_*_HOME_POS below will be used
507
 #define MANUAL_HOME_POSITIONS  // MANUAL_*_HOME_POS below will be used
410
-// For deltabots this means top and center of the cartesian print volume.
508
+// For deltabots this means top and center of the Cartesian print volume.
411
 #define MANUAL_X_HOME_POS 0
509
 #define MANUAL_X_HOME_POS 0
412
 #define MANUAL_Y_HOME_POS 0
510
 #define MANUAL_Y_HOME_POS 0
413
 #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
511
 #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
442
 //=============================Additional Features===========================
540
 //=============================Additional Features===========================
443
 //===========================================================================
541
 //===========================================================================
444
 
542
 
543
+// Custom M code points
544
+#define CUSTOM_M_CODES
545
+#ifdef CUSTOM_M_CODES
546
+  #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
547
+  #define Z_PROBE_OFFSET_RANGE_MIN -15
548
+  #define Z_PROBE_OFFSET_RANGE_MAX -5
549
+#endif
550
+
551
+
445
 // EEPROM
552
 // EEPROM
446
-// the microcontroller can store settings in the EEPROM, e.g. max velocity...
447
-// M500 - stores paramters in EEPROM
553
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
554
+// M500 - stores parameters in EEPROM
448
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
555
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
449
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
556
 // 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
557
+//define this to enable EEPROM support
451
 //#define EEPROM_SETTINGS
558
 //#define EEPROM_SETTINGS
452
 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
559
 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
453
 // please keep turned on if you can.
560
 // please keep turned on if you can.
463
 #define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
570
 #define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
464
 
571
 
465
 //LCD and SD support
572
 //LCD and SD support
466
-//#define ULTRA_LCD  //general lcd support, also 16x2
573
+//#define ULTRA_LCD  //general LCD support, also 16x2
467
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
574
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
468
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
575
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
469
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
576
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
577
+//#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
470
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
578
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
471
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
579
 //#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
580
+//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
581
+//#define ULTIPANEL  //the UltiPanel as on Thingiverse
582
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
583
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
474
 
584
 
475
 // The MaKr3d Makr-Panel with graphic controller and SD support
585
 // The MaKr3d Makr-Panel with graphic controller and SD support
476
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
586
 // http://reprap.org/wiki/MaKr3d_MaKrPanel
556
   #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
666
   #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
557
   #define NEWPANEL
667
   #define NEWPANEL
558
   #define ULTIPANEL
668
   #define ULTIPANEL
669
+
670
+  #ifndef ENCODER_PULSES_PER_STEP
671
+	#define ENCODER_PULSES_PER_STEP 4
672
+  #endif
673
+
674
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
675
+	#define ENCODER_STEPS_PER_MENU_ITEM 1
676
+  #endif
677
+
678
+
679
+  #ifdef LCD_USE_I2C_BUZZER
680
+	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
681
+	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
682
+  #endif
683
+
559
 #endif
684
 #endif
560
 
685
 
561
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
686
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
578
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
703
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
579
 //#define SR_LCD
704
 //#define SR_LCD
580
 #ifdef SR_LCD
705
 #ifdef SR_LCD
581
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
706
+   #define SR_LCD_2W_NL    // Non latching 2 wire shift register
582
    //#define NEWPANEL
707
    //#define NEWPANEL
583
 #endif
708
 #endif
584
 
709
 
594
     #define LCD_WIDTH 20
719
     #define LCD_WIDTH 20
595
     #define LCD_HEIGHT 4
720
     #define LCD_HEIGHT 4
596
   #endif
721
   #endif
597
-#else //no panel but just lcd
722
+#else //no panel but just LCD
598
   #ifdef ULTRA_LCD
723
   #ifdef ULTRA_LCD
599
   #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
724
   #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
600
     #define LCD_WIDTH 20
725
     #define LCD_WIDTH 20
616
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
741
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
617
 //#define FAST_PWM_FAN
742
 //#define FAST_PWM_FAN
618
 
743
 
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.
744
+// Temperature status LEDs that display the hotend and bet temperature.
745
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
621
 // Otherwise the RED led is on. There is 1C hysteresis.
746
 // Otherwise the RED led is on. There is 1C hysteresis.
622
 //#define TEMP_STAT_LEDS
747
 //#define TEMP_STAT_LEDS
623
 
748
 
667
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
792
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
668
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
793
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
669
 
794
 
795
+/**********************************************************************\
796
+ * Support for a filament diameter sensor
797
+ * Also allows adjustment of diameter at print time (vs  at slicing)
798
+ * Single extruder only at this point (extruder 0)
799
+ * 
800
+ * Motherboards
801
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector 
802
+ * 81 - Printrboard - Uses Analog input 2 on the Aux 2 connector
803
+ * 301 - Rambo  - uses Analog input 3
804
+ * Note may require analog pins to be defined for different motherboards
805
+ **********************************************************************/
806
+#define FILAMENT_SENSOR
807
+#define FILAMENT_SENSOR_EXTRUDER_NUM	0  //The number of the extruder that has the filament sensor (0,1,2)
808
+#define MEASUREMENT_DELAY_CM			14  //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
809
+
810
+#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
811
+#define MEASURED_UPPER_LIMIT          3.30  //upper limit factor used for sensor reading validation in mm
812
+#define MEASURED_LOWER_LIMIT          1.90  //lower limit factor for sensor reading validation in mm
813
+#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)
814
+
815
+//defines used in the code
816
+#define DEFAULT_MEASURED_FILAMENT_DIA  DEFAULT_NOMINAL_FILAMENT_DIA  //set measured to nominal initially 
817
+
818
+
819
+
820
+
821
+
822
+
823
+
670
 #include "Configuration_adv.h"
824
 #include "Configuration_adv.h"
671
 #include "thermistortables.h"
825
 #include "thermistortables.h"
672
 
826
 

+ 13
- 2
Marlin/example_configurations/delta/Configuration_adv.h View File

281
 //=============================Additional Features===========================
281
 //=============================Additional Features===========================
282
 //===========================================================================
282
 //===========================================================================
283
 
283
 
284
+//#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
285
+#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
286
+
284
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
287
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
285
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
288
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
286
 
289
 
401
 // the moves are than replaced by the firmware controlled ones.
404
 // the moves are than replaced by the firmware controlled ones.
402
 
405
 
403
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
406
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
404
-#define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
405
-
407
+#ifdef FWRETRACT
408
+  #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
409
+  #define RETRACT_LENGTH 3               //default retract length (positive mm)
410
+  #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
411
+  #define RETRACT_FEEDRATE 45            //default feedrate for retracting (mm/s)
412
+  #define RETRACT_ZLIFT 0                //default retract Z-lift
413
+  #define RETRACT_RECOVER_LENGTH 0       //default additional recover length (mm, added to retract length when recovering)
414
+  #define RETRACT_RECOVER_LENGTH_SWAP 0  //default additional swap recover length (mm, added to retract length when recovering from extruder change)
415
+  #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
416
+#endif
406
 
417
 
407
 //adds support for experimental filament exchange support M600; requires display
418
 //adds support for experimental filament exchange support M600; requires display
408
 #ifdef ULTIPANEL
419
 #ifdef ULTIPANEL

+ 14
- 3
Marlin/language.h View File

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

+ 8
- 0
Marlin/motion_control.cpp View File

44
   if (angular_travel < 0) { angular_travel += 2*M_PI; }
44
   if (angular_travel < 0) { angular_travel += 2*M_PI; }
45
   if (isclockwise) { angular_travel -= 2*M_PI; }
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
   float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
55
   float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
48
   if (millimeters_of_travel < 0.001) { return; }
56
   if (millimeters_of_travel < 0.001) { return; }
49
   uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);
57
   uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);

+ 22
- 6
Marlin/pins.h View File

531
 * Arduino Mega pin assignment
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
 #define KNOWN_BOARD 1
535
 #define KNOWN_BOARD 1
536
 
536
 
537
 //////////////////FIX THIS//////////////
537
 //////////////////FIX THIS//////////////
547
 // #define RAMPS_V_1_0
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
   #define LARGE_FLASH true
552
   #define LARGE_FLASH true
553
 
553
 
628
     #define E1_DIR_PIN         34
628
     #define E1_DIR_PIN         34
629
     #define E1_ENABLE_PIN      30
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
     #if MOTHERBOARD == 68
640
     #if MOTHERBOARD == 68
632
       #define E2_STEP_PIN        23
641
       #define E2_STEP_PIN        23
633
       #define E2_DIR_PIN         25
642
       #define E2_DIR_PIN         25
653
     #define FAN_PIN            4 // IO pin. Buffer needed
662
     #define FAN_PIN            4 // IO pin. Buffer needed
654
   #endif
663
   #endif
655
 
664
 
656
-  #if MOTHERBOARD == 77
665
+  #if MOTHERBOARD == 77 || MOTHERBOARD == 36
657
     #define FAN_PIN            8
666
     #define FAN_PIN            8
658
   #endif
667
   #endif
659
 
668
 
709
     #define TEMP_2_PIN         -1   // ANALOG NUMBERING
718
     #define TEMP_2_PIN         -1   // ANALOG NUMBERING
710
   #endif
719
   #endif
711
 
720
 
712
-  #if MOTHERBOARD == 35
721
+  #if MOTHERBOARD == 35 || MOTHERBOARD == 36
713
     #define HEATER_BED_PIN     -1    // NO BED
722
     #define HEATER_BED_PIN     -1    // NO BED
714
   #else
723
   #else
715
     #if MOTHERBOARD == 77
724
     #if MOTHERBOARD == 77
1762
   #define Z_STOP_PIN         36
1771
   #define Z_STOP_PIN         36
1763
   #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
1772
   #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
1764
   #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
1773
   #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
1774
+  #ifdef FILAMENT_SENSOR
1775
+   #define FILWIDTH_PIN        2
1776
+  #endif //FILAMENT_SENSOR
1765
 #endif
1777
 #endif
1766
 
1778
 
1767
 #define TEMP_1_PIN         -1
1779
 #define TEMP_1_PIN         -1
2078
 #define Z_DIR_PIN          28
2090
 #define Z_DIR_PIN          28
2079
 #define Z_STOP_PIN         30
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
 #define LED_PIN            -1
2096
 #define LED_PIN            -1
2085
 
2097
 
2396
   #endif
2408
   #endif
2397
 #endif //ULTRA_LCD
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
 #endif
2416
 #endif
2401
 
2417
 

+ 47
- 0
Marlin/planner.cpp View File

119
 static long y_segment_time[3]={MAX_FREQ_TIME + 1,0,0};
119
 static long y_segment_time[3]={MAX_FREQ_TIME + 1,0,0};
120
 #endif
120
 #endif
121
 
121
 
122
+#ifdef FILAMENT_SENSOR
123
+ static char meas_sample; //temporary variable to hold filament measurement sample
124
+#endif
125
+
122
 // Returns the index of the next block in the ring buffer
126
 // Returns the index of the next block in the ring buffer
123
 // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication.
127
 // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication.
124
 static int8_t next_block_index(int8_t block_index) {
128
 static int8_t next_block_index(int8_t block_index) {
762
   block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
766
   block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
763
   block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0
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
   // Calculate and limit speed in mm/sec for each axis
812
   // Calculate and limit speed in mm/sec for each axis
766
   float current_speed[4];
813
   float current_speed[4];
767
   float speed_factor = 1.0; //factor <=1 do decrease speed
814
   float speed_factor = 1.0; //factor <=1 do decrease speed

+ 1
- 1
Marlin/stepper.cpp View File

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

+ 117
- 6
Marlin/temperature.cpp View File

74
 #ifdef BABYSTEPPING
74
 #ifdef BABYSTEPPING
75
   volatile int babystepsTodo[3]={0,0,0};
75
   volatile int babystepsTodo[3]={0,0,0};
76
 #endif
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
 //=============================private variables============================
82
 //=============================private variables============================
80
 //===========================================================================
83
 //===========================================================================
161
 #define SOFT_PWM_SCALE 0
164
 #define SOFT_PWM_SCALE 0
162
 #endif
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
 //=============================   functions      ============================
171
 //=============================   functions      ============================
166
 //===========================================================================
172
 //===========================================================================
604
       }
610
       }
605
     #endif
611
     #endif
606
   #endif
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
 #define PGM_RD_W(x)   (short)pgm_read_word(&x)
637
 #define PGM_RD_W(x)   (short)pgm_read_word(&x)
697
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
725
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
698
       redundant_temperature = analog2temp(redundant_temperature_raw, 1);
726
       redundant_temperature = analog2temp(redundant_temperature_raw, 1);
699
     #endif
727
     #endif
728
+    #ifdef FILAMENT_SENSOR  && (FILWIDTH_PIN > -1)    //check if a sensor is supported 
729
+      filament_width_meas = analog2widthFil();
730
+    #endif  
700
     //Reset the watchdog after we know we have a temperature measurement.
731
     //Reset the watchdog after we know we have a temperature measurement.
701
     watchdog_reset();
732
     watchdog_reset();
702
 
733
 
705
     CRITICAL_SECTION_END;
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
 void tp_init()
769
 void tp_init()
709
 {
770
 {
710
 #if (MOTHERBOARD == 80) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1))
771
 #if (MOTHERBOARD == 80) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1))
804
     #endif
865
     #endif
805
   #endif
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
   // Use timer0 for temperature measurement
879
   // Use timer0 for temperature measurement
808
   // Interleave temperature interrupt with millies interrupt
880
   // Interleave temperature interrupt with millies interrupt
809
   OCR0B = 128;
881
   OCR0B = 128;
1116
   static unsigned long raw_temp_1_value = 0;
1188
   static unsigned long raw_temp_1_value = 0;
1117
   static unsigned long raw_temp_2_value = 0;
1189
   static unsigned long raw_temp_2_value = 0;
1118
   static unsigned long raw_temp_bed_value = 0;
1190
   static unsigned long raw_temp_bed_value = 0;
1119
-  static unsigned char temp_state = 8;
1191
+  static unsigned char temp_state = 10;
1120
   static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1192
   static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1121
   static unsigned char soft_pwm_0;
1193
   static unsigned char soft_pwm_0;
1122
   #if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
1194
   #if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
1129
   static unsigned char soft_pwm_b;
1201
   static unsigned char soft_pwm_b;
1130
   #endif
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
   if(pwm_count == 0){
1208
   if(pwm_count == 0){
1133
     soft_pwm_0 = soft_pwm[0];
1209
     soft_pwm_0 = soft_pwm[0];
1134
     if(soft_pwm_0 > 0) { 
1210
     if(soft_pwm_0 > 0) { 
1255
       #if defined(TEMP_2_PIN) && (TEMP_2_PIN > -1)
1331
       #if defined(TEMP_2_PIN) && (TEMP_2_PIN > -1)
1256
         raw_temp_2_value += ADC;
1332
         raw_temp_2_value += ADC;
1257
       #endif
1333
       #endif
1258
-      temp_state = 0;
1259
-      temp_count++;
1334
+      temp_state = 8;//change so that Filament Width is also measured
1335
+      
1260
       break;
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
       temp_state = 0;
1367
       temp_state = 0;
1263
       break;
1368
       break;
1264
 //    default:
1369
 //    default:
1267
 //      break;
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
     if (!temp_meas_ready) //Only update the raw values if they have been read. Else we could be updating them during reading.
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
 #endif
1388
 #endif
1284
       current_temperature_bed_raw = raw_temp_bed_value;
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
     temp_meas_ready = true;
1398
     temp_meas_ready = true;
1288
     temp_count = 0;
1399
     temp_count = 0;

+ 8
- 0
Marlin/temperature.h View File

31
 void tp_init();  //initialize the heating
31
 void tp_init();  //initialize the heating
32
 void manage_heater(); //it is critical that this is called periodically.
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
 // low level conversion routines
42
 // low level conversion routines
35
 // do not use these routines and variables outside of temperature.cpp
43
 // do not use these routines and variables outside of temperature.cpp
36
 extern int target_temperature[EXTRUDERS];  
44
 extern int target_temperature[EXTRUDERS];  

+ 69
- 0
Marlin/thermistortables.h View File

621
 };
621
 };
622
 #endif
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
 #if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
693
 #if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
625
 /* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
694
 /* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
626
 This does not match the normal thermistor behaviour so we need to set the following defines */
695
 This does not match the normal thermistor behaviour so we need to set the following defines */

+ 27
- 1
Marlin/ultralcd.cpp View File

328
 }
328
 }
329
 #endif
329
 #endif
330
 
330
 
331
+void lcd_set_home_offsets()
332
+{
333
+    for(int8_t i=0; i < NUM_AXIS; i++) {
334
+      if (i != E_AXIS) {
335
+        add_homing[i] -= current_position[i];
336
+        current_position[i] = 0.0;
337
+      }
338
+    }
339
+    plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
340
+
341
+    // Audio feedback
342
+    enquecommand_P(PSTR("M300 S659 P200"));
343
+    enquecommand_P(PSTR("M300 S698 P200"));
344
+    lcd_return_to_status();
345
+}
346
+
347
+
331
 #ifdef BABYSTEPPING
348
 #ifdef BABYSTEPPING
332
 static void lcd_babystep_x()
349
 static void lcd_babystep_x()
333
 {
350
 {
395
     START_MENU();
412
     START_MENU();
396
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
413
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
397
     MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999);
414
     MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999);
415
+#if TEMP_SENSOR_0 != 0
398
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
416
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
417
+#endif
399
 #if TEMP_SENSOR_1 != 0
418
 #if TEMP_SENSOR_1 != 0
400
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
419
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
401
 #endif
420
 #endif
587
 #endif
606
 #endif
588
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
607
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
589
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
608
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
609
+    MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
590
     //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
610
     //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
591
 #if TEMP_SENSOR_0 != 0
611
 #if TEMP_SENSOR_0 != 0
592
   #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0
612
   #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0
801
 
821
 
802
     START_MENU();
822
     START_MENU();
803
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
823
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
824
+#if TEMP_SENSOR_0 != 0
804
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
825
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
826
+#endif
805
 #if TEMP_SENSOR_1 != 0
827
 #if TEMP_SENSOR_1 != 0
806
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
828
     MENU_ITEM_EDIT(int3, MSG_NOZZLE1, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
807
 #endif
829
 #endif
812
     MENU_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
834
     MENU_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
813
 #endif
835
 #endif
814
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
836
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
815
-#ifdef AUTOTEMP
837
+#if defined AUTOTEMP && (TEMP_SENSOR_0 != 0)
816
     MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
838
     MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
817
     MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
839
     MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
818
     MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15);
840
     MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15);
837
     START_MENU();
859
     START_MENU();
838
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
860
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
839
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255);
861
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255);
862
+#if TEMP_SENSOR_0 != 0
840
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
863
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
864
+#endif
841
 #if TEMP_SENSOR_BED != 0
865
 #if TEMP_SENSOR_BED != 0
842
     MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, 0, BED_MAXTEMP - 15);
866
     MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, 0, BED_MAXTEMP - 15);
843
 #endif
867
 #endif
852
     START_MENU();
876
     START_MENU();
853
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
877
     MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
854
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255);
878
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255);
879
+#if TEMP_SENSOR_0 != 0
855
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
880
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, 0, HEATER_0_MAXTEMP - 15);
881
+#endif
856
 #if TEMP_SENSOR_BED != 0
882
 #if TEMP_SENSOR_BED != 0
857
     MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, 0, BED_MAXTEMP - 15);
883
     MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, 0, BED_MAXTEMP - 15);
858
 #endif
884
 #endif

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

467
 # endif//LCD_WIDTH > 19
467
 # endif//LCD_WIDTH > 19
468
     lcd.setCursor(LCD_WIDTH - 8, 1);
468
     lcd.setCursor(LCD_WIDTH - 8, 1);
469
     lcd.print('Z');
469
     lcd.print('Z');
470
-    lcd.print(ftostr32(current_position[Z_AXIS]));
470
+    lcd.print(ftostr32(current_position[Z_AXIS] + 0.00001));
471
 #endif//LCD_HEIGHT > 2
471
 #endif//LCD_HEIGHT > 2
472
 
472
 
473
 #if LCD_HEIGHT > 3
473
 #if LCD_HEIGHT > 3

+ 5
- 0
README.md View File

2
 Marlin 3D Printer Firmware
2
 Marlin 3D Printer Firmware
3
 ==========================
3
 ==========================
4
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224)
4
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224)
5
+[![Travis Build Status](https://travis-ci.org/ErikZalm/Marlin.svg)](https://travis-ci.org/ErikZalm/Marlin)
5
 
6
 
6
 Marlin has a GPL license because I believe in open development.
7
 Marlin has a GPL license because I believe in open development.
7
 Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent.
8
 Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent.
233
 *  M400 - Finish all moves
234
 *  M400 - Finish all moves
234
 *  M401 - Lower z-probe if present
235
 *  M401 - Lower z-probe if present
235
 *  M402 - Raise z-probe if present
236
 *  M402 - Raise z-probe if present
237
+*  M404 - N<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
238
+*  M405 - Turn on Filament Sensor extrusion control.  Optional D<delay in cm> to set delay in centimeters between sensor and extruder
239
+*  M406 - Turn off Filament Sensor extrusion control
240
+*  M407 - Displays measured filament diameter
236
 *  M500 - stores paramters in EEPROM
241
 *  M500 - stores paramters in EEPROM
237
 *  M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
242
 *  M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
238
 *  M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
243
 *  M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.

Loading…
Cancel
Save