Ver código fonte

Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into Marlin_v1

Neil Darlow 10 anos atrás
pai
commit
1632e5e38a

+ 11
- 1
Marlin/Configuration.h Ver arquivo

@@ -12,6 +12,13 @@
12 12
 // example_configurations/delta directory.
13 13
 //
14 14
 
15
+//===========================================================================
16
+//============================= SCARA Printer ===============================
17
+//===========================================================================
18
+// For a Delta printer replace the configuration files with the files in the
19
+// example_configurations/SCARA directory.
20
+//
21
+
15 22
 // User-specified version info of this build to display in [Pronterface, etc] terminal window during
16 23
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
17 24
 // build by the user have been successfully uploaded into firmware.
@@ -72,6 +79,7 @@
72 79
 // 301= Rambo
73 80
 // 21 = Elefu Ra Board (v3)
74 81
 // 88 = 5DPrint D8 Driver Board
82
+// 999 = Leapfrog
75 83
 
76 84
 #ifndef MOTHERBOARD
77 85
 #define MOTHERBOARD 7
@@ -132,7 +140,6 @@
132 140
 // 1010 is Pt1000 with 1k pullup (non standard)
133 141
 // 147 is Pt100 with 4k7 pullup
134 142
 // 110 is Pt100 with 1k pullup (non standard)
135
-// 70 is 500C thermistor for Pico hot end
136 143
 
137 144
 #define TEMP_SENSOR_0 -1
138 145
 #define TEMP_SENSOR_1 -1
@@ -376,6 +383,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
376 383
 //============================= Bed Auto Leveling ===========================
377 384
 
378 385
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
386
+#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
379 387
 
380 388
 #ifdef ENABLE_AUTO_BED_LEVELING
381 389
 
@@ -436,6 +444,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
436 444
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
437 445
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
438 446
 
447
+  //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
448
+  //#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.
439 449
 
440 450
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
441 451
   //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.

+ 29
- 5
Marlin/ConfigurationStore.cpp Ver arquivo

@@ -37,10 +37,15 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
37 37
 // the default values are used whenever there is a change to the data, to prevent
38 38
 // wrong data being written to the variables.
39 39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
40
-#ifdef DELTA
41
-#define EEPROM_VERSION "V11"
42
-#else
40
+
43 41
 #define EEPROM_VERSION "V10"
42
+#ifdef DELTA
43
+	#undef EEPROM_VERSION
44
+	#define EEPROM_VERSION "V11"
45
+#endif
46
+#ifdef SCARA
47
+	#undef EEPROM_VERSION
48
+	#define EEPROM_VERSION "V12"
44 49
 #endif
45 50
 
46 51
 #ifdef EEPROM_SETTINGS
@@ -49,7 +54,7 @@ void Config_StoreSettings()
49 54
   char ver[4]= "000";
50 55
   int i=EEPROM_OFFSET;
51 56
   EEPROM_WRITE_VAR(i,ver); // invalidate data first 
52
-  EEPROM_WRITE_VAR(i,axis_steps_per_unit);  
57
+  EEPROM_WRITE_VAR(i,axis_steps_per_unit);
53 58
   EEPROM_WRITE_VAR(i,max_feedrate);  
54 59
   EEPROM_WRITE_VAR(i,max_acceleration_units_per_sq_second);
55 60
   EEPROM_WRITE_VAR(i,acceleration);
@@ -93,6 +98,9 @@ void Config_StoreSettings()
93 98
     int lcd_contrast = 32;
94 99
   #endif
95 100
   EEPROM_WRITE_VAR(i,lcd_contrast);
101
+  #ifdef SCARA
102
+  EEPROM_WRITE_VAR(i,axis_scaling);        // Add scaling for SCARA
103
+  #endif
96 104
   char ver2[4]=EEPROM_VERSION;
97 105
   i=EEPROM_OFFSET;
98 106
   EEPROM_WRITE_VAR(i,ver2); // validate data
@@ -115,6 +123,16 @@ void Config_PrintSettings()
115 123
     SERIAL_ECHOLN("");
116 124
       
117 125
     SERIAL_ECHO_START;
126
+#ifdef SCARA
127
+SERIAL_ECHOLNPGM("Scaling factors:");
128
+    SERIAL_ECHO_START;
129
+    SERIAL_ECHOPAIR("  M365 X",axis_scaling[0]);
130
+    SERIAL_ECHOPAIR(" Y",axis_scaling[1]);
131
+    SERIAL_ECHOPAIR(" Z",axis_scaling[2]);
132
+    SERIAL_ECHOLN("");
133
+      
134
+    SERIAL_ECHO_START;
135
+#endif
118 136
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
119 137
     SERIAL_ECHO_START;
120 138
     SERIAL_ECHOPAIR("  M203 X",max_feedrate[0]);
@@ -196,7 +214,7 @@ void Config_RetrieveSettings()
196 214
     if (strncmp(ver,stored_ver,3) == 0)
197 215
     {
198 216
         // version number match
199
-        EEPROM_READ_VAR(i,axis_steps_per_unit);  
217
+        EEPROM_READ_VAR(i,axis_steps_per_unit);
200 218
         EEPROM_READ_VAR(i,max_feedrate);  
201 219
         EEPROM_READ_VAR(i,max_acceleration_units_per_sq_second);
202 220
         
@@ -240,6 +258,9 @@ void Config_RetrieveSettings()
240 258
         int lcd_contrast;
241 259
         #endif
242 260
         EEPROM_READ_VAR(i,lcd_contrast);
261
+		#ifdef SCARA
262
+		EEPROM_READ_VAR(i,axis_scaling);
263
+		#endif
243 264
 
244 265
 		// Call updatePID (similar to when we have processed M301)
245 266
 		updatePID();
@@ -266,6 +287,9 @@ void Config_ResetDefault()
266 287
         axis_steps_per_unit[i]=tmp1[i];  
267 288
         max_feedrate[i]=tmp2[i];  
268 289
         max_acceleration_units_per_sq_second[i]=tmp3[i];
290
+		#ifdef SCARA
291
+		axis_scaling[i]=1;
292
+		#endif
269 293
     }
270 294
     
271 295
     // steps per sq second need to be updated to agree with the units per sq second

+ 7
- 0
Marlin/Marlin.h Ver arquivo

@@ -178,6 +178,10 @@ void get_coordinates();
178 178
 void calculate_delta(float cartesian[3]);
179 179
 extern float delta[3];
180 180
 #endif
181
+#ifdef SCARA
182
+void calculate_delta(float cartesian[3]);
183
+void calculate_SCARA_forward_Transform(float f_scara[3]);
184
+#endif
181 185
 void prepare_move();
182 186
 void kill();
183 187
 void Stop();
@@ -215,6 +219,9 @@ extern float delta_diagonal_rod;
215 219
 extern float delta_segments_per_second;
216 220
 void recalc_delta_settings(float radius, float diagonal_rod);
217 221
 #endif
222
+#ifdef SCARA
223
+extern float axis_scaling[3];  // Build size scaling
224
+#endif
218 225
 extern float min_pos[3];
219 226
 extern float max_pos[3];
220 227
 extern bool axis_known_position[3];

+ 704
- 21
Marlin/Marlin_main.cpp
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 802
- 0
Marlin/example_configurations/SCARA/Configuration.h Ver arquivo

@@ -0,0 +1,802 @@
1
+#ifndef CONFIGURATION_H
2
+#define CONFIGURATION_H
3
+
4
+// This configuration file contains the basic settings.
5
+// Advanced settings can be found in Configuration_adv.h
6
+// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
7
+
8
+//===========================================================================
9
+//========================= SCARA Settings ==================================
10
+//===========================================================================
11
+// SCARA-mode for Marlin has been developed by QHARLEY in ZA in 2012/2013. Implemented
12
+// and slightly reworked by JCERNY in 06/2014 with the goal to bring it into Master-Branch
13
+// QHARLEYS Autobedlevelling has not been ported, because Marlin has now Bed-levelling
14
+// You might need Z-Min endstop on SCARA-Printer to use this feature. Actually untested!
15
+// Uncomment to use Morgan scara mode
16
+#define SCARA  
17
+#define scara_segments_per_second 200 //careful, two much will decrease performance...
18
+// Length of inner support arm
19
+#define Linkage_1 150 //mm      Preprocessor cannot handle decimal point...
20
+// Length of outer support arm     Measure arm lengths precisely and enter 
21
+#define Linkage_2 150 //mm    
22
+
23
+// SCARA tower offset (position of Tower relative to bed zero position) 
24
+// This needs to be reasonably accurate as it defines the printbed position in the SCARA space.
25
+#define SCARA_offset_x 100 //mm   
26
+#define SCARA_offset_y -56 //mm
27
+#define SCARA_RAD2DEG 57.2957795  // to convert RAD to degrees
28
+
29
+#define THETA_HOMING_OFFSET 0	//calculatated from Calibration Guide and command M360 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
30
+#define PSI_HOMING_OFFSET 0  // calculatated from Calibration Guide and command M364 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
31
+
32
+//some helper variables to make kinematics faster
33
+#define L1_2 sq(Linkage_1) // do not change
34
+#define L2_2 sq(Linkage_2) // do not change
35
+
36
+//===========================================================================
37
+//========================= SCARA Settings end ==================================
38
+//===========================================================================
39
+
40
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
41
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
42
+// build by the user have been successfully uploaded into firmware.
43
+#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
44
+#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
45
+
46
+// SERIAL_PORT selects which serial port should be used for communication with the host.
47
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
48
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
49
+#define SERIAL_PORT 0
50
+
51
+// This determines the communication speed of the printer
52
+// This determines the communication speed of the printer
53
+#define BAUDRATE 250000
54
+
55
+// This enables the serial port associated to the Bluetooth interface
56
+//#define BTENABLED              // Enable BT interface on AT90USB devices
57
+
58
+
59
+//// The following define selects which electronics board you have. Please choose the one that matches your setup
60
+// 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
61
+// 11 = Gen7 v1.1, v1.2 = 11
62
+// 12 = Gen7 v1.3
63
+// 13 = Gen7 v1.4
64
+// 131 = OpenHardware.co.za custom Gen7 electronics
65
+// 2  = Cheaptronic v1.0
66
+// 20 = Sethi 3D_1
67
+// 3  = MEGA/RAMPS up to 1.2 = 3
68
+// 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
69
+// 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
70
+// 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
71
+// 4  = Duemilanove w/ ATMega328P pin assignment
72
+// 5  = Gen6
73
+// 51 = Gen6 deluxe
74
+// 6  = Sanguinololu < 1.2
75
+// 62 = Sanguinololu 1.2 and above
76
+// 63 = Melzi
77
+// 64 = STB V1.1
78
+// 65 = Azteeg X1
79
+// 66 = Melzi with ATmega1284 (MaKr3d version)
80
+// 67 = Azteeg X3
81
+// 68 = Azteeg X3 Pro
82
+// 7  = Ultimaker
83
+// 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
84
+// 72 = Ultimainboard 2.x (Uses TEMP_SENSOR 20)
85
+// 77 = 3Drag Controller
86
+// 8  = Teensylu
87
+// 80 = Rumba
88
+// 81 = Printrboard (AT90USB1286)
89
+// 82 = Brainwave (AT90USB646)
90
+// 83 = SAV Mk-I (AT90USB1286)
91
+// 84 = Teensy++2.0 (AT90USB1286) // CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84  make
92
+// 9  = Gen3+
93
+// 70 = Megatronics
94
+// 701= Megatronics v2.0
95
+// 702= Minitronics v1.0
96
+// 90 = Alpha OMCA board
97
+// 91 = Final OMCA board
98
+// 301= Rambo
99
+// 21 = Elefu Ra Board (v3)
100
+// 88 = 5DPrint D8 Driver Board
101
+
102
+#ifndef MOTHERBOARD
103
+#define MOTHERBOARD 33
104
+#endif
105
+
106
+// Define this to set a custom name for your generic Mendel,
107
+// #define CUSTOM_MENDEL_NAME "This Mendel"
108
+
109
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
110
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
111
+// #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
112
+
113
+// This defines the number of extruders
114
+#define EXTRUDERS 1
115
+
116
+//// The following define selects which power supply you have. Please choose the one that matches your setup
117
+// 1 = ATX
118
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
119
+
120
+#define POWER_SUPPLY 1
121
+
122
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
123
+// #define PS_DEFAULT_OFF
124
+
125
+//===========================================================================
126
+//=============================Thermal Settings  ============================
127
+//===========================================================================
128
+//
129
+//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
130
+//
131
+//// Temperature sensor settings:
132
+// -2 is thermocouple with MAX6675 (only for sensor 0)
133
+// -1 is thermocouple with AD595
134
+// 0 is not used
135
+// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
136
+// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
137
+// 3 is Mendel-parts thermistor (4.7k pullup)
138
+// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
139
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
140
+// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
141
+// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
142
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
143
+// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
144
+// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
145
+// 10 is 100k RS thermistor 198-961 (4.7k pullup)
146
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
147
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
148
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
149
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
150
+//
151
+//    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
152
+//                          (but gives greater accuracy and more stable PID)
153
+// 51 is 100k thermistor - EPCOS (1k pullup)
154
+// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
155
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
156
+//
157
+// 1047 is Pt1000 with 4k7 pullup
158
+// 1010 is Pt1000 with 1k pullup (non standard)
159
+// 147 is Pt100 with 4k7 pullup
160
+// 110 is Pt100 with 1k pullup (non standard)
161
+
162
+#define TEMP_SENSOR_0 1
163
+#define TEMP_SENSOR_1 0
164
+#define TEMP_SENSOR_2 0
165
+#define TEMP_SENSOR_BED 1
166
+
167
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
168
+//#define TEMP_SENSOR_1_AS_REDUNDANT
169
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
170
+
171
+// Actual temperature must be close to target for this long before M109 returns success
172
+#define TEMP_RESIDENCY_TIME 3  // (seconds)
173
+#define TEMP_HYSTERESIS 2       // (degC) range of +/- temperatures considered "close" to the target one
174
+#define TEMP_WINDOW     1       // (degC) Window around target to start the residency timer x degC early.
175
+
176
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
177
+// to check that the wiring to the thermistor is not broken.
178
+// Otherwise this would lead to the heater being powered on all the time.
179
+#define HEATER_0_MINTEMP 5
180
+#define HEATER_1_MINTEMP 5
181
+#define HEATER_2_MINTEMP 5
182
+#define BED_MINTEMP 5
183
+
184
+// When temperature exceeds max temp, your heater will be switched off.
185
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
186
+// You should use MINTEMP for thermistor short/failure protection.
187
+#define HEATER_0_MAXTEMP 275
188
+#define HEATER_1_MAXTEMP 275
189
+#define HEATER_2_MAXTEMP 275
190
+#define BED_MAXTEMP 150
191
+
192
+// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
193
+// average current. The value should be an integer and the heat bed will be turned on for 1 interval of
194
+// HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
195
+//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
196
+
197
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
198
+#define EXTRUDER_WATTS (2*2/5.9) //  P=I^2/R
199
+#define BED_WATTS (5.45*5.45/2.2)      // P=I^2/R
200
+
201
+// PID settings:
202
+// Comment the following line to disable PID and enable bang-bang.
203
+#define PIDTEMP
204
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
205
+#define PID_MAX 255 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
206
+#ifdef PIDTEMP
207
+  //#define PID_DEBUG // Sends debug data to the serial port.
208
+  //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
209
+  #define PID_FUNCTIONAL_RANGE 20 // If the temperature difference between the target temperature and the actual temperature
210
+                                  // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
211
+  #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
212
+  #define K1 0.95 //smoothing factor within the PID
213
+  #define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
214
+
215
+// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
216
+// Ultimaker
217
+  //  #define  DEFAULT_Kp 22.2
218
+  //  #define  DEFAULT_Ki 1.08
219
+   // #define  DEFAULT_Kd 114
220
+  
221
+ // Jhead MK5: From Autotune  
222
+  //  #define  DEFAULT_Kp 20.92
223
+   // #define  DEFAULT_Ki 1.51
224
+  //  #define  DEFAULT_Kd 72.34
225
+    
226
+ //Merlin Hotend: From Autotune  
227
+    #define  DEFAULT_Kp 24.5
228
+    #define  DEFAULT_Ki 1.72
229
+    #define  DEFAULT_Kd 87.73
230
+
231
+// MakerGear
232
+//    #define  DEFAULT_Kp 7.0
233
+//    #define  DEFAULT_Ki 0.1
234
+//    #define  DEFAULT_Kd 12
235
+
236
+// Mendel Parts V9 on 12V
237
+  //  #define  DEFAULT_Kp 63.0
238
+   // #define  DEFAULT_Ki 2.25
239
+   // #define  DEFAULT_Kd 440
240
+#endif // PIDTEMP
241
+
242
+// Bed Temperature Control
243
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
244
+//
245
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
246
+// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
247
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
248
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
249
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
250
+// shouldn't use bed PID until someone else verifies your hardware works.
251
+// If this is enabled, find your own PID constants below.
252
+#define PIDTEMPBED
253
+//
254
+#define BED_LIMIT_SWITCHING
255
+
256
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
257
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
258
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
259
+// so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
260
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
261
+
262
+#ifdef PIDTEMPBED
263
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
264
+//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
265
+  //  #define  DEFAULT_bedKp 10.00
266
+  //  #define  DEFAULT_bedKi .023
267
+  //  #define  DEFAULT_bedKd 305.4
268
+
269
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
270
+//from pidautotune
271
+//    #define  DEFAULT_bedKp 97.1
272
+//    #define  DEFAULT_bedKi 1.41
273
+//    #define  DEFAULT_bedKd 1675.16
274
+
275
+//12v Heatbed Mk3 12V in parallel
276
+//from pidautotune
277
+    #define  DEFAULT_bedKp 630.14
278
+    #define  DEFAULT_bedKi 121.71
279
+    #define  DEFAULT_bedKd 815.64
280
+    
281
+// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
282
+#endif // PIDTEMPBED
283
+
284
+
285
+
286
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
287
+//can be software-disabled for whatever purposes by
288
+//#define PREVENT_DANGEROUS_EXTRUDE
289
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
290
+#define PREVENT_LENGTHY_EXTRUDE
291
+
292
+#define EXTRUDE_MINTEMP 150
293
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
294
+
295
+/*================== Thermal Runaway Protection ==============================
296
+This is a feature to protect your printer from burn up in flames if it has
297
+a thermistor coming off place (this happened to a friend of mine recently and
298
+motivated me writing this feature).
299
+
300
+The issue: If a thermistor come off, it will read a lower temperature than actual.
301
+The system will turn the heater on forever, burning up the filament and anything
302
+else around.
303
+
304
+After the temperature reaches the target for the first time, this feature will 
305
+start measuring for how long the current temperature stays below the target 
306
+minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
307
+
308
+If it stays longer than _PERIOD, it means the thermistor temperature
309
+cannot catch up with the target, so something *may be* wrong. Then, to be on the
310
+safe side, the system will he halt.
311
+
312
+Bear in mind the count down will just start AFTER the first time the 
313
+thermistor temperature is over the target, so you will have no problem if
314
+your extruder heater takes 2 minutes to hit the target on heating.
315
+
316
+*/
317
+// If you want to enable this feature for all your extruder heaters,
318
+// uncomment the 2 defines below:
319
+
320
+// Parameters for all extruder heaters
321
+//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
322
+//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
323
+
324
+// If you want to enable this feature for your bed heater,
325
+// uncomment the 2 defines below:
326
+
327
+// Parameters for the bed heater
328
+//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
329
+//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
330
+//===========================================================================
331
+
332
+//===========================================================================
333
+//=============================Mechanical Settings===========================
334
+//===========================================================================
335
+
336
+// Uncomment the following line to enable CoreXY kinematics
337
+// #define COREXY
338
+
339
+// coarse Endstop Settings
340
+//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
341
+
342
+#ifndef ENDSTOPPULLUPS
343
+  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
344
+  // #define ENDSTOPPULLUP_XMAX
345
+  // #define ENDSTOPPULLUP_YMAX
346
+   #define ENDSTOPPULLUP_ZMAX  // open pin, inverted
347
+   #define ENDSTOPPULLUP_XMIN  // open pin, inverted
348
+   #define ENDSTOPPULLUP_YMIN  // open pin, inverted
349
+  // #define ENDSTOPPULLUP_ZMIN
350
+#endif
351
+
352
+#ifdef ENDSTOPPULLUPS
353
+  #define ENDSTOPPULLUP_XMAX
354
+  #define ENDSTOPPULLUP_YMAX
355
+  #define ENDSTOPPULLUP_ZMAX
356
+  #define ENDSTOPPULLUP_XMIN
357
+  #define ENDSTOPPULLUP_YMIN
358
+  #define ENDSTOPPULLUP_ZMIN
359
+#endif
360
+
361
+// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
362
+const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
363
+const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
364
+const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
365
+const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
366
+const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
367
+const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
368
+//#define DISABLE_MAX_ENDSTOPS
369
+//#define DISABLE_MIN_ENDSTOPS
370
+
371
+// Disable max endstops for compatibility with endstop checking routine
372
+#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
373
+  #define DISABLE_MAX_ENDSTOPS
374
+#endif
375
+
376
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
377
+#define X_ENABLE_ON 0
378
+#define Y_ENABLE_ON 0
379
+#define Z_ENABLE_ON 0
380
+#define E_ENABLE_ON 0 // For all extruders
381
+
382
+// Disables axis when it's not being used.
383
+#define DISABLE_X false
384
+#define DISABLE_Y false
385
+#define DISABLE_Z false
386
+#define DISABLE_E false // For all extruders
387
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
388
+
389
+#define INVERT_X_DIR false    // for Mendel set to false, for Orca set to true
390
+#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
391
+#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true
392
+#define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
393
+#define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
394
+#define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
395
+
396
+// ENDSTOP SETTINGS:
397
+// Sets direction of endstop	s when homing; 1=MAX, -1=MIN
398
+#define X_HOME_DIR 1
399
+#define Y_HOME_DIR 1
400
+#define Z_HOME_DIR -1
401
+
402
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
403
+#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
404
+
405
+// Travel limits after homing
406
+#define X_MAX_POS 200
407
+#define X_MIN_POS 0
408
+#define Y_MAX_POS 200
409
+#define Y_MIN_POS 0
410
+#define Z_MAX_POS 225
411
+#define Z_MIN_POS MANUAL_Z_HOME_POS
412
+
413
+#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
414
+#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
415
+#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
416
+//============================= Bed Auto Leveling ===========================
417
+
418
+//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
419
+
420
+#ifdef ENABLE_AUTO_BED_LEVELING
421
+
422
+// There are 2 different ways to pick the X and Y locations to probe:
423
+
424
+//  - "grid" mode
425
+//    Probe every point in a rectangular grid
426
+//    You must specify the rectangle, and the density of sample points
427
+//    This mode is preferred because there are more measurements.
428
+//    It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
429
+
430
+//  - "3-point" mode
431
+//    Probe 3 arbitrary points on the bed (that aren't colinear)
432
+//    You must specify the X & Y coordinates of all 3 points
433
+
434
+  #define AUTO_BED_LEVELING_GRID
435
+  // with AUTO_BED_LEVELING_GRID, the bed is sampled in a
436
+  // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
437
+  // and least squares solution is calculated
438
+  // Note: this feature occupies 10'206 byte
439
+  #ifdef AUTO_BED_LEVELING_GRID
440
+
441
+    // set the rectangle in which to probe
442
+    #define LEFT_PROBE_BED_POSITION 15
443
+    #define RIGHT_PROBE_BED_POSITION 170
444
+    #define BACK_PROBE_BED_POSITION 180
445
+    #define FRONT_PROBE_BED_POSITION 20
446
+
447
+     // set the number of grid points per dimension
448
+     // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
449
+    #define AUTO_BED_LEVELING_GRID_POINTS 2
450
+
451
+
452
+  #else  // not AUTO_BED_LEVELING_GRID
453
+    // with no grid, just probe 3 arbitrary points.  A simple cross-product
454
+    // is used to esimate the plane of the print bed
455
+
456
+      #define ABL_PROBE_PT_1_X 15
457
+      #define ABL_PROBE_PT_1_Y 180
458
+      #define ABL_PROBE_PT_2_X 15
459
+      #define ABL_PROBE_PT_2_Y 20
460
+      #define ABL_PROBE_PT_3_X 170
461
+      #define ABL_PROBE_PT_3_Y 20
462
+
463
+  #endif // AUTO_BED_LEVELING_GRID
464
+
465
+
466
+  // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
467
+  #define X_PROBE_OFFSET_FROM_EXTRUDER -25
468
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
469
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
470
+
471
+  //#define Z_RAISE_BEFORE_HOMING 4       // (in mm) Raise Z before homing (G28) for Probe Clearance.
472
+                                        // Be sure you have this distance over your Z_MAX_POS in case
473
+
474
+  #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
475
+
476
+  #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
477
+  #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
478
+
479
+
480
+  //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
481
+  //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.
482
+  // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
483
+
484
+//  #define PROBE_SERVO_DEACTIVATION_DELAY 300
485
+
486
+
487
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
488
+//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
489
+
490
+ // #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
491
+                          // When defined, it will:
492
+                          // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
493
+                          // - If stepper drivers timeout, it will need X and Y homing again before Z homing
494
+                          // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
495
+                          // - Block Z homing only when the probe is outside bed area.
496
+
497
+  #ifdef Z_SAFE_HOMING
498
+
499
+    #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2)    // X point for Z homing when homing all axis (G28)
500
+    #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2)    // Y point for Z homing when homing all axis (G28)
501
+
502
+  #endif
503
+
504
+#endif // ENABLE_AUTO_BED_LEVELING
505
+
506
+
507
+// The position of the homing switches
508
+#define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
509
+//#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
510
+
511
+//Manual homing switch locations:
512
+// For deltabots this means top and center of the Cartesian print volume.
513
+// For SCARA: Offset between HomingPosition and Bed X=0 / Y=0
514
+#define MANUAL_X_HOME_POS -22.
515
+#define MANUAL_Y_HOME_POS -52.
516
+#define MANUAL_Z_HOME_POS 0.1  // Distance between nozzle and print surface after homing.
517
+
518
+
519
+//// MOVEMENT SETTINGS
520
+#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
521
+#define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0}  // set the homing speeds (mm/min)
522
+
523
+// default settings
524
+
525
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {103.69,106.65,200/1.25,1000}  // default steps per unit for SCARA
526
+#define DEFAULT_MAX_FEEDRATE          {300, 300, 30, 25}    // (mm/sec)
527
+#define DEFAULT_MAX_ACCELERATION      {300,300,20,1000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
528
+
529
+#define DEFAULT_ACCELERATION          400    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
530
+#define DEFAULT_RETRACT_ACCELERATION  2000  // X, Y, Z and E max acceleration in mm/s^2 for retracts
531
+
532
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
533
+// The offset has to be X=0, Y=0 for extruder 0 hotend (default extruder).
534
+// For the other hotends it is their distance from the extruder 0 hotend.
535
+// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
536
+// #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
537
+
538
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
539
+#define DEFAULT_XYJERK                5    // (mm/sec)
540
+#define DEFAULT_ZJERK                 0.4    // (mm/sec)
541
+#define DEFAULT_EJERK                 3    // (mm/sec)
542
+
543
+//===========================================================================
544
+//=============================Additional Features===========================
545
+//===========================================================================
546
+
547
+// Custom M code points
548
+//#define CUSTOM_M_CODES
549
+#ifdef CUSTOM_M_CODES
550
+  #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
551
+  #define Z_PROBE_OFFSET_RANGE_MIN -15
552
+  #define Z_PROBE_OFFSET_RANGE_MAX -5
553
+#endif
554
+
555
+
556
+// EEPROM
557
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
558
+// M500 - stores parameters in EEPROM
559
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
560
+// M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
561
+//define this to enable EEPROM support
562
+//#define EEPROM_SETTINGS
563
+//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
564
+// please keep turned on if you can.
565
+#define EEPROM_CHITCHAT
566
+
567
+// Preheat Constants
568
+#define PLA_PREHEAT_HOTEND_TEMP 180
569
+#define PLA_PREHEAT_HPB_TEMP 70
570
+#define PLA_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
571
+
572
+#define ABS_PREHEAT_HOTEND_TEMP 240
573
+#define ABS_PREHEAT_HPB_TEMP 100
574
+#define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
575
+
576
+//LCD and SD support
577
+//#define ULTRA_LCD  //general LCD support, also 16x2
578
+//#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
579
+//#define SDSUPPORT // Enable SD Card Support in Hardware Console
580
+//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
581
+//#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
582
+//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
583
+//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
584
+//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
585
+//#define ULTIPANEL  //the UltiPanel as on Thingiverse
586
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
587
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
588
+
589
+// The MaKr3d Makr-Panel with graphic controller and SD support
590
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
591
+//#define MAKRPANEL
592
+
593
+// The RepRapDiscount Smart Controller (white PCB)
594
+// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
595
+//#define REPRAP_DISCOUNT_SMART_CONTROLLER
596
+
597
+// The GADGETS3D G3D LCD/SD Controller (blue PCB)
598
+// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
599
+//#define G3D_PANEL
600
+
601
+// The RepRapDiscount FULL GRAPHIC Smart Controller (quadratic white PCB)
602
+// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
603
+//
604
+// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
605
+//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
606
+
607
+// The RepRapWorld REPRAPWORLD_KEYPAD v1.1
608
+// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
609
+//#define REPRAPWORLD_KEYPAD
610
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
611
+
612
+// The Elefu RA Board Control Panel
613
+// http://www.elefu.com/index.php?route=product/product&product_id=53
614
+// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARUDINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
615
+//#define RA_CONTROL_PANEL
616
+
617
+//automatic expansion
618
+#if defined (MAKRPANEL)
619
+ #define DOGLCD
620
+ #define SDSUPPORT
621
+ #define ULTIPANEL
622
+ #define NEWPANEL
623
+ #define DEFAULT_LCD_CONTRAST 17
624
+#endif
625
+
626
+#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
627
+ #define DOGLCD
628
+ #define U8GLIB_ST7920
629
+ #define REPRAP_DISCOUNT_SMART_CONTROLLER
630
+#endif
631
+
632
+#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
633
+ #define ULTIPANEL
634
+ #define NEWPANEL
635
+#endif
636
+
637
+#if defined(REPRAPWORLD_KEYPAD)
638
+  #define NEWPANEL
639
+  #define ULTIPANEL
640
+#endif
641
+#if defined(RA_CONTROL_PANEL)
642
+ #define ULTIPANEL
643
+ #define NEWPANEL
644
+ #define LCD_I2C_TYPE_PCA8574
645
+ #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
646
+#endif
647
+
648
+//I2C PANELS
649
+
650
+//#define LCD_I2C_SAINSMART_YWROBOT
651
+#ifdef LCD_I2C_SAINSMART_YWROBOT
652
+  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
653
+  // Make sure it is placed in the Arduino libraries directory.
654
+  #define LCD_I2C_TYPE_PCF8575
655
+  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
656
+  #define NEWPANEL
657
+  #define ULTIPANEL
658
+#endif
659
+
660
+// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
661
+//#define LCD_I2C_PANELOLU2
662
+#ifdef LCD_I2C_PANELOLU2
663
+  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
664
+  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
665
+  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
666
+  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
667
+  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
668
+  #define LCD_I2C_TYPE_MCP23017
669
+  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
670
+  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
671
+  #define NEWPANEL
672
+  #define ULTIPANEL
673
+
674
+  #ifndef ENCODER_PULSES_PER_STEP
675
+	#define ENCODER_PULSES_PER_STEP 4
676
+  #endif
677
+
678
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
679
+	#define ENCODER_STEPS_PER_MENU_ITEM 1
680
+  #endif
681
+
682
+
683
+  #ifdef LCD_USE_I2C_BUZZER
684
+	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
685
+	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
686
+  #endif
687
+
688
+#endif
689
+
690
+// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
691
+//#define LCD_I2C_VIKI
692
+#ifdef LCD_I2C_VIKI
693
+  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
694
+  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
695
+  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
696
+  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
697
+  #define LCD_I2C_TYPE_MCP23017
698
+  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
699
+  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
700
+  #define NEWPANEL
701
+  #define ULTIPANEL
702
+#endif
703
+
704
+// Shift register panels
705
+// ---------------------
706
+// 2 wire Non-latching LCD SR from:
707
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
708
+//#define SR_LCD
709
+#ifdef SR_LCD
710
+   #define SR_LCD_2W_NL    // Non latching 2 wire shift register
711
+   //#define NEWPANEL
712
+#endif
713
+
714
+
715
+#ifdef ULTIPANEL
716
+//  #define NEWPANEL  //enable this if you have a click-encoder panel
717
+  #define SDSUPPORT
718
+  #define ULTRA_LCD
719
+  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
720
+    #define LCD_WIDTH 20
721
+    #define LCD_HEIGHT 5
722
+  #else
723
+    #define LCD_WIDTH 20
724
+    #define LCD_HEIGHT 4
725
+  #endif
726
+#else //no panel but just LCD
727
+  #ifdef ULTRA_LCD
728
+  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
729
+    #define LCD_WIDTH 20
730
+    #define LCD_HEIGHT 5
731
+  #else
732
+    #define LCD_WIDTH 16
733
+    #define LCD_HEIGHT 2
734
+  #endif
735
+  #endif
736
+#endif
737
+
738
+// default LCD contrast for dogm-like LCD displays
739
+#ifdef DOGLCD
740
+# ifndef DEFAULT_LCD_CONTRAST
741
+#  define DEFAULT_LCD_CONTRAST 32
742
+# endif
743
+#endif
744
+
745
+// Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
746
+//#define FAST_PWM_FAN
747
+
748
+// Temperature status LEDs that display the hotend and bet temperature.
749
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
750
+// Otherwise the RED led is on. There is 1C hysteresis.
751
+//#define TEMP_STAT_LEDS
752
+
753
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
754
+// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
755
+// is too low, you should also increment SOFT_PWM_SCALE.
756
+//#define FAN_SOFT_PWM
757
+
758
+// Incrementing this by 1 will double the software PWM frequency,
759
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
760
+// However, control resolution will be halved for each increment;
761
+// at zero value, there are 128 effective control positions.
762
+#define SOFT_PWM_SCALE 0
763
+
764
+// M240  Triggers a camera by emulating a Canon RC-1 Remote
765
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
766
+// #define PHOTOGRAPH_PIN     23
767
+
768
+// SF send wrong arc g-codes when using Arc Point as fillet procedure
769
+//#define SF_ARC_FIX
770
+
771
+// Support for the BariCUDA Paste Extruder.
772
+//#define BARICUDA
773
+
774
+//define BlinkM/CyzRgb Support
775
+//#define BLINKM
776
+
777
+/*********************************************************************\
778
+* R/C SERVO support
779
+* Sponsored by TrinityLabs, Reworked by codexmas
780
+**********************************************************************/
781
+
782
+// Number of servos
783
+//
784
+// If you select a configuration below, this will receive a default value and does not need to be set manually
785
+// set it manually if you have more servos than extruders and wish to manually control some
786
+// leaving it undefined or defining as 0 will disable the servo subsystem
787
+// If unsure, leave commented / disabled
788
+//
789
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
790
+
791
+// Servo Endstops
792
+//
793
+// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
794
+// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
795
+//
796
+//#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
797
+//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
798
+
799
+#include "Configuration_adv.h"
800
+#include "thermistortables.h"
801
+
802
+#endif //__CONFIGURATION_H

+ 507
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h Ver arquivo

@@ -0,0 +1,507 @@
1
+#ifndef CONFIGURATION_ADV_H
2
+#define CONFIGURATION_ADV_H
3
+
4
+//===========================================================================
5
+//=============================Thermal Settings  ============================
6
+//===========================================================================
7
+
8
+#ifdef BED_LIMIT_SWITCHING
9
+  #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
10
+#endif
11
+#define BED_CHECK_INTERVAL 3000 //ms between checks in bang-bang control
12
+
13
+//// Heating sanity check:
14
+// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
15
+// If the temperature has not increased at the end of that period, the target temperature is set to zero.
16
+// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
17
+//  differ by at least 2x WATCH_TEMP_INCREASE
18
+//#define WATCH_TEMP_PERIOD 40000 //40 seconds
19
+//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
20
+
21
+#ifdef PIDTEMP
22
+  // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
23
+  // if Kc is chosen well, the additional required power due to increased melting should be compensated.
24
+  #define PID_ADD_EXTRUSION_RATE
25
+  #ifdef PID_ADD_EXTRUSION_RATE
26
+    #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
27
+  #endif
28
+#endif
29
+
30
+
31
+//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode.
32
+//The maximum buffered steps/sec of the extruder motor are called "se".
33
+//You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor>
34
+// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp
35
+// you exit the value by any M109 without F*
36
+// Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
37
+// on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
38
+#define AUTOTEMP
39
+#ifdef AUTOTEMP
40
+  #define AUTOTEMP_OLDWEIGHT 0.98
41
+#endif
42
+
43
+//Show Temperature ADC value
44
+//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
45
+//#define SHOW_TEMP_ADC_VALUES
46
+
47
+//  extruder run-out prevention.
48
+//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
49
+//#define EXTRUDER_RUNOUT_PREVENT
50
+#define EXTRUDER_RUNOUT_MINTEMP 180
51
+#define EXTRUDER_RUNOUT_SECONDS 30.
52
+#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
53
+#define EXTRUDER_RUNOUT_SPEED 180.  //extrusion speed
54
+#define EXTRUDER_RUNOUT_EXTRUDE 100
55
+
56
+//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements.
57
+//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET"
58
+#define TEMP_SENSOR_AD595_OFFSET 0.0
59
+#define TEMP_SENSOR_AD595_GAIN   1.0
60
+
61
+//This is for controlling a fan to cool down the stepper drivers
62
+//it will turn on when any driver is enabled
63
+//and turn off after the set amount of seconds from last driver being disabled again
64
+#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
65
+#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
66
+#define CONTROLLERFAN_SPEED 255  // == full speed
67
+
68
+// When first starting the main fan, run it at full speed for the
69
+// given number of milliseconds.  This gets the fan spinning reliably
70
+// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
71
+//#define FAN_KICKSTART_TIME 100
72
+
73
+// Extruder cooling fans
74
+// Configure fan pin outputs to automatically turn on/off when the associated
75
+// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
76
+// Multiple extruders can be assigned to the same pin in which case
77
+// the fan will turn on when any selected extruder is above the threshold.
78
+#define EXTRUDER_0_AUTO_FAN_PIN   -1
79
+#define EXTRUDER_1_AUTO_FAN_PIN   -1
80
+#define EXTRUDER_2_AUTO_FAN_PIN   -1
81
+#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
82
+#define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
83
+
84
+
85
+//===========================================================================
86
+//=============================Mechanical Settings===========================
87
+//===========================================================================
88
+
89
+#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
90
+
91
+
92
+//// AUTOSET LOCATIONS OF LIMIT SWITCHES
93
+//// Added by ZetaPhoenix 09-15-2012
94
+#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
95
+  #define X_HOME_POS MANUAL_X_HOME_POS
96
+  #define Y_HOME_POS MANUAL_Y_HOME_POS
97
+  #define Z_HOME_POS MANUAL_Z_HOME_POS
98
+#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
99
+  //X axis
100
+  #if X_HOME_DIR == -1
101
+    #ifdef BED_CENTER_AT_0_0
102
+      #define X_HOME_POS X_MAX_LENGTH * -0.5
103
+    #else
104
+      #define X_HOME_POS X_MIN_POS
105
+    #endif //BED_CENTER_AT_0_0
106
+  #else
107
+    #ifdef BED_CENTER_AT_0_0
108
+      #define X_HOME_POS X_MAX_LENGTH * 0.5
109
+    #else
110
+      #define X_HOME_POS X_MAX_POS
111
+    #endif //BED_CENTER_AT_0_0
112
+  #endif //X_HOME_DIR == -1
113
+
114
+  //Y axis
115
+  #if Y_HOME_DIR == -1
116
+    #ifdef BED_CENTER_AT_0_0
117
+      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
118
+    #else
119
+      #define Y_HOME_POS Y_MIN_POS
120
+    #endif //BED_CENTER_AT_0_0
121
+  #else
122
+    #ifdef BED_CENTER_AT_0_0
123
+      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
124
+    #else
125
+      #define Y_HOME_POS Y_MAX_POS
126
+    #endif //BED_CENTER_AT_0_0
127
+  #endif //Y_HOME_DIR == -1
128
+
129
+  // Z axis
130
+  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
131
+    #define Z_HOME_POS Z_MIN_POS
132
+  #else
133
+    #define Z_HOME_POS Z_MAX_POS
134
+  #endif //Z_HOME_DIR == -1
135
+#endif //End auto min/max positions
136
+//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
137
+
138
+
139
+//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
140
+
141
+// A single Z stepper driver is usually used to drive 2 stepper motors.
142
+// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
143
+// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
144
+// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
145
+// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
146
+//#define Z_DUAL_STEPPER_DRIVERS
147
+
148
+#ifdef Z_DUAL_STEPPER_DRIVERS
149
+  #undef EXTRUDERS
150
+  #define EXTRUDERS 1
151
+#endif
152
+
153
+// Same again but for Y Axis.
154
+//#define Y_DUAL_STEPPER_DRIVERS
155
+
156
+// Define if the two Y drives need to rotate in opposite directions
157
+#define INVERT_Y2_VS_Y_DIR true
158
+
159
+#ifdef Y_DUAL_STEPPER_DRIVERS
160
+  #undef EXTRUDERS
161
+  #define EXTRUDERS 1
162
+#endif
163
+
164
+#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
165
+  #error "You cannot have dual drivers for both Y and Z"
166
+#endif
167
+
168
+// Enable this for dual x-carriage printers.
169
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
170
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
171
+// allowing faster printing speeds.
172
+//#define DUAL_X_CARRIAGE
173
+#ifdef DUAL_X_CARRIAGE
174
+// Configuration for second X-carriage
175
+// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
176
+// the second x-carriage always homes to the maximum endstop.
177
+#define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
178
+#define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed
179
+#define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
180
+#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
181
+    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
182
+    // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
183
+    // without modifying the firmware (through the "M218 T1 X???" command).
184
+    // Remember: you should set the second extruder x-offset to 0 in your slicer.
185
+
186
+// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
187
+#define X2_ENABLE_PIN 29
188
+#define X2_STEP_PIN 25
189
+#define X2_DIR_PIN 23
190
+
191
+// There are a few selectable movement modes for dual x-carriages using M605 S<mode>
192
+//    Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
193
+//                           as long as it supports dual x-carriages. (M605 S0)
194
+//    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
195
+//                           that additional slicer support is not required. (M605 S1)
196
+//    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
197
+//                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
198
+//                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
199
+
200
+// This is the default power-up mode which can be later using M605.
201
+#define DEFAULT_DUAL_X_CARRIAGE_MODE 0
202
+
203
+// As the x-carriages are independent we can now account for any relative Z offset
204
+#define EXTRUDER1_Z_OFFSET 0.0           // z offset relative to extruder 0
205
+
206
+// Default settings in "Auto-park Mode"
207
+#define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
208
+#define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
209
+
210
+// Default x offset in duplication mode (typically set to half print bed width)
211
+#define DEFAULT_DUPLICATION_X_OFFSET 100
212
+
213
+#endif //DUAL_X_CARRIAGE
214
+
215
+//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
216
+#define X_HOME_RETRACT_MM 3
217
+#define Y_HOME_RETRACT_MM 3
218
+#define Z_HOME_RETRACT_MM 3
219
+//#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
220
+#ifdef SCARA
221
+	#define QUICK_HOME //SCARA needs Quickhome
222
+#endif
223
+
224
+#define AXIS_RELATIVE_MODES {false, false, false, false}
225
+
226
+#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
227
+
228
+//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
229
+#define INVERT_X_STEP_PIN false
230
+#define INVERT_Y_STEP_PIN false
231
+#define INVERT_Z_STEP_PIN false
232
+#define INVERT_E_STEP_PIN false
233
+
234
+//default stepper release if idle
235
+#define DEFAULT_STEPPER_DEACTIVE_TIME 240
236
+
237
+#define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
238
+#define DEFAULT_MINTRAVELFEEDRATE     0.0
239
+
240
+// Feedrates for manual moves along X, Y, Z, E from panel
241
+#ifdef ULTIPANEL
242
+#define MANUAL_FEEDRATE {50*60, 50*60, 10*60, 60}  // set the speeds for manual moves (mm/min)
243
+#endif
244
+
245
+//Comment to disable setting feedrate multiplier via encoder
246
+#ifdef ULTIPANEL
247
+    #define ULTIPANEL_FEEDMULTIPLY
248
+#endif
249
+
250
+// minimum time in microseconds that a movement needs to take if the buffer is emptied.
251
+#define DEFAULT_MINSEGMENTTIME        20000
252
+
253
+// If defined the movements slow down when the look ahead buffer is only half full
254
+//#define SLOWDOWN
255
+#ifdef SCARA
256
+ #undef SLOWDOWN
257
+#endif
258
+// Frequency limit
259
+// See nophead's blog for more info
260
+// Not working O
261
+//#define XY_FREQUENCY_LIMIT  15
262
+
263
+// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
264
+// of the buffer and all stops. This should not be much greater than zero and should only be changed
265
+// if unwanted behavior is observed on a user's machine when running at very slow speeds.
266
+#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
267
+
268
+// MS1 MS2 Stepper Driver Microstepping mode table
269
+#define MICROSTEP1 LOW,LOW
270
+#define MICROSTEP2 HIGH,LOW
271
+#define MICROSTEP4 LOW,HIGH
272
+#define MICROSTEP8 HIGH,HIGH
273
+#define MICROSTEP16 HIGH,HIGH
274
+
275
+// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
276
+#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
277
+
278
+// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
279
+#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
280
+
281
+// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
282
+//#define DIGIPOT_I2C
283
+// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
284
+#define DIGIPOT_I2C_NUM_CHANNELS 8
285
+// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
286
+#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
287
+
288
+//===========================================================================
289
+//=============================Additional Features===========================
290
+//===========================================================================
291
+
292
+//#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/
293
+#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
294
+
295
+#define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
296
+#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
297
+
298
+#define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the file system block order.
299
+// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
300
+// using:
301
+//#define MENU_ADDAUTOSTART
302
+
303
+// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
304
+//#define USE_WATCHDOG
305
+
306
+#ifdef USE_WATCHDOG
307
+// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
308
+// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
309
+//  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
310
+//#define WATCHDOG_RESET_MANUAL
311
+#endif
312
+
313
+// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
314
+//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
315
+
316
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
317
+// it can e.g. be used to change z-positions in the print startup phase in real-time
318
+// does not respect endstops!
319
+//#define BABYSTEPPING
320
+#ifdef BABYSTEPPING
321
+  #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
322
+  #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
323
+  #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
324
+
325
+  #ifdef COREXY
326
+    #error BABYSTEPPING not implemented for COREXY yet.
327
+  #endif
328
+
329
+  #ifdef DELTA
330
+    #ifdef BABYSTEP_XY
331
+      #error BABYSTEPPING only implemented for Z axis on deltabots.
332
+    #endif
333
+  #endif
334
+  
335
+  #ifdef SCARA
336
+    #error BABYSTEPPING not implemented for SCARA yet.
337
+  #endif
338
+  
339
+#endif
340
+
341
+// extruder advance constant (s2/mm3)
342
+//
343
+// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2
344
+//
345
+// Hooke's law says:		force = k * distance
346
+// Bernoulli's principle says:	v ^ 2 / 2 + g . h + pressure / density = constant
347
+// so: v ^ 2 is proportional to number of steps we advance the extruder
348
+#define ADVANCE
349
+
350
+#ifdef ADVANCE
351
+  #define EXTRUDER_ADVANCE_K .0
352
+
353
+  #define D_FILAMENT 1.75
354
+  #define STEPS_MM_E 1000
355
+  #define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
356
+  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA)
357
+
358
+#endif // ADVANCE
359
+
360
+// Arc interpretation settings:
361
+#define MM_PER_ARC_SEGMENT 1
362
+#define N_ARC_CORRECTION 25
363
+
364
+const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
365
+
366
+// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
367
+// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
368
+// in the pins.h file.  When using a push button pulling the pin to ground this will need inverted.  This setting should
369
+// be commented out otherwise
370
+#define SDCARDDETECTINVERTED
371
+
372
+#ifdef ULTIPANEL
373
+ #undef SDCARDDETECTINVERTED
374
+#endif
375
+
376
+// Power Signal Control Definitions
377
+// By default use ATX definition
378
+#ifndef POWER_SUPPLY
379
+  #define POWER_SUPPLY 1
380
+#endif
381
+// 1 = ATX
382
+#if (POWER_SUPPLY == 1)
383
+  #define PS_ON_AWAKE  LOW
384
+  #define PS_ON_ASLEEP HIGH
385
+#endif
386
+// 2 = X-Box 360 203W
387
+#if (POWER_SUPPLY == 2)
388
+  #define PS_ON_AWAKE  HIGH
389
+  #define PS_ON_ASLEEP LOW
390
+#endif
391
+
392
+// Control heater 0 and heater 1 in parallel.
393
+//#define HEATERS_PARALLEL
394
+
395
+//===========================================================================
396
+//=============================Buffers           ============================
397
+//===========================================================================
398
+
399
+// The number of linear motions that can be in the plan at any give time.
400
+// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
401
+#if defined SDSUPPORT
402
+  #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
403
+#else
404
+  #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
405
+#endif
406
+
407
+
408
+//The ASCII buffer for receiving from the serial:
409
+#define MAX_CMD_SIZE 96
410
+#define BUFSIZE 4
411
+
412
+
413
+// Firmware based and LCD controlled retract
414
+// M207 and M208 can be used to define parameters for the retraction.
415
+// The retraction can be called by the slicer using G10 and G11
416
+// until then, intended retractions can be detected by moves that only extrude and the direction.
417
+// the moves are than replaced by the firmware controlled ones.
418
+
419
+// #define FWRETRACT  //ONLY PARTIALLY TESTED
420
+#ifdef FWRETRACT
421
+  #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
422
+  #define RETRACT_LENGTH 3               //default retract length (positive mm)
423
+  #define RETRACT_FEEDRATE 35            //default feedrate for retracting (mm/s)
424
+  #define RETRACT_ZLIFT 0                //default retract Z-lift
425
+  #define RETRACT_RECOVER_LENGTH 0       //default additional recover length (mm, added to retract length when recovering)
426
+  #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
427
+#endif
428
+
429
+//adds support for experimental filament exchange support M600; requires display
430
+#ifdef ULTIPANEL
431
+  #define FILAMENTCHANGEENABLE
432
+  #ifdef FILAMENTCHANGEENABLE
433
+    #define FILAMENTCHANGE_XPOS 3
434
+    #define FILAMENTCHANGE_YPOS 3
435
+    #define FILAMENTCHANGE_ZADD 10
436
+    #define FILAMENTCHANGE_FIRSTRETRACT -2
437
+    #define FILAMENTCHANGE_FINALRETRACT -100
438
+  #endif
439
+#endif
440
+
441
+#ifdef FILAMENTCHANGEENABLE
442
+  #ifdef EXTRUDER_RUNOUT_PREVENT
443
+    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
444
+  #endif
445
+#endif
446
+
447
+//===========================================================================
448
+//=============================  Define Defines  ============================
449
+//===========================================================================
450
+#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
451
+  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
452
+#endif
453
+
454
+#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
455
+  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
456
+#endif
457
+
458
+#if TEMP_SENSOR_0 > 0
459
+  #define THERMISTORHEATER_0 TEMP_SENSOR_0
460
+  #define HEATER_0_USES_THERMISTOR
461
+#endif
462
+#if TEMP_SENSOR_1 > 0
463
+  #define THERMISTORHEATER_1 TEMP_SENSOR_1
464
+  #define HEATER_1_USES_THERMISTOR
465
+#endif
466
+#if TEMP_SENSOR_2 > 0
467
+  #define THERMISTORHEATER_2 TEMP_SENSOR_2
468
+  #define HEATER_2_USES_THERMISTOR
469
+#endif
470
+#if TEMP_SENSOR_BED > 0
471
+  #define THERMISTORBED TEMP_SENSOR_BED
472
+  #define BED_USES_THERMISTOR
473
+#endif
474
+#if TEMP_SENSOR_0 == -1
475
+  #define HEATER_0_USES_AD595
476
+#endif
477
+#if TEMP_SENSOR_1 == -1
478
+  #define HEATER_1_USES_AD595
479
+#endif
480
+#if TEMP_SENSOR_2 == -1
481
+  #define HEATER_2_USES_AD595
482
+#endif
483
+#if TEMP_SENSOR_BED == -1
484
+  #define BED_USES_AD595
485
+#endif
486
+#if TEMP_SENSOR_0 == -2
487
+  #define HEATER_0_USES_MAX6675
488
+#endif
489
+#if TEMP_SENSOR_0 == 0
490
+  #undef HEATER_0_MINTEMP
491
+  #undef HEATER_0_MAXTEMP
492
+#endif
493
+#if TEMP_SENSOR_1 == 0
494
+  #undef HEATER_1_MINTEMP
495
+  #undef HEATER_1_MAXTEMP
496
+#endif
497
+#if TEMP_SENSOR_2 == 0
498
+  #undef HEATER_2_MINTEMP
499
+  #undef HEATER_2_MAXTEMP
500
+#endif
501
+#if TEMP_SENSOR_BED == 0
502
+  #undef BED_MINTEMP
503
+  #undef BED_MAXTEMP
504
+#endif
505
+
506
+
507
+#endif //__CONFIGURATION_ADV_H

+ 75
- 986
Marlin/language.h
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 73
- 3
Marlin/pins.h Ver arquivo

@@ -95,6 +95,76 @@
95 95
 #endif /* 88 */
96 96
 
97 97
 /****************************************************************************************
98
+* Leapfrog Driver board
99
+* 
100
+****************************************************************************************/
101
+#if MOTHERBOARD == 999  // Leapfrog board
102
+#define KNOWN_BOARD 1
103
+
104
+#ifndef __AVR_ATmega1280__
105
+ #ifndef __AVR_ATmega2560__
106
+ #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
107
+ #endif
108
+#endif
109
+
110
+#define X_STEP_PIN         28
111
+#define X_DIR_PIN          63
112
+#define X_ENABLE_PIN       29
113
+#define X_MIN_PIN          47
114
+#define X_MAX_PIN          -1   //2 //Max endstops default to disabled "-1", set to commented value to enable.
115
+
116
+#define Y_STEP_PIN         14 // A6
117
+#define Y_DIR_PIN          15 // A0
118
+#define Y_ENABLE_PIN       39
119
+#define Y_MIN_PIN          48
120
+#define Y_MAX_PIN          -1   //15
121
+
122
+#define Z_STEP_PIN         31 // A2
123
+#define Z_DIR_PIN          32 // A6
124
+#define Z_ENABLE_PIN       30 // A1
125
+#define Z_MIN_PIN          49
126
+#define Z_MAX_PIN          -1
127
+
128
+#define E0_STEP_PIN         34  //34
129
+#define E0_DIR_PIN          35 //35
130
+#define E0_ENABLE_PIN       33 //33
131
+
132
+#define E1_STEP_PIN         37 //37
133
+#define E1_DIR_PIN          40 //40
134
+#define E1_ENABLE_PIN       36 //36
135
+
136
+#define Y2_STEP_PIN         37
137
+#define Y2_DIR_PIN          40
138
+#define Y2_ENABLE_PIN       36
139
+
140
+#define Z2_STEP_PIN         37
141
+#define Z2_DIR_PIN          40
142
+#define Z2_ENABLE_PIN       36
143
+
144
+#define SDPOWER            -1
145
+#define SDSS               11
146
+#define SDCARDDETECT       -1 // 10 optional also used as mode pin
147
+#define LED_PIN            13
148
+#define FAN_PIN            7
149
+#define PS_ON_PIN          -1
150
+#define KILL_PIN           -1
151
+#define SOL1_PIN   16
152
+#define SOL2_PIN    17
153
+
154
+#define HEATER_0_PIN       9
155
+#define HEATER_1_PIN       8 // 12
156
+#define HEATER_2_PIN       11 //-1 // 13
157
+#define TEMP_0_PIN         13 //D27   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
158
+#define TEMP_1_PIN         15 // 1
159
+#define TEMP_2_PIN         -1 // 2
160
+#define HEATER_BED_PIN     10 // 14/15
161
+#define TEMP_BED_PIN       14 // 1,2 or I2C
162
+/*  Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31)  */
163
+
164
+
165
+#endif
166
+
167
+/****************************************************************************************
98 168
 *
99 169
 *
100 170
 ****************************************************************************************/
@@ -823,9 +893,9 @@
823 893
 
824 894
 #ifndef SDSUPPORT
825 895
 // these pins are defined in the SD library if building with SD support
826
-  #define MAX_SCK_PIN          52
827
-  #define MAX_MISO_PIN         50
828
-  #define MAX_MOSI_PIN         51
896
+  #define SCK_PIN          52
897
+  #define MISO_PIN         50
898
+  #define MOSI_PIN         51
829 899
   #define MAX6675_SS       53
830 900
 #else
831 901
   #define MAX6675_SS       49

+ 28
- 3
Marlin/planner.cpp Ver arquivo

@@ -96,6 +96,8 @@ float autotemp_factor=0.1;
96 96
 bool autotemp_enabled=false;
97 97
 #endif
98 98
 
99
+unsigned char g_uc_extruder_last_move[3] = {0,0,0};
100
+
99 101
 //===========================================================================
100 102
 //=================semi-private variables, used in inline  functions    =====
101 103
 //===========================================================================
@@ -662,11 +664,34 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
662 664
   {
663 665
     if (DISABLE_INACTIVE_EXTRUDER) //enable only selected extruder
664 666
     {
667
+
668
+      if(g_uc_extruder_last_move[0] > 0) g_uc_extruder_last_move[0]--;
669
+      if(g_uc_extruder_last_move[1] > 0) g_uc_extruder_last_move[1]--;
670
+      if(g_uc_extruder_last_move[2] > 0) g_uc_extruder_last_move[2]--;
671
+      
665 672
       switch(extruder)
666 673
       {
667
-        case 0: enable_e0(); disable_e1(); disable_e2(); break;
668
-        case 1: disable_e0(); enable_e1(); disable_e2(); break;
669
-        case 2: disable_e0(); disable_e1(); enable_e2(); break;
674
+        case 0: 
675
+          enable_e0(); 
676
+          g_uc_extruder_last_move[0] = BLOCK_BUFFER_SIZE*2;
677
+          
678
+          if(g_uc_extruder_last_move[1] == 0) disable_e1(); 
679
+          if(g_uc_extruder_last_move[2] == 0) disable_e2(); 
680
+        break;
681
+        case 1:
682
+          enable_e1(); 
683
+          g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2;
684
+          
685
+          if(g_uc_extruder_last_move[0] == 0) disable_e0(); 
686
+          if(g_uc_extruder_last_move[2] == 0) disable_e2(); 
687
+        break;
688
+        case 2:
689
+          enable_e2(); 
690
+          g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2;
691
+          
692
+          if(g_uc_extruder_last_move[0] == 0) disable_e0(); 
693
+          if(g_uc_extruder_last_move[1] == 0) disable_e1(); 
694
+        break;        
670 695
       }
671 696
     }
672 697
     else //enable all

+ 16
- 9
Marlin/temperature.cpp Ver arquivo

@@ -34,6 +34,9 @@
34 34
 #include "temperature.h"
35 35
 #include "watchdog.h"
36 36
 
37
+#include "Sd2PinMap.h"
38
+
39
+
37 40
 //===========================================================================
38 41
 //=============================public variables============================
39 42
 //===========================================================================
@@ -748,18 +751,22 @@ void tp_init()
748 751
 
749 752
   #ifdef HEATER_0_USES_MAX6675
750 753
     #ifndef SDSUPPORT
751
-      SET_OUTPUT(MAX_SCK_PIN);
752
-      WRITE(MAX_SCK_PIN,0);
754
+      SET_OUTPUT(SCK_PIN);
755
+      WRITE(SCK_PIN,0);
753 756
     
754
-      SET_OUTPUT(MAX_MOSI_PIN);
755
-      WRITE(MAX_MOSI_PIN,1);
757
+      SET_OUTPUT(MOSI_PIN);
758
+      WRITE(MOSI_PIN,1);
756 759
     
757
-      SET_INPUT(MAX_MISO_PIN);
758
-      WRITE(MAX_MISO_PIN,1);
760
+      SET_INPUT(MISO_PIN);
761
+      WRITE(MISO_PIN,1);
759 762
     #endif
763
+    /* Using pinMode and digitalWrite, as that was the only way I could get it to compile */
760 764
     
761
-    SET_OUTPUT(MAX6675_SS);
762
-    WRITE(MAX6675_SS,1);
765
+    //Have to toggle SD card CS pin to low first, to enable firmware to talk with SD card
766
+	pinMode(SS_PIN, OUTPUT);
767
+	digitalWrite(SS_PIN,0);  
768
+	pinMode(MAX6675_SS, OUTPUT);
769
+	digitalWrite(MAX6675_SS,1);
763 770
   #endif
764 771
 
765 772
   // Set analog inputs
@@ -1045,7 +1052,7 @@ void bed_max_temp_error(void) {
1045 1052
 
1046 1053
 #ifdef HEATER_0_USES_MAX6675
1047 1054
 #define MAX6675_HEAT_INTERVAL 250
1048
-long max6675_previous_millis = -HEAT_INTERVAL;
1055
+long max6675_previous_millis = MAX6675_HEAT_INTERVAL;
1049 1056
 int max6675_temp = 2000;
1050 1057
 
1051 1058
 int read_max6675()

+ 0
- 75
Marlin/thermistortables.h Ver arquivo

@@ -1021,81 +1021,6 @@ const short temptable_1047[][2] PROGMEM = {
1021 1021
   PtLine(300,1000,4700)
1022 1022
 };
1023 1023
 #endif
1024
-#if (THERMISTORHEATER_0 == 70) || (THERMISTORHEATER_1 == 70) || (THERMISTORHEATER_2 == 70) || (THERMISTORBED == 70) // 500C thermistor for Pico hot end
1025
-const short temptable_70[][2] PROGMEM = {
1026
-  {  110.774119598719*OVERSAMPLENR ,  350 },
1027
-  {  118.214386957249*OVERSAMPLENR ,  345 },
1028
-  {  126.211418543166*OVERSAMPLENR ,  340 },
1029
-  {  134.789559066223*OVERSAMPLENR ,  335 },
1030
-  {  144.004513869701*OVERSAMPLENR ,  330 },
1031
-  {  153.884483790827*OVERSAMPLENR ,  325 },
1032
-  {  164.484880793637*OVERSAMPLENR ,  320 },
1033
-  {  175.848885102724*OVERSAMPLENR ,  315 },
1034
-  {  188.006799079015*OVERSAMPLENR ,  310 },
1035
-  {  201.008072969044*OVERSAMPLENR ,  305 },
1036
-  {  214.83716032276*OVERSAMPLENR ,  300 },
1037
-  {  229.784739779664*OVERSAMPLENR ,  295 },
1038
-  {  245.499466045473*OVERSAMPLENR ,  290 },
1039
-  {  262.2766342096*OVERSAMPLENR ,  285 },
1040
-  {  280.073883176433*OVERSAMPLENR ,  280 },
1041
-  {  298.952693467726*OVERSAMPLENR ,  275 },
1042
-  {  318.808251051674*OVERSAMPLENR ,  270 },
1043
-  {  337.490932563222*OVERSAMPLENR ,  265 },
1044
-  {  361.683649122745*OVERSAMPLENR ,  260 },
1045
-  {  384.717024083981*OVERSAMPLENR ,  255 },
1046
-  {  408.659301759076*OVERSAMPLENR ,  250 },
1047
-  {  433.471659455884*OVERSAMPLENR ,  245 },
1048
-  {  459.199039926034*OVERSAMPLENR ,  240 },
1049
-  {  485.566500982316*OVERSAMPLENR ,  235 },
1050
-  {  512.538918631075*OVERSAMPLENR ,  230 },
1051
-  {  539.980999544838*OVERSAMPLENR ,  225 },
1052
-  {  567.783095549935*OVERSAMPLENR ,  220 },
1053
-  {  595.698041673552*OVERSAMPLENR ,  215 },
1054
-  {  623.633922319597*OVERSAMPLENR ,  210 },
1055
-  {  651.356162750829*OVERSAMPLENR ,  205 },
1056
-  {  678.700901620956*OVERSAMPLENR ,  200 },
1057
-  {  705.528145361264*OVERSAMPLENR ,  195 },
1058
-  {  731.61267976339*OVERSAMPLENR ,  190 },
1059
-  {  756.786212184365*OVERSAMPLENR ,  185 },
1060
-  {  780.950223357761*OVERSAMPLENR ,  180 },
1061
-  {  804.012961595082*OVERSAMPLENR ,  175 },
1062
-  {  825.904975939166*OVERSAMPLENR ,  170 },
1063
-  {  846.403941639008*OVERSAMPLENR ,  165 },
1064
-  {  865.52326974895*OVERSAMPLENR ,  160 },
1065
-  {  883.246145367727*OVERSAMPLENR ,  155 },
1066
-  {  899.5821946515*OVERSAMPLENR ,  150 },
1067
-  {  914.544289228582*OVERSAMPLENR ,  145 },
1068
-  {  928.145628221761*OVERSAMPLENR ,  140 },
1069
-  {  940.422208546562*OVERSAMPLENR ,  135 },
1070
-  {  951.456922916497*OVERSAMPLENR ,  130 },
1071
-  {  961.303500633788*OVERSAMPLENR ,  125 },
1072
-  {  970.044756889055*OVERSAMPLENR ,  120 },
1073
-  {  977.761456230051*OVERSAMPLENR ,  115 },
1074
-  {  984.540978083453*OVERSAMPLENR ,  110 },
1075
-  {  990.440780765757*OVERSAMPLENR ,  105 },
1076
-  {  995.589621465301*OVERSAMPLENR ,  100 },
1077
-  {  1000.02514280144*OVERSAMPLENR ,  95 },
1078
-  {  1003.84429789876*OVERSAMPLENR ,  90 },
1079
-  {  1007.10199009318*OVERSAMPLENR ,  85 },
1080
-  {  1009.87151698323*OVERSAMPLENR ,  80 },
1081
-  {  1012.21633594237*OVERSAMPLENR ,  75 },
1082
-  {  1014.18959892949*OVERSAMPLENR ,  70 },
1083
-  {  1015.84079162998*OVERSAMPLENR ,  65 },
1084
-  {  1017.21555915335*OVERSAMPLENR ,  60 },
1085
-  {  1018.35284662863*OVERSAMPLENR ,  55 },
1086
-  {  1019.28926921888*OVERSAMPLENR ,  50 },
1087
-  {  1020.05398015669*OVERSAMPLENR ,  45 },
1088
-  {  1020.67737496272*OVERSAMPLENR ,  40 },
1089
-  {  1021.1802909627*OVERSAMPLENR ,  35 },
1090
-  {  1021.58459281248*OVERSAMPLENR ,  30 },
1091
-  {  1021.90701441192*OVERSAMPLENR ,  25 },
1092
-  {  1022.16215103698*OVERSAMPLENR ,  20 },
1093
-  {  1022.36275529549*OVERSAMPLENR ,  15 },
1094
-  {  1022.51930392497*OVERSAMPLENR ,  10 },
1095
-  {  1022.64051573734*OVERSAMPLENR ,  5 },
1096
-  {  1022.73355805611*OVERSAMPLENR ,  0 }
1097
-};
1098
-#endif
1099 1024
 
1100 1025
 #define _TT_NAME(_N) temptable_ ## _N
1101 1026
 #define TT_NAME(_N) _TT_NAME(_N)

+ 15
- 6
Marlin/ultralcd.cpp Ver arquivo

@@ -19,6 +19,7 @@ int absPreheatHotendTemp;
19 19
 int absPreheatHPBTemp;
20 20
 int absPreheatFanSpeed;
21 21
 
22
+
22 23
 #ifdef ULTIPANEL
23 24
 static float manual_feedrate[] = MANUAL_FEEDRATE;
24 25
 #endif // ULTIPANEL
@@ -255,8 +256,8 @@ static void lcd_sdcard_stop()
255 256
         enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
256 257
     }
257 258
     autotempShutdown();
258
-    
259
-    cancel_heatup = true;
259
+
260
+	cancel_heatup = true;
260 261
 }
261 262
 
262 263
 /* Menu implementation */
@@ -869,6 +870,10 @@ static void lcd_control_motion_menu()
869 870
 #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
870 871
     MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
871 872
 #endif
873
+#ifdef SCARA
874
+    MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2);
875
+    MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS],0.5,2);
876
+#endif
872 877
     END_MENU();
873 878
 }
874 879
 
@@ -904,13 +909,13 @@ static void lcd_control_retract_menu()
904 909
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
905 910
     MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
906 911
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100);
907
-    #if EXTRUDERS > 1
912
+	#if EXTRUDERS > 1
908 913
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100);
909 914
     #endif
910 915
     MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999);
911 916
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999);
912 917
     MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100);
913
-    #if EXTRUDERS > 1
918
+	#if EXTRUDERS > 1
914 919
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
915 920
     #endif
916 921
     MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
@@ -1515,9 +1520,13 @@ char *itostr31(const int &xx)
1515 1520
   return conv;
1516 1521
 }
1517 1522
 
1518
-char *itostr3(const int &xx)
1523
+char *itostr3(const int &x)
1519 1524
 {
1520
-  if (xx >= 100)
1525
+  int xx = x;
1526
+  if (xx < 0) {
1527
+     conv[0]='-';
1528
+     xx = -xx;
1529
+  } else if (xx >= 100)
1521 1530
     conv[0]=(xx/100)%10+'0';
1522 1531
   else
1523 1532
     conv[0]=' ';

+ 76
- 30
README.md Ver arquivo

@@ -1,8 +1,8 @@
1 1
 ==========================
2 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)
5
-
4
+[![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224)
5
+
6 6
 Marlin has a GPL license because I believe in open development.
7 7
 Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent.
8 8
 
@@ -47,6 +47,7 @@ Features:
47 47
 *   PID tuning
48 48
 *   CoreXY kinematics (www.corexy.com/theory.html)
49 49
 *   Delta kinematics
50
+*   SCARA kinematics
50 51
 *   Dual X-carriage support for multiple extruder systems
51 52
 *   Configurable serial port to support connection of wireless adaptors.
52 53
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
@@ -159,6 +160,8 @@ Implemented G Codes:
159 160
 *  G28 - Home all Axis
160 161
 *  G29 - Detailed Z-Probe, probes the bed at 3 points.  You must de at the home position for this to work correctly.
161 162
 *  G30 - Single Z Probe, probes bed at current XY location.
163
+*  G31 - Dock Z Probe sled (if enabled)
164
+*  G32 - Undock Z Probe sled (if enabled)
162 165
 *  G90 - Use Absolute Coordinates
163 166
 *  G91 - Use Relative Coordinates
164 167
 *  G92 - Set current position to cordinates given
@@ -207,15 +210,15 @@ M Codes
207 210
 *  M140 - Set bed target temp
208 211
 *  M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
209 212
 *         Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
210
-*  M200 D<millimeters>- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).
213
+*  M200 D<millimeters>- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).
211 214
 *  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
212 215
 *  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
213 216
 *  M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
214 217
 *  M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2  also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate
215 218
 *  M205 -  advanced settings:  minimum travel speed S=while printing T=travel only,  B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
216 219
 *  M206 - set additional homeing offset
217
-*  M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
218
-*  M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
220
+*  M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
221
+*  M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
219 222
 *  M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
220 223
 *  M218 - set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
221 224
 *  M220 S<factor in percent>- set speed factor override percentage
@@ -272,8 +275,46 @@ That's ok.  Enjoy Silky Smooth Printing.
272 275
 ===============================================
273 276
 Instructions for configuring Bed Auto Leveling
274 277
 ===============================================
278
+There are two options for this feature. You may choose to use a servo mounted on the X carriage or you may use a sled that mounts on the X axis and can be docked when not in use.
279
+See the section for each option below for specifics about installation and configuration. Also included are instructions that apply to both options.
280
+
281
+Note for RAMPS users:
282
+---------------------
283
+
284
+By default, RAMPS have no power on servo bus (if you happen to have a multimeter, check the voltage on servo power pins).
285
+In order to get the servo working, you need to supply 5V to 5V pin.. You can do it using your power supply (if it has a 5V output) or jumping the "Vcc" from Arduino to the 5V RAMPS rail.
286
+These 2 pins are located just between the Reset Button and the yellow fuses... There are marks in the board showing 5V and VCC.. just connect them..
287
+If jumping the arduino Vcc do RAMPS 5V rail, take care to not use a power hungry servo, otherwise you will cause a blackout in the arduino board ;-)
288
+
289
+Instructions for Both Options
290
+-----------------------------
291
+
275 292
 Uncomment the "ENABLE_AUTO_BED_LEVELING" define (commented by default)
276 293
 
294
+The following options define the probing positions. These are good starting values.
295
+I recommend to keep a better clearance from borders in the first run and then make the probes as close as possible to borders:
296
+
297
+* \#define LEFT_PROBE_BED_POSITION 30
298
+* \#define RIGHT_PROBE_BED_POSITION 140
299
+* \#define BACK_PROBE_BED_POSITION 140
300
+* \#define FRONT_PROBE_BED_POSITION 30
301
+
302
+A few more options:
303
+
304
+* \#define XY_TRAVEL_SPEED 6000
305
+
306
+X and Y axis travel speed between probes, in mm/min.
307
+Bear in mind that really fast moves may render step skipping. 6000 mm/min (100mm/s) is a good value.
308
+
309
+* \#define Z_RAISE_BEFORE_PROBING 10
310
+* \#define Z_RAISE_BETWEEN_PROBINGS 10
311
+
312
+The Z axis is lifted when traveling to the first probe point by Z_RAISE_BEFORE_PROBING value
313
+and then lifted when traveling from first to second and second to third point by Z_RAISE_BETWEEN_PROBINGS.
314
+All values are in mm as usual.
315
+
316
+Servo Option Notes
317
+------------------
277 318
 You will probably need a swivel Z-MIN endstop in the extruder. A rc servo do a great job.
278 319
 Check the system working here: http://www.youtube.com/watch?v=3IKMeOYz-1Q (Enable English subtitles)
279 320
 Teasing ;-) video: http://www.youtube.com/watch?v=x8eqSQNAyro
@@ -286,20 +327,10 @@ In order to get the servo working, you need to enable:
286 327
 
287 328
 * \#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 165,60} // X,Y,Z Axis Extend and Retract angles
288 329
 
289
-
290 330
 The first define tells firmware how many servos you have.
291 331
 The second tells what axis this servo will be attached to. In the example above, we have a servo in Z axis.
292 332
 The third one tells the angle in 2 situations: Probing (165º) and resting (60º). Check this with command M280 P0 S{angle} (example: M280 P0 S60 moves the servo to 60º)
293 333
 
294
-For RAMPS users:
295
-----------------
296
-
297
-By default, RAMPS have no power on servo bus (if you happen to have a multimeter, check the voltage on servo power pins).
298
-In order to get the servo working, you need to supply 5V to 5V pin.. You can do it using your power supply (if it has a 5V output) or jumping the "Vcc" from Arduino to the 5V RAMPS rail.
299
-These 2 pins are located just between the Reset Button and the yellow fuses... There are marks in the board showing 5V and VCC.. just connect them..
300
-If jumping the arduino Vcc do RAMPS 5V rail, take care to not use a power hungry servo, otherwise you will cause a blackout in the arduino board ;-)
301
-
302
-
303 334
 Next you need to define the Z endstop (probe) offset from hotend.
304 335
 My preferred method:
305 336
 
@@ -317,27 +348,42 @@ My preferred method:
317 348
 * \#define Z_PROBE_OFFSET_FROM_EXTRUDER -5.1
318 349
 
319 350
 
320
-The following options define the probing positions. These are good starting values.
321
-I recommend to keep a better clearance from borders in the first run and then make the probes as close as possible to borders:
351
+Sled Option Notes
352
+-----------------
353
+The sled option uses an electromagnet to attach and detach to/from the X carriage. See http://www.thingiverse.com/thing:396692 for more details on how to print and install this feature. It uses the same connections as the servo option.
322 354
 
323
-* \#define LEFT_PROBE_BED_POSITION 30
324
-* \#define RIGHT_PROBE_BED_POSITION 140
325
-* \#define BACK_PROBE_BED_POSITION 140
326
-* \#define FRONT_PROBE_BED_POSITION 30
355
+To use the sled option, you must define two additional things in Configuration.h:
327 356
 
328
-A few more options:
357
+* \#define Z_PROBE_SLED
358
+* \#define SLED_DOCKING_OFFSET 5
329 359
 
330
-* \#define XY_TRAVEL_SPEED 6000
360
+Uncomment the Z_PROBE_SLED to define to enable the sled (commented out by default).
331 361
 
332
-X and Y axis travel speed between probes, in mm/min.
333
-Bear in mind that really fast moves may render step skipping. 6000 mm/min (100mm/s) is a good value.
362
+Uncomment the SLED_DOCKING_OFFSET to set the extra distance the X axis must travel to dock the sled. This value can be found by moving the X axis to its maximum position then measure the distance to the right X end and subtract the width of the sled (23mm if you printed the sled from Thingiverse).
334 363
 
335
-* \#define Z_RAISE_BEFORE_PROBING 10
336
-* \#define Z_RAISE_BETWEEN_PROBINGS 10
364
+Next you need to define the Z endstop (probe) offset from hotend.
365
+My preferred method:
337 366
 
338
-The Z axis is lifted when traveling to the first probe point by Z_RAISE_BEFORE_PROBING value
339
-and then lifted when traveling from first to second and second to third point by Z_RAISE_BETWEEN_PROBINGS.
340
-All values are in mm as usual. 
367
+* a) Home the X and Y axes.
368
+* b) Move the X axis to about the center of the print bed. Make a mark on the print bed.
369
+* c) Move the Y axis to the maximum position. Make another mark.
370
+* d) Home the X axis and use a straight edge to make a line between the two points.
371
+* e) Repeat (b)-(d) reversing the X and Y. When you are done you will have two lines on the print bed. We will use these to measure the offset for the Z probe endstop.
372
+* f) Move the nozzle so that it is positioned on the center point of the two lines. You can use fine movement of 0.1mm to get it as close as possible. Note the position of X and Y.
373
+* g) Zero the Z axis with the G92 Z0 command.
374
+* h) Raise the Z axis about 20mmm.
375
+* i) Use the G32 command to retrieve the sled.
376
+* j) Now more the X and Y axis to the position recorded in (f).
377
+* k) Lower the Z axis in 0.1mm steps until you hear the "click" meaning the mechanical endstop was trigged. You can confirm with the M119 command. Note the position of the Z axis.
378
+* l) Make a mark on the print bed where the endstop lever has touched the print bed. Raise the Z-axis about 30mm to give yourself some room.
379
+* m) Now measure the distance from the center point to the endstop impact site along the X and Y axis using the lines drawn previously.
380
+* n) Fill in the values below. If the endstop mark is in front of the line running left-to-right, use positive values. If it is behind, use negative values. For the Z axis use the value from (k) and subtract 0.1mm.
381
+
382
+For example, suppose you measured the endstop position and it was 20mm to the right of the line running front-to-back, 10mm toward the front of the line running left-to-right, and the value from (k) was 2.85. The values for the defines would be:
383
+
384
+* \#define X_PROBE_OFFSET_FROM_EXTRUDER 20
385
+* \#define Y_PROBE_OFFSET_FROM_EXTRUDER 10
386
+* \#define Z_PROBE_OFFSET_FROM_EXTRUDER 2.75
341 387
 
342 388
 That's it.. enjoy never having to calibrate your Z endstop neither leveling your bed by hand anymore ;-)
343 389
 

Carregando…
Cancelar
Salvar