Browse Source

Merge remote-tracking branch 'upstream/Development' into Development

CONSULitAS 10 years ago
parent
commit
045ea42cc8
40 changed files with 2177 additions and 5137 deletions
  1. BIN
      Documentation/Logo/marlinwiki.png
  2. 29
    0
      Documentation/changelog.md
  3. 405
    0
      Marlin/Conditionals.h
  4. 9
    144
      Marlin/Configuration.h
  5. 22
    0
      Marlin/ConfigurationStore.cpp
  6. 70
    242
      Marlin/Configuration_adv.h
  7. 29
    33
      Marlin/Marlin.h
  8. 73
    78
      Marlin/Marlin_main.cpp
  9. 254
    0
      Marlin/SanityCheck.h
  10. 2
    3
      Marlin/Sd2PinMap.h
  11. 33
    157
      Marlin/configurator/config/Configuration.h
  12. 10
    211
      Marlin/configurator/config/Configuration_adv.h
  13. 33
    170
      Marlin/example_configurations/Felix/Configuration.h
  14. 33
    169
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  15. 11
    186
      Marlin/example_configurations/Felix/Configuration_adv.h
  16. 34
    152
      Marlin/example_configurations/Hephestos/Configuration.h
  17. 10
    201
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  18. 34
    152
      Marlin/example_configurations/K8200/Configuration.h
  19. 11
    206
      Marlin/example_configurations/K8200/Configuration_adv.h
  20. 34
    152
      Marlin/example_configurations/SCARA/Configuration.h
  21. 11
    197
      Marlin/example_configurations/SCARA/Configuration_adv.h
  22. 34
    152
      Marlin/example_configurations/WITBOX/Configuration.h
  23. 10
    201
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  24. 34
    152
      Marlin/example_configurations/delta/generic/Configuration.h
  25. 9
    207
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  26. 34
    152
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  27. 9
    207
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  28. 34
    152
      Marlin/example_configurations/makibox/Configuration.h
  29. 10
    190
      Marlin/example_configurations/makibox/Configuration_adv.h
  30. 34
    152
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  31. 10
    186
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  32. 1
    2
      Marlin/language.h
  33. 29
    2
      Marlin/pins.h
  34. 515
    648
      Marlin/planner.cpp
  35. 50
    62
      Marlin/planner.h
  36. 147
    69
      Marlin/stepper.cpp
  37. 6
    0
      Marlin/stepper.h
  38. 49
    129
      Marlin/temperature.cpp
  39. 3
    8
      Marlin/ultralcd.cpp
  40. 12
    13
      Marlin/ultralcd.h

BIN
Documentation/Logo/marlinwiki.png View File


+ 29
- 0
Documentation/changelog.md View File

@@ -1 +1,30 @@
1
+### Version 1.0.3
2
+* Reduced code size, maybe a lot depending on your configuration.
3
+* Improved support for Delta, SCARA, and COREXY kinematics.
4
+* Move parts of Configuration files to `Conditionals.h` and `SanityCheck.h`.
5
+* Clean up of temperature code.
6
+* Enhanced `G29` with improved grid bed leveling based on Roxy code. See documentation.
7
+* Various bugs fixed from 1.0.2.
8
+* EEPROM layout updated to `V17`.
9
+* Added `M204` travel acceleration options.
10
+* `M204` "`P`" parameter replaces "`S`." "`S`" retained for backward compatibility.
11
+* Support for more RAMPS-based boards.
12
+* Configurator utility under development.
13
+* `M404` "`N`" parameter replaced with "`W`." ("`N`" is for line numbers only).
14
+* Much cleanup of the code.
15
+* Improved support for Cyrillic and accented languages.
16
+* LCD controller knob acceleration.
17
+* Improved compatibility with various sensors, MAX6675 thermocouple.
18
+* Filament runout sensor support.
19
+* Filament width measurement support.
20
+* Support for TMC and L6470 stepper drivers.
21
+* Better support of G-Code `;` comments, `\`, `N` line numbers, and `*` checksums.
22
+* Moved GCode handling code into individual functions per-code.
1 23
 
24
+### Version 1.0.2
25
+* Progress bar for character-based LCD displays.
26
+
27
+### Version 1.0.1
28
+
29
+### Version 1.0.0
30
+* Initial release

+ 405
- 0
Marlin/Conditionals.h View File

@@ -0,0 +1,405 @@
1
+/**
2
+ * Conditionals.h
3
+ * Defines that depend on configuration but are not editable.
4
+ */
5
+#ifndef CONDITIONALS_H
6
+
7
+#ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first
8
+
9
+  #define CONFIGURATION_LCD
10
+
11
+  #if defined(MAKRPANEL)
12
+    #define DOGLCD
13
+    #define SDSUPPORT
14
+    #define DEFAULT_LCD_CONTRAST 17
15
+    #define ULTIPANEL
16
+    #define NEWPANEL
17
+  #endif
18
+
19
+  #if defined(miniVIKI) || defined(VIKI2)
20
+    #define ULTRA_LCD  //general LCD support, also 16x2
21
+    #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
22
+    #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
23
+
24
+    #ifdef miniVIKI
25
+      #define DEFAULT_LCD_CONTRAST 95
26
+    #else
27
+      #define DEFAULT_LCD_CONTRAST 40
28
+    #endif
29
+
30
+    #define ENCODER_PULSES_PER_STEP 4
31
+    #define ENCODER_STEPS_PER_MENU_ITEM 1
32
+  #endif
33
+
34
+  #ifdef PANEL_ONE
35
+    #define SDSUPPORT
36
+    #define ULTIMAKERCONTROLLER
37
+  #endif
38
+
39
+  #ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
40
+    #define DOGLCD
41
+    #define U8GLIB_ST7920
42
+    #define REPRAP_DISCOUNT_SMART_CONTROLLER
43
+  #endif
44
+
45
+  #if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
46
+    #define ULTIPANEL
47
+    #define NEWPANEL
48
+  #endif
49
+
50
+  #ifdef REPRAPWORLD_KEYPAD
51
+    #define ULTIPANEL
52
+    #define NEWPANEL
53
+  #endif
54
+
55
+  #ifdef RA_CONTROL_PANEL
56
+    #define LCD_I2C_TYPE_PCA8574
57
+    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
58
+    #define ULTIPANEL
59
+    #define NEWPANEL
60
+  #endif
61
+
62
+  /**
63
+   * I2C PANELS
64
+   */
65
+
66
+  #ifdef LCD_I2C_SAINSMART_YWROBOT
67
+    // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
68
+    // Make sure it is placed in the Arduino libraries directory.
69
+    #define LCD_I2C_TYPE_PCF8575
70
+    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
71
+    #define ULTIPANEL
72
+    #define NEWPANEL
73
+  #endif
74
+
75
+  // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
76
+  #ifdef LCD_I2C_PANELOLU2
77
+    // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
78
+    // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
79
+    // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
80
+    // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
81
+    //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
82
+    #define LCD_I2C_TYPE_MCP23017
83
+    #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
84
+    #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
85
+
86
+    #ifndef ENCODER_PULSES_PER_STEP
87
+      #define ENCODER_PULSES_PER_STEP 4
88
+    #endif
89
+
90
+    #ifndef ENCODER_STEPS_PER_MENU_ITEM
91
+      #define ENCODER_STEPS_PER_MENU_ITEM 1
92
+    #endif
93
+
94
+    #ifdef LCD_USE_I2C_BUZZER
95
+      #define LCD_FEEDBACK_FREQUENCY_HZ 1000
96
+      #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
97
+    #endif
98
+
99
+    #define ULTIPANEL
100
+    #define NEWPANEL
101
+  #endif
102
+
103
+  // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
104
+  #ifdef LCD_I2C_VIKI
105
+    // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
106
+    // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
107
+    // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
108
+    //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
109
+    #define LCD_I2C_TYPE_MCP23017
110
+    #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
111
+    #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
112
+    #define ULTIPANEL
113
+    #define NEWPANEL
114
+  #endif
115
+
116
+  // Shift register panels
117
+  // ---------------------
118
+  // 2 wire Non-latching LCD SR from:
119
+  // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
120
+
121
+  #ifdef SAV_3DLCD
122
+     #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
123
+     #define ULTIPANEL
124
+     #define NEWPANEL
125
+  #endif
126
+
127
+
128
+  #ifdef ULTIPANEL
129
+    #define NEWPANEL  //enable this if you have a click-encoder panel
130
+    #define SDSUPPORT
131
+    #define ULTRA_LCD
132
+    #ifdef DOGLCD // Change number of lines to match the DOG graphic display
133
+      #define LCD_WIDTH 22
134
+      #define LCD_HEIGHT 5
135
+    #else
136
+      #define LCD_WIDTH 20
137
+      #define LCD_HEIGHT 4
138
+    #endif
139
+  #else //no panel but just LCD
140
+    #ifdef ULTRA_LCD
141
+    #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
142
+      #define LCD_WIDTH 22
143
+      #define LCD_HEIGHT 5
144
+    #else
145
+      #define LCD_WIDTH 16
146
+      #define LCD_HEIGHT 2
147
+    #endif
148
+    #endif
149
+  #endif
150
+
151
+  /**
152
+   * Default LCD contrast for dogm-like LCD displays
153
+   */
154
+  #if defined(DOGLCD) && !defined(DEFAULT_LCD_CONTRAST)
155
+    #define DEFAULT_LCD_CONTRAST 32
156
+  #endif
157
+
158
+#else // CONFIGURATION_LCD
159
+
160
+  #define CONDITIONALS_H
161
+
162
+  #ifndef AT90USB
163
+    #define HardwareSerial_h // trick to disable the standard HWserial
164
+  #endif
165
+
166
+  #if (ARDUINO >= 100)
167
+    #include "Arduino.h"
168
+  #else
169
+    #include "WProgram.h"
170
+  #endif
171
+
172
+  #include "pins.h"
173
+
174
+  /**
175
+   * ENDSTOPPULLUPS
176
+   */
177
+  #ifdef ENDSTOPPULLUPS
178
+    #ifndef DISABLE_MAX_ENDSTOPS
179
+      #define ENDSTOPPULLUP_XMAX
180
+      #define ENDSTOPPULLUP_YMAX
181
+      #define ENDSTOPPULLUP_ZMAX
182
+    #endif
183
+    #ifndef DISABLE_MIN_ENDSTOPS
184
+      #define ENDSTOPPULLUP_XMIN
185
+      #define ENDSTOPPULLUP_YMIN
186
+      #define ENDSTOPPULLUP_ZMIN
187
+    #endif
188
+  #endif
189
+
190
+  /**
191
+   * Axis lengths
192
+   */
193
+  #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
194
+  #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
195
+  #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
196
+
197
+  /**
198
+   * SCARA
199
+   */
200
+  #ifdef SCARA
201
+    #undef SLOWDOWN
202
+    #define QUICK_HOME //SCARA needs Quickhome
203
+  #endif
204
+
205
+  /**
206
+   * AUTOSET LOCATIONS OF LIMIT SWITCHES
207
+   * Added by ZetaPhoenix 09-15-2012
208
+   */
209
+  #ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
210
+    #define X_HOME_POS MANUAL_X_HOME_POS
211
+    #define Y_HOME_POS MANUAL_Y_HOME_POS
212
+    #define Z_HOME_POS MANUAL_Z_HOME_POS
213
+  #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits
214
+    #ifdef BED_CENTER_AT_0_0
215
+      #define X_HOME_POS X_MAX_LENGTH * X_HOME_DIR * 0.5
216
+      #define Y_HOME_POS Y_MAX_LENGTH * Y_HOME_DIR * 0.5
217
+    #else
218
+      #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
219
+      #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
220
+    #endif
221
+    #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS)
222
+  #endif //!MANUAL_HOME_POSITIONS
223
+
224
+  /**
225
+   * Auto Bed Leveling
226
+   */
227
+  #ifdef ENABLE_AUTO_BED_LEVELING
228
+    // Boundaries for probing based on set limits
229
+    #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
230
+    #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
231
+    #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
232
+    #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
233
+  #endif
234
+
235
+  /**
236
+   * MAX_STEP_FREQUENCY differs for TOSHIBA
237
+   */
238
+  #ifdef CONFIG_STEPPERS_TOSHIBA
239
+    #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
240
+  #else
241
+    #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
242
+  #endif
243
+
244
+  // MS1 MS2 Stepper Driver Microstepping mode table
245
+  #define MICROSTEP1 LOW,LOW
246
+  #define MICROSTEP2 HIGH,LOW
247
+  #define MICROSTEP4 LOW,HIGH
248
+  #define MICROSTEP8 HIGH,HIGH
249
+  #define MICROSTEP16 HIGH,HIGH
250
+
251
+  /**
252
+   * Advance calculated values
253
+   */
254
+  #ifdef ADVANCE
255
+    #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
256
+    #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA)
257
+  #endif
258
+
259
+  #ifdef ULTIPANEL
260
+   #undef SDCARDDETECTINVERTED
261
+  #endif
262
+
263
+  // Power Signal Control Definitions
264
+  // By default use ATX definition
265
+  #ifndef POWER_SUPPLY
266
+    #define POWER_SUPPLY 1
267
+  #endif
268
+  // 1 = ATX
269
+  #if (POWER_SUPPLY == 1)
270
+    #define PS_ON_AWAKE  LOW
271
+    #define PS_ON_ASLEEP HIGH
272
+  #endif
273
+  // 2 = X-Box 360 203W
274
+  #if (POWER_SUPPLY == 2)
275
+    #define PS_ON_AWAKE  HIGH
276
+    #define PS_ON_ASLEEP LOW
277
+  #endif
278
+
279
+  /**
280
+   * Temp Sensor defines
281
+   */
282
+  #if TEMP_SENSOR_0 == -2
283
+    #define HEATER_0_USES_MAX6675
284
+  #elif TEMP_SENSOR_0 == -1
285
+    #define HEATER_0_USES_AD595
286
+  #elif TEMP_SENSOR_0 == 0
287
+    #undef HEATER_0_MINTEMP
288
+    #undef HEATER_0_MAXTEMP
289
+  #elif TEMP_SENSOR_0 > 0
290
+    #define THERMISTORHEATER_0 TEMP_SENSOR_0
291
+    #define HEATER_0_USES_THERMISTOR
292
+  #endif
293
+
294
+  #if TEMP_SENSOR_1 == -1
295
+    #define HEATER_1_USES_AD595
296
+  #elif TEMP_SENSOR_1 == 0
297
+    #undef HEATER_1_MINTEMP
298
+    #undef HEATER_1_MAXTEMP
299
+  #elif TEMP_SENSOR_1 > 0
300
+    #define THERMISTORHEATER_1 TEMP_SENSOR_1
301
+    #define HEATER_1_USES_THERMISTOR
302
+  #endif
303
+
304
+  #if TEMP_SENSOR_2 == -1
305
+    #define HEATER_2_USES_AD595
306
+  #elif TEMP_SENSOR_2 == 0
307
+    #undef HEATER_2_MINTEMP
308
+    #undef HEATER_2_MAXTEMP
309
+  #elif TEMP_SENSOR_2 > 0
310
+    #define THERMISTORHEATER_2 TEMP_SENSOR_2
311
+    #define HEATER_2_USES_THERMISTOR
312
+  #endif
313
+
314
+  #if TEMP_SENSOR_3 == -1
315
+    #define HEATER_3_USES_AD595
316
+  #elif TEMP_SENSOR_3 == 0
317
+    #undef HEATER_3_MINTEMP
318
+    #undef HEATER_3_MAXTEMP
319
+  #elif TEMP_SENSOR_3 > 0
320
+    #define THERMISTORHEATER_3 TEMP_SENSOR_3
321
+    #define HEATER_3_USES_THERMISTOR
322
+  #endif
323
+
324
+  #if TEMP_SENSOR_BED == -1
325
+    #define BED_USES_AD595
326
+  #elif TEMP_SENSOR_BED == 0
327
+    #undef BED_MINTEMP
328
+    #undef BED_MAXTEMP
329
+  #elif TEMP_SENSOR_BED > 0
330
+    #define THERMISTORBED TEMP_SENSOR_BED
331
+    #define BED_USES_THERMISTOR
332
+  #endif
333
+
334
+  /**
335
+   * ARRAY_BY_EXTRUDERS based on EXTRUDERS
336
+   */
337
+  #if EXTRUDERS > 3
338
+    #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3, v4 }
339
+  #elif EXTRUDERS > 2
340
+    #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3 }
341
+  #elif EXTRUDERS > 1
342
+    #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2 }
343
+  #else
344
+    #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1 }
345
+  #endif
346
+
347
+  /**
348
+   * Shorthand for pin tests, for temperature.cpp
349
+   */
350
+  #define HAS_TEMP_0 (defined(TEMP_0_PIN) && TEMP_0_PIN >= 0)
351
+  #define HAS_TEMP_1 (defined(TEMP_1_PIN) && TEMP_1_PIN >= 0)
352
+  #define HAS_TEMP_2 (defined(TEMP_2_PIN) && TEMP_2_PIN >= 0)
353
+  #define HAS_TEMP_3 (defined(TEMP_3_PIN) && TEMP_3_PIN >= 0)
354
+  #define HAS_TEMP_BED (defined(TEMP_BED_PIN) && TEMP_BED_PIN >= 0)
355
+  #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
356
+  #define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0)
357
+  #define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0)
358
+  #define HAS_HEATER_2 (defined(HEATER_2_PIN) && HEATER_2_PIN >= 0)
359
+  #define HAS_HEATER_3 (defined(HEATER_3_PIN) && HEATER_3_PIN >= 0)
360
+  #define HAS_HEATER_BED (defined(HEATER_BED_PIN) && HEATER_BED_PIN >= 0)
361
+  #define HAS_AUTO_FAN_0 (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN >= 0)
362
+  #define HAS_AUTO_FAN_1 (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN >= 0)
363
+  #define HAS_AUTO_FAN_2 (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN >= 0)
364
+  #define HAS_AUTO_FAN_3 (defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN >= 0)
365
+  #define HAS_AUTO_FAN HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3
366
+  #define HAS_FAN (defined(FAN_PIN) && FAN_PIN >= 0)
367
+
368
+  /**
369
+   * Helper Macros for heaters and extruder fan
370
+   */
371
+  #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
372
+  #if EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
373
+    #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
374
+    #if EXTRUDERS > 2
375
+      #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
376
+      #if EXTRUDERS > 3
377
+        #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v)
378
+      #endif
379
+    #endif
380
+  #endif
381
+  #ifdef HEATERS_PARALLEL
382
+    #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
383
+  #else
384
+    #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
385
+  #endif
386
+  #if HAS_HEATER_BED
387
+    #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, v)
388
+  #endif
389
+  #if HAS_FAN
390
+    #define WRITE_FAN(v) WRITE(FAN_PIN, v)
391
+  #endif
392
+
393
+  /**
394
+   * Sampling period of the temperature routine
395
+   * This override comes originally from temperature.cpp
396
+   * The Configuration.h option is basically ignored.
397
+   */
398
+  #ifdef PID_dT
399
+    #undef PID_dT
400
+  #endif
401
+  #define PID_dT ((OVERSAMPLENR * 12.0)/(F_CPU / 64.0 / 256.0))
402
+
403
+
404
+#endif //CONFIGURATION_LCD
405
+#endif //CONDITIONALS_H

+ 9
- 144
Marlin/Configuration.h View File

@@ -360,10 +360,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
360 360
 #define Y_MAX_POS 200
361 361
 #define Z_MAX_POS 200
362 362
 
363
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
364
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
365
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
366
-
367 363
 //===========================================================================
368 364
 //============================= Filament Runout Sensor ======================
369 365
 //===========================================================================
@@ -624,112 +620,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
624 620
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
625 621
 //#define RA_CONTROL_PANEL
626 622
 
627
-//automatic expansion
628
-#if defined (MAKRPANEL)
629
- #define DOGLCD
630
- #define SDSUPPORT
631
- #define ULTIPANEL
632
- #define NEWPANEL
633
- #define DEFAULT_LCD_CONTRAST 17
634
-#endif
635
-
636
-#if defined(miniVIKI) || defined(VIKI2)
637
- #define ULTRA_LCD  //general LCD support, also 16x2
638
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
639
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
640
- 
641
-  #ifdef miniVIKI
642
-   #define DEFAULT_LCD_CONTRAST 95
643
-  #else
644
-   #define DEFAULT_LCD_CONTRAST 40
645
-  #endif
646
-  
647
- #define ENCODER_PULSES_PER_STEP 4
648
- #define ENCODER_STEPS_PER_MENU_ITEM 1
649
-#endif
650
-
651
-#if defined (PANEL_ONE)
652
- #define SDSUPPORT
653
- #define ULTIMAKERCONTROLLER
654
-#endif
655
-
656
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
657
- #define DOGLCD
658
- #define U8GLIB_ST7920
659
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
660
-#endif
661
-
662
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
663
- #define ULTIPANEL
664
- #define NEWPANEL
665
-#endif
666
-
667
-#if defined(REPRAPWORLD_KEYPAD)
668
-  #define NEWPANEL
669
-  #define ULTIPANEL
670
-#endif
671
-#if defined(RA_CONTROL_PANEL)
672
- #define ULTIPANEL
673
- #define NEWPANEL
674
- #define LCD_I2C_TYPE_PCA8574
675
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
676
-#endif
677
-
678
-//I2C PANELS
623
+/**
624
+ * I2C Panels
625
+ */
679 626
 
680 627
 //#define LCD_I2C_SAINSMART_YWROBOT
681
-#ifdef LCD_I2C_SAINSMART_YWROBOT
682
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
683
-  // Make sure it is placed in the Arduino libraries directory.
684
-  #define LCD_I2C_TYPE_PCF8575
685
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
686
-  #define NEWPANEL
687
-  #define ULTIPANEL
688
-#endif
689 628
 
690 629
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
691 630
 //#define LCD_I2C_PANELOLU2
692
-#ifdef LCD_I2C_PANELOLU2
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
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
696
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
697
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
698
-  #define LCD_I2C_TYPE_MCP23017
699
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
700
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
701
-  #define NEWPANEL
702
-  #define ULTIPANEL
703
-
704
-  #ifndef ENCODER_PULSES_PER_STEP
705
-	#define ENCODER_PULSES_PER_STEP 4
706
-  #endif
707
-
708
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
709
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
710
-  #endif
711
-
712
-
713
-  #ifdef LCD_USE_I2C_BUZZER
714
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
715
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
716
-  #endif
717
-
718
-#endif
719 631
 
720 632
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
721 633
 //#define LCD_I2C_VIKI
722
-#ifdef LCD_I2C_VIKI
723
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
724
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
725
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
726
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
727
-  #define LCD_I2C_TYPE_MCP23017
728
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
729
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
730
-  #define NEWPANEL
731
-  #define ULTIPANEL
732
-#endif
733 634
 
734 635
 // Shift register panels
735 636
 // ---------------------
@@ -737,51 +638,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
737 638
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
738 639
 
739 640
 //#define SAV_3DLCD
740
-#ifdef SAV_3DLCD
741
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
742
-   #define NEWPANEL
743
-   #define ULTIPANEL
744
-#endif
745
-
746
-
747
-#ifdef ULTIPANEL
748
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
749
-  #define SDSUPPORT
750
-  #define ULTRA_LCD
751
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
752
-    #define LCD_WIDTH 22
753
-    #define LCD_HEIGHT 5
754
-  #else
755
-    #define LCD_WIDTH 20
756
-    #define LCD_HEIGHT 4
757
-  #endif
758
-#else //no panel but just LCD
759
-  #ifdef ULTRA_LCD
760
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
761
-    #define LCD_WIDTH 22
762
-    #define LCD_HEIGHT 5
763
-  #else
764
-    #define LCD_WIDTH 16
765
-    #define LCD_HEIGHT 2
766
-  #endif
767
-  #endif
768
-#endif
769
-
770
-// default LCD contrast for dogm-like LCD displays
771
-#ifdef DOGLCD
772
-# ifndef DEFAULT_LCD_CONTRAST
773
-#  define DEFAULT_LCD_CONTRAST 32
774
-# endif
775
-#endif
776 641
 
777 642
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
778 643
 //#define FAST_PWM_FAN
779 644
 
780
-// Temperature status LEDs that display the hotend and bet temperature.
781
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
782
-// Otherwise the RED led is on. There is 1C hysteresis.
783
-//#define TEMP_STAT_LEDS
784
-
785 645
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
786 646
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
787 647
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -793,6 +653,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
793 653
 // at zero value, there are 128 effective control positions.
794 654
 #define SOFT_PWM_SCALE 0
795 655
 
656
+// Temperature status LEDs that display the hotend and bet temperature.
657
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
658
+// Otherwise the RED led is on. There is 1C hysteresis.
659
+//#define TEMP_STAT_LEDS
660
+
796 661
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
797 662
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
798 663
 // #define PHOTOGRAPH_PIN     23
@@ -864,4 +729,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
864 729
 #include "Configuration_adv.h"
865 730
 #include "thermistortables.h"
866 731
 
867
-#endif //__CONFIGURATION_H
732
+#endif //CONFIGURATION_H

+ 22
- 0
Marlin/ConfigurationStore.cpp View File

@@ -67,6 +67,9 @@
67 67
  *
68 68
  *  filament_size (x4)
69 69
  *
70
+ * Z_DUAL_ENDSTOPS
71
+ *  z_endstop_adj
72
+ *
70 73
  */
71 74
 #include "Marlin.h"
72 75
 #include "language.h"
@@ -165,6 +168,10 @@ void Config_StoreSettings()  {
165 168
     EEPROM_WRITE_VAR(i, delta_radius);              // 1 float
166 169
     EEPROM_WRITE_VAR(i, delta_diagonal_rod);        // 1 float
167 170
     EEPROM_WRITE_VAR(i, delta_segments_per_second); // 1 float
171
+  #elif defined(Z_DUAL_ENDSTOPS)
172
+    EEPROM_WRITE_VAR(i, z_endstop_adj);            // 1 floats
173
+    dummy = 0.0f;
174
+    for (int q=5; q--;) EEPROM_WRITE_VAR(i, dummy);
168 175
   #else
169 176
     dummy = 0.0f;
170 177
     for (int q=6; q--;) EEPROM_WRITE_VAR(i, dummy);
@@ -326,7 +333,12 @@ void Config_RetrieveSettings() {
326 333
       EEPROM_READ_VAR(i, delta_radius);               // 1 float
327 334
       EEPROM_READ_VAR(i, delta_diagonal_rod);         // 1 float
328 335
       EEPROM_READ_VAR(i, delta_segments_per_second);  // 1 float
336
+    #elif defined(Z_DUAL_ENDSTOPS)
337
+      EEPROM_READ_VAR(i, z_endstop_adj);
338
+      dummy = 0.0f;
339
+      for (int q=5; q--;) EEPROM_READ_VAR(i, dummy);
329 340
     #else
341
+      dummy = 0.0f;
330 342
       for (int q=6; q--;) EEPROM_READ_VAR(i, dummy);
331 343
     #endif
332 344
 
@@ -459,6 +471,8 @@ void Config_ResetDefault() {
459 471
     delta_diagonal_rod =  DELTA_DIAGONAL_ROD;
460 472
     delta_segments_per_second =  DELTA_SEGMENTS_PER_SECOND;
461 473
     recalc_delta_settings(delta_radius, delta_diagonal_rod);
474
+  #elif defined(Z_DUAL_ENDSTOPS)
475
+    z_endstop_adj = 0;
462 476
   #endif
463 477
 
464 478
   #ifdef ULTIPANEL
@@ -629,6 +643,14 @@ void Config_PrintSettings(bool forReplay) {
629 643
     SERIAL_ECHOPAIR(" R", delta_radius );
630 644
     SERIAL_ECHOPAIR(" S", delta_segments_per_second );
631 645
     SERIAL_EOL;
646
+  #elif defined(Z_DUAL_ENDSTOPS)
647
+    SERIAL_ECHO_START;
648
+    if (!forReplay) {
649
+      SERIAL_ECHOLNPGM("Z2 Endstop adjustement (mm):");
650
+      SERIAL_ECHO_START;
651
+    }
652
+    SERIAL_ECHOPAIR("  M666 Z", z_endstop_adj );
653
+    SERIAL_EOL;  
632 654
   #endif // DELTA
633 655
 
634 656
   #ifdef PIDTEMP

+ 70
- 242
Marlin/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -144,11 +98,31 @@
144 98
 // Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
145 99
 // to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147
-//#define Z_DUAL_STEPPER_DRIVERS
101
+#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149 103
 #ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
104
+
105
+// Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
106
+// That way the machine is capable to align the bed during home, since both Z steppers are homed. 
107
+// There is also an implementation of M666 (software endstops adjustment) to this feature.
108
+// After Z homing, this adjustment is applied to just one of the steppers in order to align the bed.
109
+// One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2.
110
+// If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive.
111
+// Play a little bit with small adjustments (0.5mm) and check the behaviour.
112
+// The M119 (endstops report) will start reporting the Z2 Endstop as well.
113
+
114
+#define Z_DUAL_ENDSTOPS
115
+
116
+#ifdef Z_DUAL_ENDSTOPS
117
+  #define Z2_STEP_PIN E2_STEP_PIN           // Stepper to be used to Z2 axis.
118
+  #define Z2_DIR_PIN E2_DIR_PIN
119
+  #define Z2_ENABLE_PIN E2_ENABLE_PIN
120
+  #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
121
+  const bool Z2_MAX_ENDSTOP_INVERTING = false;
122
+  #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
123
+#endif
124
+
125
+
152 126
 #endif
153 127
 
154 128
 // Same again but for Y Axis.
@@ -157,56 +131,47 @@
157 131
 // Define if the two Y drives need to rotate in opposite directions
158 132
 #define INVERT_Y2_VS_Y_DIR true
159 133
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 134
 // Enable this for dual x-carriage printers.
170 135
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 136
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
172 137
 // allowing faster printing speeds.
173 138
 //#define DUAL_X_CARRIAGE
174 139
 #ifdef DUAL_X_CARRIAGE
175
-// Configuration for second X-carriage
176
-// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
177
-// the second x-carriage always homes to the maximum endstop.
178
-#define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
179
-#define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed
180
-#define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
181
-#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
182
-    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
183
-    // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
184
-    // without modifying the firmware (through the "M218 T1 X???" command).
185
-    // Remember: you should set the second extruder x-offset to 0 in your slicer.
186
-
187
-// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
188
-#define X2_ENABLE_PIN 29
189
-#define X2_STEP_PIN 25
190
-#define X2_DIR_PIN 23
191
-
192
-// There are a few selectable movement modes for dual x-carriages using M605 S<mode>
193
-//    Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
194
-//                           as long as it supports dual x-carriages. (M605 S0)
195
-//    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
196
-//                           that additional slicer support is not required. (M605 S1)
197
-//    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
198
-//                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
199
-//                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
200
-
201
-// This is the default power-up mode which can be later using M605.
202
-#define DEFAULT_DUAL_X_CARRIAGE_MODE 0
203
-
204
-// Default settings in "Auto-park Mode"
205
-#define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
206
-#define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
207
-
208
-// Default x offset in duplication mode (typically set to half print bed width)
209
-#define DEFAULT_DUPLICATION_X_OFFSET 100
140
+  // Configuration for second X-carriage
141
+  // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
142
+  // the second x-carriage always homes to the maximum endstop.
143
+  #define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
144
+  #define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed
145
+  #define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
146
+  #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
147
+      // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
148
+      // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
149
+      // without modifying the firmware (through the "M218 T1 X???" command).
150
+      // Remember: you should set the second extruder x-offset to 0 in your slicer.
151
+
152
+  // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
153
+  #define X2_ENABLE_PIN 29
154
+  #define X2_STEP_PIN 25
155
+  #define X2_DIR_PIN 23
156
+
157
+  // There are a few selectable movement modes for dual x-carriages using M605 S<mode>
158
+  //    Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
159
+  //                           as long as it supports dual x-carriages. (M605 S0)
160
+  //    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
161
+  //                           that additional slicer support is not required. (M605 S1)
162
+  //    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
163
+  //                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
164
+  //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
165
+
166
+  // This is the default power-up mode which can be later using M605.
167
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
168
+
169
+  // Default settings in "Auto-park Mode"
170
+  #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
171
+  #define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
172
+
173
+  // Default x offset in duplication mode (typically set to half print bed width)
174
+  #define DEFAULT_DUPLICATION_X_OFFSET 100
210 175
 
211 176
 #endif //DUAL_X_CARRIAGE
212 177
 
@@ -218,31 +183,22 @@
218 183
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
219 184
 
220 185
 #define AXIS_RELATIVE_MODES {false, false, false, false}
221
-#ifdef CONFIG_STEPPERS_TOSHIBA
222
-#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
223
-#else
224
-#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
225
-#endif
186
+
226 187
 //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
227 188
 #define INVERT_X_STEP_PIN false
228 189
 #define INVERT_Y_STEP_PIN false
229 190
 #define INVERT_Z_STEP_PIN false
230 191
 #define INVERT_E_STEP_PIN false
231 192
 
232
-//default stepper release if idle. Set to 0 to deactivate.
193
+// Default stepper release if idle. Set to 0 to deactivate.
233 194
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
234 195
 
235 196
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
236 197
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
237 198
 
238
-// Feedrates for manual moves along X, Y, Z, E from panel
239 199
 #ifdef ULTIPANEL
240
-#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
241
-#endif
242
-
243
-//Comment to disable setting feedrate multiplier via encoder
244
-#ifdef ULTIPANEL
245
-    #define ULTIPANEL_FEEDMULTIPLY
200
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
201
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
246 202
 #endif
247 203
 
248 204
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -261,13 +217,6 @@
261 217
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
262 218
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
263 219
 
264
-// MS1 MS2 Stepper Driver Microstepping mode table
265
-#define MICROSTEP1 LOW,LOW
266
-#define MICROSTEP2 HIGH,LOW
267
-#define MICROSTEP4 LOW,HIGH
268
-#define MICROSTEP8 HIGH,HIGH
269
-#define MICROSTEP16 HIGH,HIGH
270
-
271 220
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
272 221
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
273 222
 
@@ -313,12 +262,6 @@
313 262
   #define PROGRESS_MSG_EXPIRE   0
314 263
   // Enable this to show messages for MSG_TIME then hide them
315 264
   //#define PROGRESS_MSG_ONCE
316
-  #ifdef DOGLCD
317
-    #warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
318
-  #endif
319
-  #ifdef FILAMENT_LCD_DISPLAY
320
-    #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
321
-  #endif
322 265
 #endif
323 266
 
324 267
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
@@ -342,16 +285,6 @@
342 285
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
343 286
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
344 287
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
345
-
346
-  #ifdef COREXY
347
-    #error BABYSTEPPING not implemented for COREXY yet.
348
-  #endif
349
-
350
-  #ifdef DELTA
351
-    #ifdef BABYSTEP_XY
352
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
353
-    #endif
354
-  #endif
355 288
 #endif
356 289
 
357 290
 // extruder advance constant (s2/mm3)
@@ -365,12 +298,8 @@
365 298
 
366 299
 #ifdef ADVANCE
367 300
   #define EXTRUDER_ADVANCE_K .0
368
-
369 301
   #define D_FILAMENT 2.85
370 302
   #define STEPS_MM_E 836
371
-  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
372
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
373
-
374 303
 #endif // ADVANCE
375 304
 
376 305
 // Arc interpretation settings:
@@ -385,26 +314,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
385 314
 // be commented out otherwise
386 315
 #define SDCARDDETECTINVERTED
387 316
 
388
-#ifdef ULTIPANEL
389
- #undef SDCARDDETECTINVERTED
390
-#endif
391
-
392
-// Power Signal Control Definitions
393
-// By default use ATX definition
394
-#ifndef POWER_SUPPLY
395
-  #define POWER_SUPPLY 1
396
-#endif
397
-// 1 = ATX
398
-#if (POWER_SUPPLY == 1)
399
-  #define PS_ON_AWAKE  LOW
400
-  #define PS_ON_ASLEEP HIGH
401
-#endif
402
-// 2 = X-Box 360 203W
403
-#if (POWER_SUPPLY == 2)
404
-  #define PS_ON_AWAKE  HIGH
405
-  #define PS_ON_ASLEEP LOW
406
-#endif
407
-
408 317
 // Control heater 0 and heater 1 in parallel.
409 318
 //#define HEATERS_PARALLEL
410 319
 
@@ -414,7 +323,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
414 323
 
415 324
 // The number of linear motions that can be in the plan at any give time.
416 325
 // 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.
417
-#if defined SDSUPPORT
326
+#ifdef SDSUPPORT
418 327
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
419 328
 #else
420 329
   #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
@@ -444,9 +353,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
444 353
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
445 354
 #endif
446 355
 
447
-//adds support for experimental filament exchange support M600; requires display
356
+// Add support for experimental filament exchange support M600; requires display
448 357
 #ifdef ULTIPANEL
449
-  #define FILAMENTCHANGEENABLE
358
+  //#define FILAMENTCHANGEENABLE
450 359
   #ifdef FILAMENTCHANGEENABLE
451 360
     #define FILAMENTCHANGE_XPOS 3
452 361
     #define FILAMENTCHANGE_YPOS 3
@@ -456,13 +365,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
456 365
   #endif
457 366
 #endif
458 367
 
459
-#ifdef FILAMENTCHANGEENABLE
460
-  #ifdef EXTRUDER_RUNOUT_PREVENT
461
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
462
-  #endif
463
-#endif
464
-
465
-
466 368
 /******************************************************************************\
467 369
  * enable this section if you have TMC26X motor drivers. 
468 370
  * you need to import the TMC26XStepper library into the arduino IDE for this
@@ -596,81 +498,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
596 498
 	
597 499
 #endif
598 500
 
501
+#include "Conditionals.h"
502
+#include "SanityCheck.h"
599 503
 
600
-//===========================================================================
601
-//=============================  Define Defines  ============================
602
-//===========================================================================
603
-
604
-#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
605
-  #error "Bed Auto Leveling is still not compatible with Delta Kinematics."
606
-#endif
607
-
608
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
609
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
610
-#endif
611
-
612
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
613
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
614
-#endif
615
-
616
-#if TEMP_SENSOR_0 > 0
617
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
618
-  #define HEATER_0_USES_THERMISTOR
619
-#endif
620
-#if TEMP_SENSOR_1 > 0
621
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
622
-  #define HEATER_1_USES_THERMISTOR
623
-#endif
624
-#if TEMP_SENSOR_2 > 0
625
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
626
-  #define HEATER_2_USES_THERMISTOR
627
-#endif
628
-#if TEMP_SENSOR_3 > 0
629
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
630
-  #define HEATER_3_USES_THERMISTOR
631
-#endif
632
-#if TEMP_SENSOR_BED > 0
633
-  #define THERMISTORBED TEMP_SENSOR_BED
634
-  #define BED_USES_THERMISTOR
635
-#endif
636
-#if TEMP_SENSOR_0 == -1
637
-  #define HEATER_0_USES_AD595
638
-#endif
639
-#if TEMP_SENSOR_1 == -1
640
-  #define HEATER_1_USES_AD595
641
-#endif
642
-#if TEMP_SENSOR_2 == -1
643
-  #define HEATER_2_USES_AD595
644
-#endif
645
-#if TEMP_SENSOR_3 == -1
646
-  #define HEATER_3_USES_AD595
647
-#endif
648
-#if TEMP_SENSOR_BED == -1
649
-  #define BED_USES_AD595
650
-#endif
651
-#if TEMP_SENSOR_0 == -2
652
-  #define HEATER_0_USES_MAX6675
653
-#endif
654
-#if TEMP_SENSOR_0 == 0
655
-  #undef HEATER_0_MINTEMP
656
-  #undef HEATER_0_MAXTEMP
657
-#endif
658
-#if TEMP_SENSOR_1 == 0
659
-  #undef HEATER_1_MINTEMP
660
-  #undef HEATER_1_MAXTEMP
661
-#endif
662
-#if TEMP_SENSOR_2 == 0
663
-  #undef HEATER_2_MINTEMP
664
-  #undef HEATER_2_MAXTEMP
665
-#endif
666
-#if TEMP_SENSOR_3 == 0
667
-  #undef HEATER_3_MINTEMP
668
-  #undef HEATER_3_MAXTEMP
669
-#endif
670
-#if TEMP_SENSOR_BED == 0
671
-  #undef BED_MINTEMP
672
-  #undef BED_MAXTEMP
673
-#endif
674
-
675
-
676
-#endif //__CONFIGURATION_ADV_H
504
+#endif //CONFIGURATION_ADV_H

+ 29
- 33
Marlin/Marlin.h View File

@@ -20,11 +20,6 @@
20 20
 
21 21
 #include "fastio.h"
22 22
 #include "Configuration.h"
23
-#include "pins.h"
24
-
25
-#ifndef AT90USB
26
-  #define  HardwareSerial_h // trick to disable the standard HWserial
27
-#endif
28 23
 
29 24
 #if (ARDUINO >= 100)
30 25
   #include "Arduino.h"
@@ -183,7 +178,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
183 178
   #define disable_e3() /* nothing */
184 179
 #endif
185 180
 
186
-enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5}; 
181
+enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
187 182
 //X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
188 183
 
189 184
 void FlushSerialRequestResend();
@@ -191,17 +186,17 @@ void ClearToSend();
191 186
 
192 187
 void get_coordinates();
193 188
 #ifdef DELTA
194
-void calculate_delta(float cartesian[3]);
189
+  void calculate_delta(float cartesian[3]);
195 190
   #ifdef ENABLE_AUTO_BED_LEVELING
196
-  extern int delta_grid_spacing[2];
197
-  void adjust_delta(float cartesian[3]);
191
+    extern int delta_grid_spacing[2];
192
+    void adjust_delta(float cartesian[3]);
198 193
   #endif
199
-extern float delta[3];
200
-void prepare_move_raw();
194
+  extern float delta[3];
195
+  void prepare_move_raw();
201 196
 #endif
202 197
 #ifdef SCARA
203
-void calculate_delta(float cartesian[3]);
204
-void calculate_SCARA_forward_Transform(float f_scara[3]);
198
+  void calculate_delta(float cartesian[3]);
199
+  void calculate_SCARA_forward_Transform(float f_scara[3]);
205 200
 #endif
206 201
 void reset_bed_level();
207 202
 void prepare_move();
@@ -209,7 +204,7 @@ void kill();
209 204
 void Stop();
210 205
 
211 206
 #ifdef FILAMENT_RUNOUT_SENSOR
212
-void filrunout();
207
+  void filrunout();
213 208
 #endif
214 209
 
215 210
 bool IsStopped();
@@ -223,7 +218,7 @@ void clamp_to_software_endstops(float target[3]);
223 218
 void refresh_cmd_timeout(void);
224 219
 
225 220
 #ifdef FAST_PWM_FAN
226
-void setPwmFrequency(uint8_t pin, int val);
221
+  void setPwmFrequency(uint8_t pin, int val);
227 222
 #endif
228 223
 
229 224
 #ifndef CRITICAL_SECTION_START
@@ -242,14 +237,16 @@ extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional
242 237
 extern float current_position[NUM_AXIS] ;
243 238
 extern float home_offset[3];
244 239
 #ifdef DELTA
245
-extern float endstop_adj[3];
246
-extern float delta_radius;
247
-extern float delta_diagonal_rod;
248
-extern float delta_segments_per_second;
249
-void recalc_delta_settings(float radius, float diagonal_rod);
240
+  extern float endstop_adj[3];
241
+  extern float delta_radius;
242
+  extern float delta_diagonal_rod;
243
+  extern float delta_segments_per_second;
244
+  void recalc_delta_settings(float radius, float diagonal_rod);
245
+#elif defined(Z_DUAL_ENDSTOPS)
246
+extern float z_endstop_adj;
250 247
 #endif
251 248
 #ifdef SCARA
252
-extern float axis_scaling[3];  // Build size scaling
249
+  extern float axis_scaling[3];  // Build size scaling
253 250
 #endif
254 251
 extern float min_pos[3];
255 252
 extern float max_pos[3];
@@ -257,12 +254,12 @@ extern bool axis_known_position[3];
257 254
 extern float zprobe_zoffset;
258 255
 extern int fanSpeed;
259 256
 #ifdef BARICUDA
260
-extern int ValvePressure;
261
-extern int EtoPPressure;
257
+  extern int ValvePressure;
258
+  extern int EtoPPressure;
262 259
 #endif
263 260
 
264 261
 #ifdef FAN_SOFT_PWM
265
-extern unsigned char fanSpeedSoftPwm;
262
+  extern unsigned char fanSpeedSoftPwm;
266 263
 #endif
267 264
 
268 265
 #ifdef FILAMENT_SENSOR
@@ -270,16 +267,16 @@ extern unsigned char fanSpeedSoftPwm;
270 267
   extern bool filament_sensor;  //indicates that filament sensor readings should control extrusion
271 268
   extern float filament_width_meas; //holds the filament diameter as accurately measured
272 269
   extern signed char measurement_delay[];  //ring buffer to delay measurement
273
-  extern int delay_index1, delay_index2;  //index into ring buffer
270
+  extern int delay_index1, delay_index2;  //ring buffer index. used by planner, temperature, and main code
274 271
   extern float delay_dist; //delay distance counter
275 272
   extern int meas_delay_cm; //delay distance
276 273
 #endif
277 274
 
278 275
 #ifdef FWRETRACT
279
-extern bool autoretract_enabled;
280
-extern bool retracted[EXTRUDERS];
281
-extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift;
282
-extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
276
+  extern bool autoretract_enabled;
277
+  extern bool retracted[EXTRUDERS];
278
+  extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift;
279
+  extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
283 280
 #endif
284 281
 
285 282
 extern unsigned long starttime;
@@ -289,11 +286,10 @@ extern unsigned long stoptime;
289 286
 extern uint8_t active_extruder;
290 287
 
291 288
 #ifdef DIGIPOT_I2C
292
-extern void digipot_i2c_set_current( int channel, float current );
293
-extern void digipot_i2c_init();
294
-#endif
295
-
289
+  extern void digipot_i2c_set_current( int channel, float current );
290
+  extern void digipot_i2c_init();
296 291
 #endif
297 292
 
298 293
 extern void calculate_volumetric_multipliers();
299 294
 
295
+#endif //MARLIN_H

+ 73
- 78
Marlin/Marlin_main.cpp View File

@@ -30,9 +30,6 @@
30 30
 #include "Marlin.h"
31 31
 
32 32
 #ifdef ENABLE_AUTO_BED_LEVELING
33
-  #if Z_MIN_PIN == -1
34
-    #error "You must have a Z_MIN endstop to enable Auto Bed Leveling feature. Z_MIN_PIN must point to a valid hardware pin."
35
-  #endif
36 33
   #include "vector_3.h"
37 34
   #ifdef AUTO_BED_LEVELING_GRID
38 35
     #include "qr_solve.h"
@@ -251,6 +248,8 @@ float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
251 248
 float home_offset[3] = { 0, 0, 0 };
252 249
 #ifdef DELTA
253 250
   float endstop_adj[3] = { 0, 0, 0 };
251
+#elif defined(Z_DUAL_ENDSTOPS)
252
+  float z_endstop_adj = 0;
254 253
 #endif
255 254
 
256 255
 float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
@@ -967,43 +966,36 @@ XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
967 966
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
968 967
 
969 968
 #ifdef DUAL_X_CARRIAGE
970
-  #if EXTRUDERS == 1 || defined(COREXY) \
971
-      || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
972
-      || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
973
-      || !defined(X_MAX_PIN) || X_MAX_PIN < 0
974
-    #error "Missing or invalid definitions for DUAL_X_CARRIAGE mode."
975
-  #endif
976
-  #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
977
-    #error "Please use canonical x-carriage assignment" // the x-carriages are defined by their homing directions
978
-  #endif
979 969
 
980
-#define DXC_FULL_CONTROL_MODE 0
981
-#define DXC_AUTO_PARK_MODE    1
982
-#define DXC_DUPLICATION_MODE  2
983
-static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
970
+  #define DXC_FULL_CONTROL_MODE 0
971
+  #define DXC_AUTO_PARK_MODE    1
972
+  #define DXC_DUPLICATION_MODE  2
973
+
974
+  static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
984 975
 
985
-static float x_home_pos(int extruder) {
986
-  if (extruder == 0)
976
+  static float x_home_pos(int extruder) {
977
+    if (extruder == 0)
987 978
     return base_home_pos(X_AXIS) + home_offset[X_AXIS];
988
-  else
989
-    // In dual carriage mode the extruder offset provides an override of the
990
-    // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
991
-    // This allow soft recalibration of the second extruder offset position without firmware reflash
992
-    // (through the M218 command).
993
-    return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
994
-}
979
+    else
980
+      // In dual carriage mode the extruder offset provides an override of the
981
+      // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
982
+      // This allow soft recalibration of the second extruder offset position without firmware reflash
983
+      // (through the M218 command).
984
+      return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
985
+  }
995 986
 
996
-static int x_home_dir(int extruder) {
997
-  return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR;
998
-}
987
+  static int x_home_dir(int extruder) {
988
+    return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR;
989
+  }
990
+
991
+  static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1
992
+  static bool active_extruder_parked = false; // used in mode 1 & 2
993
+  static float raised_parked_position[NUM_AXIS]; // used in mode 1
994
+  static unsigned long delayed_move_time = 0; // used in mode 1
995
+  static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
996
+  static float duplicate_extruder_temp_offset = 0; // used in mode 2
997
+  bool extruder_duplication_enabled = false; // used in mode 2
999 998
 
1000
-static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1
1001
-static bool active_extruder_parked = false; // used in mode 1 & 2
1002
-static float raised_parked_position[NUM_AXIS]; // used in mode 1
1003
-static unsigned long delayed_move_time = 0; // used in mode 1
1004
-static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
1005
-static float duplicate_extruder_temp_offset = 0; // used in mode 2
1006
-bool extruder_duplication_enabled = false; // used in mode 2
1007 999
 #endif //DUAL_X_CARRIAGE
1008 1000
 
1009 1001
 static void axis_is_at_home(int axis) {
@@ -1497,6 +1489,9 @@ static void homeaxis(int axis) {
1497 1489
       }
1498 1490
     #endif
1499 1491
 #endif // Z_PROBE_SLED
1492
+    #ifdef Z_DUAL_ENDSTOPS
1493
+      if (axis==Z_AXIS) In_Homing_Process(true);
1494
+    #endif
1500 1495
     destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
1501 1496
     feedrate = homing_feedrate[axis];
1502 1497
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
@@ -1522,6 +1517,27 @@ static void homeaxis(int axis) {
1522 1517
 
1523 1518
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
1524 1519
     st_synchronize();
1520
+    #ifdef Z_DUAL_ENDSTOPS
1521
+      if (axis==Z_AXIS)
1522
+      {
1523
+        feedrate = homing_feedrate[axis];
1524
+        plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1525
+        if (axis_home_dir > 0)
1526
+        {
1527
+          destination[axis] = (-1) * fabs(z_endstop_adj);
1528
+          if (z_endstop_adj > 0) Lock_z_motor(true); else Lock_z2_motor(true);
1529
+        } else {
1530
+          destination[axis] = fabs(z_endstop_adj);
1531
+          if (z_endstop_adj < 0) Lock_z_motor(true); else Lock_z2_motor(true);        
1532
+        }
1533
+        plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
1534
+        st_synchronize();
1535
+        Lock_z_motor(false);
1536
+        Lock_z2_motor(false);
1537
+        In_Homing_Process(false);
1538
+      }
1539
+    #endif
1540
+
1525 1541
 #ifdef DELTA
1526 1542
     // retrace by the amount specified in endstop_adj
1527 1543
     if (endstop_adj[axis] * axis_home_dir < 0) {
@@ -1764,7 +1780,7 @@ inline void gcode_G28() {
1764 1780
 
1765 1781
   enable_endstops(true);
1766 1782
 
1767
-  for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = current_position[i];
1783
+  for (int i = X_AXIS; i <= NUM_AXIS; i++) destination[i] = current_position[i];
1768 1784
 
1769 1785
   feedrate = 0.0;
1770 1786
 
@@ -1954,7 +1970,7 @@ inline void gcode_G28() {
1954 1970
     if (code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
1955 1971
       current_position[Z_AXIS] = code_value() + home_offset[Z_AXIS];
1956 1972
 
1957
-    #ifdef ENABLE_AUTO_BED_LEVELING
1973
+    #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)
1958 1974
       if (home_all_axis || code_seen(axis_codes[Z_AXIS]))
1959 1975
         current_position[Z_AXIS] += zprobe_zoffset;  //Add Z_Probe offset (the distance is negative)
1960 1976
     #endif
@@ -2079,44 +2095,6 @@ inline void gcode_G28() {
2079 2095
 
2080 2096
 #ifdef ENABLE_AUTO_BED_LEVELING
2081 2097
 
2082
-  // Define the possible boundaries for probing based on set limits
2083
-  #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
2084
-  #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
2085
-  #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
2086
-  #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
2087
-
2088
-  #ifdef AUTO_BED_LEVELING_GRID
2089
-
2090
-    // Make sure probing points are reachable
2091
-
2092
-    #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
2093
-      #error "The given LEFT_PROBE_BED_POSITION can't be reached by the probe."
2094
-    #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
2095
-      #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the probe."
2096
-    #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
2097
-      #error "The given FRONT_PROBE_BED_POSITION can't be reached by the probe."
2098
-    #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
2099
-      #error "The given BACK_PROBE_BED_POSITION can't be reached by the probe."
2100
-    #endif
2101
-
2102
-  #else // !AUTO_BED_LEVELING_GRID
2103
-
2104
-    #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
2105
-      #error "The given ABL_PROBE_PT_1_X can't be reached by the probe."
2106
-    #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
2107
-      #error "The given ABL_PROBE_PT_2_X can't be reached by the probe."
2108
-    #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
2109
-      #error "The given ABL_PROBE_PT_3_X can't be reached by the probe."
2110
-    #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
2111
-      #error "The given ABL_PROBE_PT_1_Y can't be reached by the probe."
2112
-    #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
2113
-      #error "The given ABL_PROBE_PT_2_Y can't be reached by the probe."
2114
-    #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
2115
-      #error "The given ABL_PROBE_PT_3_Y can't be reached by the probe."
2116
-    #endif
2117
-
2118
-  #endif // !AUTO_BED_LEVELING_GRID
2119
-
2120 2098
   /**
2121 2099
    * G29: Detailed Z-Probe, probes the bed at 3 or more points.
2122 2100
    *      Will fail if the printer has not been homed with G28.
@@ -2296,13 +2274,11 @@ inline void gcode_G28() {
2296 2274
           xStart = 0;
2297 2275
           xStop = auto_bed_leveling_grid_points;
2298 2276
           xInc = 1;
2299
-          zig = false;
2300 2277
         }
2301 2278
         else {
2302 2279
           xStart = auto_bed_leveling_grid_points - 1;
2303 2280
           xStop = -1;
2304 2281
           xInc = -1;
2305
-          zig = true;
2306 2282
         }
2307 2283
 
2308 2284
         #ifndef DELTA
@@ -2389,7 +2365,7 @@ inline void gcode_G28() {
2389 2365
         SERIAL_PROTOCOLPGM("+-----------+\n");
2390 2366
 
2391 2367
         for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
2392
-          for (int xx = auto_bed_leveling_grid_points - 1; xx >= 0; xx--) {
2368
+          for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
2393 2369
             int ind = yy * auto_bed_leveling_grid_points + xx;
2394 2370
             float diff = eqnBVector[ind] - mean;
2395 2371
             if (diff >= 0.0)
@@ -3500,6 +3476,11 @@ inline void gcode_M119() {
3500 3476
     SERIAL_PROTOCOLPGM(MSG_Z_MAX);
3501 3477
     SERIAL_PROTOCOLLN(((READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
3502 3478
   #endif
3479
+  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1
3480
+    SERIAL_PROTOCOLPGM(MSG_Z2_MAX);
3481
+    SERIAL_PROTOCOLLN(((READ(Z2_MAX_PIN)^Z2_MAX_ENDSTOP_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
3482
+  #endif
3483
+  
3503 3484
 }
3504 3485
 
3505 3486
 /**
@@ -3693,6 +3674,16 @@ inline void gcode_M206() {
3693 3674
       }
3694 3675
     }
3695 3676
   }
3677
+#elif defined(Z_DUAL_ENDSTOPS)
3678
+  /**
3679
+   * M666: For Z Dual Endstop setup, set z axis offset to the z2 axis.
3680
+   */
3681
+  inline void gcode_M666() {
3682
+   if (code_seen('Z')) z_endstop_adj = code_value();
3683
+   SERIAL_ECHOPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj );
3684
+   SERIAL_EOL;
3685
+  }
3686
+  
3696 3687
 #endif // DELTA
3697 3688
 
3698 3689
 #ifdef FWRETRACT
@@ -4942,6 +4933,10 @@ void process_commands() {
4942 4933
         case 666: // M666 set delta endstop adjustment
4943 4934
           gcode_M666();
4944 4935
           break;
4936
+      #elif defined(Z_DUAL_ENDSTOPS)
4937
+        case 666: // M666 set delta endstop adjustment
4938
+          gcode_M666();
4939
+          break;
4945 4940
       #endif // DELTA
4946 4941
 
4947 4942
       #ifdef FWRETRACT

+ 254
- 0
Marlin/SanityCheck.h View File

@@ -0,0 +1,254 @@
1
+/**
2
+ * SanityCheck.h
3
+ *
4
+ * Test configuration values for errors at compile-time.
5
+ */
6
+#ifndef SANITYCHECK_H
7
+  #define SANITYCHECK_H
8
+
9
+  /**
10
+   * Dual Stepper Drivers
11
+   */
12
+  #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Y_DUAL_STEPPER_DRIVERS)
13
+    #error You cannot have dual stepper drivers for both Y and Z.
14
+  #endif
15
+
16
+  /**
17
+   * Progress Bar
18
+   */
19
+  #ifdef LCD_PROGRESS_BAR
20
+    #ifdef DOGLCD
21
+      #warning LCD_PROGRESS_BAR does not apply to graphical displays.
22
+    #endif
23
+    #ifdef FILAMENT_LCD_DISPLAY
24
+      #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
25
+    #endif
26
+  #endif
27
+
28
+  /**
29
+   * Babystepping
30
+   */
31
+  #ifdef BABYSTEPPING
32
+    #ifdef COREXY
33
+      #error BABYSTEPPING not implemented for COREXY yet.
34
+    #endif
35
+    #ifdef SCARA
36
+      #error BABYSTEPPING is not implemented for SCARA yet.
37
+    #endif
38
+    #if defined(DELTA) && defined(BABYSTEP_XY)
39
+      #error BABYSTEPPING only implemented for Z axis on deltabots.
40
+    #endif
41
+  #endif
42
+
43
+  /**
44
+   * Filament Change with Extruder Runout Prevention
45
+   */
46
+  #if defined(FILAMENTCHANGEENABLE) && defined(EXTRUDER_RUNOUT_PREVENT)
47
+    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE.
48
+  #endif
49
+
50
+  /**
51
+   * Options only for EXTRUDERS == 1
52
+   */
53
+  #if EXTRUDERS > 1
54
+
55
+    #if EXTRUDERS > 4
56
+      #error The maximum number of EXTRUDERS is 4.
57
+    #endif
58
+
59
+    #ifdef TEMP_SENSOR_1_AS_REDUNDANT
60
+      #error EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT.
61
+    #endif
62
+
63
+    #ifdef HEATERS_PARALLEL
64
+      #error EXTRUDERS must be 1 with HEATERS_PARALLEL.
65
+    #endif
66
+
67
+    #ifdef Y_DUAL_STEPPER_DRIVERS
68
+      #error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS.
69
+    #endif
70
+
71
+    #ifdef Z_DUAL_STEPPER_DRIVERS
72
+      #error EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS.
73
+    #endif
74
+
75
+  #endif // EXTRUDERS > 1
76
+
77
+  /**
78
+   * Required LCD language
79
+   */
80
+  #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)
81
+    #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN for your LCD controller.
82
+  #endif
83
+
84
+  /**
85
+   * Auto Bed Leveling
86
+   */
87
+  #ifdef ENABLE_AUTO_BED_LEVELING
88
+
89
+    /**
90
+     * Require a Z Min pin
91
+     */
92
+    #if Z_MIN_PIN == -1
93
+      #ifdef Z_PROBE_REPEATABILITY_TEST
94
+        #error You must have a Z_MIN endstop to enable Z_PROBE_REPEATABILITY_TEST.
95
+      #else
96
+        #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN endstop. Z_MIN_PIN must point to a valid hardware pin.
97
+      #endif
98
+    #endif
99
+
100
+    /**
101
+     * Check if Probe_Offset * Grid Points is greater than Probing Range
102
+     */
103
+    #ifdef AUTO_BED_LEVELING_GRID
104
+
105
+      // Make sure probing points are reachable
106
+      #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
107
+        #error The given LEFT_PROBE_BED_POSITION can't be reached by the probe.
108
+      #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
109
+        #error The given RIGHT_PROBE_BED_POSITION can't be reached by the probe.
110
+      #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
111
+        #error The given FRONT_PROBE_BED_POSITION can't be reached by the probe.
112
+      #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
113
+        #error The given BACK_PROBE_BED_POSITION can't be reached by the probe.
114
+      #endif
115
+
116
+      #define PROBE_SIZE_X (X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1))
117
+      #define PROBE_SIZE_Y (Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1))
118
+      #define PROBE_AREA_WIDTH (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION)
119
+      #define PROBE_AREA_DEPTH (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION)
120
+      #if X_PROBE_OFFSET_FROM_EXTRUDER < 0
121
+        #if PROBE_SIZE_X <= -PROBE_AREA_WIDTH
122
+          #define X_PROBE_ERROR
123
+        #endif
124
+      #elif PROBE_SIZE_X >= PROBE_AREA_WIDTH
125
+        #define X_PROBE_ERROR
126
+      #endif
127
+      #ifdef X_PROBE_ERROR
128
+        #error The X axis probing range is too small to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS
129
+      #endif
130
+      #if Y_PROBE_OFFSET_FROM_EXTRUDER < 0
131
+        #if PROBE_SIZE_Y <= -PROBE_AREA_DEPTH
132
+          #define Y_PROBE_ERROR
133
+        #endif
134
+      #elif PROBE_SIZE_Y >= PROBE_AREA_DEPTH
135
+        #define Y_PROBE_ERROR
136
+      #endif
137
+      #ifdef Y_PROBE_ERROR
138
+        #error The Y axis probing range is to small to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS
139
+      #endif
140
+
141
+      #undef PROBE_SIZE_X
142
+      #undef PROBE_SIZE_Y
143
+      #undef PROBE_AREA_WIDTH
144
+      #undef PROBE_AREA_DEPTH
145
+
146
+    #else // !AUTO_BED_LEVELING_GRID
147
+
148
+      // Check the triangulation points
149
+      #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
150
+        #error "The given ABL_PROBE_PT_1_X can't be reached by the probe."
151
+      #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
152
+        #error "The given ABL_PROBE_PT_2_X can't be reached by the probe."
153
+      #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
154
+        #error "The given ABL_PROBE_PT_3_X can't be reached by the probe."
155
+      #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
156
+        #error "The given ABL_PROBE_PT_1_Y can't be reached by the probe."
157
+      #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
158
+        #error "The given ABL_PROBE_PT_2_Y can't be reached by the probe."
159
+      #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
160
+        #error "The given ABL_PROBE_PT_3_Y can't be reached by the probe."
161
+      #endif
162
+
163
+    #endif // !AUTO_BED_LEVELING_GRID
164
+
165
+  #endif // ENABLE_AUTO_BED_LEVELING
166
+
167
+  /**
168
+   * ULTIPANEL encoder
169
+   */
170
+  #if defined(ULTIPANEL) && !defined(NEWPANEL) && !defined(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
171
+    #error ULTIPANEL requires some kind of encoder.
172
+  #endif
173
+
174
+  /**
175
+   * Delta has limited bed leveling options
176
+   */
177
+  #ifdef DELTA
178
+
179
+    #ifdef ENABLE_AUTO_BED_LEVELING
180
+
181
+      #ifndef AUTO_BED_LEVELING_GRID
182
+        #error Only AUTO_BED_LEVELING_GRID is supported with DELTA.
183
+      #endif
184
+
185
+      #ifdef Z_PROBE_SLED
186
+        #error You cannot use Z_PROBE_SLED with DELTA.
187
+      #endif
188
+
189
+      #ifdef Z_PROBE_REPEATABILITY_TEST
190
+        #error Z_PROBE_REPEATABILITY_TEST is not supported with DELTA yet.
191
+      #endif
192
+
193
+    #endif
194
+
195
+  #endif
196
+
197
+  /**
198
+   * Allen Key Z Probe requires Auto Bed Leveling grid and Delta
199
+   */
200
+  #if defined(Z_PROBE_ALLEN_KEY) && !(defined(AUTO_BED_LEVELING_GRID) && defined(DELTA))
201
+    #error Invalid use of Z_PROBE_ALLEN_KEY.
202
+  #endif
203
+
204
+  /**
205
+   * Dual X Carriage requirements
206
+   */
207
+  #ifdef DUAL_X_CARRIAGE
208
+    #if EXTRUDERS == 1 || defined(COREXY) \
209
+        || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
210
+        || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
211
+        || !defined(X_MAX_PIN) || X_MAX_PIN < 0
212
+      #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
213
+    #endif
214
+    #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
215
+      #error Please use canonical x-carriage assignment.
216
+    #endif
217
+  #endif // DUAL_X_CARRIAGE
218
+
219
+  /**
220
+   * Make sure auto fan pins don't conflict with the fan pin
221
+   */
222
+  #if HAS_AUTO_FAN && HAS_FAN
223
+    #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
224
+      #error You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN
225
+    #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
226
+      #error You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN
227
+    #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN
228
+      #error You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN
229
+    #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN
230
+      #error You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN
231
+    #endif
232
+  #endif
233
+
234
+  /**
235
+   * Test required HEATER defines
236
+   */
237
+  #if EXTRUDERS > 3
238
+    #if !HAS_HEATER_3
239
+      #error HEATER_3_PIN not defined for this board
240
+    #endif
241
+  #elif EXTRUDERS > 2
242
+    #if !HAS_HEATER_2
243
+      #error HEATER_2_PIN not defined for this board
244
+    #endif
245
+  #elif EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
246
+    #if !HAS_HEATER_1
247
+      #error HEATER_1_PIN not defined for this board
248
+    #endif
249
+  #endif
250
+  #if !HAS_HEATER_0
251
+    #error HEATER_0_PIN not defined for this board
252
+  #endif
253
+
254
+#endif //SANITYCHECK_H

+ 2
- 3
Marlin/Sd2PinMap.h View File

@@ -33,9 +33,7 @@ struct pin_map_t {
33 33
   uint8_t bit;
34 34
 };
35 35
 //------------------------------------------------------------------------------
36
-#if defined(__AVR_ATmega1280__)\
37
-|| defined(__AVR_ATmega2560__)
38
-// Mega
36
+#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // Mega
39 37
 
40 38
 // Two Wire (aka I2C) ports
41 39
 uint8_t const SDA_PIN = 20;  // D1
@@ -43,6 +41,7 @@ uint8_t const SCL_PIN = 21;  // D0
43 41
 
44 42
 #undef MOSI_PIN
45 43
 #undef MISO_PIN
44
+#undef SCK_PIN
46 45
 // SPI port
47 46
 uint8_t const SS_PIN = 53;    // B0
48 47
 uint8_t const MOSI_PIN = 51;  // B2

+ 33
- 157
Marlin/configurator/config/Configuration.h View File

@@ -330,15 +330,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
330 330
   // #define ENDSTOPPULLUP_ZMIN
331 331
 #endif
332 332
 
333
-#ifdef ENDSTOPPULLUPS
334
-  #define ENDSTOPPULLUP_XMAX
335
-  #define ENDSTOPPULLUP_YMAX
336
-  #define ENDSTOPPULLUP_ZMAX
337
-  #define ENDSTOPPULLUP_XMIN
338
-  #define ENDSTOPPULLUP_YMIN
339
-  #define ENDSTOPPULLUP_ZMIN
340
-#endif
341
-
342 333
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
343 334
 const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
344 335
 const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
@@ -405,12 +396,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
405 396
 #define Y_MAX_POS 205
406 397
 #define Z_MAX_POS 200
407 398
 
408
-// @section hidden
399
+//===========================================================================
400
+//============================= Filament Runout Sensor ======================
401
+//===========================================================================
402
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
403
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
404
+                                 // It is assumed that when logic high = filament available
405
+                                 //                    when logic  low = filament ran out
406
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
407
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
408
+
409
+//===========================================================================
410
+//============================ Manual Bed Leveling ==========================
411
+//===========================================================================
409 412
 
410
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
411
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
412
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
413
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
414
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
413 415
 
416
+#if defined(MESH_BED_LEVELING)
417
+  #define MESH_MIN_X 10
418
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
419
+  #define MESH_MIN_Y 10
420
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
421
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
422
+  #define MESH_NUM_Y_POINTS 3
423
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
424
+#endif  // MESH_BED_LEVELING
414 425
 
415 426
 //===========================================================================
416 427
 //============================= Bed Auto Leveling ===========================
@@ -650,114 +661,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
650 661
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
651 662
 //#define RA_CONTROL_PANEL
652 663
 
653
-// @section hidden
654
-
655
-//automatic expansion
656
-#if defined (MAKRPANEL)
657
- #define DOGLCD
658
- #define SDSUPPORT
659
- #define ULTIPANEL
660
- #define NEWPANEL
661
- #define DEFAULT_LCD_CONTRAST 17
662
-#endif
663
-
664
-#if defined(miniVIKI) || defined(VIKI2)
665
- #define ULTRA_LCD  //general LCD support, also 16x2
666
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
667
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
668
- 
669
-  #ifdef miniVIKI
670
-   #define DEFAULT_LCD_CONTRAST 95
671
-  #else
672
-   #define DEFAULT_LCD_CONTRAST 40
673
-  #endif
674
-  
675
- #define ENCODER_PULSES_PER_STEP 4
676
- #define ENCODER_STEPS_PER_MENU_ITEM 1
677
-#endif
678
-
679
-#if defined (PANEL_ONE)
680
- #define SDSUPPORT
681
- #define ULTIMAKERCONTROLLER
682
-#endif
683
-
684
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
685
- #define DOGLCD
686
- #define U8GLIB_ST7920
687
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
688
-#endif
689
-
690
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
691
- #define ULTIPANEL
692
- #define NEWPANEL
693
-#endif
694
-
695
-#if defined(REPRAPWORLD_KEYPAD)
696
-  #define NEWPANEL
697
-  #define ULTIPANEL
698
-#endif
699
-#if defined(RA_CONTROL_PANEL)
700
- #define ULTIPANEL
701
- #define NEWPANEL
702
- #define LCD_I2C_TYPE_PCA8574
703
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
704
-#endif
705
-
706
-//I2C PANELS
664
+/**
665
+ * I2C Panels
666
+ */
707 667
 
708 668
 //#define LCD_I2C_SAINSMART_YWROBOT
709
-#ifdef LCD_I2C_SAINSMART_YWROBOT
710
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
711
-  // Make sure it is placed in the Arduino libraries directory.
712
-  #define LCD_I2C_TYPE_PCF8575
713
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
714
-  #define NEWPANEL
715
-  #define ULTIPANEL
716
-#endif
717 669
 
718 670
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
719 671
 //#define LCD_I2C_PANELOLU2
720
-#ifdef LCD_I2C_PANELOLU2
721
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
722
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
723
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
724
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
725
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
726
-  #define LCD_I2C_TYPE_MCP23017
727
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
728
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
729
-  #define NEWPANEL
730
-  #define ULTIPANEL
731
-
732
-  #ifndef ENCODER_PULSES_PER_STEP
733
-	#define ENCODER_PULSES_PER_STEP 4
734
-  #endif
735
-
736
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
737
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
738
-  #endif
739
-
740
-
741
-  #ifdef LCD_USE_I2C_BUZZER
742
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
743
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
744
-  #endif
745
-
746
-#endif
747 672
 
748 673
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
749 674
 //#define LCD_I2C_VIKI
750
-#ifdef LCD_I2C_VIKI
751
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
752
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
753
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
754
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
755
-  #define LCD_I2C_TYPE_MCP23017
756
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
757
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
758
-  #define NEWPANEL
759
-  #define ULTIPANEL
760
-#endif
761 675
 
762 676
 // Shift register panels
763 677
 // ---------------------
@@ -765,55 +679,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
765 679
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
766 680
 
767 681
 //#define SAV_3DLCD
768
-#ifdef SAV_3DLCD
769
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
770
-   #define NEWPANEL
771
-   #define ULTIPANEL
772
-#endif
773
-
774
-
775
-#ifdef ULTIPANEL
776
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
777
-  #define SDSUPPORT
778
-  #define ULTRA_LCD
779
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
780
-    #define LCD_WIDTH 22
781
-    #define LCD_HEIGHT 5
782
-  #else
783
-    #define LCD_WIDTH 20
784
-    #define LCD_HEIGHT 4
785
-  #endif
786
-#else //no panel but just LCD
787
-  #ifdef ULTRA_LCD
788
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
789
-    #define LCD_WIDTH 22
790
-    #define LCD_HEIGHT 5
791
-  #else
792
-    #define LCD_WIDTH 16
793
-    #define LCD_HEIGHT 2
794
-  #endif
795
-  #endif
796
-#endif
797
-
798
-// @section lcd
799
-
800
-// default LCD contrast for dogm-like LCD displays
801
-#ifdef DOGLCD
802
-# ifndef DEFAULT_LCD_CONTRAST
803
-#  define DEFAULT_LCD_CONTRAST 32
804
-# endif
805
-#endif
806 682
 
807 683
 // @section extras
808 684
 
809 685
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
810 686
 //#define FAST_PWM_FAN
811 687
 
812
-// Temperature status LEDs that display the hotend and bet temperature.
813
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
814
-// Otherwise the RED led is on. There is 1C hysteresis.
815
-//#define TEMP_STAT_LEDS
816
-
817 688
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
818 689
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
819 690
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -825,6 +696,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
825 696
 // at zero value, there are 128 effective control positions.
826 697
 #define SOFT_PWM_SCALE 0
827 698
 
699
+// Temperature status LEDs that display the hotend and bet temperature.
700
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
701
+// Otherwise the RED led is on. There is 1C hysteresis.
702
+//#define TEMP_STAT_LEDS
703
+
828 704
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
829 705
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
830 706
 // #define PHOTOGRAPH_PIN     23
@@ -896,4 +772,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
896 772
 #include "Configuration_adv.h"
897 773
 #include "thermistortables.h"
898 774
 
899
-#endif //__CONFIGURATION_H
775
+#endif //CONFIGURATION_H

+ 10
- 211
Marlin/configurator/config/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 // @section temperature
5 7
 
6 8
 //===========================================================================
@@ -99,56 +101,6 @@
99 101
 
100 102
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
101 103
 
102
-
103
-// @section hidden
104
-
105
-
106
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
107
-//// Added by ZetaPhoenix 09-15-2012
108
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
109
-  #define X_HOME_POS MANUAL_X_HOME_POS
110
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
111
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
112
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
113
-  //X axis
114
-  #if X_HOME_DIR == -1
115
-    #ifdef BED_CENTER_AT_0_0
116
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
117
-    #else
118
-      #define X_HOME_POS X_MIN_POS
119
-    #endif //BED_CENTER_AT_0_0
120
-  #else
121
-    #ifdef BED_CENTER_AT_0_0
122
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
123
-    #else
124
-      #define X_HOME_POS X_MAX_POS
125
-    #endif //BED_CENTER_AT_0_0
126
-  #endif //X_HOME_DIR == -1
127
-
128
-  //Y axis
129
-  #if Y_HOME_DIR == -1
130
-    #ifdef BED_CENTER_AT_0_0
131
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
132
-    #else
133
-      #define Y_HOME_POS Y_MIN_POS
134
-    #endif //BED_CENTER_AT_0_0
135
-  #else
136
-    #ifdef BED_CENTER_AT_0_0
137
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
138
-    #else
139
-      #define Y_HOME_POS Y_MAX_POS
140
-    #endif //BED_CENTER_AT_0_0
141
-  #endif //Y_HOME_DIR == -1
142
-
143
-  // Z axis
144
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
145
-    #define Z_HOME_POS Z_MIN_POS
146
-  #else
147
-    #define Z_HOME_POS Z_MAX_POS
148
-  #endif //Z_HOME_DIR == -1
149
-#endif //End auto min/max positions
150
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
151
-
152 104
 // @section extras
153 105
 
154 106
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
@@ -160,26 +112,12 @@
160 112
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
161 113
 //#define Z_DUAL_STEPPER_DRIVERS
162 114
 
163
-#ifdef Z_DUAL_STEPPER_DRIVERS
164
-  #undef EXTRUDERS
165
-  #define EXTRUDERS 1
166
-#endif
167
-
168 115
 // Same again but for Y Axis.
169 116
 //#define Y_DUAL_STEPPER_DRIVERS
170 117
 
171 118
 // Define if the two Y drives need to rotate in opposite directions
172 119
 #define INVERT_Y2_VS_Y_DIR true
173 120
 
174
-#ifdef Y_DUAL_STEPPER_DRIVERS
175
-  #undef EXTRUDERS
176
-  #define EXTRUDERS 1
177
-#endif
178
-
179
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
180
-  #error "You cannot have dual drivers for both Y and Z"
181
-#endif
182
-
183 121
 // Enable this for dual x-carriage printers.
184 122
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
185 123
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -236,14 +174,6 @@
236 174
 
237 175
 #define AXIS_RELATIVE_MODES {false, false, false, false}
238 176
 
239
-// @section hidden
240
-
241
-#ifdef CONFIG_STEPPERS_TOSHIBA
242
-  #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
243
-#else
244
-  #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
245
-#endif
246
-
247 177
 // @section machine
248 178
 
249 179
 //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
@@ -252,7 +182,7 @@
252 182
 #define INVERT_Z_STEP_PIN false
253 183
 #define INVERT_E_STEP_PIN false
254 184
 
255
-//default stepper release if idle. Set to 0 to deactivate.
185
+// Default stepper release if idle. Set to 0 to deactivate.
256 186
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
257 187
 
258 188
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
@@ -260,14 +190,9 @@
260 190
 
261 191
 // @section lcd
262 192
 
263
-// Feedrates for manual moves along X, Y, Z, E from panel
264 193
 #ifdef ULTIPANEL
265
-#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
266
-#endif
267
-
268
-//Comment to disable setting feedrate multiplier via encoder
269
-#ifdef ULTIPANEL
270
-    #define ULTIPANEL_FEEDMULTIPLY
194
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
195
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
271 196
 #endif
272 197
 
273 198
 // @section extras
@@ -288,13 +213,6 @@
288 213
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
289 214
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
290 215
 
291
-// MS1 MS2 Stepper Driver Microstepping mode table
292
-#define MICROSTEP1 LOW,LOW
293
-#define MICROSTEP2 HIGH,LOW
294
-#define MICROSTEP4 LOW,HIGH
295
-#define MICROSTEP8 HIGH,HIGH
296
-#define MICROSTEP16 HIGH,HIGH
297
-
298 216
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
299 217
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
300 218
 
@@ -342,12 +260,6 @@
342 260
   #define PROGRESS_MSG_EXPIRE   0
343 261
   // Enable this to show messages for MSG_TIME then hide them
344 262
   //#define PROGRESS_MSG_ONCE
345
-  #ifdef DOGLCD
346
-    #warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
347
-  #endif
348
-  #ifdef FILAMENT_LCD_DISPLAY
349
-    #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
350
-  #endif
351 263
 #endif
352 264
 
353 265
 // @section more
@@ -373,16 +285,6 @@
373 285
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
374 286
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375 287
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
376
-
377
-  #ifdef COREXY
378
-    #error BABYSTEPPING not implemented for COREXY yet.
379
-  #endif
380
-
381
-  #ifdef DELTA
382
-    #ifdef BABYSTEP_XY
383
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
384
-    #endif
385
-  #endif
386 288
 #endif
387 289
 
388 290
 // extruder advance constant (s2/mm3)
@@ -418,28 +320,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
418 320
 // be commented out otherwise
419 321
 #define SDCARDDETECTINVERTED
420 322
 
421
-// @section hidden
422
-
423
-#ifdef ULTIPANEL
424
- #undef SDCARDDETECTINVERTED
425
-#endif
426
-
427
-// Power Signal Control Definitions
428
-// By default use ATX definition
429
-#ifndef POWER_SUPPLY
430
-  #define POWER_SUPPLY 1
431
-#endif
432
-// 1 = ATX
433
-#if (POWER_SUPPLY == 1)
434
-  #define PS_ON_AWAKE  LOW
435
-  #define PS_ON_ASLEEP HIGH
436
-#endif
437
-// 2 = X-Box 360 203W
438
-#if (POWER_SUPPLY == 2)
439
-  #define PS_ON_AWAKE  HIGH
440
-  #define PS_ON_ASLEEP LOW
441
-#endif
442
-
443 323
 // @section temperature
444 324
 
445 325
 // Control heater 0 and heater 1 in parallel.
@@ -485,9 +365,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
485 365
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
486 366
 #endif
487 367
 
488
-//adds support for experimental filament exchange support M600; requires display
368
+// Add support for experimental filament exchange support M600; requires display
489 369
 #ifdef ULTIPANEL
490
-  #define FILAMENTCHANGEENABLE
370
+  //#define FILAMENTCHANGEENABLE
491 371
   #ifdef FILAMENTCHANGEENABLE
492 372
     #define FILAMENTCHANGE_XPOS 3
493 373
     #define FILAMENTCHANGE_YPOS 3
@@ -497,88 +377,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
497 377
   #endif
498 378
 #endif
499 379
 
500
-#ifdef FILAMENTCHANGEENABLE
501
-  #ifdef EXTRUDER_RUNOUT_PREVENT
502
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
503
-  #endif
504
-#endif
505
-
506
-//===========================================================================
507
-//=============================  Define Defines  ============================
508
-//===========================================================================
509
-
510
-// @section hidden
511
-
512
-#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
513
-  #error "Bed Auto Leveling is still not compatible with Delta Kinematics."
514
-#endif
515
-
516
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
517
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
518
-#endif
519
-
520
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
521
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
522
-#endif
523
-
524
-#if TEMP_SENSOR_0 > 0
525
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
526
-  #define HEATER_0_USES_THERMISTOR
527
-#endif
528
-#if TEMP_SENSOR_1 > 0
529
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
530
-  #define HEATER_1_USES_THERMISTOR
531
-#endif
532
-#if TEMP_SENSOR_2 > 0
533
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
534
-  #define HEATER_2_USES_THERMISTOR
535
-#endif
536
-#if TEMP_SENSOR_3 > 0
537
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
538
-  #define HEATER_3_USES_THERMISTOR
539
-#endif
540
-#if TEMP_SENSOR_BED > 0
541
-  #define THERMISTORBED TEMP_SENSOR_BED
542
-  #define BED_USES_THERMISTOR
543
-#endif
544
-#if TEMP_SENSOR_0 == -1
545
-  #define HEATER_0_USES_AD595
546
-#endif
547
-#if TEMP_SENSOR_1 == -1
548
-  #define HEATER_1_USES_AD595
549
-#endif
550
-#if TEMP_SENSOR_2 == -1
551
-  #define HEATER_2_USES_AD595
552
-#endif
553
-#if TEMP_SENSOR_3 == -1
554
-  #define HEATER_3_USES_AD595
555
-#endif
556
-#if TEMP_SENSOR_BED == -1
557
-  #define BED_USES_AD595
558
-#endif
559
-#if TEMP_SENSOR_0 == -2
560
-  #define HEATER_0_USES_MAX6675
561
-#endif
562
-#if TEMP_SENSOR_0 == 0
563
-  #undef HEATER_0_MINTEMP
564
-  #undef HEATER_0_MAXTEMP
565
-#endif
566
-#if TEMP_SENSOR_1 == 0
567
-  #undef HEATER_1_MINTEMP
568
-  #undef HEATER_1_MAXTEMP
569
-#endif
570
-#if TEMP_SENSOR_2 == 0
571
-  #undef HEATER_2_MINTEMP
572
-  #undef HEATER_2_MAXTEMP
573
-#endif
574
-#if TEMP_SENSOR_3 == 0
575
-  #undef HEATER_3_MINTEMP
576
-  #undef HEATER_3_MAXTEMP
577
-#endif
578
-#if TEMP_SENSOR_BED == 0
579
-  #undef BED_MINTEMP
580
-  #undef BED_MAXTEMP
581
-#endif
582
-
380
+#include "Conditionals.h"
381
+#include "SanityCheck.h"
583 382
 
584
-#endif //__CONFIGURATION_ADV_H
383
+#endif //CONFIGURATION_ADV_H

+ 33
- 170
Marlin/example_configurations/Felix/Configuration.h View File

@@ -296,15 +296,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
296 296
   // #define ENDSTOPPULLUP_ZMIN
297 297
 #endif
298 298
 
299
-#ifdef ENDSTOPPULLUPS
300
-  #define ENDSTOPPULLUP_XMAX
301
-  #define ENDSTOPPULLUP_YMAX
302
-  #define ENDSTOPPULLUP_ZMAX
303
-  #define ENDSTOPPULLUP_XMIN
304
-  #define ENDSTOPPULLUP_YMIN
305
-  #define ENDSTOPPULLUP_ZMIN
306
-#endif
307
-
308 299
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
309 300
 const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
310 301
 const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
@@ -353,10 +344,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
353 344
 #define Z_MAX_POS 235
354 345
 #define Z_MIN_POS 0
355 346
 
356
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
357
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
358
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
347
+//===========================================================================
348
+//============================= Filament Runout Sensor ======================
349
+//===========================================================================
350
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
351
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
352
+                                 // It is assumed that when logic high = filament available
353
+                                 //                    when logic  low = filament ran out
354
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
355
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
356
+
357
+//===========================================================================
358
+//============================ Manual Bed Leveling ==========================
359
+//===========================================================================
359 360
 
361
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
362
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
363
+
364
+#if defined(MESH_BED_LEVELING)
365
+  #define MESH_MIN_X 10
366
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
367
+  #define MESH_MIN_Y 10
368
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
369
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
370
+  #define MESH_NUM_Y_POINTS 3
371
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
372
+#endif  // MESH_BED_LEVELING
360 373
 
361 374
 //===========================================================================
362 375
 //============================= Bed Auto Leveling ===========================
@@ -451,29 +464,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
451 464
 
452 465
   #endif
453 466
 
454
-  #ifdef AUTO_BED_LEVELING_GRID	// Check if Probe_Offset * Grid Points is greater than Probing Range
455
-    #if X_PROBE_OFFSET_FROM_EXTRUDER < 0
456
-      #if (-(X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION))
457
-	     #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
458
-	  #endif
459
-	#else
460
-      #if ((X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION))
461
-	     #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
462
-	  #endif
463
-	#endif
464
-    #if Y_PROBE_OFFSET_FROM_EXTRUDER < 0
465
-      #if (-(Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION))
466
-	     #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
467
-	  #endif
468
-	#else
469
-      #if ((Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION))
470
-	     #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
471
-	  #endif
472
-	#endif
473
-
474
-
475
-  #endif
476
-
477 467
 #endif // ENABLE_AUTO_BED_LEVELING
478 468
 
479 469
 
@@ -609,112 +599,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
609 599
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
610 600
 //#define RA_CONTROL_PANEL
611 601
 
612
-//automatic expansion
613
-#if defined (MAKRPANEL)
614
- #define DOGLCD
615
- #define SDSUPPORT
616
- #define ULTIPANEL
617
- #define NEWPANEL
618
- #define DEFAULT_LCD_CONTRAST 17
619
-#endif
620
-
621
-#if defined(miniVIKI) || defined(VIKI2)
622
- #define ULTRA_LCD  //general LCD support, also 16x2
623
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
624
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
625
-
626
-  #ifdef miniVIKI
627
-   #define DEFAULT_LCD_CONTRAST 95
628
-  #else
629
-   #define DEFAULT_LCD_CONTRAST 40
630
-  #endif
631
-
632
- #define ENCODER_PULSES_PER_STEP 4
633
- #define ENCODER_STEPS_PER_MENU_ITEM 1
634
-#endif
635
-
636
-#if defined (PANEL_ONE)
637
- #define SDSUPPORT
638
- #define ULTIMAKERCONTROLLER
639
-#endif
640
-
641
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
642
- #define DOGLCD
643
- #define U8GLIB_ST7920
644
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
645
-#endif
646
-
647
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
648
- #define ULTIPANEL
649
- #define NEWPANEL
650
-#endif
651
-
652
-#if defined(REPRAPWORLD_KEYPAD)
653
-  #define NEWPANEL
654
-  #define ULTIPANEL
655
-#endif
656
-#if defined(RA_CONTROL_PANEL)
657
- #define ULTIPANEL
658
- #define NEWPANEL
659
- #define LCD_I2C_TYPE_PCA8574
660
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
661
-#endif
662
-
663
-//I2C PANELS
602
+/**
603
+ * I2C Panels
604
+ */
664 605
 
665 606
 //#define LCD_I2C_SAINSMART_YWROBOT
666
-#ifdef LCD_I2C_SAINSMART_YWROBOT
667
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
668
-  // Make sure it is placed in the Arduino libraries directory.
669
-  #define LCD_I2C_TYPE_PCF8575
670
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
671
-  #define NEWPANEL
672
-  #define ULTIPANEL
673
-#endif
674 607
 
675 608
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
676 609
 //#define LCD_I2C_PANELOLU2
677
-#ifdef LCD_I2C_PANELOLU2
678
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
679
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
680
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
681
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
682
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
683
-  #define LCD_I2C_TYPE_MCP23017
684
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
685
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
686
-  #define NEWPANEL
687
-  #define ULTIPANEL
688
-
689
-  #ifndef ENCODER_PULSES_PER_STEP
690
-	#define ENCODER_PULSES_PER_STEP 4
691
-  #endif
692
-
693
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
694
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
695
-  #endif
696
-
697
-
698
-  #ifdef LCD_USE_I2C_BUZZER
699
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
700
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
701
-  #endif
702
-
703
-#endif
704 610
 
705 611
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
706 612
 //#define LCD_I2C_VIKI
707
-#ifdef LCD_I2C_VIKI
708
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
709
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
710
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
711
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
712
-  #define LCD_I2C_TYPE_MCP23017
713
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
714
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
715
-  #define NEWPANEL
716
-  #define ULTIPANEL
717
-#endif
718 613
 
719 614
 // Shift register panels
720 615
 // ---------------------
@@ -722,42 +617,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
722 617
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
723 618
 
724 619
 //#define SAV_3DLCD
725
-#ifdef SAV_3DLCD
726
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
727
-   #define NEWPANEL
728
-   #define ULTIPANEL
729
-#endif
730
-
731
-
732
-#ifdef ULTIPANEL
733
-  #define NEWPANEL  //enable this if you have a click-encoder panel
734
-  #define SDSUPPORT
735
-  #define ULTRA_LCD
736
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
737
-    #define LCD_WIDTH 22
738
-    #define LCD_HEIGHT 5
739
-  #else
740
-    #define LCD_WIDTH 20
741
-    #define LCD_HEIGHT 4
742
-  #endif
743
-#else //no panel but just LCD
744
-  #ifdef ULTRA_LCD
745
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
746
-    #define LCD_WIDTH 22
747
-    #define LCD_HEIGHT 5
748
-  #else
749
-    #define LCD_WIDTH 16
750
-    #define LCD_HEIGHT 2
751
-  #endif
752
-  #endif
753
-#endif
754
-
755
-// default LCD contrast for dogm-like LCD displays
756
-#ifdef DOGLCD
757
-# ifndef DEFAULT_LCD_CONTRAST
758
-#  define DEFAULT_LCD_CONTRAST 32
759
-# endif
760
-#endif
761 620
 
762 621
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
763 622
 #define FAST_PWM_FAN
@@ -842,7 +701,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
842 701
 //#define FILAMENT_LCD_DISPLAY
843 702
 
844 703
 
704
+
705
+
706
+
707
+
845 708
 #include "Configuration_adv.h"
846 709
 #include "thermistortables.h"
847 710
 
848
-#endif //__CONFIGURATION_H
711
+#endif //CONFIGURATION_H

+ 33
- 169
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -296,15 +296,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
296 296
   // #define ENDSTOPPULLUP_ZMIN
297 297
 #endif
298 298
 
299
-#ifdef ENDSTOPPULLUPS
300
-  #define ENDSTOPPULLUP_XMAX
301
-  #define ENDSTOPPULLUP_YMAX
302
-  #define ENDSTOPPULLUP_ZMAX
303
-  #define ENDSTOPPULLUP_XMIN
304
-  #define ENDSTOPPULLUP_YMIN
305
-  #define ENDSTOPPULLUP_ZMIN
306
-#endif
307
-
308 299
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
309 300
 const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
310 301
 const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
@@ -353,10 +344,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
353 344
 #define Z_MAX_POS 235
354 345
 #define Z_MIN_POS 0
355 346
 
356
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
357
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
358
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
347
+//===========================================================================
348
+//============================= Filament Runout Sensor ======================
349
+//===========================================================================
350
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
351
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
352
+                                 // It is assumed that when logic high = filament available
353
+                                 //                    when logic  low = filament ran out
354
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
355
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
356
+
357
+//===========================================================================
358
+//============================ Manual Bed Leveling ==========================
359
+//===========================================================================
359 360
 
361
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
362
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
363
+
364
+#if defined(MESH_BED_LEVELING)
365
+  #define MESH_MIN_X 10
366
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
367
+  #define MESH_MIN_Y 10
368
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
369
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
370
+  #define MESH_NUM_Y_POINTS 3
371
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
372
+#endif  // MESH_BED_LEVELING
360 373
 
361 374
 //===========================================================================
362 375
 //============================= Bed Auto Leveling ===========================
@@ -451,29 +464,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
451 464
 
452 465
   #endif
453 466
 
454
-  #ifdef AUTO_BED_LEVELING_GRID	// Check if Probe_Offset * Grid Points is greater than Probing Range
455
-    #if X_PROBE_OFFSET_FROM_EXTRUDER < 0
456
-      #if (-(X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION))
457
-	     #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
458
-	  #endif
459
-	#else
460
-      #if ((X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION))
461
-	     #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
462
-	  #endif
463
-	#endif
464
-    #if Y_PROBE_OFFSET_FROM_EXTRUDER < 0
465
-      #if (-(Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION))
466
-	     #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
467
-	  #endif
468
-	#else
469
-      #if ((Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION))
470
-	     #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
471
-	  #endif
472
-	#endif
473
-
474
-
475
-  #endif
476
-
477 467
 #endif // ENABLE_AUTO_BED_LEVELING
478 468
 
479 469
 
@@ -609,112 +599,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
609 599
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
610 600
 //#define RA_CONTROL_PANEL
611 601
 
612
-//automatic expansion
613
-#if defined (MAKRPANEL)
614
- #define DOGLCD
615
- #define SDSUPPORT
616
- #define ULTIPANEL
617
- #define NEWPANEL
618
- #define DEFAULT_LCD_CONTRAST 17
619
-#endif
620
-
621
-#if defined(miniVIKI) || defined(VIKI2)
622
- #define ULTRA_LCD  //general LCD support, also 16x2
623
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
624
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
625
-
626
-  #ifdef miniVIKI
627
-   #define DEFAULT_LCD_CONTRAST 95
628
-  #else
629
-   #define DEFAULT_LCD_CONTRAST 40
630
-  #endif
631
-
632
- #define ENCODER_PULSES_PER_STEP 4
633
- #define ENCODER_STEPS_PER_MENU_ITEM 1
634
-#endif
635
-
636
-#if defined (PANEL_ONE)
637
- #define SDSUPPORT
638
- #define ULTIMAKERCONTROLLER
639
-#endif
640
-
641
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
642
- #define DOGLCD
643
- #define U8GLIB_ST7920
644
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
645
-#endif
646
-
647
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
648
- #define ULTIPANEL
649
- #define NEWPANEL
650
-#endif
651
-
652
-#if defined(REPRAPWORLD_KEYPAD)
653
-  #define NEWPANEL
654
-  #define ULTIPANEL
655
-#endif
656
-#if defined(RA_CONTROL_PANEL)
657
- #define ULTIPANEL
658
- #define NEWPANEL
659
- #define LCD_I2C_TYPE_PCA8574
660
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
661
-#endif
662
-
663
-//I2C PANELS
602
+/**
603
+ * I2C Panels
604
+ */
664 605
 
665 606
 //#define LCD_I2C_SAINSMART_YWROBOT
666
-#ifdef LCD_I2C_SAINSMART_YWROBOT
667
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
668
-  // Make sure it is placed in the Arduino libraries directory.
669
-  #define LCD_I2C_TYPE_PCF8575
670
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
671
-  #define NEWPANEL
672
-  #define ULTIPANEL
673
-#endif
674 607
 
675 608
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
676 609
 //#define LCD_I2C_PANELOLU2
677
-#ifdef LCD_I2C_PANELOLU2
678
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
679
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
680
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
681
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
682
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
683
-  #define LCD_I2C_TYPE_MCP23017
684
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
685
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
686
-  #define NEWPANEL
687
-  #define ULTIPANEL
688
-
689
-  #ifndef ENCODER_PULSES_PER_STEP
690
-	#define ENCODER_PULSES_PER_STEP 4
691
-  #endif
692
-
693
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
694
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
695
-  #endif
696
-
697
-
698
-  #ifdef LCD_USE_I2C_BUZZER
699
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
700
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
701
-  #endif
702
-
703
-#endif
704 610
 
705 611
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
706 612
 //#define LCD_I2C_VIKI
707
-#ifdef LCD_I2C_VIKI
708
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
709
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
710
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
711
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
712
-  #define LCD_I2C_TYPE_MCP23017
713
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
714
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
715
-  #define NEWPANEL
716
-  #define ULTIPANEL
717
-#endif
718 613
 
719 614
 // Shift register panels
720 615
 // ---------------------
@@ -722,42 +617,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
722 617
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
723 618
 
724 619
 //#define SAV_3DLCD
725
-#ifdef SAV_3DLCD
726
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
727
-   #define NEWPANEL
728
-   #define ULTIPANEL
729
-#endif
730
-
731
-
732
-#ifdef ULTIPANEL
733
-  #define NEWPANEL  //enable this if you have a click-encoder panel
734
-  #define SDSUPPORT
735
-  #define ULTRA_LCD
736
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
737
-    #define LCD_WIDTH 22
738
-    #define LCD_HEIGHT 5
739
-  #else
740
-    #define LCD_WIDTH 20
741
-    #define LCD_HEIGHT 4
742
-  #endif
743
-#else //no panel but just LCD
744
-  #ifdef ULTRA_LCD
745
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
746
-    #define LCD_WIDTH 22
747
-    #define LCD_HEIGHT 5
748
-  #else
749
-    #define LCD_WIDTH 16
750
-    #define LCD_HEIGHT 2
751
-  #endif
752
-  #endif
753
-#endif
754 620
 
755
-// default LCD contrast for dogm-like LCD displays
756
-#ifdef DOGLCD
757
-# ifndef DEFAULT_LCD_CONTRAST
758
-#  define DEFAULT_LCD_CONTRAST 32
759
-# endif
760
-#endif
761 621
 
762 622
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
763 623
 #define FAST_PWM_FAN
@@ -842,7 +702,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
842 702
 //#define FILAMENT_LCD_DISPLAY
843 703
 
844 704
 
705
+
706
+
707
+
708
+
845 709
 #include "Configuration_adv.h"
846 710
 #include "thermistortables.h"
847 711
 
848
-#endif //__CONFIGURATION_H
712
+#endif //CONFIGURATION_H

+ 11
- 186
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers.
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -218,31 +158,22 @@
218 158
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
219 159
 
220 160
 #define AXIS_RELATIVE_MODES {false, false, false, false}
221
-#ifdef CONFIG_STEPPERS_TOSHIBA
222
-#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
223
-#else
224
-#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
225
-#endif
161
+
226 162
 //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
227 163
 #define INVERT_X_STEP_PIN false
228 164
 #define INVERT_Y_STEP_PIN false
229 165
 #define INVERT_Z_STEP_PIN false
230 166
 #define INVERT_E_STEP_PIN false
231 167
 
232
-//default stepper release if idle. Set to 0 to deactivate.
168
+// Default stepper release if idle. Set to 0 to deactivate.
233 169
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
234 170
 
235 171
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
236 172
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
237 173
 
238
-// Feedrates for manual moves along X, Y, Z, E from panel
239 174
 #ifdef ULTIPANEL
240
-#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
241
-#endif
242
-
243
-//Comment to disable setting feedrate multiplier via encoder
244
-#ifdef ULTIPANEL
245
-    #define ULTIPANEL_FEEDMULTIPLY
175
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
176
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
246 177
 #endif
247 178
 
248 179
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -261,13 +192,6 @@
261 192
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
262 193
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
263 194
 
264
-// MS1 MS2 Stepper Driver Microstepping mode table
265
-#define MICROSTEP1 LOW,LOW
266
-#define MICROSTEP2 HIGH,LOW
267
-#define MICROSTEP4 LOW,HIGH
268
-#define MICROSTEP8 HIGH,HIGH
269
-#define MICROSTEP16 HIGH,HIGH
270
-
271 195
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
272 196
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
273 197
 
@@ -313,12 +237,6 @@
313 237
   #define PROGRESS_MSG_EXPIRE   0
314 238
   // Enable this to show messages for MSG_TIME then hide them
315 239
   //#define PROGRESS_MSG_ONCE
316
-  #ifdef DOGLCD
317
-    #warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
318
-  #endif
319
-  #ifdef FILAMENT_LCD_DISPLAY
320
-    #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
321
-  #endif
322 240
 #endif
323 241
 
324 242
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
@@ -342,16 +260,6 @@
342 260
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
343 261
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
344 262
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
345
-
346
-  #ifdef COREXY
347
-    #error BABYSTEPPING not implemented for COREXY yet.
348
-  #endif
349
-
350
-  #ifdef DELTA
351
-    #ifdef BABYSTEP_XY
352
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
353
-    #endif
354
-  #endif
355 263
 #endif
356 264
 
357 265
 // extruder advance constant (s2/mm3)
@@ -365,12 +273,8 @@
365 273
 
366 274
 #ifdef ADVANCE
367 275
   #define EXTRUDER_ADVANCE_K .0
368
-
369 276
   #define D_FILAMENT 2.85
370 277
   #define STEPS_MM_E 836
371
-  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
372
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
373
-
374 278
 #endif // ADVANCE
375 279
 
376 280
 // Arc interpretation settings:
@@ -444,9 +348,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
444 348
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
445 349
 #endif
446 350
 
447
-//adds support for experimental filament exchange support M600; requires display
351
+// Add support for experimental filament exchange support M600; requires display
448 352
 #ifdef ULTIPANEL
449
-  #define FILAMENTCHANGEENABLE
353
+  //#define FILAMENTCHANGEENABLE
450 354
   #ifdef FILAMENTCHANGEENABLE
451 355
     #define FILAMENTCHANGE_XPOS 3
452 356
     #define FILAMENTCHANGE_YPOS 3
@@ -456,86 +360,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
456 360
   #endif
457 361
 #endif
458 362
 
459
-#ifdef FILAMENTCHANGEENABLE
460
-  #ifdef EXTRUDER_RUNOUT_PREVENT
461
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
462
-  #endif
463
-#endif
464
-
465
-//===========================================================================
466
-//=============================  Define Defines  ============================
467
-//===========================================================================
468
-
469
-#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
470
-  #error "Bed Auto Leveling is still not compatible with Delta Kinematics."
471
-#endif
472
-
473
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
474
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
475
-#endif
476
-
477
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
478
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
479
-#endif
480
-
481
-#if TEMP_SENSOR_0 > 0
482
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
483
-  #define HEATER_0_USES_THERMISTOR
484
-#endif
485
-#if TEMP_SENSOR_1 > 0
486
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
487
-  #define HEATER_1_USES_THERMISTOR
488
-#endif
489
-#if TEMP_SENSOR_2 > 0
490
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
491
-  #define HEATER_2_USES_THERMISTOR
492
-#endif
493
-#if TEMP_SENSOR_3 > 0
494
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
495
-  #define HEATER_3_USES_THERMISTOR
496
-#endif
497
-#if TEMP_SENSOR_BED > 0
498
-  #define THERMISTORBED TEMP_SENSOR_BED
499
-  #define BED_USES_THERMISTOR
500
-#endif
501
-#if TEMP_SENSOR_0 == -1
502
-  #define HEATER_0_USES_AD595
503
-#endif
504
-#if TEMP_SENSOR_1 == -1
505
-  #define HEATER_1_USES_AD595
506
-#endif
507
-#if TEMP_SENSOR_2 == -1
508
-  #define HEATER_2_USES_AD595
509
-#endif
510
-#if TEMP_SENSOR_3 == -1
511
-  #define HEATER_3_USES_AD595
512
-#endif
513
-#if TEMP_SENSOR_BED == -1
514
-  #define BED_USES_AD595
515
-#endif
516
-#if TEMP_SENSOR_0 == -2
517
-  #define HEATER_0_USES_MAX6675
518
-#endif
519
-#if TEMP_SENSOR_0 == 0
520
-  #undef HEATER_0_MINTEMP
521
-  #undef HEATER_0_MAXTEMP
522
-#endif
523
-#if TEMP_SENSOR_1 == 0
524
-  #undef HEATER_1_MINTEMP
525
-  #undef HEATER_1_MAXTEMP
526
-#endif
527
-#if TEMP_SENSOR_2 == 0
528
-  #undef HEATER_2_MINTEMP
529
-  #undef HEATER_2_MAXTEMP
530
-#endif
531
-#if TEMP_SENSOR_3 == 0
532
-  #undef HEATER_3_MINTEMP
533
-  #undef HEATER_3_MAXTEMP
534
-#endif
535
-#if TEMP_SENSOR_BED == 0
536
-  #undef BED_MINTEMP
537
-  #undef BED_MAXTEMP
538
-#endif
539
-
363
+#include "Conditionals.h"
364
+#include "SanityCheck.h"
540 365
 
541
-#endif //__CONFIGURATION_ADV_H
366
+#endif //CONFIGURATION_ADV_H

+ 34
- 152
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -322,15 +322,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
322 322
   // #define ENDSTOPPULLUP_ZMIN
323 323
 #endif
324 324
 
325
-#ifdef ENDSTOPPULLUPS
326
-  #define ENDSTOPPULLUP_XMAX
327
-  #define ENDSTOPPULLUP_YMAX
328
-  #define ENDSTOPPULLUP_ZMAX
329
-  #define ENDSTOPPULLUP_XMIN
330
-  #define ENDSTOPPULLUP_YMIN
331
-  #define ENDSTOPPULLUP_ZMIN
332
-#endif
333
-
334 325
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
335 326
 const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
336 327
 const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
@@ -379,10 +370,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
379 370
 #define Z_MAX_POS 180
380 371
 #define Z_MIN_POS 0
381 372
 
382
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
383
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
384
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
373
+//===========================================================================
374
+//============================= Filament Runout Sensor ======================
375
+//===========================================================================
376
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
377
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
378
+                                 // It is assumed that when logic high = filament available
379
+                                 //                    when logic  low = filament ran out
380
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
381
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
382
+
383
+//===========================================================================
384
+//============================ Manual Bed Leveling ==========================
385
+//===========================================================================
385 386
 
387
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
388
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
389
+
390
+#if defined(MESH_BED_LEVELING)
391
+  #define MESH_MIN_X 10
392
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
393
+  #define MESH_MIN_Y 10
394
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
395
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
396
+  #define MESH_NUM_Y_POINTS 3
397
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
398
+#endif  // MESH_BED_LEVELING
386 399
 
387 400
 //===========================================================================
388 401
 //============================= Bed Auto Leveling ===========================
@@ -614,112 +627,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
614 627
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
615 628
 //#define RA_CONTROL_PANEL
616 629
 
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(miniVIKI) || defined(VIKI2)
627
- #define ULTRA_LCD  //general LCD support, also 16x2
628
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
629
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
630
- 
631
-  #ifdef miniVIKI
632
-   #define DEFAULT_LCD_CONTRAST 95
633
-  #else
634
-   #define DEFAULT_LCD_CONTRAST 40
635
-  #endif
636
-  
637
- #define ENCODER_PULSES_PER_STEP 4
638
- #define ENCODER_STEPS_PER_MENU_ITEM 1
639
-#endif
640
-
641
-#if defined (PANEL_ONE)
642
- #define SDSUPPORT
643
- #define ULTIMAKERCONTROLLER
644
-#endif
645
-
646
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
647
- #define DOGLCD
648
- #define U8GLIB_ST7920
649
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
650
-#endif
651
-
652
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
653
- #define ULTIPANEL
654
- #define NEWPANEL
655
-#endif
656
-
657
-#if defined(REPRAPWORLD_KEYPAD)
658
-  #define NEWPANEL
659
-  #define ULTIPANEL
660
-#endif
661
-#if defined(RA_CONTROL_PANEL)
662
- #define ULTIPANEL
663
- #define NEWPANEL
664
- #define LCD_I2C_TYPE_PCA8574
665
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
666
-#endif
667
-
668
-//I2C PANELS
630
+/**
631
+ * I2C Panels
632
+ */
669 633
 
670 634
 //#define LCD_I2C_SAINSMART_YWROBOT
671
-#ifdef LCD_I2C_SAINSMART_YWROBOT
672
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
673
-  // Make sure it is placed in the Arduino libraries directory.
674
-  #define LCD_I2C_TYPE_PCF8575
675
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
676
-  #define NEWPANEL
677
-  #define ULTIPANEL
678
-#endif
679 635
 
680 636
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
681 637
 //#define LCD_I2C_PANELOLU2
682
-#ifdef LCD_I2C_PANELOLU2
683
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
684
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
685
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
686
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
687
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
688
-  #define LCD_I2C_TYPE_MCP23017
689
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
690
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
691
-  #define NEWPANEL
692
-  #define ULTIPANEL
693
-
694
-  #ifndef ENCODER_PULSES_PER_STEP
695
-	#define ENCODER_PULSES_PER_STEP 4
696
-  #endif
697
-
698
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
699
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
700
-  #endif
701
-
702
-
703
-  #ifdef LCD_USE_I2C_BUZZER
704
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
705
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
706
-  #endif
707
-
708
-#endif
709 638
 
710 639
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
711 640
 //#define LCD_I2C_VIKI
712
-#ifdef LCD_I2C_VIKI
713
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
714
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
715
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
716
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
717
-  #define LCD_I2C_TYPE_MCP23017
718
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
719
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
720
-  #define NEWPANEL
721
-  #define ULTIPANEL
722
-#endif
723 641
 
724 642
 // Shift register panels
725 643
 // ---------------------
@@ -727,51 +645,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
727 645
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
728 646
 
729 647
 //#define SAV_3DLCD
730
-#ifdef SAV_3DLCD
731
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
732
-   #define NEWPANEL
733
-   #define ULTIPANEL
734
-#endif
735
-
736
-
737
-#ifdef ULTIPANEL
738
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
739
-  #define SDSUPPORT
740
-  #define ULTRA_LCD
741
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
742
-    #define LCD_WIDTH 22
743
-    #define LCD_HEIGHT 5
744
-  #else
745
-    #define LCD_WIDTH 20
746
-    #define LCD_HEIGHT 4
747
-  #endif
748
-#else //no panel but just LCD
749
-  #ifdef ULTRA_LCD
750
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
751
-    #define LCD_WIDTH 22
752
-    #define LCD_HEIGHT 5
753
-  #else
754
-    #define LCD_WIDTH 16
755
-    #define LCD_HEIGHT 2
756
-  #endif
757
-  #endif
758
-#endif
759
-
760
-// default LCD contrast for dogm-like LCD displays
761
-#ifdef DOGLCD
762
-# ifndef DEFAULT_LCD_CONTRAST
763
-#  define DEFAULT_LCD_CONTRAST 32
764
-# endif
765
-#endif
766 648
 
767 649
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
768 650
 //#define FAST_PWM_FAN
769 651
 
770
-// Temperature status LEDs that display the hotend and bet temperature.
771
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
772
-// Otherwise the RED led is on. There is 1C hysteresis.
773
-//#define TEMP_STAT_LEDS
774
-
775 652
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
776 653
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
777 654
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -783,6 +660,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
783 660
 // at zero value, there are 128 effective control positions.
784 661
 #define SOFT_PWM_SCALE 0
785 662
 
663
+// Temperature status LEDs that display the hotend and bet temperature.
664
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
665
+// Otherwise the RED led is on. There is 1C hysteresis.
666
+//#define TEMP_STAT_LEDS
667
+
786 668
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
787 669
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
788 670
 // #define PHOTOGRAPH_PIN     23
@@ -854,4 +736,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
854 736
 #include "Configuration_adv.h"
855 737
 #include "thermistortables.h"
856 738
 
857
-#endif //__CONFIGURATION_H
739
+#endif //CONFIGURATION_H

+ 10
- 201
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 //#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers.
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -229,20 +169,15 @@
229 169
 #define INVERT_Z_STEP_PIN false
230 170
 #define INVERT_E_STEP_PIN false
231 171
 
232
-//default stepper release if idle. Set to 0 to deactivate.
172
+// Default stepper release if idle. Set to 0 to deactivate.
233 173
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
234 174
 
235 175
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
236 176
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
237 177
 
238
-// Feedrates for manual moves along X, Y, Z, E from panel
239 178
 #ifdef ULTIPANEL
240
-#define MANUAL_FEEDRATE {120*60, 120*60, 18*60, 60}  // set the speeds for manual moves (mm/min)
241
-#endif
242
-
243
-//Comment to disable setting feedrate multiplier via encoder
244
-#ifdef ULTIPANEL
245
-    #define ULTIPANEL_FEEDMULTIPLY
179
+  #define MANUAL_FEEDRATE {120*60, 120*60, 18*60, 60}  // Feedrates for manual moves along X, Y, Z, E from panel
180
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
246 181
 #endif
247 182
 
248 183
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -261,13 +196,6 @@
261 196
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
262 197
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
263 198
 
264
-// MS1 MS2 Stepper Driver Microstepping mode table
265
-#define MICROSTEP1 LOW,LOW
266
-#define MICROSTEP2 HIGH,LOW
267
-#define MICROSTEP4 LOW,HIGH
268
-#define MICROSTEP8 HIGH,HIGH
269
-#define MICROSTEP16 HIGH,HIGH
270
-
271 199
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
272 200
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
273 201
 
@@ -313,12 +241,6 @@
313 241
   #define PROGRESS_MSG_EXPIRE   0
314 242
   // Enable this to show messages for MSG_TIME then hide them
315 243
   //#define PROGRESS_MSG_ONCE
316
-  #ifdef DOGLCD
317
-    #warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
318
-  #endif
319
-  #ifdef FILAMENT_LCD_DISPLAY
320
-    #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
321
-  #endif
322 244
 #endif
323 245
 
324 246
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
@@ -342,16 +264,6 @@
342 264
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
343 265
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
344 266
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
345
-
346
-  #ifdef COREXY
347
-    #error BABYSTEPPING not implemented for COREXY yet.
348
-  #endif
349
-
350
-  #ifdef DELTA
351
-    #ifdef BABYSTEP_XY
352
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
353
-    #endif
354
-  #endif
355 267
 #endif
356 268
 
357 269
 // extruder advance constant (s2/mm3)
@@ -365,12 +277,8 @@
365 277
 
366 278
 #ifdef ADVANCE
367 279
   #define EXTRUDER_ADVANCE_K .0
368
-
369 280
   #define D_FILAMENT 1.75
370 281
   #define STEPS_MM_E 100.47095761381482
371
-  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
372
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
373
-
374 282
 #endif // ADVANCE
375 283
 
376 284
 // Arc interpretation settings:
@@ -385,26 +293,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
385 293
 // be commented out otherwise
386 294
 #define SDCARDDETECTINVERTED
387 295
 
388
-#ifdef ULTIPANEL
389
- #undef SDCARDDETECTINVERTED
390
-#endif
391
-
392
-// Power Signal Control Definitions
393
-// By default use ATX definition
394
-#ifndef POWER_SUPPLY
395
-  #define POWER_SUPPLY 1
396
-#endif
397
-// 1 = ATX
398
-#if (POWER_SUPPLY == 1)
399
-  #define PS_ON_AWAKE  LOW
400
-  #define PS_ON_ASLEEP HIGH
401
-#endif
402
-// 2 = X-Box 360 203W
403
-#if (POWER_SUPPLY == 2)
404
-  #define PS_ON_AWAKE  HIGH
405
-  #define PS_ON_ASLEEP LOW
406
-#endif
407
-
408 296
 // Control heater 0 and heater 1 in parallel.
409 297
 //#define HEATERS_PARALLEL
410 298
 
@@ -444,9 +332,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
444 332
   #define RETRACT_RECOVER_FEEDRATE 8*60     //default feedrate for recovering from retraction (mm/s)
445 333
 #endif
446 334
 
447
-//adds support for experimental filament exchange support M600; requires display
335
+// Add support for experimental filament exchange support M600; requires display
448 336
 #ifdef ULTIPANEL
449
-  #define FILAMENTCHANGEENABLE
337
+  //#define FILAMENTCHANGEENABLE
450 338
   #ifdef FILAMENTCHANGEENABLE
451 339
     #define FILAMENTCHANGE_XPOS 3
452 340
     #define FILAMENTCHANGE_YPOS 3
@@ -456,86 +344,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
456 344
   #endif
457 345
 #endif
458 346
 
459
-#ifdef FILAMENTCHANGEENABLE
460
-  #ifdef EXTRUDER_RUNOUT_PREVENT
461
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
462
-  #endif
463
-#endif
464
-
465
-//===========================================================================
466
-//=============================  Define Defines  ============================
467
-//===========================================================================
468
-
469
-#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
470
-  #error "Bed Auto Leveling is still not compatible with Delta Kinematics."
471
-#endif
472
-
473
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
474
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
475
-#endif
476
-
477
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
478
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
479
-#endif
480
-
481
-#if TEMP_SENSOR_0 > 0
482
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
483
-  #define HEATER_0_USES_THERMISTOR
484
-#endif
485
-#if TEMP_SENSOR_1 > 0
486
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
487
-  #define HEATER_1_USES_THERMISTOR
488
-#endif
489
-#if TEMP_SENSOR_2 > 0
490
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
491
-  #define HEATER_2_USES_THERMISTOR
492
-#endif
493
-#if TEMP_SENSOR_3 > 0
494
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
495
-  #define HEATER_3_USES_THERMISTOR
496
-#endif
497
-#if TEMP_SENSOR_BED > 0
498
-  #define THERMISTORBED TEMP_SENSOR_BED
499
-  #define BED_USES_THERMISTOR
500
-#endif
501
-#if TEMP_SENSOR_0 == -1
502
-  #define HEATER_0_USES_AD595
503
-#endif
504
-#if TEMP_SENSOR_1 == -1
505
-  #define HEATER_1_USES_AD595
506
-#endif
507
-#if TEMP_SENSOR_2 == -1
508
-  #define HEATER_2_USES_AD595
509
-#endif
510
-#if TEMP_SENSOR_3 == -1
511
-  #define HEATER_3_USES_AD595
512
-#endif
513
-#if TEMP_SENSOR_BED == -1
514
-  #define BED_USES_AD595
515
-#endif
516
-#if TEMP_SENSOR_0 == -2
517
-  #define HEATER_0_USES_MAX6675
518
-#endif
519
-#if TEMP_SENSOR_0 == 0
520
-  #undef HEATER_0_MINTEMP
521
-  #undef HEATER_0_MAXTEMP
522
-#endif
523
-#if TEMP_SENSOR_1 == 0
524
-  #undef HEATER_1_MINTEMP
525
-  #undef HEATER_1_MAXTEMP
526
-#endif
527
-#if TEMP_SENSOR_2 == 0
528
-  #undef HEATER_2_MINTEMP
529
-  #undef HEATER_2_MAXTEMP
530
-#endif
531
-#if TEMP_SENSOR_3 == 0
532
-  #undef HEATER_3_MINTEMP
533
-  #undef HEATER_3_MAXTEMP
534
-#endif
535
-#if TEMP_SENSOR_BED == 0
536
-  #undef BED_MINTEMP
537
-  #undef BED_MAXTEMP
538
-#endif
539
-
347
+#include "Conditionals.h"
348
+#include "SanityCheck.h"
540 349
 
541
-#endif //__CONFIGURATION_ADV_H
350
+#endif //CONFIGURATION_ADV_H

+ 34
- 152
Marlin/example_configurations/K8200/Configuration.h View File

@@ -327,15 +327,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
327 327
   #define ENDSTOPPULLUP_ZMIN
328 328
 #endif
329 329
 
330
-#ifdef ENDSTOPPULLUPS
331
-  // #define ENDSTOPPULLUP_XMAX
332
-  // #define ENDSTOPPULLUP_YMAX
333
-  // #define ENDSTOPPULLUP_ZMAX
334
-  #define ENDSTOPPULLUP_XMIN
335
-  #define ENDSTOPPULLUP_YMIN
336
-  #define ENDSTOPPULLUP_ZMIN
337
-#endif
338
-
339 330
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
340 331
 const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
341 332
 const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
@@ -384,10 +375,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
384 375
 #define Z_MAX_POS 200
385 376
 #define Z_MIN_POS 0
386 377
 
387
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
388
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
389
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
378
+//===========================================================================
379
+//============================= Filament Runout Sensor ======================
380
+//===========================================================================
381
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
382
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
383
+                                 // It is assumed that when logic high = filament available
384
+                                 //                    when logic  low = filament ran out
385
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
386
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
390 387
 
388
+//===========================================================================
389
+//============================ Manual Bed Leveling ==========================
390
+//===========================================================================
391
+
392
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
393
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
394
+
395
+#if defined(MESH_BED_LEVELING)
396
+  #define MESH_MIN_X 10
397
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
398
+  #define MESH_MIN_Y 10
399
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
400
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
401
+  #define MESH_NUM_Y_POINTS 3
402
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
403
+#endif  // MESH_BED_LEVELING
391 404
 
392 405
 //===========================================================================
393 406
 //============================= Bed Auto Leveling ===========================
@@ -618,112 +631,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
618 631
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
619 632
 //#define RA_CONTROL_PANEL
620 633
 
621
-//automatic expansion
622
-#if defined (MAKRPANEL)
623
- #define DOGLCD
624
- #define SDSUPPORT
625
- #define ULTIPANEL
626
- #define NEWPANEL
627
- #define DEFAULT_LCD_CONTRAST 17
628
-#endif
629
-
630
-#if defined(miniVIKI) || defined(VIKI2)
631
- #define ULTRA_LCD  //general LCD support, also 16x2
632
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
633
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
634
- 
635
-  #ifdef miniVIKI
636
-   #define DEFAULT_LCD_CONTRAST 95
637
-  #else
638
-   #define DEFAULT_LCD_CONTRAST 40
639
-  #endif
640
-  
641
- #define ENCODER_PULSES_PER_STEP 4
642
- #define ENCODER_STEPS_PER_MENU_ITEM 1
643
-#endif
644
-
645
-#if defined (PANEL_ONE)
646
- #define SDSUPPORT
647
- #define ULTIMAKERCONTROLLER
648
-#endif
649
-
650
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
651
- #define DOGLCD
652
- #define U8GLIB_ST7920
653
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
654
-#endif
655
-
656
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
657
- #define ULTIPANEL
658
- #define NEWPANEL
659
-#endif
660
-
661
-#if defined(REPRAPWORLD_KEYPAD)
662
-  #define NEWPANEL
663
-  #define ULTIPANEL
664
-#endif
665
-#if defined(RA_CONTROL_PANEL)
666
- #define ULTIPANEL
667
- #define NEWPANEL
668
- #define LCD_I2C_TYPE_PCA8574
669
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
670
-#endif
671
-
672
-//I2C PANELS
634
+/**
635
+ * I2C Panels
636
+ */
673 637
 
674 638
 //#define LCD_I2C_SAINSMART_YWROBOT
675
-#ifdef LCD_I2C_SAINSMART_YWROBOT
676
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
677
-  // Make sure it is placed in the Arduino libraries directory.
678
-  #define LCD_I2C_TYPE_PCF8575
679
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
680
-  #define NEWPANEL
681
-  #define ULTIPANEL
682
-#endif
683 639
 
684 640
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
685 641
 //#define LCD_I2C_PANELOLU2
686
-#ifdef LCD_I2C_PANELOLU2
687
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
688
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
689
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
690
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
691
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
692
-  #define LCD_I2C_TYPE_MCP23017
693
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
694
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
695
-  #define NEWPANEL
696
-  #define ULTIPANEL
697
-
698
-  #ifndef ENCODER_PULSES_PER_STEP
699
-	#define ENCODER_PULSES_PER_STEP 4
700
-  #endif
701
-
702
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
703
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
704
-  #endif
705
-
706
-
707
-  #ifdef LCD_USE_I2C_BUZZER
708
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
709
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
710
-  #endif
711
-
712
-#endif
713 642
 
714 643
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
715 644
 //#define LCD_I2C_VIKI
716
-#ifdef LCD_I2C_VIKI
717
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
718
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
719
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
720
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
721
-  #define LCD_I2C_TYPE_MCP23017
722
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
723
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
724
-  #define NEWPANEL
725
-  #define ULTIPANEL
726
-#endif
727 645
 
728 646
 // Shift register panels
729 647
 // ---------------------
@@ -731,51 +649,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
731 649
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
732 650
 
733 651
 //#define SAV_3DLCD
734
-#ifdef SAV_3DLCD
735
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
736
-   #define NEWPANEL
737
-   #define ULTIPANEL
738
-#endif
739
-
740
-
741
-#ifdef ULTIPANEL
742
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
743
-  #define SDSUPPORT
744
-  #define ULTRA_LCD
745
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
746
-    #define LCD_WIDTH 22
747
-    #define LCD_HEIGHT 5
748
-  #else
749
-    #define LCD_WIDTH 20
750
-    #define LCD_HEIGHT 4
751
-  #endif
752
-#else //no panel but just LCD
753
-  #ifdef ULTRA_LCD
754
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
755
-    #define LCD_WIDTH 22
756
-    #define LCD_HEIGHT 5
757
-  #else
758
-    #define LCD_WIDTH 16
759
-    #define LCD_HEIGHT 2
760
-  #endif
761
-  #endif
762
-#endif
763
-
764
-// default LCD contrast for dogm-like LCD displays
765
-#ifdef DOGLCD
766
-# ifndef DEFAULT_LCD_CONTRAST
767
-#  define DEFAULT_LCD_CONTRAST 32
768
-# endif
769
-#endif
770 652
 
771 653
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
772 654
 //#define FAST_PWM_FAN
773 655
 
774
-// Temperature status LEDs that display the hotend and bet temperature.
775
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
776
-// Otherwise the RED led is on. There is 1C hysteresis.
777
-//#define TEMP_STAT_LEDS
778
-
779 656
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
780 657
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
781 658
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -787,6 +664,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
787 664
 // at zero value, there are 128 effective control positions.
788 665
 #define SOFT_PWM_SCALE 0
789 666
 
667
+// Temperature status LEDs that display the hotend and bet temperature.
668
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
669
+// Otherwise the RED led is on. There is 1C hysteresis.
670
+//#define TEMP_STAT_LEDS
671
+
790 672
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
791 673
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
792 674
 // #define PHOTOGRAPH_PIN     23
@@ -858,4 +740,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
858 740
 #include "Configuration_adv.h"
859 741
 #include "thermistortables.h"
860 742
 
861
-#endif //__CONFIGURATION_H
743
+#endif //CONFIGURATION_H

+ 11
- 206
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers.
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -218,31 +158,22 @@
218 158
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
219 159
 
220 160
 #define AXIS_RELATIVE_MODES {false, false, false, false}
221
-#ifdef CONFIG_STEPPERS_TOSHIBA
222
-#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
223
-#else
224
-#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
225
-#endif
161
+
226 162
 //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
227 163
 #define INVERT_X_STEP_PIN false
228 164
 #define INVERT_Y_STEP_PIN false
229 165
 #define INVERT_Z_STEP_PIN false
230 166
 #define INVERT_E_STEP_PIN false
231 167
 
232
-//default stepper release if idle. Set to 0 to deactivate.
168
+// Default stepper release if idle. Set to 0 to deactivate.
233 169
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
234 170
 
235 171
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
236 172
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
237 173
 
238
-// Feedrates for manual moves along X, Y, Z, E from panel
239
-#ifdef ULTIPANEL
240
-#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
241
-#endif
242
-
243
-//Comment to disable setting feedrate multiplier via encoder
244 174
 #ifdef ULTIPANEL
245
-    #define ULTIPANEL_FEEDMULTIPLY
175
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
176
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
246 177
 #endif
247 178
 
248 179
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -261,13 +192,6 @@
261 192
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
262 193
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
263 194
 
264
-// MS1 MS2 Stepper Driver Microstepping mode table
265
-#define MICROSTEP1 LOW,LOW
266
-#define MICROSTEP2 HIGH,LOW
267
-#define MICROSTEP4 LOW,HIGH
268
-#define MICROSTEP8 HIGH,HIGH
269
-#define MICROSTEP16 HIGH,HIGH
270
-
271 195
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
272 196
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
273 197
 
@@ -313,12 +237,6 @@
313 237
   #define PROGRESS_MSG_EXPIRE   0
314 238
   // Enable this to show messages for MSG_TIME then hide them
315 239
   //#define PROGRESS_MSG_ONCE
316
-  #ifdef DOGLCD
317
-    #warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
318
-  #endif
319
-  #ifdef FILAMENT_LCD_DISPLAY
320
-    #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
321
-  #endif
322 240
 #endif
323 241
 
324 242
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
@@ -342,16 +260,6 @@
342 260
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
343 261
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
344 262
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
345
-
346
-  #ifdef COREXY
347
-    #error BABYSTEPPING not implemented for COREXY yet.
348
-  #endif
349
-
350
-  #ifdef DELTA
351
-    #ifdef BABYSTEP_XY
352
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
353
-    #endif
354
-  #endif
355 263
 #endif
356 264
 
357 265
 // extruder advance constant (s2/mm3)
@@ -365,12 +273,8 @@
365 273
 
366 274
 #ifdef ADVANCE
367 275
   #define EXTRUDER_ADVANCE_K .0
368
-
369 276
   #define D_FILAMENT 2.85
370 277
   #define STEPS_MM_E 836
371
-  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
372
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
373
-
374 278
 #endif // ADVANCE
375 279
 
376 280
 // Arc interpretation settings:
@@ -385,26 +289,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
385 289
 // be commented out otherwise
386 290
 #define SDCARDDETECTINVERTED
387 291
 
388
-#ifdef ULTIPANEL
389
- #undef SDCARDDETECTINVERTED
390
-#endif
391
-
392
-// Power Signal Control Definitions
393
-// By default use ATX definition
394
-#ifndef POWER_SUPPLY
395
-  #define POWER_SUPPLY 1
396
-#endif
397
-// 1 = ATX
398
-#if (POWER_SUPPLY == 1)
399
-  #define PS_ON_AWAKE  LOW
400
-  #define PS_ON_ASLEEP HIGH
401
-#endif
402
-// 2 = X-Box 360 203W
403
-#if (POWER_SUPPLY == 2)
404
-  #define PS_ON_AWAKE  HIGH
405
-  #define PS_ON_ASLEEP LOW
406
-#endif
407
-
408 292
 // Control heater 0 and heater 1 in parallel.
409 293
 //#define HEATERS_PARALLEL
410 294
 
@@ -444,9 +328,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
444 328
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
445 329
 #endif
446 330
 
447
-//adds support for experimental filament exchange support M600; requires display
331
+// Add support for experimental filament exchange support M600; requires display
448 332
 #ifdef ULTIPANEL
449
-  #define FILAMENTCHANGEENABLE
333
+  //#define FILAMENTCHANGEENABLE
450 334
   #ifdef FILAMENTCHANGEENABLE
451 335
     #define FILAMENTCHANGE_XPOS 3
452 336
     #define FILAMENTCHANGE_YPOS 3
@@ -456,86 +340,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
456 340
   #endif
457 341
 #endif
458 342
 
459
-#ifdef FILAMENTCHANGEENABLE
460
-  #ifdef EXTRUDER_RUNOUT_PREVENT
461
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
462
-  #endif
463
-#endif
464
-
465
-//===========================================================================
466
-//=============================  Define Defines  ============================
467
-//===========================================================================
468
-
469
-#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
470
-  #error "Bed Auto Leveling is still not compatible with Delta Kinematics."
471
-#endif
472
-
473
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
474
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
475
-#endif
476
-
477
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
478
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
479
-#endif
480
-
481
-#if TEMP_SENSOR_0 > 0
482
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
483
-  #define HEATER_0_USES_THERMISTOR
484
-#endif
485
-#if TEMP_SENSOR_1 > 0
486
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
487
-  #define HEATER_1_USES_THERMISTOR
488
-#endif
489
-#if TEMP_SENSOR_2 > 0
490
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
491
-  #define HEATER_2_USES_THERMISTOR
492
-#endif
493
-#if TEMP_SENSOR_3 > 0
494
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
495
-  #define HEATER_3_USES_THERMISTOR
496
-#endif
497
-#if TEMP_SENSOR_BED > 0
498
-  #define THERMISTORBED TEMP_SENSOR_BED
499
-  #define BED_USES_THERMISTOR
500
-#endif
501
-#if TEMP_SENSOR_0 == -1
502
-  #define HEATER_0_USES_AD595
503
-#endif
504
-#if TEMP_SENSOR_1 == -1
505
-  #define HEATER_1_USES_AD595
506
-#endif
507
-#if TEMP_SENSOR_2 == -1
508
-  #define HEATER_2_USES_AD595
509
-#endif
510
-#if TEMP_SENSOR_3 == -1
511
-  #define HEATER_3_USES_AD595
512
-#endif
513
-#if TEMP_SENSOR_BED == -1
514
-  #define BED_USES_AD595
515
-#endif
516
-#if TEMP_SENSOR_0 == -2
517
-  #define HEATER_0_USES_MAX6675
518
-#endif
519
-#if TEMP_SENSOR_0 == 0
520
-  #undef HEATER_0_MINTEMP
521
-  #undef HEATER_0_MAXTEMP
522
-#endif
523
-#if TEMP_SENSOR_1 == 0
524
-  #undef HEATER_1_MINTEMP
525
-  #undef HEATER_1_MAXTEMP
526
-#endif
527
-#if TEMP_SENSOR_2 == 0
528
-  #undef HEATER_2_MINTEMP
529
-  #undef HEATER_2_MAXTEMP
530
-#endif
531
-#if TEMP_SENSOR_3 == 0
532
-  #undef HEATER_3_MINTEMP
533
-  #undef HEATER_3_MAXTEMP
534
-#endif
535
-#if TEMP_SENSOR_BED == 0
536
-  #undef BED_MINTEMP
537
-  #undef BED_MAXTEMP
538
-#endif
539
-
343
+#include "Conditionals.h"
344
+#include "SanityCheck.h"
540 345
 
541
-#endif //__CONFIGURATION_ADV_H
346
+#endif //CONFIGURATION_ADV_H

+ 34
- 152
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -351,15 +351,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
351 351
   // #define ENDSTOPPULLUP_ZMIN
352 352
 #endif
353 353
 
354
-#ifdef ENDSTOPPULLUPS
355
-  #define ENDSTOPPULLUP_XMAX
356
-  #define ENDSTOPPULLUP_YMAX
357
-  #define ENDSTOPPULLUP_ZMAX
358
-  #define ENDSTOPPULLUP_XMIN
359
-  #define ENDSTOPPULLUP_YMIN
360
-  #define ENDSTOPPULLUP_ZMIN
361
-#endif
362
-
363 354
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
364 355
 const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
365 356
 const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
@@ -408,10 +399,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
408 399
 #define Z_MAX_POS 225
409 400
 #define Z_MIN_POS MANUAL_Z_HOME_POS
410 401
 
411
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
412
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
413
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
402
+//===========================================================================
403
+//============================= Filament Runout Sensor ======================
404
+//===========================================================================
405
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
406
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
407
+                                 // It is assumed that when logic high = filament available
408
+                                 //                    when logic  low = filament ran out
409
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
410
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
411
+
412
+//===========================================================================
413
+//============================ Manual Bed Leveling ==========================
414
+//===========================================================================
414 415
 
416
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
417
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
418
+
419
+#if defined(MESH_BED_LEVELING)
420
+  #define MESH_MIN_X 10
421
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
422
+  #define MESH_MIN_Y 10
423
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
424
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
425
+  #define MESH_NUM_Y_POINTS 3
426
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
427
+#endif  // MESH_BED_LEVELING
415 428
 
416 429
 //===========================================================================
417 430
 //============================= Bed Auto Leveling ===========================
@@ -644,112 +657,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
644 657
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
645 658
 //#define RA_CONTROL_PANEL
646 659
 
647
-//automatic expansion
648
-#if defined (MAKRPANEL)
649
- #define DOGLCD
650
- #define SDSUPPORT
651
- #define ULTIPANEL
652
- #define NEWPANEL
653
- #define DEFAULT_LCD_CONTRAST 17
654
-#endif
655
-
656
-#if defined(miniVIKI) || defined(VIKI2)
657
- #define ULTRA_LCD  //general LCD support, also 16x2
658
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
659
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
660
- 
661
-  #ifdef miniVIKI
662
-   #define DEFAULT_LCD_CONTRAST 95
663
-  #else
664
-   #define DEFAULT_LCD_CONTRAST 40
665
-  #endif
666
-  
667
- #define ENCODER_PULSES_PER_STEP 4
668
- #define ENCODER_STEPS_PER_MENU_ITEM 1
669
-#endif
670
-
671
-#if defined (PANEL_ONE)
672
- #define SDSUPPORT
673
- #define ULTIMAKERCONTROLLER
674
-#endif
675
-
676
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
677
- #define DOGLCD
678
- #define U8GLIB_ST7920
679
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
680
-#endif
681
-
682
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
683
- #define ULTIPANEL
684
- #define NEWPANEL
685
-#endif
686
-
687
-#if defined(REPRAPWORLD_KEYPAD)
688
-  #define NEWPANEL
689
-  #define ULTIPANEL
690
-#endif
691
-#if defined(RA_CONTROL_PANEL)
692
- #define ULTIPANEL
693
- #define NEWPANEL
694
- #define LCD_I2C_TYPE_PCA8574
695
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
696
-#endif
697
-
698
-//I2C PANELS
660
+/**
661
+ * I2C Panels
662
+ */
699 663
 
700 664
 //#define LCD_I2C_SAINSMART_YWROBOT
701
-#ifdef LCD_I2C_SAINSMART_YWROBOT
702
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
703
-  // Make sure it is placed in the Arduino libraries directory.
704
-  #define LCD_I2C_TYPE_PCF8575
705
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
706
-  #define NEWPANEL
707
-  #define ULTIPANEL
708
-#endif
709 665
 
710 666
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
711 667
 //#define LCD_I2C_PANELOLU2
712
-#ifdef LCD_I2C_PANELOLU2
713
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
714
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
715
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
716
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
717
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
718
-  #define LCD_I2C_TYPE_MCP23017
719
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
720
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
721
-  #define NEWPANEL
722
-  #define ULTIPANEL
723
-
724
-  #ifndef ENCODER_PULSES_PER_STEP
725
-	#define ENCODER_PULSES_PER_STEP 4
726
-  #endif
727
-
728
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
729
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
730
-  #endif
731
-
732
-
733
-  #ifdef LCD_USE_I2C_BUZZER
734
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
735
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
736
-  #endif
737
-
738
-#endif
739 668
 
740 669
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
741 670
 //#define LCD_I2C_VIKI
742
-#ifdef LCD_I2C_VIKI
743
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
744
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
745
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
746
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
747
-  #define LCD_I2C_TYPE_MCP23017
748
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
749
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
750
-  #define NEWPANEL
751
-  #define ULTIPANEL
752
-#endif
753 671
 
754 672
 // Shift register panels
755 673
 // ---------------------
@@ -757,51 +675,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
757 675
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
758 676
 
759 677
 //#define SAV_3DLCD
760
-#ifdef SAV_3DLCD
761
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
762
-   #define NEWPANEL
763
-   #define ULTIPANEL
764
-#endif
765
-
766
-
767
-#ifdef ULTIPANEL
768
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
769
-  #define SDSUPPORT
770
-  #define ULTRA_LCD
771
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
772
-    #define LCD_WIDTH 22
773
-    #define LCD_HEIGHT 5
774
-  #else
775
-    #define LCD_WIDTH 20
776
-    #define LCD_HEIGHT 4
777
-  #endif
778
-#else //no panel but just LCD
779
-  #ifdef ULTRA_LCD
780
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
781
-    #define LCD_WIDTH 22
782
-    #define LCD_HEIGHT 5
783
-  #else
784
-    #define LCD_WIDTH 16
785
-    #define LCD_HEIGHT 2
786
-  #endif
787
-  #endif
788
-#endif
789
-
790
-// default LCD contrast for dogm-like LCD displays
791
-#ifdef DOGLCD
792
-# ifndef DEFAULT_LCD_CONTRAST
793
-#  define DEFAULT_LCD_CONTRAST 32
794
-# endif
795
-#endif
796 678
 
797 679
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
798 680
 //#define FAST_PWM_FAN
799 681
 
800
-// Temperature status LEDs that display the hotend and bet temperature.
801
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
802
-// Otherwise the RED led is on. There is 1C hysteresis.
803
-//#define TEMP_STAT_LEDS
804
-
805 682
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
806 683
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
807 684
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -813,6 +690,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
813 690
 // at zero value, there are 128 effective control positions.
814 691
 #define SOFT_PWM_SCALE 0
815 692
 
693
+// Temperature status LEDs that display the hotend and bet temperature.
694
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
695
+// Otherwise the RED led is on. There is 1C hysteresis.
696
+//#define TEMP_STAT_LEDS
697
+
816 698
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
817 699
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
818 700
 // #define PHOTOGRAPH_PIN     23
@@ -884,4 +766,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
884 766
 #include "Configuration_adv.h"
885 767
 #include "thermistortables.h"
886 768
 
887
-#endif //__CONFIGURATION_H
769
+#endif //CONFIGURATION_H

+ 11
- 197
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers.
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -216,9 +156,6 @@
216 156
 #define Z_HOME_RETRACT_MM 3
217 157
 #define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
218 158
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
219
-#ifdef SCARA
220
-	#define QUICK_HOME //SCARA needs Quickhome
221
-#endif
222 159
 
223 160
 #define AXIS_RELATIVE_MODES {false, false, false, false}
224 161
 
@@ -230,20 +167,15 @@
230 167
 #define INVERT_Z_STEP_PIN false
231 168
 #define INVERT_E_STEP_PIN false
232 169
 
233
-//default stepper release if idle. Set to 0 to deactivate.
170
+// Default stepper release if idle. Set to 0 to deactivate.
234 171
 #define DEFAULT_STEPPER_DEACTIVE_TIME 240
235 172
 
236 173
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
237 174
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
238 175
 
239
-// Feedrates for manual moves along X, Y, Z, E from panel
240
-#ifdef ULTIPANEL
241
-#define MANUAL_FEEDRATE {50*60, 50*60, 10*60, 60}  // set the speeds for manual moves (mm/min)
242
-#endif
243
-
244
-//Comment to disable setting feedrate multiplier via encoder
245 176
 #ifdef ULTIPANEL
246
-    #define ULTIPANEL_FEEDMULTIPLY
177
+  #define MANUAL_FEEDRATE {50*60, 50*60, 10*60, 60}  // Feedrates for manual moves along X, Y, Z, E from panel
178
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
247 179
 #endif
248 180
 
249 181
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -251,9 +183,7 @@
251 183
 
252 184
 // If defined the movements slow down when the look ahead buffer is only half full
253 185
 //#define SLOWDOWN
254
-#ifdef SCARA
255
- #undef SLOWDOWN
256
-#endif
186
+
257 187
 // Frequency limit
258 188
 // See nophead's blog for more info
259 189
 // Not working O
@@ -264,13 +194,6 @@
264 194
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
265 195
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
266 196
 
267
-// MS1 MS2 Stepper Driver Microstepping mode table
268
-#define MICROSTEP1 LOW,LOW
269
-#define MICROSTEP2 HIGH,LOW
270
-#define MICROSTEP4 LOW,HIGH
271
-#define MICROSTEP8 HIGH,HIGH
272
-#define MICROSTEP16 HIGH,HIGH
273
-
274 197
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
275 198
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
276 199
 
@@ -339,21 +262,6 @@
339 262
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
340 263
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
341 264
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
342
-
343
-  #ifdef COREXY
344
-    #error BABYSTEPPING not implemented for COREXY yet.
345
-  #endif
346
-
347
-  #ifdef DELTA
348
-    #ifdef BABYSTEP_XY
349
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
350
-    #endif
351
-  #endif
352
-  
353
-  #ifdef SCARA
354
-    #error BABYSTEPPING not implemented for SCARA yet.
355
-  #endif
356
-  
357 265
 #endif
358 266
 
359 267
 // extruder advance constant (s2/mm3)
@@ -387,26 +295,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
387 295
 // be commented out otherwise
388 296
 #define SDCARDDETECTINVERTED
389 297
 
390
-#ifdef ULTIPANEL
391
- #undef SDCARDDETECTINVERTED
392
-#endif
393
-
394
-// Power Signal Control Definitions
395
-// By default use ATX definition
396
-#ifndef POWER_SUPPLY
397
-  #define POWER_SUPPLY 1
398
-#endif
399
-// 1 = ATX
400
-#if (POWER_SUPPLY == 1)
401
-  #define PS_ON_AWAKE  LOW
402
-  #define PS_ON_ASLEEP HIGH
403
-#endif
404
-// 2 = X-Box 360 203W
405
-#if (POWER_SUPPLY == 2)
406
-  #define PS_ON_AWAKE  HIGH
407
-  #define PS_ON_ASLEEP LOW
408
-#endif
409
-
410 298
 // Control heater 0 and heater 1 in parallel.
411 299
 //#define HEATERS_PARALLEL
412 300
 
@@ -444,9 +332,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
444 332
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
445 333
 #endif
446 334
 
447
-//adds support for experimental filament exchange support M600; requires display
335
+// Add support for experimental filament exchange support M600; requires display
448 336
 #ifdef ULTIPANEL
449
-  #define FILAMENTCHANGEENABLE
337
+  //#define FILAMENTCHANGEENABLE
450 338
   #ifdef FILAMENTCHANGEENABLE
451 339
     #define FILAMENTCHANGE_XPOS 3
452 340
     #define FILAMENTCHANGE_YPOS 3
@@ -456,81 +344,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
456 344
   #endif
457 345
 #endif
458 346
 
459
-#ifdef FILAMENTCHANGEENABLE
460
-  #ifdef EXTRUDER_RUNOUT_PREVENT
461
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
462
-  #endif
463
-#endif
464
-
465
-//===========================================================================
466
-//=============================  Define Defines  ============================
467
-//===========================================================================
468
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
469
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
470
-#endif
471
-
472
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
473
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
474
-#endif
475
-
476
-#if TEMP_SENSOR_0 > 0
477
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
478
-  #define HEATER_0_USES_THERMISTOR
479
-#endif
480
-#if TEMP_SENSOR_1 > 0
481
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
482
-  #define HEATER_1_USES_THERMISTOR
483
-#endif
484
-#if TEMP_SENSOR_2 > 0
485
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
486
-  #define HEATER_2_USES_THERMISTOR
487
-#endif
488
-#if TEMP_SENSOR_3 > 0
489
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
490
-  #define HEATER_3_USES_THERMISTOR
491
-#endif
492
-#if TEMP_SENSOR_BED > 0
493
-  #define THERMISTORBED TEMP_SENSOR_BED
494
-  #define BED_USES_THERMISTOR
495
-#endif
496
-#if TEMP_SENSOR_0 == -1
497
-  #define HEATER_0_USES_AD595
498
-#endif
499
-#if TEMP_SENSOR_1 == -1
500
-  #define HEATER_1_USES_AD595
501
-#endif
502
-#if TEMP_SENSOR_2 == -1
503
-  #define HEATER_2_USES_AD595
504
-#endif
505
-#if TEMP_SENSOR_3 == -1
506
-  #define HEATER_3_USES_AD595
507
-#endif
508
-#if TEMP_SENSOR_BED == -1
509
-  #define BED_USES_AD595
510
-#endif
511
-#if TEMP_SENSOR_0 == -2
512
-  #define HEATER_0_USES_MAX6675
513
-#endif
514
-#if TEMP_SENSOR_0 == 0
515
-  #undef HEATER_0_MINTEMP
516
-  #undef HEATER_0_MAXTEMP
517
-#endif
518
-#if TEMP_SENSOR_1 == 0
519
-  #undef HEATER_1_MINTEMP
520
-  #undef HEATER_1_MAXTEMP
521
-#endif
522
-#if TEMP_SENSOR_2 == 0
523
-  #undef HEATER_2_MINTEMP
524
-  #undef HEATER_2_MAXTEMP
525
-#endif
526
-#if TEMP_SENSOR_3 == 0
527
-  #undef HEATER_3_MINTEMP
528
-  #undef HEATER_3_MAXTEMP
529
-#endif
530
-#if TEMP_SENSOR_BED == 0
531
-  #undef BED_MINTEMP
532
-  #undef BED_MAXTEMP
533
-#endif
534
-
347
+#include "Conditionals.h"
348
+#include "SanityCheck.h"
535 349
 
536
-#endif //__CONFIGURATION_ADV_H
350
+#endif //CONFIGURATION_ADV_H

+ 34
- 152
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -321,15 +321,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
321 321
   // #define ENDSTOPPULLUP_ZMIN
322 322
 #endif
323 323
 
324
-#ifdef ENDSTOPPULLUPS
325
-  #define ENDSTOPPULLUP_XMAX
326
-  #define ENDSTOPPULLUP_YMAX
327
-  #define ENDSTOPPULLUP_ZMAX
328
-  #define ENDSTOPPULLUP_XMIN
329
-  #define ENDSTOPPULLUP_YMIN
330
-  #define ENDSTOPPULLUP_ZMIN
331
-#endif
332
-
333 324
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
334 325
 const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
335 326
 const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
@@ -378,10 +369,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
378 369
 #define Z_MAX_POS 200
379 370
 #define Z_MIN_POS 0
380 371
 
381
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
382
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
383
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
372
+//===========================================================================
373
+//============================= Filament Runout Sensor ======================
374
+//===========================================================================
375
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
376
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
377
+                                 // It is assumed that when logic high = filament available
378
+                                 //                    when logic  low = filament ran out
379
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
380
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
381
+
382
+//===========================================================================
383
+//============================ Manual Bed Leveling ==========================
384
+//===========================================================================
384 385
 
386
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
387
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
388
+
389
+#if defined(MESH_BED_LEVELING)
390
+  #define MESH_MIN_X 10
391
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
392
+  #define MESH_MIN_Y 10
393
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
394
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
395
+  #define MESH_NUM_Y_POINTS 3
396
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
397
+#endif  // MESH_BED_LEVELING
385 398
 
386 399
 //===========================================================================
387 400
 //============================= Bed Auto Leveling ===========================
@@ -611,112 +624,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
611 624
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
612 625
 //#define RA_CONTROL_PANEL
613 626
 
614
-//automatic expansion
615
-#if defined (MAKRPANEL)
616
- #define DOGLCD
617
- #define SDSUPPORT
618
- #define ULTIPANEL
619
- #define NEWPANEL
620
- #define DEFAULT_LCD_CONTRAST 17
621
-#endif
622
-
623
-#if defined(miniVIKI) || defined(VIKI2)
624
- #define ULTRA_LCD  //general LCD support, also 16x2
625
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
626
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
627
- 
628
-  #ifdef miniVIKI
629
-   #define DEFAULT_LCD_CONTRAST 95
630
-  #else
631
-   #define DEFAULT_LCD_CONTRAST 40
632
-  #endif
633
-  
634
- #define ENCODER_PULSES_PER_STEP 4
635
- #define ENCODER_STEPS_PER_MENU_ITEM 1
636
-#endif
637
-
638
-#if defined (PANEL_ONE)
639
- #define SDSUPPORT
640
- #define ULTIMAKERCONTROLLER
641
-#endif
642
-
643
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
644
- #define DOGLCD
645
- #define U8GLIB_ST7920
646
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
647
-#endif
648
-
649
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
650
- #define ULTIPANEL
651
- #define NEWPANEL
652
-#endif
653
-
654
-#if defined(REPRAPWORLD_KEYPAD)
655
-  #define NEWPANEL
656
-  #define ULTIPANEL
657
-#endif
658
-#if defined(RA_CONTROL_PANEL)
659
- #define ULTIPANEL
660
- #define NEWPANEL
661
- #define LCD_I2C_TYPE_PCA8574
662
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
663
-#endif
664
-
665
-//I2C PANELS
627
+/**
628
+ * I2C Panels
629
+ */
666 630
 
667 631
 //#define LCD_I2C_SAINSMART_YWROBOT
668
-#ifdef LCD_I2C_SAINSMART_YWROBOT
669
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
670
-  // Make sure it is placed in the Arduino libraries directory.
671
-  #define LCD_I2C_TYPE_PCF8575
672
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
673
-  #define NEWPANEL
674
-  #define ULTIPANEL
675
-#endif
676 632
 
677 633
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
678 634
 //#define LCD_I2C_PANELOLU2
679
-#ifdef LCD_I2C_PANELOLU2
680
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
681
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
682
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
683
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
684
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
685
-  #define LCD_I2C_TYPE_MCP23017
686
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
687
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
688
-  #define NEWPANEL
689
-  #define ULTIPANEL
690
-
691
-  #ifndef ENCODER_PULSES_PER_STEP
692
-	#define ENCODER_PULSES_PER_STEP 4
693
-  #endif
694
-
695
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
696
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
697
-  #endif
698
-
699
-
700
-  #ifdef LCD_USE_I2C_BUZZER
701
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
702
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
703
-  #endif
704
-
705
-#endif
706 635
 
707 636
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
708 637
 //#define LCD_I2C_VIKI
709
-#ifdef LCD_I2C_VIKI
710
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
711
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
712
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
713
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
714
-  #define LCD_I2C_TYPE_MCP23017
715
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
716
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
717
-  #define NEWPANEL
718
-  #define ULTIPANEL
719
-#endif
720 638
 
721 639
 // Shift register panels
722 640
 // ---------------------
@@ -724,51 +642,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
724 642
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
725 643
 
726 644
 //#define SAV_3DLCD
727
-#ifdef SAV_3DLCD
728
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
729
-   #define NEWPANEL
730
-   #define ULTIPANEL
731
-#endif
732
-
733
-
734
-#ifdef ULTIPANEL
735
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
736
-  #define SDSUPPORT
737
-  #define ULTRA_LCD
738
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
739
-    #define LCD_WIDTH 22
740
-    #define LCD_HEIGHT 5
741
-  #else
742
-    #define LCD_WIDTH 20
743
-    #define LCD_HEIGHT 4
744
-  #endif
745
-#else //no panel but just LCD
746
-  #ifdef ULTRA_LCD
747
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
748
-    #define LCD_WIDTH 22
749
-    #define LCD_HEIGHT 5
750
-  #else
751
-    #define LCD_WIDTH 16
752
-    #define LCD_HEIGHT 2
753
-  #endif
754
-  #endif
755
-#endif
756
-
757
-// default LCD contrast for dogm-like LCD displays
758
-#ifdef DOGLCD
759
-# ifndef DEFAULT_LCD_CONTRAST
760
-#  define DEFAULT_LCD_CONTRAST 32
761
-# endif
762
-#endif
763 645
 
764 646
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
765 647
 //#define FAST_PWM_FAN
766 648
 
767
-// Temperature status LEDs that display the hotend and bet temperature.
768
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
769
-// Otherwise the RED led is on. There is 1C hysteresis.
770
-//#define TEMP_STAT_LEDS
771
-
772 649
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
773 650
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
774 651
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -780,6 +657,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
780 657
 // at zero value, there are 128 effective control positions.
781 658
 #define SOFT_PWM_SCALE 0
782 659
 
660
+// Temperature status LEDs that display the hotend and bet temperature.
661
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
662
+// Otherwise the RED led is on. There is 1C hysteresis.
663
+//#define TEMP_STAT_LEDS
664
+
783 665
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
784 666
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
785 667
 // #define PHOTOGRAPH_PIN     23
@@ -851,4 +733,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
851 733
 #include "Configuration_adv.h"
852 734
 #include "thermistortables.h"
853 735
 
854
-#endif //__CONFIGURATION_H
736
+#endif //CONFIGURATION_H

+ 10
- 201
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 //#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers.
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -229,20 +169,15 @@
229 169
 #define INVERT_Z_STEP_PIN false
230 170
 #define INVERT_E_STEP_PIN false
231 171
 
232
-//default stepper release if idle. Set to 0 to deactivate.
172
+// Default stepper release if idle. Set to 0 to deactivate.
233 173
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
234 174
 
235 175
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
236 176
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
237 177
 
238
-// Feedrates for manual moves along X, Y, Z, E from panel
239 178
 #ifdef ULTIPANEL
240
-#define MANUAL_FEEDRATE {120*60, 120*60, 18*60, 60}  // set the speeds for manual moves (mm/min)
241
-#endif
242
-
243
-//Comment to disable setting feedrate multiplier via encoder
244
-#ifdef ULTIPANEL
245
-    #define ULTIPANEL_FEEDMULTIPLY
179
+  #define MANUAL_FEEDRATE {120*60, 120*60, 18*60, 60}  // Feedrates for manual moves along X, Y, Z, E from panel
180
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
246 181
 #endif
247 182
 
248 183
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -261,13 +196,6 @@
261 196
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
262 197
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
263 198
 
264
-// MS1 MS2 Stepper Driver Microstepping mode table
265
-#define MICROSTEP1 LOW,LOW
266
-#define MICROSTEP2 HIGH,LOW
267
-#define MICROSTEP4 LOW,HIGH
268
-#define MICROSTEP8 HIGH,HIGH
269
-#define MICROSTEP16 HIGH,HIGH
270
-
271 199
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
272 200
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
273 201
 
@@ -313,12 +241,6 @@
313 241
   #define PROGRESS_MSG_EXPIRE   0
314 242
   // Enable this to show messages for MSG_TIME then hide them
315 243
   //#define PROGRESS_MSG_ONCE
316
-  #ifdef DOGLCD
317
-    #warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
318
-  #endif
319
-  #ifdef FILAMENT_LCD_DISPLAY
320
-    #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
321
-  #endif
322 244
 #endif
323 245
 
324 246
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
@@ -342,16 +264,6 @@
342 264
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
343 265
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
344 266
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
345
-
346
-  #ifdef COREXY
347
-    #error BABYSTEPPING not implemented for COREXY yet.
348
-  #endif
349
-
350
-  #ifdef DELTA
351
-    #ifdef BABYSTEP_XY
352
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
353
-    #endif
354
-  #endif
355 267
 #endif
356 268
 
357 269
 // extruder advance constant (s2/mm3)
@@ -365,12 +277,8 @@
365 277
 
366 278
 #ifdef ADVANCE
367 279
   #define EXTRUDER_ADVANCE_K .0
368
-
369 280
   #define D_FILAMENT 1.75
370 281
   #define STEPS_MM_E 100.47095761381482
371
-  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
372
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
373
-
374 282
 #endif // ADVANCE
375 283
 
376 284
 // Arc interpretation settings:
@@ -385,26 +293,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
385 293
 // be commented out otherwise
386 294
 #define SDCARDDETECTINVERTED
387 295
 
388
-#ifdef ULTIPANEL
389
- #undef SDCARDDETECTINVERTED
390
-#endif
391
-
392
-// Power Signal Control Definitions
393
-// By default use ATX definition
394
-#ifndef POWER_SUPPLY
395
-  #define POWER_SUPPLY 1
396
-#endif
397
-// 1 = ATX
398
-#if (POWER_SUPPLY == 1)
399
-  #define PS_ON_AWAKE  LOW
400
-  #define PS_ON_ASLEEP HIGH
401
-#endif
402
-// 2 = X-Box 360 203W
403
-#if (POWER_SUPPLY == 2)
404
-  #define PS_ON_AWAKE  HIGH
405
-  #define PS_ON_ASLEEP LOW
406
-#endif
407
-
408 296
 // Control heater 0 and heater 1 in parallel.
409 297
 //#define HEATERS_PARALLEL
410 298
 
@@ -444,9 +332,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
444 332
   #define RETRACT_RECOVER_FEEDRATE 8*60     //default feedrate for recovering from retraction (mm/s)
445 333
 #endif
446 334
 
447
-//adds support for experimental filament exchange support M600; requires display
335
+// Add support for experimental filament exchange support M600; requires display
448 336
 #ifdef ULTIPANEL
449
-  #define FILAMENTCHANGEENABLE
337
+  //#define FILAMENTCHANGEENABLE
450 338
   #ifdef FILAMENTCHANGEENABLE
451 339
     #define FILAMENTCHANGE_XPOS 3
452 340
     #define FILAMENTCHANGE_YPOS 3
@@ -456,86 +344,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
456 344
   #endif
457 345
 #endif
458 346
 
459
-#ifdef FILAMENTCHANGEENABLE
460
-  #ifdef EXTRUDER_RUNOUT_PREVENT
461
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
462
-  #endif
463
-#endif
464
-
465
-//===========================================================================
466
-//=============================  Define Defines  ============================
467
-//===========================================================================
468
-
469
-#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
470
-  #error "Bed Auto Leveling is still not compatible with Delta Kinematics."
471
-#endif
472
-
473
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
474
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
475
-#endif
476
-
477
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
478
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
479
-#endif
480
-
481
-#if TEMP_SENSOR_0 > 0
482
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
483
-  #define HEATER_0_USES_THERMISTOR
484
-#endif
485
-#if TEMP_SENSOR_1 > 0
486
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
487
-  #define HEATER_1_USES_THERMISTOR
488
-#endif
489
-#if TEMP_SENSOR_2 > 0
490
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
491
-  #define HEATER_2_USES_THERMISTOR
492
-#endif
493
-#if TEMP_SENSOR_3 > 0
494
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
495
-  #define HEATER_3_USES_THERMISTOR
496
-#endif
497
-#if TEMP_SENSOR_BED > 0
498
-  #define THERMISTORBED TEMP_SENSOR_BED
499
-  #define BED_USES_THERMISTOR
500
-#endif
501
-#if TEMP_SENSOR_0 == -1
502
-  #define HEATER_0_USES_AD595
503
-#endif
504
-#if TEMP_SENSOR_1 == -1
505
-  #define HEATER_1_USES_AD595
506
-#endif
507
-#if TEMP_SENSOR_2 == -1
508
-  #define HEATER_2_USES_AD595
509
-#endif
510
-#if TEMP_SENSOR_3 == -1
511
-  #define HEATER_3_USES_AD595
512
-#endif
513
-#if TEMP_SENSOR_BED == -1
514
-  #define BED_USES_AD595
515
-#endif
516
-#if TEMP_SENSOR_0 == -2
517
-  #define HEATER_0_USES_MAX6675
518
-#endif
519
-#if TEMP_SENSOR_0 == 0
520
-  #undef HEATER_0_MINTEMP
521
-  #undef HEATER_0_MAXTEMP
522
-#endif
523
-#if TEMP_SENSOR_1 == 0
524
-  #undef HEATER_1_MINTEMP
525
-  #undef HEATER_1_MAXTEMP
526
-#endif
527
-#if TEMP_SENSOR_2 == 0
528
-  #undef HEATER_2_MINTEMP
529
-  #undef HEATER_2_MAXTEMP
530
-#endif
531
-#if TEMP_SENSOR_3 == 0
532
-  #undef HEATER_3_MINTEMP
533
-  #undef HEATER_3_MAXTEMP
534
-#endif
535
-#if TEMP_SENSOR_BED == 0
536
-  #undef BED_MINTEMP
537
-  #undef BED_MAXTEMP
538
-#endif
539
-
347
+#include "Conditionals.h"
348
+#include "SanityCheck.h"
540 349
 
541
-#endif //__CONFIGURATION_ADV_H
350
+#endif //CONFIGURATION_ADV_H

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

@@ -349,15 +349,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
349 349
   // #define ENDSTOPPULLUP_ZMIN
350 350
 #endif
351 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 352
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
362 353
 const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
363 354
 const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
@@ -408,10 +399,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
408 399
 #define Z_MAX_POS MANUAL_Z_HOME_POS
409 400
 #define Z_MIN_POS 0
410 401
 
411
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
412
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
413
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
402
+//===========================================================================
403
+//============================= Filament Runout Sensor ======================
404
+//===========================================================================
405
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
406
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
407
+                                 // It is assumed that when logic high = filament available
408
+                                 //                    when logic  low = filament ran out
409
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
410
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
411
+
412
+//===========================================================================
413
+//============================ Manual Bed Leveling ==========================
414
+//===========================================================================
414 415
 
416
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
417
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
418
+
419
+#if defined(MESH_BED_LEVELING)
420
+  #define MESH_MIN_X 10
421
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
422
+  #define MESH_MIN_Y 10
423
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
424
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
425
+  #define MESH_NUM_Y_POINTS 3
426
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
427
+#endif  // MESH_BED_LEVELING
415 428
 
416 429
 //===========================================================================
417 430
 //============================= Bed Auto Leveling ===========================
@@ -634,112 +647,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
634 647
 // in ultralcd.cpp@lcd_delta_calibrate_menu()
635 648
 // #define DELTA_CALIBRATION_MENU
636 649
 
637
-//automatic expansion
638
-#if defined (MAKRPANEL)
639
- #define DOGLCD
640
- #define SDSUPPORT
641
- #define ULTIPANEL
642
- #define NEWPANEL
643
- #define DEFAULT_LCD_CONTRAST 17
644
-#endif
645
-
646
-#if defined(miniVIKI) || defined(VIKI2)
647
- #define ULTRA_LCD  //general LCD support, also 16x2
648
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
649
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
650
- 
651
-  #ifdef miniVIKI
652
-   #define DEFAULT_LCD_CONTRAST 95
653
-  #else
654
-   #define DEFAULT_LCD_CONTRAST 40
655
-  #endif
656
-  
657
- #define ENCODER_PULSES_PER_STEP 4
658
- #define ENCODER_STEPS_PER_MENU_ITEM 1
659
-#endif
660
-
661
-#if defined (PANEL_ONE)
662
- #define SDSUPPORT
663
- #define ULTIMAKERCONTROLLER
664
-#endif
665
-
666
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
667
- #define DOGLCD
668
- #define U8GLIB_ST7920
669
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
670
-#endif
671
-
672
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
673
- #define ULTIPANEL
674
- #define NEWPANEL
675
-#endif
676
-
677
-#if defined(REPRAPWORLD_KEYPAD)
678
-  #define NEWPANEL
679
-  #define ULTIPANEL
680
-#endif
681
-#if defined(RA_CONTROL_PANEL)
682
- #define ULTIPANEL
683
- #define NEWPANEL
684
- #define LCD_I2C_TYPE_PCA8574
685
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
686
-#endif
687
-
688
-//I2C PANELS
650
+/**
651
+ * I2C PANELS
652
+ */
689 653
 
690 654
 //#define LCD_I2C_SAINSMART_YWROBOT
691
-#ifdef LCD_I2C_SAINSMART_YWROBOT
692
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
693
-  // Make sure it is placed in the Arduino libraries directory.
694
-  #define LCD_I2C_TYPE_PCF8575
695
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
696
-  #define NEWPANEL
697
-  #define ULTIPANEL
698
-#endif
699 655
 
700 656
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
701 657
 //#define LCD_I2C_PANELOLU2
702
-#ifdef LCD_I2C_PANELOLU2
703
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
704
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
705
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
706
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
707
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
708
-  #define LCD_I2C_TYPE_MCP23017
709
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
710
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
711
-  #define NEWPANEL
712
-  #define ULTIPANEL
713
-
714
-  #ifndef ENCODER_PULSES_PER_STEP
715
-	#define ENCODER_PULSES_PER_STEP 4
716
-  #endif
717
-
718
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
719
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
720
-  #endif
721
-
722
-
723
-  #ifdef LCD_USE_I2C_BUZZER
724
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
725
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
726
-  #endif
727
-
728
-#endif
729 658
 
730 659
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
731 660
 //#define LCD_I2C_VIKI
732
-#ifdef LCD_I2C_VIKI
733
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
734
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
735
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
736
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
737
-  #define LCD_I2C_TYPE_MCP23017
738
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
739
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
740
-  #define NEWPANEL
741
-  #define ULTIPANEL
742
-#endif
743 661
 
744 662
 // Shift register panels
745 663
 // ---------------------
@@ -747,51 +665,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
747 665
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
748 666
 
749 667
 //#define SAV_3DLCD
750
-#ifdef SAV_3DLCD
751
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
752
-   #define NEWPANEL
753
-   #define ULTIPANEL
754
-#endif
755
-
756
-
757
-#ifdef ULTIPANEL
758
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
759
-  #define SDSUPPORT
760
-  #define ULTRA_LCD
761
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
762
-    #define LCD_WIDTH 22
763
-    #define LCD_HEIGHT 5
764
-  #else
765
-    #define LCD_WIDTH 20
766
-    #define LCD_HEIGHT 4
767
-  #endif
768
-#else //no panel but just LCD
769
-  #ifdef ULTRA_LCD
770
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
771
-    #define LCD_WIDTH 22
772
-    #define LCD_HEIGHT 5
773
-  #else
774
-    #define LCD_WIDTH 16
775
-    #define LCD_HEIGHT 2
776
-  #endif
777
-  #endif
778
-#endif
779
-
780
-// default LCD contrast for dogm-like LCD displays
781
-#ifdef DOGLCD
782
-# ifndef DEFAULT_LCD_CONTRAST
783
-#  define DEFAULT_LCD_CONTRAST 32
784
-# endif
785
-#endif
786 668
 
787 669
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
788 670
 //#define FAST_PWM_FAN
789 671
 
790
-// Temperature status LEDs that display the hotend and bet temperature.
791
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
792
-// Otherwise the RED led is on. There is 1C hysteresis.
793
-//#define TEMP_STAT_LEDS
794
-
795 672
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
796 673
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
797 674
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -803,6 +680,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
803 680
 // at zero value, there are 128 effective control positions.
804 681
 #define SOFT_PWM_SCALE 0
805 682
 
683
+// Temperature status LEDs that display the hotend and bet temperature.
684
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
685
+// Otherwise the RED led is on. There is 1C hysteresis.
686
+//#define TEMP_STAT_LEDS
687
+
806 688
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
807 689
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
808 690
 // #define PHOTOGRAPH_PIN     23
@@ -874,4 +756,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
874 756
 #include "Configuration_adv.h"
875 757
 #include "thermistortables.h"
876 758
 
877
-#endif //__CONFIGURATION_H
759
+#endif //CONFIGURATION_H

+ 9
- 207
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else    
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-  
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else    
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-  
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else    
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers. 
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -228,7 +168,7 @@
228 168
 #define INVERT_Z_STEP_PIN false
229 169
 #define INVERT_E_STEP_PIN false
230 170
 
231
-//default stepper release if idle. Set to 0 to deactivate.
171
+// Default stepper release if idle. Set to 0 to deactivate.
232 172
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
233 173
 
234 174
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
@@ -236,7 +176,7 @@
236 176
 
237 177
 // Feedrates for manual moves along X, Y, Z, E from panel
238 178
 #ifdef ULTIPANEL
239
-#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
179
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
240 180
 #endif
241 181
 
242 182
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -256,13 +196,6 @@
256 196
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
257 197
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
258 198
 
259
-// MS1 MS2 Stepper Driver Microstepping mode table
260
-#define MICROSTEP1 LOW,LOW
261
-#define MICROSTEP2 HIGH,LOW
262
-#define MICROSTEP4 LOW,HIGH
263
-#define MICROSTEP8 HIGH,HIGH
264
-#define MICROSTEP16 HIGH,HIGH
265
-
266 199
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
267 200
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
268 201
 
@@ -331,16 +264,6 @@
331 264
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
332 265
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
333 266
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
334
-  
335
-  #ifdef COREXY
336
-    #error BABYSTEPPING not implemented for COREXY yet.
337
-  #endif
338
-
339
-  #ifdef DELTA
340
-    #ifdef BABYSTEP_XY
341
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
342
-    #endif
343
-  #endif
344 267
 #endif
345 268
 
346 269
 // extruder advance constant (s2/mm3)
@@ -354,12 +277,8 @@
354 277
 
355 278
 #ifdef ADVANCE
356 279
   #define EXTRUDER_ADVANCE_K .0
357
-
358 280
   #define D_FILAMENT 2.85
359 281
   #define STEPS_MM_E 836
360
-  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
361
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
362
-
363 282
 #endif // ADVANCE
364 283
 
365 284
 // Arc interpretation settings:
@@ -374,26 +293,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
374 293
 // be commented out otherwise
375 294
 #define SDCARDDETECTINVERTED 
376 295
 
377
-#ifdef ULTIPANEL
378
- #undef SDCARDDETECTINVERTED
379
-#endif
380
-
381
-// Power Signal Control Definitions
382
-// By default use ATX definition
383
-#ifndef POWER_SUPPLY
384
-  #define POWER_SUPPLY 1
385
-#endif
386
-// 1 = ATX
387
-#if (POWER_SUPPLY == 1) 
388
-  #define PS_ON_AWAKE  LOW
389
-  #define PS_ON_ASLEEP HIGH
390
-#endif
391
-// 2 = X-Box 360 203W
392
-#if (POWER_SUPPLY == 2) 
393
-  #define PS_ON_AWAKE  HIGH
394
-  #define PS_ON_ASLEEP LOW
395
-#endif
396
-
397 296
 // Control heater 0 and heater 1 in parallel.
398 297
 //#define HEATERS_PARALLEL
399 298
 
@@ -433,9 +332,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
433 332
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
434 333
 #endif
435 334
 
436
-//adds support for experimental filament exchange support M600; requires display
335
+// Add support for experimental filament exchange support M600; requires display
437 336
 #ifdef ULTIPANEL
438
-  #define FILAMENTCHANGEENABLE
337
+  //#define FILAMENTCHANGEENABLE
439 338
   #ifdef FILAMENTCHANGEENABLE
440 339
     #define FILAMENTCHANGE_XPOS 3
441 340
     #define FILAMENTCHANGE_YPOS 3
@@ -445,104 +344,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
445 344
   #endif
446 345
 #endif
447 346
 
448
-#ifdef FILAMENTCHANGEENABLE
449
-  #ifdef EXTRUDER_RUNOUT_PREVENT
450
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
451
-  #endif 
452
-#endif
453
- 
454
-//===========================================================================
455
-//=============================  Define Defines  ============================
456
-//===========================================================================
457
-
458
-#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
459
-
460
-  #if not defined(AUTO_BED_LEVELING_GRID)
461
-    #error "Only Grid Bed Auto Leveling is supported on Deltas."
462
-  #endif
463
-  
464
-  #if defined(Z_PROBE_SLED)
465
-    #error "You cannot use Z_PROBE_SLED together with DELTA."
466
-  #endif
467
-
468
-  #if defined(Z_PROBE_REPEATABILITY_TEST)
469
-    #error "Z-probe repeatability test is not supported on Deltas yet."
470
-  #endif
471
-
472
-#endif  
473
-
474
-#if defined(Z_PROBE_ALLEN_KEY)
475
-  #if !defined(AUTO_BED_LEVELING_GRID) || !defined(DELTA)
476
-    #error "Invalid use of Z_PROBE_ALLEN_KEY."
477
-  #endif
478
-#endif
479
-
480
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
481
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
482
-#endif
483
-
484
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
485
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
486
-#endif
487
-
488
-#if TEMP_SENSOR_0 > 0
489
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
490
-  #define HEATER_0_USES_THERMISTOR
491
-#endif
492
-#if TEMP_SENSOR_1 > 0
493
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
494
-  #define HEATER_1_USES_THERMISTOR
495
-#endif
496
-#if TEMP_SENSOR_2 > 0
497
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
498
-  #define HEATER_2_USES_THERMISTOR
499
-#endif
500
-#if TEMP_SENSOR_3 > 0
501
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
502
-  #define HEATER_3_USES_THERMISTOR
503
-#endif
504
-#if TEMP_SENSOR_BED > 0
505
-  #define THERMISTORBED TEMP_SENSOR_BED
506
-  #define BED_USES_THERMISTOR
507
-#endif
508
-#if TEMP_SENSOR_0 == -1
509
-  #define HEATER_0_USES_AD595
510
-#endif
511
-#if TEMP_SENSOR_1 == -1
512
-  #define HEATER_1_USES_AD595
513
-#endif
514
-#if TEMP_SENSOR_2 == -1
515
-  #define HEATER_2_USES_AD595
516
-#endif
517
-#if TEMP_SENSOR_3 == -1
518
-  #define HEATER_3_USES_AD595
519
-#endif
520
-#if TEMP_SENSOR_BED == -1
521
-  #define BED_USES_AD595
522
-#endif
523
-#if TEMP_SENSOR_0 == -2
524
-  #define HEATER_0_USES_MAX6675
525
-#endif
526
-#if TEMP_SENSOR_0 == 0
527
-  #undef HEATER_0_MINTEMP
528
-  #undef HEATER_0_MAXTEMP
529
-#endif
530
-#if TEMP_SENSOR_1 == 0
531
-  #undef HEATER_1_MINTEMP
532
-  #undef HEATER_1_MAXTEMP
533
-#endif
534
-#if TEMP_SENSOR_2 == 0
535
-  #undef HEATER_2_MINTEMP
536
-  #undef HEATER_2_MAXTEMP
537
-#endif
538
-#if TEMP_SENSOR_3 == 0
539
-  #undef HEATER_3_MINTEMP
540
-  #undef HEATER_3_MAXTEMP
541
-#endif
542
-#if TEMP_SENSOR_BED == 0
543
-  #undef BED_MINTEMP
544
-  #undef BED_MAXTEMP
545
-#endif
546
-
347
+#include "Conditionals.h"
348
+#include "SanityCheck.h"
547 349
 
548
-#endif //__CONFIGURATION_ADV_H
350
+#endif //CONFIGURATION_ADV_H

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

@@ -350,15 +350,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
350 350
   // #define ENDSTOPPULLUP_ZMIN
351 351
 #endif
352 352
 
353
-#ifdef ENDSTOPPULLUPS
354
-  #define ENDSTOPPULLUP_XMAX
355
-  #define ENDSTOPPULLUP_YMAX
356
-  #define ENDSTOPPULLUP_ZMAX
357
-  #define ENDSTOPPULLUP_XMIN
358
-  #define ENDSTOPPULLUP_YMIN
359
-  #define ENDSTOPPULLUP_ZMIN
360
-#endif
361
-
362 353
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
363 354
 const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
364 355
 const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
@@ -409,10 +400,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
409 400
 #define Z_MAX_POS MANUAL_Z_HOME_POS
410 401
 #define Z_MIN_POS 0
411 402
 
412
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
413
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
414
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
403
+//===========================================================================
404
+//============================= Filament Runout Sensor ======================
405
+//===========================================================================
406
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
407
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
408
+                                 // It is assumed that when logic high = filament available
409
+                                 //                    when logic  low = filament ran out
410
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
411
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
412
+
413
+//===========================================================================
414
+//============================ Manual Bed Leveling ==========================
415
+//===========================================================================
415 416
 
417
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
418
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
419
+
420
+#if defined(MESH_BED_LEVELING)
421
+  #define MESH_MIN_X 10
422
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
423
+  #define MESH_MIN_Y 10
424
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
425
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
426
+  #define MESH_NUM_Y_POINTS 3
427
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
428
+#endif  // MESH_BED_LEVELING
416 429
 
417 430
 //===========================================================================
418 431
 //============================= Bed Auto Leveling ===========================
@@ -636,112 +649,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
636 649
 // in ultralcd.cpp@lcd_delta_calibrate_menu()
637 650
 // #define DELTA_CALIBRATION_MENU
638 651
 
639
-//automatic expansion
640
-#if defined (MAKRPANEL)
641
- #define DOGLCD
642
- #define SDSUPPORT
643
- #define ULTIPANEL
644
- #define NEWPANEL
645
- #define DEFAULT_LCD_CONTRAST 17
646
-#endif
647
-
648
-#if defined(miniVIKI) || defined(VIKI2)
649
- #define ULTRA_LCD  //general LCD support, also 16x2
650
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
651
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
652
- 
653
-  #ifdef miniVIKI
654
-   #define DEFAULT_LCD_CONTRAST 95
655
-  #else
656
-   #define DEFAULT_LCD_CONTRAST 40
657
-  #endif
658
-  
659
- #define ENCODER_PULSES_PER_STEP 4
660
- #define ENCODER_STEPS_PER_MENU_ITEM 1
661
-#endif
662
-
663
-#if defined (PANEL_ONE)
664
- #define SDSUPPORT
665
- #define ULTIMAKERCONTROLLER
666
-#endif
667
-
668
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
669
- #define DOGLCD
670
- #define U8GLIB_ST7920
671
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
672
-#endif
673
-
674
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
675
- #define ULTIPANEL
676
- #define NEWPANEL
677
-#endif
678
-
679
-#if defined(REPRAPWORLD_KEYPAD)
680
-  #define NEWPANEL
681
-  #define ULTIPANEL
682
-#endif
683
-#if defined(RA_CONTROL_PANEL)
684
- #define ULTIPANEL
685
- #define NEWPANEL
686
- #define LCD_I2C_TYPE_PCA8574
687
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
688
-#endif
689
-
690
-//I2C PANELS
652
+/**
653
+ * I2C Panels
654
+ */
691 655
 
692 656
 //#define LCD_I2C_SAINSMART_YWROBOT
693
-#ifdef LCD_I2C_SAINSMART_YWROBOT
694
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
695
-  // Make sure it is placed in the Arduino libraries directory.
696
-  #define LCD_I2C_TYPE_PCF8575
697
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
698
-  #define NEWPANEL
699
-  #define ULTIPANEL
700
-#endif
701 657
 
702 658
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
703 659
 //#define LCD_I2C_PANELOLU2
704
-#ifdef LCD_I2C_PANELOLU2
705
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
706
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
707
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
708
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
709
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
710
-  #define LCD_I2C_TYPE_MCP23017
711
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
712
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
713
-  #define NEWPANEL
714
-  #define ULTIPANEL
715
-
716
-  #ifndef ENCODER_PULSES_PER_STEP
717
-	#define ENCODER_PULSES_PER_STEP 4
718
-  #endif
719
-
720
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
721
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
722
-  #endif
723
-
724
-
725
-  #ifdef LCD_USE_I2C_BUZZER
726
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
727
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
728
-  #endif
729
-
730
-#endif
731 660
 
732 661
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
733 662
 //#define LCD_I2C_VIKI
734
-#ifdef LCD_I2C_VIKI
735
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
736
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
737
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
738
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
739
-  #define LCD_I2C_TYPE_MCP23017
740
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
741
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
742
-  #define NEWPANEL
743
-  #define ULTIPANEL
744
-#endif
745 663
 
746 664
 // Shift register panels
747 665
 // ---------------------
@@ -749,51 +667,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
749 667
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
750 668
 
751 669
 //#define SAV_3DLCD
752
-#ifdef SAV_3DLCD
753
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
754
-   #define NEWPANEL
755
-   #define ULTIPANEL
756
-#endif
757
-
758
-
759
-#ifdef ULTIPANEL
760
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
761
-  #define SDSUPPORT
762
-  #define ULTRA_LCD
763
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
764
-    #define LCD_WIDTH 22
765
-    #define LCD_HEIGHT 5
766
-  #else
767
-    #define LCD_WIDTH 20
768
-    #define LCD_HEIGHT 4
769
-  #endif
770
-#else //no panel but just LCD
771
-  #ifdef ULTRA_LCD
772
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
773
-    #define LCD_WIDTH 22
774
-    #define LCD_HEIGHT 5
775
-  #else
776
-    #define LCD_WIDTH 16
777
-    #define LCD_HEIGHT 2
778
-  #endif
779
-  #endif
780
-#endif
781
-
782
-// default LCD contrast for dogm-like LCD displays
783
-#ifdef DOGLCD
784
-# ifndef DEFAULT_LCD_CONTRAST
785
-#  define DEFAULT_LCD_CONTRAST 32
786
-# endif
787
-#endif
788 670
 
789 671
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
790 672
 //#define FAST_PWM_FAN
791 673
 
792
-// Temperature status LEDs that display the hotend and bet temperature.
793
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
794
-// Otherwise the RED led is on. There is 1C hysteresis.
795
-//#define TEMP_STAT_LEDS
796
-
797 674
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
798 675
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
799 676
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -805,6 +682,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
805 682
 // at zero value, there are 128 effective control positions.
806 683
 #define SOFT_PWM_SCALE 0
807 684
 
685
+// Temperature status LEDs that display the hotend and bet temperature.
686
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
687
+// Otherwise the RED led is on. There is 1C hysteresis.
688
+//#define TEMP_STAT_LEDS
689
+
808 690
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
809 691
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
810 692
 // #define PHOTOGRAPH_PIN     23
@@ -876,4 +758,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
876 758
 #include "Configuration_adv.h"
877 759
 #include "thermistortables.h"
878 760
 
879
-#endif //__CONFIGURATION_H
761
+#endif //CONFIGURATION_H

+ 9
- 207
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else    
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-  
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else    
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-  
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else    
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers. 
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -228,7 +168,7 @@
228 168
 #define INVERT_Z_STEP_PIN false
229 169
 #define INVERT_E_STEP_PIN false
230 170
 
231
-//default stepper release if idle. Set to 0 to deactivate.
171
+// Default stepper release if idle. Set to 0 to deactivate.
232 172
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
233 173
 
234 174
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
@@ -236,7 +176,7 @@
236 176
 
237 177
 // Feedrates for manual moves along X, Y, Z, E from panel
238 178
 #ifdef ULTIPANEL
239
-#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
179
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
240 180
 #endif
241 181
 
242 182
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -255,13 +195,6 @@
255 195
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
256 196
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
257 197
 
258
-// MS1 MS2 Stepper Driver Microstepping mode table
259
-#define MICROSTEP1 LOW,LOW
260
-#define MICROSTEP2 HIGH,LOW
261
-#define MICROSTEP4 LOW,HIGH
262
-#define MICROSTEP8 HIGH,HIGH
263
-#define MICROSTEP16 HIGH,HIGH
264
-
265 198
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
266 199
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
267 200
 
@@ -330,16 +263,6 @@
330 263
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
331 264
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
332 265
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
333
-  
334
-  #ifdef COREXY
335
-    #error BABYSTEPPING not implemented for COREXY yet.
336
-  #endif
337
-
338
-  #ifdef DELTA
339
-    #ifdef BABYSTEP_XY
340
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
341
-    #endif
342
-  #endif
343 266
 #endif
344 267
 
345 268
 // extruder advance constant (s2/mm3)
@@ -353,12 +276,8 @@
353 276
 
354 277
 #ifdef ADVANCE
355 278
   #define EXTRUDER_ADVANCE_K .0
356
-
357 279
   #define D_FILAMENT 2.85
358 280
   #define STEPS_MM_E 836
359
-  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
360
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
361
-
362 281
 #endif // ADVANCE
363 282
 
364 283
 // Arc interpretation settings:
@@ -373,26 +292,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
373 292
 // be commented out otherwise
374 293
 #define SDCARDDETECTINVERTED 
375 294
 
376
-#ifdef ULTIPANEL
377
- #undef SDCARDDETECTINVERTED
378
-#endif
379
-
380
-// Power Signal Control Definitions
381
-// By default use ATX definition
382
-#ifndef POWER_SUPPLY
383
-  #define POWER_SUPPLY 1
384
-#endif
385
-// 1 = ATX
386
-#if (POWER_SUPPLY == 1) 
387
-  #define PS_ON_AWAKE  LOW
388
-  #define PS_ON_ASLEEP HIGH
389
-#endif
390
-// 2 = X-Box 360 203W
391
-#if (POWER_SUPPLY == 2) 
392
-  #define PS_ON_AWAKE  HIGH
393
-  #define PS_ON_ASLEEP LOW
394
-#endif
395
-
396 295
 // Control heater 0 and heater 1 in parallel.
397 296
 //#define HEATERS_PARALLEL
398 297
 
@@ -432,9 +331,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
432 331
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
433 332
 #endif
434 333
 
435
-//adds support for experimental filament exchange support M600; requires display
334
+// Add support for experimental filament exchange support M600; requires display
436 335
 #ifdef ULTIPANEL
437
-  #define FILAMENTCHANGEENABLE
336
+  //#define FILAMENTCHANGEENABLE
438 337
   #ifdef FILAMENTCHANGEENABLE
439 338
     #define FILAMENTCHANGE_XPOS 3
440 339
     #define FILAMENTCHANGE_YPOS 3
@@ -444,104 +343,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
444 343
   #endif
445 344
 #endif
446 345
 
447
-#ifdef FILAMENTCHANGEENABLE
448
-  #ifdef EXTRUDER_RUNOUT_PREVENT
449
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
450
-  #endif 
451
-#endif
452
- 
453
-//===========================================================================
454
-//=============================  Define Defines  ============================
455
-//===========================================================================
456
-
457
-#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
458
-
459
-  #if not defined(AUTO_BED_LEVELING_GRID)
460
-    #error "Only Grid Bed Auto Leveling is supported on Deltas."
461
-  #endif
462
-  
463
-  #if defined(Z_PROBE_SLED)
464
-    #error "You cannot use Z_PROBE_SLED together with DELTA."
465
-  #endif
466
-
467
-  #if defined(Z_PROBE_REPEATABILITY_TEST)
468
-    #error "Z-probe repeatability test is not supported on Deltas yet."
469
-  #endif
470
-
471
-#endif  
472
-
473
-#if defined(Z_PROBE_ALLEN_KEY)
474
-  #if !defined(AUTO_BED_LEVELING_GRID) || !defined(DELTA)
475
-    #error "Invalid use of Z_PROBE_ALLEN_KEY."
476
-  #endif
477
-#endif
478
-
479
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
480
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
481
-#endif
482
-
483
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
484
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
485
-#endif
486
-
487
-#if TEMP_SENSOR_0 > 0
488
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
489
-  #define HEATER_0_USES_THERMISTOR
490
-#endif
491
-#if TEMP_SENSOR_1 > 0
492
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
493
-  #define HEATER_1_USES_THERMISTOR
494
-#endif
495
-#if TEMP_SENSOR_2 > 0
496
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
497
-  #define HEATER_2_USES_THERMISTOR
498
-#endif
499
-#if TEMP_SENSOR_3 > 0
500
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
501
-  #define HEATER_3_USES_THERMISTOR
502
-#endif
503
-#if TEMP_SENSOR_BED > 0
504
-  #define THERMISTORBED TEMP_SENSOR_BED
505
-  #define BED_USES_THERMISTOR
506
-#endif
507
-#if TEMP_SENSOR_0 == -1
508
-  #define HEATER_0_USES_AD595
509
-#endif
510
-#if TEMP_SENSOR_1 == -1
511
-  #define HEATER_1_USES_AD595
512
-#endif
513
-#if TEMP_SENSOR_2 == -1
514
-  #define HEATER_2_USES_AD595
515
-#endif
516
-#if TEMP_SENSOR_3 == -1
517
-  #define HEATER_3_USES_AD595
518
-#endif
519
-#if TEMP_SENSOR_BED == -1
520
-  #define BED_USES_AD595
521
-#endif
522
-#if TEMP_SENSOR_0 == -2
523
-  #define HEATER_0_USES_MAX6675
524
-#endif
525
-#if TEMP_SENSOR_0 == 0
526
-  #undef HEATER_0_MINTEMP
527
-  #undef HEATER_0_MAXTEMP
528
-#endif
529
-#if TEMP_SENSOR_1 == 0
530
-  #undef HEATER_1_MINTEMP
531
-  #undef HEATER_1_MAXTEMP
532
-#endif
533
-#if TEMP_SENSOR_2 == 0
534
-  #undef HEATER_2_MINTEMP
535
-  #undef HEATER_2_MAXTEMP
536
-#endif
537
-#if TEMP_SENSOR_3 == 0
538
-  #undef HEATER_3_MINTEMP
539
-  #undef HEATER_3_MAXTEMP
540
-#endif
541
-#if TEMP_SENSOR_BED == 0
542
-  #undef BED_MINTEMP
543
-  #undef BED_MAXTEMP
544
-#endif
545
-
346
+#include "Conditionals.h"
347
+#include "SanityCheck.h"
546 348
 
547
-#endif //__CONFIGURATION_ADV_H
349
+#endif //CONFIGURATION_ADV_H

+ 34
- 152
Marlin/example_configurations/makibox/Configuration.h View File

@@ -319,15 +319,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
319 319
   // #define ENDSTOPPULLUP_ZMIN
320 320
 #endif
321 321
 
322
-#ifdef ENDSTOPPULLUPS
323
-  #define ENDSTOPPULLUP_XMAX
324
-  #define ENDSTOPPULLUP_YMAX
325
-  #define ENDSTOPPULLUP_ZMAX
326
-  #define ENDSTOPPULLUP_XMIN
327
-  #define ENDSTOPPULLUP_YMIN
328
-  #define ENDSTOPPULLUP_ZMIN
329
-#endif
330
-
331 322
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
332 323
 const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
333 324
 const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
@@ -376,10 +367,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
376 367
 #define Z_MAX_POS 86
377 368
 #define Z_MIN_POS 0
378 369
 
379
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
380
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
381
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
370
+//===========================================================================
371
+//============================= Filament Runout Sensor ======================
372
+//===========================================================================
373
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
374
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
375
+                                 // It is assumed that when logic high = filament available
376
+                                 //                    when logic  low = filament ran out
377
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
378
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
379
+
380
+//===========================================================================
381
+//============================ Manual Bed Leveling ==========================
382
+//===========================================================================
382 383
 
384
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
385
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
386
+
387
+#if defined(MESH_BED_LEVELING)
388
+  #define MESH_MIN_X 10
389
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
390
+  #define MESH_MIN_Y 10
391
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
392
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
393
+  #define MESH_NUM_Y_POINTS 3
394
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
395
+#endif  // MESH_BED_LEVELING
383 396
 
384 397
 //===========================================================================
385 398
 //============================= Bed Auto Leveling ===========================
@@ -609,112 +622,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
609 622
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
610 623
 //#define RA_CONTROL_PANEL
611 624
 
612
-//automatic expansion
613
-#if defined (MAKRPANEL)
614
- #define DOGLCD
615
- #define SDSUPPORT
616
- #define ULTIPANEL
617
- #define NEWPANEL
618
- #define DEFAULT_LCD_CONTRAST 17
619
-#endif
620
-
621
-#if defined(miniVIKI) || defined(VIKI2)
622
- #define ULTRA_LCD  //general LCD support, also 16x2
623
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
624
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
625
- 
626
-  #ifdef miniVIKI
627
-   #define DEFAULT_LCD_CONTRAST 95
628
-  #else
629
-   #define DEFAULT_LCD_CONTRAST 40
630
-  #endif
631
-  
632
- #define ENCODER_PULSES_PER_STEP 4
633
- #define ENCODER_STEPS_PER_MENU_ITEM 1
634
-#endif
635
-
636
-#if defined (PANEL_ONE)
637
- #define SDSUPPORT
638
- #define ULTIMAKERCONTROLLER
639
-#endif
640
-
641
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
642
- #define DOGLCD
643
- #define U8GLIB_ST7920
644
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
645
-#endif
646
-
647
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
648
- #define ULTIPANEL
649
- #define NEWPANEL
650
-#endif
651
-
652
-#if defined(REPRAPWORLD_KEYPAD)
653
-  #define NEWPANEL
654
-  #define ULTIPANEL
655
-#endif
656
-#if defined(RA_CONTROL_PANEL)
657
- #define ULTIPANEL
658
- #define NEWPANEL
659
- #define LCD_I2C_TYPE_PCA8574
660
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
661
-#endif
662
-
663
-//I2C PANELS
625
+/**
626
+ * I2C Panels
627
+ */
664 628
 
665 629
 //#define LCD_I2C_SAINSMART_YWROBOT
666
-#ifdef LCD_I2C_SAINSMART_YWROBOT
667
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
668
-  // Make sure it is placed in the Arduino libraries directory.
669
-  #define LCD_I2C_TYPE_PCF8575
670
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
671
-  #define NEWPANEL
672
-  #define ULTIPANEL
673
-#endif
674 630
 
675 631
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
676 632
 //#define LCD_I2C_PANELOLU2
677
-#ifdef LCD_I2C_PANELOLU2
678
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
679
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
680
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
681
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
682
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
683
-  #define LCD_I2C_TYPE_MCP23017
684
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
685
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
686
-  #define NEWPANEL
687
-  #define ULTIPANEL
688
-
689
-  #ifndef ENCODER_PULSES_PER_STEP
690
-	#define ENCODER_PULSES_PER_STEP 4
691
-  #endif
692
-
693
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
694
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
695
-  #endif
696
-
697
-
698
-  #ifdef LCD_USE_I2C_BUZZER
699
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
700
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
701
-  #endif
702
-
703
-#endif
704 633
 
705 634
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
706 635
 //#define LCD_I2C_VIKI
707
-#ifdef LCD_I2C_VIKI
708
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
709
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
710
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
711
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
712
-  #define LCD_I2C_TYPE_MCP23017
713
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
714
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
715
-  #define NEWPANEL
716
-  #define ULTIPANEL
717
-#endif
718 636
 
719 637
 // Shift register panels
720 638
 // ---------------------
@@ -722,51 +640,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
722 640
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
723 641
 
724 642
 //#define SAV_3DLCD
725
-#ifdef SAV_3DLCD
726
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
727
-   #define NEWPANEL
728
-   #define ULTIPANEL
729
-#endif
730
-
731
-
732
-#ifdef ULTIPANEL
733
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
734
-  #define SDSUPPORT
735
-  #define ULTRA_LCD
736
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
737
-    #define LCD_WIDTH 22
738
-    #define LCD_HEIGHT 5
739
-  #else
740
-    #define LCD_WIDTH 20
741
-    #define LCD_HEIGHT 4
742
-  #endif
743
-#else //no panel but just LCD
744
-  #ifdef ULTRA_LCD
745
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
746
-    #define LCD_WIDTH 22
747
-    #define LCD_HEIGHT 5
748
-  #else
749
-    #define LCD_WIDTH 16
750
-    #define LCD_HEIGHT 2
751
-  #endif
752
-  #endif
753
-#endif
754
-
755
-// default LCD contrast for dogm-like LCD displays
756
-#ifdef DOGLCD
757
-# ifndef DEFAULT_LCD_CONTRAST
758
-#  define DEFAULT_LCD_CONTRAST 32
759
-# endif
760
-#endif
761 643
 
762 644
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
763 645
 //#define FAST_PWM_FAN
764 646
 
765
-// Temperature status LEDs that display the hotend and bet temperature.
766
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
767
-// Otherwise the RED led is on. There is 1C hysteresis.
768
-//#define TEMP_STAT_LEDS
769
-
770 647
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
771 648
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
772 649
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -778,6 +655,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
778 655
 // at zero value, there are 128 effective control positions.
779 656
 #define SOFT_PWM_SCALE 0
780 657
 
658
+// Temperature status LEDs that display the hotend and bet temperature.
659
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
660
+// Otherwise the RED led is on. There is 1C hysteresis.
661
+//#define TEMP_STAT_LEDS
662
+
781 663
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
782 664
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
783 665
 // #define PHOTOGRAPH_PIN     23
@@ -849,4 +731,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
849 731
 #include "Configuration_adv.h"
850 732
 #include "thermistortables.h"
851 733
 
852
-#endif //__CONFIGURATION_H
734
+#endif //CONFIGURATION_H

+ 10
- 190
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers.
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -227,20 +167,15 @@
227 167
 #define INVERT_Z_STEP_PIN false
228 168
 #define INVERT_E_STEP_PIN false
229 169
 
230
-//default stepper release if idle. Set to 0 to deactivate.
170
+// Default stepper release if idle. Set to 0 to deactivate.
231 171
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
232 172
 
233 173
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
234 174
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
235 175
 
236
-// Feedrates for manual moves along X, Y, Z, E from panel
237 176
 #ifdef ULTIPANEL
238
-#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
239
-#endif
240
-
241
-//Comment to disable setting feedrate multiplier via encoder
242
-#ifdef ULTIPANEL
243
-    #define ULTIPANEL_FEEDMULTIPLY
177
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
178
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
244 179
 #endif
245 180
 
246 181
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -259,13 +194,6 @@
259 194
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
260 195
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
261 196
 
262
-// MS1 MS2 Stepper Driver Microstepping mode table
263
-#define MICROSTEP1 LOW,LOW
264
-#define MICROSTEP2 HIGH,LOW
265
-#define MICROSTEP4 LOW,HIGH
266
-#define MICROSTEP8 HIGH,HIGH
267
-#define MICROSTEP16 HIGH,HIGH
268
-
269 197
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
270 198
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
271 199
 
@@ -335,16 +263,6 @@
335 263
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
336 264
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
337 265
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
338
-
339
-  #ifdef COREXY
340
-    #error BABYSTEPPING not implemented for COREXY yet.
341
-  #endif
342
-
343
-  #ifdef DELTA
344
-    #ifdef BABYSTEP_XY
345
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
346
-    #endif
347
-  #endif
348 266
 #endif
349 267
 
350 268
 // extruder advance constant (s2/mm3)
@@ -358,12 +276,8 @@
358 276
 
359 277
 #ifdef ADVANCE
360 278
   #define EXTRUDER_ADVANCE_K .0
361
-
362 279
   #define D_FILAMENT 2.85
363 280
   #define STEPS_MM_E 836
364
-  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
365
-  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
366
-
367 281
 #endif // ADVANCE
368 282
 
369 283
 // Arc interpretation settings:
@@ -378,26 +292,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
378 292
 // be commented out otherwise
379 293
 //#define SDCARDDETECTINVERTED
380 294
 
381
-#ifdef ULTIPANEL
382
- #undef SDCARDDETECTINVERTED
383
-#endif
384
-
385
-// Power Signal Control Definitions
386
-// By default use ATX definition
387
-#ifndef POWER_SUPPLY
388
-  #define POWER_SUPPLY 1
389
-#endif
390
-// 1 = ATX
391
-#if (POWER_SUPPLY == 1)
392
-  #define PS_ON_AWAKE  LOW
393
-  #define PS_ON_ASLEEP HIGH
394
-#endif
395
-// 2 = X-Box 360 203W
396
-#if (POWER_SUPPLY == 2)
397
-  #define PS_ON_AWAKE  HIGH
398
-  #define PS_ON_ASLEEP LOW
399
-#endif
400
-
401 295
 // Control heater 0 and heater 1 in parallel.
402 296
 //#define HEATERS_PARALLEL
403 297
 
@@ -435,9 +329,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
435 329
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
436 330
 #endif
437 331
 
438
-//adds support for experimental filament exchange support M600; requires display
332
+// Add support for experimental filament exchange support M600; requires display
439 333
 #ifdef ULTIPANEL
440
-  #define FILAMENTCHANGEENABLE
334
+  //#define FILAMENTCHANGEENABLE
441 335
   #ifdef FILAMENTCHANGEENABLE
442 336
     #define FILAMENTCHANGE_XPOS 3
443 337
     #define FILAMENTCHANGE_YPOS 3
@@ -447,81 +341,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
447 341
   #endif
448 342
 #endif
449 343
 
450
-#ifdef FILAMENTCHANGEENABLE
451
-  #ifdef EXTRUDER_RUNOUT_PREVENT
452
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
453
-  #endif
454
-#endif
455
-
456
-//===========================================================================
457
-//=============================  Define Defines  ============================
458
-//===========================================================================
459
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
460
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
461
-#endif
462
-
463
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
464
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
465
-#endif
466
-
467
-#if TEMP_SENSOR_0 > 0
468
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
469
-  #define HEATER_0_USES_THERMISTOR
470
-#endif
471
-#if TEMP_SENSOR_1 > 0
472
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
473
-  #define HEATER_1_USES_THERMISTOR
474
-#endif
475
-#if TEMP_SENSOR_2 > 0
476
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
477
-  #define HEATER_2_USES_THERMISTOR
478
-#endif
479
-#if TEMP_SENSOR_3 > 0
480
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
481
-  #define HEATER_3_USES_THERMISTOR
482
-#endif
483
-#if TEMP_SENSOR_BED > 0
484
-  #define THERMISTORBED TEMP_SENSOR_BED
485
-  #define BED_USES_THERMISTOR
486
-#endif
487
-#if TEMP_SENSOR_0 == -1
488
-  #define HEATER_0_USES_AD595
489
-#endif
490
-#if TEMP_SENSOR_1 == -1
491
-  #define HEATER_1_USES_AD595
492
-#endif
493
-#if TEMP_SENSOR_2 == -1
494
-  #define HEATER_2_USES_AD595
495
-#endif
496
-#if TEMP_SENSOR_3 == -1
497
-  #define HEATER_3_USES_AD595
498
-#endif
499
-#if TEMP_SENSOR_BED == -1
500
-  #define BED_USES_AD595
501
-#endif
502
-#if TEMP_SENSOR_0 == -2
503
-  #define HEATER_0_USES_MAX6675
504
-#endif
505
-#if TEMP_SENSOR_0 == 0
506
-  #undef HEATER_0_MINTEMP
507
-  #undef HEATER_0_MAXTEMP
508
-#endif
509
-#if TEMP_SENSOR_1 == 0
510
-  #undef HEATER_1_MINTEMP
511
-  #undef HEATER_1_MAXTEMP
512
-#endif
513
-#if TEMP_SENSOR_2 == 0
514
-  #undef HEATER_2_MINTEMP
515
-  #undef HEATER_2_MAXTEMP
516
-#endif
517
-#if TEMP_SENSOR_3 == 0
518
-  #undef HEATER_3_MINTEMP
519
-  #undef HEATER_3_MAXTEMP
520
-#endif
521
-#if TEMP_SENSOR_BED == 0
522
-  #undef BED_MINTEMP
523
-  #undef BED_MAXTEMP
524
-#endif
525
-
344
+#include "Conditionals.h"
345
+#include "SanityCheck.h"
526 346
 
527
-#endif //__CONFIGURATION_ADV_H
347
+#endif //CONFIGURATION_ADV_H

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

@@ -321,15 +321,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
321 321
   // #define ENDSTOPPULLUP_ZMIN
322 322
 #endif
323 323
 
324
-#ifdef ENDSTOPPULLUPS
325
-  #define ENDSTOPPULLUP_XMAX
326
-  #define ENDSTOPPULLUP_YMAX
327
-  #define ENDSTOPPULLUP_ZMAX
328
-  #define ENDSTOPPULLUP_XMIN
329
-  #define ENDSTOPPULLUP_YMIN
330
-  #define ENDSTOPPULLUP_ZMIN
331
-#endif
332
-
333 324
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
334 325
 const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
335 326
 const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
@@ -378,10 +369,32 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
378 369
 #define Z_MAX_POS 120
379 370
 #define Z_MIN_POS 0
380 371
 
381
-#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
382
-#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
383
-#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
372
+//===========================================================================
373
+//============================= Filament Runout Sensor ======================
374
+//===========================================================================
375
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
376
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
377
+                                 // It is assumed that when logic high = filament available
378
+                                 //                    when logic  low = filament ran out
379
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
380
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
381
+
382
+//===========================================================================
383
+//============================ Manual Bed Leveling ==========================
384
+//===========================================================================
384 385
 
386
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
387
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
388
+
389
+#if defined(MESH_BED_LEVELING)
390
+  #define MESH_MIN_X 10
391
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
392
+  #define MESH_MIN_Y 10
393
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
394
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
395
+  #define MESH_NUM_Y_POINTS 3
396
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
397
+#endif  // MESH_BED_LEVELING
385 398
 
386 399
 //===========================================================================
387 400
 //============================= Bed Auto Leveling ===========================
@@ -616,112 +629,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
616 629
 // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
617 630
 //#define RA_CONTROL_PANEL
618 631
 
619
-//automatic expansion
620
-#if defined (MAKRPANEL)
621
- #define DOGLCD
622
- #define SDSUPPORT
623
- #define ULTIPANEL
624
- #define NEWPANEL
625
- #define DEFAULT_LCD_CONTRAST 17
626
-#endif
627
-
628
-#if defined(miniVIKI) || defined(VIKI2)
629
- #define ULTRA_LCD  //general LCD support, also 16x2
630
- #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
631
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
632
- 
633
-  #ifdef miniVIKI
634
-   #define DEFAULT_LCD_CONTRAST 95
635
-  #else
636
-   #define DEFAULT_LCD_CONTRAST 40
637
-  #endif
638
-  
639
- #define ENCODER_PULSES_PER_STEP 4
640
- #define ENCODER_STEPS_PER_MENU_ITEM 1
641
-#endif
642
-
643
-#if defined (PANEL_ONE)
644
- #define SDSUPPORT
645
- #define ULTIMAKERCONTROLLER
646
-#endif
647
-
648
-#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
649
- #define DOGLCD
650
- #define U8GLIB_ST7920
651
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
652
-#endif
653
-
654
-#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
655
- #define ULTIPANEL
656
- #define NEWPANEL
657
-#endif
658
-
659
-#if defined(REPRAPWORLD_KEYPAD)
660
-  #define NEWPANEL
661
-  #define ULTIPANEL
662
-#endif
663
-#if defined(RA_CONTROL_PANEL)
664
- #define ULTIPANEL
665
- #define NEWPANEL
666
- #define LCD_I2C_TYPE_PCA8574
667
- #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
668
-#endif
669
-
670
-//I2C PANELS
632
+/**
633
+ * I2C Panels
634
+ */
671 635
 
672 636
 //#define LCD_I2C_SAINSMART_YWROBOT
673
-#ifdef LCD_I2C_SAINSMART_YWROBOT
674
-  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
675
-  // Make sure it is placed in the Arduino libraries directory.
676
-  #define LCD_I2C_TYPE_PCF8575
677
-  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
678
-  #define NEWPANEL
679
-  #define ULTIPANEL
680
-#endif
681 637
 
682 638
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
683 639
 //#define LCD_I2C_PANELOLU2
684
-#ifdef LCD_I2C_PANELOLU2
685
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
686
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
687
-  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
688
-  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
689
-  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
690
-  #define LCD_I2C_TYPE_MCP23017
691
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
692
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
693
-  #define NEWPANEL
694
-  #define ULTIPANEL
695
-
696
-  #ifndef ENCODER_PULSES_PER_STEP
697
-	#define ENCODER_PULSES_PER_STEP 4
698
-  #endif
699
-
700
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
701
-	#define ENCODER_STEPS_PER_MENU_ITEM 1
702
-  #endif
703
-
704
-
705
-  #ifdef LCD_USE_I2C_BUZZER
706
-	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
707
-	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
708
-  #endif
709
-
710
-#endif
711 640
 
712 641
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
713 642
 //#define LCD_I2C_VIKI
714
-#ifdef LCD_I2C_VIKI
715
-  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
716
-  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
717
-  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
718
-  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
719
-  #define LCD_I2C_TYPE_MCP23017
720
-  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
721
-  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
722
-  #define NEWPANEL
723
-  #define ULTIPANEL
724
-#endif
725 643
 
726 644
 // Shift register panels
727 645
 // ---------------------
@@ -729,51 +647,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
729 647
 // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
730 648
 
731 649
 //#define SAV_3DLCD
732
-#ifdef SAV_3DLCD
733
-   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
734
-   #define NEWPANEL
735
-   #define ULTIPANEL
736
-#endif
737
-
738
-
739
-#ifdef ULTIPANEL
740
-//  #define NEWPANEL  //enable this if you have a click-encoder panel
741
-  #define SDSUPPORT
742
-  #define ULTRA_LCD
743
-  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
744
-    #define LCD_WIDTH 22
745
-    #define LCD_HEIGHT 5
746
-  #else
747
-    #define LCD_WIDTH 20
748
-    #define LCD_HEIGHT 4
749
-  #endif
750
-#else //no panel but just LCD
751
-  #ifdef ULTRA_LCD
752
-  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
753
-    #define LCD_WIDTH 22
754
-    #define LCD_HEIGHT 5
755
-  #else
756
-    #define LCD_WIDTH 16
757
-    #define LCD_HEIGHT 2
758
-  #endif
759
-  #endif
760
-#endif
761
-
762
-// default LCD contrast for dogm-like LCD displays
763
-#ifdef DOGLCD
764
-# ifndef DEFAULT_LCD_CONTRAST
765
-#  define DEFAULT_LCD_CONTRAST 32
766
-# endif
767
-#endif
768 650
 
769 651
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
770 652
 //#define FAST_PWM_FAN
771 653
 
772
-// Temperature status LEDs that display the hotend and bet temperature.
773
-// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
774
-// Otherwise the RED led is on. There is 1C hysteresis.
775
-//#define TEMP_STAT_LEDS
776
-
777 654
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
778 655
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
779 656
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -785,6 +662,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
785 662
 // at zero value, there are 128 effective control positions.
786 663
 #define SOFT_PWM_SCALE 0
787 664
 
665
+// Temperature status LEDs that display the hotend and bet temperature.
666
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
667
+// Otherwise the RED led is on. There is 1C hysteresis.
668
+//#define TEMP_STAT_LEDS
669
+
788 670
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
789 671
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
790 672
 // #define PHOTOGRAPH_PIN     23
@@ -856,4 +738,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
856 738
 #include "Configuration_adv.h"
857 739
 #include "thermistortables.h"
858 740
 
859
-#endif //__CONFIGURATION_H
741
+#endif //CONFIGURATION_H

+ 10
- 186
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -1,6 +1,8 @@
1 1
 #ifndef CONFIGURATION_ADV_H
2 2
 #define CONFIGURATION_ADV_H
3 3
 
4
+#include "Conditionals.h"
5
+
4 6
 //===========================================================================
5 7
 //=============================Thermal Settings  ============================
6 8
 //===========================================================================
@@ -89,54 +91,6 @@
89 91
 
90 92
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
91 93
 
92
-
93
-//// AUTOSET LOCATIONS OF LIMIT SWITCHES
94
-//// Added by ZetaPhoenix 09-15-2012
95
-#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
96
-  #define X_HOME_POS MANUAL_X_HOME_POS
97
-  #define Y_HOME_POS MANUAL_Y_HOME_POS
98
-  #define Z_HOME_POS MANUAL_Z_HOME_POS
99
-#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
100
-  //X axis
101
-  #if X_HOME_DIR == -1
102
-    #ifdef BED_CENTER_AT_0_0
103
-      #define X_HOME_POS X_MAX_LENGTH * -0.5
104
-    #else
105
-      #define X_HOME_POS X_MIN_POS
106
-    #endif //BED_CENTER_AT_0_0
107
-  #else
108
-    #ifdef BED_CENTER_AT_0_0
109
-      #define X_HOME_POS X_MAX_LENGTH * 0.5
110
-    #else
111
-      #define X_HOME_POS X_MAX_POS
112
-    #endif //BED_CENTER_AT_0_0
113
-  #endif //X_HOME_DIR == -1
114
-
115
-  //Y axis
116
-  #if Y_HOME_DIR == -1
117
-    #ifdef BED_CENTER_AT_0_0
118
-      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
119
-    #else
120
-      #define Y_HOME_POS Y_MIN_POS
121
-    #endif //BED_CENTER_AT_0_0
122
-  #else
123
-    #ifdef BED_CENTER_AT_0_0
124
-      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
125
-    #else
126
-      #define Y_HOME_POS Y_MAX_POS
127
-    #endif //BED_CENTER_AT_0_0
128
-  #endif //Y_HOME_DIR == -1
129
-
130
-  // Z axis
131
-  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
132
-    #define Z_HOME_POS Z_MIN_POS
133
-  #else
134
-    #define Z_HOME_POS Z_MAX_POS
135
-  #endif //Z_HOME_DIR == -1
136
-#endif //End auto min/max positions
137
-//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
138
-
139
-
140 94
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
141 95
 
142 96
 // A single Z stepper driver is usually used to drive 2 stepper motors.
@@ -146,26 +100,12 @@
146 100
 // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
147 101
 //#define Z_DUAL_STEPPER_DRIVERS
148 102
 
149
-#ifdef Z_DUAL_STEPPER_DRIVERS
150
-  #undef EXTRUDERS
151
-  #define EXTRUDERS 1
152
-#endif
153
-
154 103
 // Same again but for Y Axis.
155 104
 //#define Y_DUAL_STEPPER_DRIVERS
156 105
 
157 106
 // Define if the two Y drives need to rotate in opposite directions
158 107
 #define INVERT_Y2_VS_Y_DIR true
159 108
 
160
-#ifdef Y_DUAL_STEPPER_DRIVERS
161
-  #undef EXTRUDERS
162
-  #define EXTRUDERS 1
163
-#endif
164
-
165
-#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
166
-  #error "You cannot have dual drivers for both Y and Z"
167
-#endif
168
-
169 109
 // Enable this for dual x-carriage printers.
170 110
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
171 111
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -229,20 +169,15 @@
229 169
 #define INVERT_Z_STEP_PIN false
230 170
 #define INVERT_E_STEP_PIN false
231 171
 
232
-//default stepper release if idle. Set to 0 to deactivate.
172
+// Default stepper release if idle. Set to 0 to deactivate.
233 173
 #define DEFAULT_STEPPER_DEACTIVE_TIME 60
234 174
 
235 175
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
236 176
 #define DEFAULT_MINTRAVELFEEDRATE     0.0
237 177
 
238
-// Feedrates for manual moves along X, Y, Z, E from panel
239
-#ifdef ULTIPANEL
240
-#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
241
-#endif
242
-
243
-//Comment to disable setting feedrate multiplier via encoder
244 178
 #ifdef ULTIPANEL
245
-    #define ULTIPANEL_FEEDMULTIPLY
179
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
180
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
246 181
 #endif
247 182
 
248 183
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.
@@ -261,13 +196,6 @@
261 196
 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
262 197
 #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
263 198
 
264
-// MS1 MS2 Stepper Driver Microstepping mode table
265
-#define MICROSTEP1 LOW,LOW
266
-#define MICROSTEP2 HIGH,LOW
267
-#define MICROSTEP4 LOW,HIGH
268
-#define MICROSTEP8 HIGH,HIGH
269
-#define MICROSTEP16 HIGH,HIGH
270
-
271 199
 // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
272 200
 #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
273 201
 
@@ -336,16 +264,6 @@
336 264
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
337 265
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
338 266
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
339
-
340
-  #ifdef COREXY
341
-    #error BABYSTEPPING not implemented for COREXY yet.
342
-  #endif
343
-
344
-  #ifdef DELTA
345
-    #ifdef BABYSTEP_XY
346
-      #error BABYSTEPPING only implemented for Z axis on deltabots.
347
-    #endif
348
-  #endif
349 267
 #endif
350 268
 
351 269
 // extruder advance constant (s2/mm3)
@@ -379,26 +297,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
379 297
 // be commented out otherwise
380 298
 #define SDCARDDETECTINVERTED
381 299
 
382
-#ifdef ULTIPANEL
383
- #undef SDCARDDETECTINVERTED
384
-#endif
385
-
386
-// Power Signal Control Definitions
387
-// By default use ATX definition
388
-#ifndef POWER_SUPPLY
389
-  #define POWER_SUPPLY 1
390
-#endif
391
-// 1 = ATX
392
-#if (POWER_SUPPLY == 1)
393
-  #define PS_ON_AWAKE  LOW
394
-  #define PS_ON_ASLEEP HIGH
395
-#endif
396
-// 2 = X-Box 360 203W
397
-#if (POWER_SUPPLY == 2)
398
-  #define PS_ON_AWAKE  HIGH
399
-  #define PS_ON_ASLEEP LOW
400
-#endif
401
-
402 300
 // Control heater 0 and heater 1 in parallel.
403 301
 //#define HEATERS_PARALLEL
404 302
 
@@ -438,9 +336,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
438 336
   #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
439 337
 #endif
440 338
 
441
-//adds support for experimental filament exchange support M600; requires display
339
+// Add support for experimental filament exchange support M600; requires display
442 340
 #ifdef ULTIPANEL
443
-  #define FILAMENTCHANGEENABLE
341
+  //#define FILAMENTCHANGEENABLE
444 342
   #ifdef FILAMENTCHANGEENABLE
445 343
     #define FILAMENTCHANGE_XPOS 3
446 344
     #define FILAMENTCHANGE_YPOS 3
@@ -450,81 +348,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
450 348
   #endif
451 349
 #endif
452 350
 
453
-#ifdef FILAMENTCHANGEENABLE
454
-  #ifdef EXTRUDER_RUNOUT_PREVENT
455
-    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
456
-  #endif
457
-#endif
458
-
459
-//===========================================================================
460
-//=============================  Define Defines  ============================
461
-//===========================================================================
462
-#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
463
-  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
464
-#endif
465
-
466
-#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
467
-  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
468
-#endif
469
-
470
-#if TEMP_SENSOR_0 > 0
471
-  #define THERMISTORHEATER_0 TEMP_SENSOR_0
472
-  #define HEATER_0_USES_THERMISTOR
473
-#endif
474
-#if TEMP_SENSOR_1 > 0
475
-  #define THERMISTORHEATER_1 TEMP_SENSOR_1
476
-  #define HEATER_1_USES_THERMISTOR
477
-#endif
478
-#if TEMP_SENSOR_2 > 0
479
-  #define THERMISTORHEATER_2 TEMP_SENSOR_2
480
-  #define HEATER_2_USES_THERMISTOR
481
-#endif
482
-#if TEMP_SENSOR_3 > 0
483
-  #define THERMISTORHEATER_3 TEMP_SENSOR_3
484
-  #define HEATER_3_USES_THERMISTOR
485
-#endif
486
-#if TEMP_SENSOR_BED > 0
487
-  #define THERMISTORBED TEMP_SENSOR_BED
488
-  #define BED_USES_THERMISTOR
489
-#endif
490
-#if TEMP_SENSOR_0 == -1
491
-  #define HEATER_0_USES_AD595
492
-#endif
493
-#if TEMP_SENSOR_1 == -1
494
-  #define HEATER_1_USES_AD595
495
-#endif
496
-#if TEMP_SENSOR_2 == -1
497
-  #define HEATER_2_USES_AD595
498
-#endif
499
-#if TEMP_SENSOR_3 == -1
500
-  #define HEATER_3_USES_AD595
501
-#endif
502
-#if TEMP_SENSOR_BED == -1
503
-  #define BED_USES_AD595
504
-#endif
505
-#if TEMP_SENSOR_0 == -2
506
-  #define HEATER_0_USES_MAX6675
507
-#endif
508
-#if TEMP_SENSOR_0 == 0
509
-  #undef HEATER_0_MINTEMP
510
-  #undef HEATER_0_MAXTEMP
511
-#endif
512
-#if TEMP_SENSOR_1 == 0
513
-  #undef HEATER_1_MINTEMP
514
-  #undef HEATER_1_MAXTEMP
515
-#endif
516
-#if TEMP_SENSOR_2 == 0
517
-  #undef HEATER_2_MINTEMP
518
-  #undef HEATER_2_MAXTEMP
519
-#endif
520
-#if TEMP_SENSOR_3 == 0
521
-  #undef HEATER_3_MINTEMP
522
-  #undef HEATER_3_MAXTEMP
523
-#endif
524
-#if TEMP_SENSOR_BED == 0
525
-  #undef BED_MINTEMP
526
-  #undef BED_MAXTEMP
527
-#endif
528
-
351
+#include "Conditionals.h"
352
+#include "SanityCheck.h"
529 353
 
530
-#endif //__CONFIGURATION_ADV_H
354
+#endif //CONFIGURATION_ADV_H

+ 1
- 2
Marlin/language.h View File

@@ -128,6 +128,7 @@
128 128
 #define MSG_Y_MAX                           "y_max: "
129 129
 #define MSG_Z_MIN                           "z_min: "
130 130
 #define MSG_Z_MAX                           "z_max: "
131
+#define MSG_Z2_MAX                          "z2_max: "
131 132
 #define MSG_M119_REPORT                     "Reporting endstop status"
132 133
 #define MSG_ENDSTOP_HIT                     "TRIGGERED"
133 134
 #define MSG_ENDSTOP_OPEN                    "open"
@@ -238,8 +239,6 @@
238 239
     #define STR_h3 "\263"
239 240
     #define STR_Deg "\337"
240 241
     #define STR_THERMOMETER "\002"
241
-  #elif defined(ULTRA_LCD)
242
-    #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN for your LCD controller.
243 242
   #endif
244 243
 #endif
245 244
 /*

+ 29
- 2
Marlin/pins.h View File

@@ -5,8 +5,6 @@
5 5
 #ifndef PINS_H
6 6
 #define PINS_H
7 7
 
8
-#include "boards.h"
9
-
10 8
 // Preset optional pins
11 9
 #define X_MS1_PIN -1
12 10
 #define X_MS2_PIN -1
@@ -180,6 +178,35 @@
180 178
   #define Z_MIN_PIN          -1
181 179
 #endif
182 180
 
181
+#ifdef DISABLE_XMAX_ENDSTOP
182
+  #undef X_MAX_PIN
183
+  #define X_MAX_PIN          -1
184
+#endif
185
+
186
+#ifdef DISABLE_XMIN_ENDSTOP
187
+  #undef X_MIN_PIN 
188
+  #define X_MIN_PIN          -1
189
+#endif
190
+
191
+#ifdef DISABLE_YMAX_ENDSTOP
192
+  #define Y_MAX_PIN          -1
193
+#endif
194
+
195
+#ifdef DISABLE_YMIN_ENDSTOP
196
+  #undef Y_MIN_PIN
197
+  #define Y_MIN_PIN          -1
198
+#endif
199
+
200
+#ifdef DISABLE_ZMAX_ENDSTOP
201
+  #undef Z_MAX_PIN
202
+  #define Z_MAX_PIN          -1
203
+#endif
204
+
205
+#ifdef DISABLE_ZMIN_ENDSTOP
206
+  #undef Z_MIN_PIN 
207
+  #define Z_MIN_PIN          -1
208
+#endif
209
+
183 210
 #define SENSITIVE_PINS { 0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, PS_ON_PIN, \
184 211
                         HEATER_BED_PIN, FAN_PIN, \
185 212
                         _E0_PINS _E1_PINS _E2_PINS _E3_PINS \

+ 515
- 648
Marlin/planner.cpp
File diff suppressed because it is too large
View File


+ 50
- 62
Marlin/planner.h View File

@@ -21,20 +21,16 @@
21 21
 // This module is to be considered a sub-module of stepper.c. Please don't include 
22 22
 // this file from any other module.
23 23
 
24
-#ifndef planner_h
25
-#define planner_h
24
+#ifndef PLANNER_H
25
+#define PLANNER_H
26 26
 
27 27
 #include "Marlin.h"
28 28
 
29
-#ifdef ENABLE_AUTO_BED_LEVELING
30
-#include "vector_3.h"
31
-#endif // ENABLE_AUTO_BED_LEVELING
32
-
33 29
 // This struct is used when buffering the setup for each linear movement "nominal" values are as specified in 
34 30
 // the source g-code and may never actually be reached if acceleration management is active.
35 31
 typedef struct {
36 32
   // Fields used by the bresenham algorithm for tracing the line
37
-  long steps_x, steps_y, steps_z, steps_e;  // Step count along each axis
33
+  long steps[NUM_AXIS];                     // Step count along each axis
38 34
   unsigned long step_event_count;           // The number of step events required to complete this block
39 35
   long accelerate_until;                    // The index of the step event on which to stop acceleration
40 36
   long decelerate_after;                    // The index of the step event on which to start decelerating
@@ -49,7 +45,7 @@ typedef struct {
49 45
   #endif
50 46
 
51 47
   // Fields used by the motion planner to manage acceleration
52
-//  float speed_x, speed_y, speed_z, speed_e;        // Nominal mm/sec for each axis
48
+  // float speed_x, speed_y, speed_z, speed_e;          // Nominal mm/sec for each axis
53 49
   float nominal_speed;                               // The nominal speed for this block in mm/sec 
54 50
   float entry_speed;                                 // Entry speed at previous-current junction in mm/sec
55 51
   float max_entry_speed;                             // Maximum allowable junction entry speed in mm/sec
@@ -65,49 +61,44 @@ typedef struct {
65 61
   unsigned long acceleration_st;                     // acceleration steps/sec^2
66 62
   unsigned long fan_speed;
67 63
   #ifdef BARICUDA
68
-  unsigned long valve_pressure;
69
-  unsigned long e_to_p_pressure;
64
+    unsigned long valve_pressure;
65
+    unsigned long e_to_p_pressure;
70 66
   #endif
71 67
   volatile char busy;
72 68
 } block_t;
73 69
 
74
-#ifdef ENABLE_AUTO_BED_LEVELING
75
-// this holds the required transform to compensate for bed level
76
-extern matrix_3x3 plan_bed_level_matrix;
77
-#endif // #ifdef ENABLE_AUTO_BED_LEVELING
70
+#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1))
78 71
 
79 72
 // Initialize the motion plan subsystem      
80 73
 void plan_init();
81 74
 
82
-// Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in 
83
-// millimaters. Feed rate specifies the speed of the motion.
75
+void check_axes_activity();
84 76
 
85
-#if defined(ENABLE_AUTO_BED_LEVELING) || defined(MESH_BED_LEVELING)
86
-void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder);
87
-#if defined(ENABLE_AUTO_BED_LEVELING)
88
-  #ifndef DELTA
89
-  // Get the position applying the bed level matrix if enabled
90
-  vector_3 plan_get_position();
91
-  #endif
92
-#endif  // ENABLE_AUTO_BED_LEVELING
93
-#else
94
-void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder);
95
-#endif  // ENABLE_AUTO_BED_LEVELING || MESH_BED_LEVELING
77
+// Get the number of buffered moves
78
+extern volatile unsigned char block_buffer_head;
79
+extern volatile unsigned char block_buffer_tail;
80
+FORCE_INLINE uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); }
96 81
 
97
-// Set position. Used for G92 instructions.
98 82
 #if defined(ENABLE_AUTO_BED_LEVELING) || defined(MESH_BED_LEVELING)
99
-void plan_set_position(float x, float y, float z, const float &e);
83
+  #if defined(ENABLE_AUTO_BED_LEVELING)
84
+    #include "vector_3.h"
85
+    // this holds the required transform to compensate for bed level
86
+    extern matrix_3x3 plan_bed_level_matrix;
87
+    // Get the position applying the bed level matrix if enabled
88
+    vector_3 plan_get_position();
89
+  #endif  // ENABLE_AUTO_BED_LEVELING
90
+  // Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in 
91
+  // millimeters. Feed rate specifies the speed of the motion.
92
+  void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder);
93
+  // Set position. Used for G92 instructions.
94
+  void plan_set_position(float x, float y, float z, const float &e);
100 95
 #else
101
-void plan_set_position(const float &x, const float &y, const float &z, const float &e);
96
+  void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder);
97
+  void plan_set_position(const float &x, const float &y, const float &z, const float &e);
102 98
 #endif // ENABLE_AUTO_BED_LEVELING || MESH_BED_LEVELING
103 99
 
104 100
 void plan_set_e_position(const float &e);
105 101
 
106
-
107
-
108
-void check_axes_activity();
109
-uint8_t movesplanned(); //return the nr of buffered moves
110
-
111 102
 extern unsigned long minsegmenttime;
112 103
 extern float max_feedrate[NUM_AXIS]; // set the max speeds
113 104
 extern float axis_steps_per_unit[NUM_AXIS];
@@ -123,44 +114,41 @@ extern float mintravelfeedrate;
123 114
 extern unsigned long axis_steps_per_sqr_second[NUM_AXIS];
124 115
 
125 116
 #ifdef AUTOTEMP
126
-    extern bool autotemp_enabled;
127
-    extern float autotemp_max;
128
-    extern float autotemp_min;
129
-    extern float autotemp_factor;
117
+  extern bool autotemp_enabled;
118
+  extern float autotemp_max;
119
+  extern float autotemp_min;
120
+  extern float autotemp_factor;
130 121
 #endif
131 122
 
132
-    
133
-
134
-
135
-extern block_t block_buffer[BLOCK_BUFFER_SIZE];            // A ring buffer for motion instfructions
123
+extern block_t block_buffer[BLOCK_BUFFER_SIZE];            // A ring buffer for motion instructions
136 124
 extern volatile unsigned char block_buffer_head;           // Index of the next block to be pushed
137 125
 extern volatile unsigned char block_buffer_tail; 
138
-// Called when the current block is no longer needed. Discards the block and makes the memory
139
-// availible for new blocks.    
140
-FORCE_INLINE void plan_discard_current_block()  
141
-{
142
-  if (block_buffer_head != block_buffer_tail) {
143
-    block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1);  
144
-  }
126
+
127
+// Returns true if the buffer has a queued block, false otherwise
128
+FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); }
129
+
130
+// Called when the current block is no longer needed. Discards
131
+// the block and makes the memory available for new blocks.
132
+FORCE_INLINE void plan_discard_current_block() {
133
+  if (blocks_queued())
134
+    block_buffer_tail = BLOCK_MOD(block_buffer_tail + 1);
145 135
 }
146 136
 
147 137
 // Gets the current block. Returns NULL if buffer empty
148
-FORCE_INLINE block_t *plan_get_current_block() 
149
-{
150
-  if (block_buffer_head == block_buffer_tail) { 
151
-    return(NULL); 
138
+FORCE_INLINE block_t *plan_get_current_block() {
139
+  if (blocks_queued()) {
140
+    block_t *block = &block_buffer[block_buffer_tail];
141
+    block->busy = true;
142
+    return block;
152 143
   }
153
-  block_t *block = &block_buffer[block_buffer_tail];
154
-  block->busy = true;
155
-  return(block);
144
+  else
145
+    return NULL;
156 146
 }
157 147
 
158
-// Returns true if the buffer has a queued block, false otherwise
159
-FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); }
160
-
161 148
 #ifdef PREVENT_DANGEROUS_EXTRUDE
162
-void set_extrude_min_temp(float temp);
149
+  void set_extrude_min_temp(float temp);
163 150
 #endif
164 151
 
165 152
 void reset_acceleration_rates();
166
-#endif
153
+
154
+#endif //PLANNER_H

+ 147
- 69
Marlin/stepper.cpp View File

@@ -48,6 +48,12 @@ block_t *current_block;  // A pointer to the block currently being traced
48 48
 static unsigned char out_bits;        // The next stepping-bits to be output
49 49
 static unsigned int cleaning_buffer_counter;  
50 50
 
51
+#ifdef Z_DUAL_ENDSTOPS
52
+  static bool performing_homing = false, 
53
+              locked_z_motor = false, 
54
+              locked_z2_motor = false;
55
+#endif
56
+
51 57
 // Counter variables for the bresenham line tracer
52 58
 static long counter_x, counter_y, counter_z, counter_e;
53 59
 volatile static unsigned long step_events_completed; // The number of step events executed in the current block
@@ -84,7 +90,13 @@ static bool old_x_min_endstop = false,
84 90
             old_y_min_endstop = false,
85 91
             old_y_max_endstop = false,
86 92
             old_z_min_endstop = false,
93
+            #ifndef Z_DUAL_ENDSTOPS
87 94
             old_z_max_endstop = false;
95
+            #else
96
+              old_z_max_endstop = false,
97
+              old_z2_min_endstop = false,
98
+              old_z2_max_endstop = false;
99
+            #endif
88 100
 
89 101
 static bool check_endstops = true;
90 102
 
@@ -128,7 +140,23 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
128 140
 
129 141
 #ifdef Z_DUAL_STEPPER_DRIVERS
130 142
   #define Z_APPLY_DIR(v,Q) { Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }
131
-  #define Z_APPLY_STEP(v,Q) { Z_STEP_WRITE(v); Z2_STEP_WRITE(v); }
143
+  #ifdef Z_DUAL_ENDSTOPS
144
+    #define Z_APPLY_STEP(v,Q) \
145
+    if (performing_homing) { \
146
+      if (Z_HOME_DIR > 0) {\
147
+        if (!(old_z_max_endstop && (count_direction[Z_AXIS] > 0)) && !locked_z_motor) Z_STEP_WRITE(v); \
148
+        if (!(old_z2_max_endstop && (count_direction[Z_AXIS] > 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \
149
+      } else {\
150
+        if (!(old_z_min_endstop && (count_direction[Z_AXIS] < 0)) && !locked_z_motor) Z_STEP_WRITE(v); \
151
+        if (!(old_z2_min_endstop && (count_direction[Z_AXIS] < 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \
152
+      } \
153
+    } else { \
154
+      Z_STEP_WRITE(v); \
155
+      Z2_STEP_WRITE(v); \
156
+    }
157
+  #else
158
+    #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v), Z2_STEP_WRITE(v)
159
+  #endif
132 160
 #else
133 161
   #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v)
134 162
   #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v)
@@ -364,7 +392,7 @@ ISR(TIMER1_COMPA_vect) {
364 392
       step_events_completed = 0;
365 393
 
366 394
       #ifdef Z_LATE_ENABLE
367
-        if (current_block->steps_z > 0) {
395
+        if (current_block->steps[Z_AXIS] > 0) {
368 396
           enable_z();
369 397
           OCR1A = 2000; //1ms wait
370 398
           return;
@@ -405,7 +433,7 @@ ISR(TIMER1_COMPA_vect) {
405 433
 
406 434
     #define UPDATE_ENDSTOP(axis,AXIS,minmax,MINMAX) \
407 435
       bool axis ##_## minmax ##_endstop = (READ(AXIS ##_## MINMAX ##_PIN) != AXIS ##_## MINMAX ##_ENDSTOP_INVERTING); \
408
-      if (axis ##_## minmax ##_endstop && old_## axis ##_## minmax ##_endstop && (current_block->steps_## axis > 0)) { \
436
+      if (axis ##_## minmax ##_endstop && old_## axis ##_## minmax ##_endstop && (current_block->steps[AXIS ##_AXIS] > 0)) { \
409 437
         endstops_trigsteps[AXIS ##_AXIS] = count_position[AXIS ##_AXIS]; \
410 438
         endstop_## axis ##_hit = true; \
411 439
         step_events_completed = current_block->step_event_count; \
@@ -414,79 +442,117 @@ ISR(TIMER1_COMPA_vect) {
414 442
 
415 443
     // Check X and Y endstops
416 444
     if (check_endstops) {
417
-      #ifndef COREXY
418
-        if (TEST(out_bits, X_AXIS))   // stepping along -X axis (regular cartesians bot)
419
-      #else
445
+      #ifdef COREXY
420 446
         // Head direction in -X axis for CoreXY bots.
421 447
         // If DeltaX == -DeltaY, the movement is only in Y axis
422
-        if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits, Y_AXIS)))      
423
-            if (TEST(out_bits, X_HEAD))
424
-      #endif
425
-            { // -direction
426
-              #ifdef DUAL_X_CARRIAGE
427
-                // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
428
-                if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
429
-              #endif          
430
-                {
431
-                  #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
432
-                    UPDATE_ENDSTOP(x, X, min, MIN);
433
-                  #endif
434
-                }
435
-            }
436
-            else { // +direction
437
-              #ifdef DUAL_X_CARRIAGE
438
-                // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
439
-                if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
440
-              #endif
441
-                {
442
-                  #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
443
-                    UPDATE_ENDSTOP(x, X, max, MAX);
444
-                  #endif
445
-                }
446
-            }
447
-      #ifndef COREXY
448
-        if (TEST(out_bits, Y_AXIS))   // -direction
448
+        if (current_block->steps[A_AXIS] != current_block->steps[B_AXIS] || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS)))
449
+          if (TEST(out_bits, X_HEAD))
449 450
       #else
451
+          if (TEST(out_bits, X_AXIS))   // stepping along -X axis (regular cartesians bot)
452
+      #endif
453
+          { // -direction
454
+            #ifdef DUAL_X_CARRIAGE
455
+              // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
456
+              if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
457
+            #endif          
458
+              {
459
+                #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
460
+                  UPDATE_ENDSTOP(x, X, min, MIN);
461
+                #endif
462
+              }
463
+          }
464
+          else { // +direction
465
+            #ifdef DUAL_X_CARRIAGE
466
+              // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
467
+              if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
468
+            #endif
469
+              {
470
+                #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
471
+                  UPDATE_ENDSTOP(x, X, max, MAX);
472
+                #endif
473
+              }
474
+          }
475
+      #ifdef COREXY
450 476
         // Head direction in -Y axis for CoreXY bots.
451 477
         // If DeltaX == DeltaY, the movement is only in X axis
452
-        if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) != TEST(out_bits, Y_AXIS)))
453
-            if (TEST(out_bits, Y_HEAD))             
478
+        if (current_block->steps[A_AXIS] != current_block->steps[B_AXIS] || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS)))
479
+          if (TEST(out_bits, Y_HEAD))
480
+      #else
481
+          if (TEST(out_bits, Y_AXIS))   // -direction
454 482
       #endif
455
-            { // -direction
456
-              #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
457
-                UPDATE_ENDSTOP(y, Y, min, MIN);
458
-              #endif
459
-            }
460
-            else { // +direction
461
-              #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
462
-                UPDATE_ENDSTOP(y, Y, max, MAX);
463
-              #endif
464
-            }
483
+          { // -direction
484
+            #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
485
+              UPDATE_ENDSTOP(y, Y, min, MIN);
486
+            #endif
487
+          }
488
+          else { // +direction
489
+            #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
490
+              UPDATE_ENDSTOP(y, Y, max, MAX);
491
+            #endif
492
+          }
465 493
     }
466 494
 
467 495
     if (TEST(out_bits, Z_AXIS)) {   // -direction
468
-      Z_DIR_WRITE(INVERT_Z_DIR);
469
-      #ifdef Z_DUAL_STEPPER_DRIVERS
470
-        Z2_DIR_WRITE(INVERT_Z_DIR);
471
-      #endif
472
-
496
+      Z_APPLY_DIR(INVERT_Z_DIR,0);
473 497
       count_direction[Z_AXIS] = -1;
474
-      if (check_endstops) {
475
-        #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
476
-          UPDATE_ENDSTOP(z, Z, min, MIN);
498
+      if (check_endstops) 
499
+      {
500
+        #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1
501
+          #ifndef Z_DUAL_ENDSTOPS
502
+            UPDATE_ENDSTOP(z, Z, min, MIN);
503
+          #else
504
+            bool z_min_endstop=(READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
505
+            #if defined(Z2_MIN_PIN) && Z2_MIN_PIN > -1
506
+              bool z2_min_endstop=(READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING);
507
+            #else
508
+              bool z2_min_endstop=z_min_endstop;
509
+            #endif
510
+            if(((z_min_endstop && old_z_min_endstop) || (z2_min_endstop && old_z2_min_endstop)) && (current_block->steps[Z_AXIS] > 0))
511
+            {
512
+              endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
513
+              endstop_z_hit=true;
514
+              if (!(performing_homing) || ((performing_homing)&&(z_min_endstop && old_z_min_endstop)&&(z2_min_endstop && old_z2_min_endstop))) //if not performing home or if both endstops were trigged during homing...
515
+              {
516
+                step_events_completed = current_block->step_event_count;
517
+              } 
518
+            }
519
+            old_z_min_endstop = z_min_endstop;
520
+            old_z2_min_endstop = z2_min_endstop;
521
+          #endif
477 522
         #endif
478 523
       }
479 524
     }
480 525
     else { // +direction
481
-      Z_DIR_WRITE(!INVERT_Z_DIR);
482
-      #ifdef Z_DUAL_STEPPER_DRIVERS
483
-        Z2_DIR_WRITE(!INVERT_Z_DIR);
484
-      #endif
485
-
526
+      Z_APPLY_DIR(!INVERT_Z_DIR,0);
486 527
       count_direction[Z_AXIS] = 1;
487 528
       if (check_endstops) {
488 529
         #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
489
-          UPDATE_ENDSTOP(z, Z, max, MAX);
530
+          #ifndef Z_DUAL_ENDSTOPS
531
+            UPDATE_ENDSTOP(z, Z, max, MAX);
532
+          #else
533
+            bool z_max_endstop=(READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING);
534
+            #if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1
535
+              bool z2_max_endstop=(READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING);
536
+            #else
537
+              bool z2_max_endstop=z_max_endstop;
538
+            #endif
539
+            if(((z_max_endstop && old_z_max_endstop) || (z2_max_endstop && old_z2_max_endstop)) && (current_block->steps[Z_AXIS] > 0))
540
+            {
541
+              endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
542
+              endstop_z_hit=true;
543
+
544
+//              if (z_max_endstop && old_z_max_endstop) SERIAL_ECHOLN("z_max_endstop = true");
545
+//              if (z2_max_endstop && old_z2_max_endstop) SERIAL_ECHOLN("z2_max_endstop = true");
546
+
547
+            
548
+              if (!(performing_homing) || ((performing_homing)&&(z_max_endstop && old_z_max_endstop)&&(z2_max_endstop && old_z2_max_endstop))) //if not performing home or if both endstops were trigged during homing...
549
+              {
550
+                step_events_completed = current_block->step_event_count;
551
+              } 
552
+            }
553
+            old_z_max_endstop = z_max_endstop;
554
+            old_z2_max_endstop = z2_max_endstop;
555
+          #endif
490 556
         #endif
491 557
       }
492 558
     }
@@ -509,7 +575,7 @@ ISR(TIMER1_COMPA_vect) {
509 575
       #endif
510 576
 
511 577
       #ifdef ADVANCE
512
-        counter_e += current_block->steps_e;
578
+        counter_e += current_block->steps[E_AXIS];
513 579
         if (counter_e > 0) {
514 580
           counter_e -= current_block->step_event_count;
515 581
           e_steps[current_block->active_extruder] += TEST(out_bits, E_AXIS) ? -1 : 1;
@@ -523,15 +589,14 @@ ISR(TIMER1_COMPA_vect) {
523 589
          * instead of doing each in turn. The extra tests add enough
524 590
          * lag to allow it work with without needing NOPs
525 591
          */
526
-        counter_x += current_block->steps_x;
527
-        if (counter_x > 0) X_STEP_WRITE(HIGH);
528
-        counter_y += current_block->steps_y;
529
-        if (counter_y > 0) Y_STEP_WRITE(HIGH);
530
-        counter_z += current_block->steps_z;
531
-        if (counter_z > 0) Z_STEP_WRITE(HIGH);
592
+        #define STEP_ADD(axis, AXIS) \
593
+         counter_## axis += current_block->steps[AXIS ##_AXIS]; \
594
+         if (counter_## axis > 0) { AXIS ##_STEP_WRITE(HIGH); }
595
+        STEP_ADD(x,X);
596
+        STEP_ADD(y,Y);
597
+        STEP_ADD(z,Z);
532 598
         #ifndef ADVANCE
533
-          counter_e += current_block->steps_e;
534
-          if (counter_e > 0) E_STEP_WRITE(HIGH);
599
+          STEP_ADD(e,E);
535 600
         #endif
536 601
 
537 602
         #define STEP_IF_COUNTER(axis, AXIS) \
@@ -551,7 +616,7 @@ ISR(TIMER1_COMPA_vect) {
551 616
       #else // !CONFIG_STEPPERS_TOSHIBA
552 617
 
553 618
         #define APPLY_MOVEMENT(axis, AXIS) \
554
-          counter_## axis += current_block->steps_## axis; \
619
+          counter_## axis += current_block->steps[AXIS ##_AXIS]; \
555 620
           if (counter_## axis > 0) { \
556 621
             AXIS ##_APPLY_STEP(!INVERT_## AXIS ##_STEP_PIN,0); \
557 622
             counter_## axis -= current_block->step_event_count; \
@@ -846,6 +911,13 @@ void st_init() {
846 911
     #endif
847 912
   #endif
848 913
 
914
+  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
915
+    SET_INPUT(Z2_MAX_PIN);
916
+    #ifdef ENDSTOPPULLUP_ZMAX
917
+      WRITE(Z2_MAX_PIN,HIGH);
918
+    #endif
919
+  #endif  
920
+  
849 921
   #define AXIS_INIT(axis, AXIS, PIN) \
850 922
     AXIS ##_STEP_INIT; \
851 923
     AXIS ##_STEP_WRITE(INVERT_## PIN ##_STEP_PIN); \
@@ -1175,3 +1247,9 @@ void microstep_readings() {
1175 1247
     SERIAL_PROTOCOLLN(digitalRead(E1_MS2_PIN));
1176 1248
   #endif
1177 1249
 }
1250
+
1251
+#ifdef Z_DUAL_ENDSTOPS
1252
+  void In_Homing_Process(bool state) { performing_homing = state; }
1253
+  void Lock_z_motor(bool state) { locked_z_motor = state; }
1254
+  void Lock_z2_motor(bool state) { locked_z2_motor = state; }
1255
+#endif

+ 6
- 0
Marlin/stepper.h View File

@@ -97,6 +97,12 @@ void digipot_current(uint8_t driver, int current);
97 97
 void microstep_init();
98 98
 void microstep_readings();
99 99
 
100
+#ifdef Z_DUAL_ENDSTOPS
101
+  void In_Homing_Process(bool state);
102
+  void Lock_z_motor(bool state);
103
+  void Lock_z2_motor(bool state);
104
+#endif
105
+
100 106
 #ifdef BABYSTEPPING
101 107
   void babystep(const uint8_t axis,const bool direction); // perform a short step with a single stepper motor, outside of any convention
102 108
 #endif

+ 49
- 129
Marlin/temperature.cpp View File

@@ -41,50 +41,14 @@
41 41
 //================================== macros =================================
42 42
 //===========================================================================
43 43
 
44
-#if EXTRUDERS > 4
45
-  #error Unsupported number of extruders
46
-#elif EXTRUDERS > 3
47
-  #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3, v4 }
48
-#elif EXTRUDERS > 2
49
-  #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3 }
50
-#elif EXTRUDERS > 1
51
-  #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2 }
52
-#else
53
-  #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1 }
44
+#ifdef K1 // Defined in Configuration.h in the PID settings
45
+  #define K2 (1.0-K1)
54 46
 #endif
55 47
 
56
-#define HAS_TEMP_0 (defined(TEMP_0_PIN) && TEMP_0_PIN >= 0)
57
-#define HAS_TEMP_1 (defined(TEMP_1_PIN) && TEMP_1_PIN >= 0)
58
-#define HAS_TEMP_2 (defined(TEMP_2_PIN) && TEMP_2_PIN >= 0)
59
-#define HAS_TEMP_3 (defined(TEMP_3_PIN) && TEMP_3_PIN >= 0)
60
-#define HAS_TEMP_BED (defined(TEMP_BED_PIN) && TEMP_BED_PIN >= 0)
61
-#define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
62
-#define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0)
63
-#define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0)
64
-#define HAS_HEATER_2 (defined(HEATER_2_PIN) && HEATER_2_PIN >= 0)
65
-#define HAS_HEATER_3 (defined(HEATER_3_PIN) && HEATER_3_PIN >= 0)
66
-#define HAS_HEATER_BED (defined(HEATER_BED_PIN) && HEATER_BED_PIN >= 0)
67
-#define HAS_AUTO_FAN_0 (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN >= 0)
68
-#define HAS_AUTO_FAN_1 (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN >= 0)
69
-#define HAS_AUTO_FAN_2 (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN >= 0)
70
-#define HAS_AUTO_FAN_3 (defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN >= 0)
71
-#define HAS_AUTO_FAN HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3
72
-#define HAS_FAN (defined(FAN_PIN) && FAN_PIN >= 0)
73
-
74 48
 //===========================================================================
75 49
 //============================= public variables ============================
76 50
 //===========================================================================
77 51
 
78
-#ifdef K1 // Defined in Configuration.h in the PID settings
79
-  #define K2 (1.0-K1)
80
-#endif
81
-
82
-// Sampling period of the temperature routine
83
-#ifdef PID_dT
84
-  #undef PID_dT
85
-#endif
86
-#define PID_dT ((OVERSAMPLENR * 12.0)/(F_CPU / 64.0 / 256.0))
87
-
88 52
 int target_temperature[EXTRUDERS] = { 0 };
89 53
 int target_temperature_bed = 0;
90 54
 int current_temperature_raw[EXTRUDERS] = { 0 };
@@ -177,7 +141,7 @@ static volatile bool temp_meas_ready = false;
177 141
 // Init min and max temp with extreme values to prevent false errors during startup
178 142
 static int minttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP);
179 143
 static int maxttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP);
180
-static int minttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 0, 0, 0, 0 );
144
+static int minttemp[EXTRUDERS] = { 0 };
181 145
 static int maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 16383, 16383, 16383, 16383 );
182 146
 //static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; /* No bed mintemp error implemented?!? */
183 147
 #ifdef BED_MAXTEMP
@@ -197,8 +161,8 @@ static float analog2tempBed(int raw);
197 161
 static void updateTemperaturesFromRawValues();
198 162
 
199 163
 #ifdef WATCH_TEMP_PERIOD
200
-  int watch_start_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0,0);
201
-  unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0,0);
164
+  int watch_start_temp[EXTRUDERS] = { 0 };
165
+  unsigned long watchmillis[EXTRUDERS] = { 0 };
202 166
 #endif //WATCH_TEMP_PERIOD
203 167
 
204 168
 #ifndef SOFT_PWM_SCALE
@@ -391,21 +355,6 @@ int getHeaterPower(int heater) {
391 355
 
392 356
 #if HAS_AUTO_FAN
393 357
 
394
-  #if HAS_FAN
395
-    #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
396
-       #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN"
397
-    #endif
398
-    #if EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
399
-       #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN"
400
-    #endif
401
-    #if EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN
402
-       #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN"
403
-    #endif
404
-    #if EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN
405
-       #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN"
406
-    #endif
407
-  #endif 
408
-
409 358
 void setExtruderAutoFanState(int pin, bool state)
410 359
 {
411 360
   unsigned char newFanSpeed = (state != 0) ? EXTRUDER_AUTO_FAN_SPEED : 0;
@@ -482,42 +431,8 @@ void checkExtruderAutoFans()
482 431
 #endif // any extruder auto fan pins set
483 432
 
484 433
 //
485
-// Error checking and Write Routines
434
+// Temperature Error Handlers
486 435
 //
487
-#if !HAS_HEATER_0
488
-  #error HEATER_0_PIN not defined for this board
489
-#endif
490
-#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
491
-#if EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
492
-  #if !HAS_HEATER_1
493
-    #error HEATER_1_PIN not defined for this board
494
-  #endif
495
-  #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
496
-  #if EXTRUDERS > 2
497
-    #if !HAS_HEATER_2
498
-      #error HEATER_2_PIN not defined for this board
499
-    #endif
500
-    #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
501
-    #if EXTRUDERS > 3
502
-      #if !HAS_HEATER_3
503
-        #error HEATER_3_PIN not defined for this board
504
-      #endif
505
-      #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v)
506
-    #endif
507
-  #endif
508
-#endif
509
-#ifdef HEATERS_PARALLEL
510
-  #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
511
-#else
512
-  #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
513
-#endif
514
-#if HAS_HEATER_BED
515
-  #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, v)
516
-#endif
517
-#if HAS_FAN
518
-  #define WRITE_FAN(v) WRITE(FAN_PIN, v)
519
-#endif
520
-
521 436
 inline void _temp_error(int e, const char *msg1, const char *msg2) {
522 437
   if (!IsStopped()) {
523 438
     SERIAL_ERROR_START;
@@ -661,12 +576,6 @@ void manage_heater() {
661 576
 
662 577
   updateTemperaturesFromRawValues();
663 578
 
664
-  #ifdef HEATER_0_USES_MAX6675
665
-    float ct = current_temperature[0];
666
-    if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
667
-    if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
668
-  #endif //HEATER_0_USES_MAX6675
669
-
670 579
   unsigned long ms = millis();
671 580
 
672 581
   // Loop through all extruders
@@ -1145,28 +1054,28 @@ void disable_heater() {
1145 1054
   for (int i=0; i<EXTRUDERS; i++) setTargetHotend(0, i);
1146 1055
   setTargetBed(0);
1147 1056
 
1057
+  #define DISABLE_HEATER(NR) { \
1058
+    target_temperature[NR] = 0; \
1059
+    soft_pwm[NR] = 0; \
1060
+    WRITE_HEATER_ ## NR (LOW); \
1061
+  }
1062
+
1148 1063
   #if HAS_TEMP_0
1149 1064
     target_temperature[0] = 0;
1150 1065
     soft_pwm[0] = 0;
1151
-    WRITE_HEATER_0P(LOW); // If HEATERS_PARALLEL should apply, change to WRITE_HEATER_0
1066
+    WRITE_HEATER_0P(LOW); // Should HEATERS_PARALLEL apply here? Then change to DISABLE_HEATER(0)
1152 1067
   #endif
1153 1068
 
1154 1069
   #if EXTRUDERS > 1 && HAS_TEMP_1
1155
-    target_temperature[1] = 0;
1156
-    soft_pwm[1] = 0;
1157
-    WRITE_HEATER_1(LOW);
1070
+    DISABLE_HEATER(1);
1158 1071
   #endif
1159 1072
 
1160 1073
   #if EXTRUDERS > 2 && HAS_TEMP_2
1161
-    target_temperature[2] = 0;
1162
-    soft_pwm[2] = 0;
1163
-    WRITE_HEATER_2(LOW);
1074
+    DISABLE_HEATER(2);
1164 1075
   #endif
1165 1076
 
1166 1077
   #if EXTRUDERS > 3 && HAS_TEMP_3
1167
-    target_temperature[3] = 0;
1168
-    soft_pwm[3] = 0;
1169
-    WRITE_HEATER_3(LOW);
1078
+    DISABLE_HEATER(3);
1170 1079
   #endif
1171 1080
 
1172 1081
   #if HAS_TEMP_BED
@@ -1257,9 +1166,15 @@ enum TempState {
1257 1166
 // Timer 0 is shared with millies
1258 1167
 //
1259 1168
 ISR(TIMER0_COMPB_vect) {
1169
+  #ifdef TEMP_SENSOR_1_AS_REDUNDANT
1170
+    #define TEMP_SENSOR_COUNT 2
1171
+  #else 
1172
+    #define TEMP_SENSOR_COUNT EXTRUDERS
1173
+  #endif
1174
+
1260 1175
   //these variables are only accesible from the ISR, but static, so they don't lose their value
1261 1176
   static unsigned char temp_count = 0;
1262
-  static unsigned long raw_temp_value[EXTRUDERS] = { 0 };
1177
+  static unsigned long raw_temp_value[TEMP_SENSOR_COUNT] = { 0 };
1263 1178
   static unsigned long raw_temp_bed_value = 0;
1264 1179
   static TempState temp_state = StartupDelay;
1265 1180
   static unsigned char pwm_count = BIT(SOFT_PWM_SCALE);
@@ -1475,6 +1390,7 @@ ISR(TIMER0_COMPB_vect) {
1475 1390
       #endif
1476 1391
       temp_state = PrepareTemp_BED;
1477 1392
       break;
1393
+
1478 1394
     case PrepareTemp_BED:
1479 1395
       #if HAS_TEMP_BED
1480 1396
         START_ADC(TEMP_BED_PIN);
@@ -1488,6 +1404,7 @@ ISR(TIMER0_COMPB_vect) {
1488 1404
       #endif
1489 1405
       temp_state = PrepareTemp_1;
1490 1406
       break;
1407
+
1491 1408
     case PrepareTemp_1:
1492 1409
       #if HAS_TEMP_1
1493 1410
         START_ADC(TEMP_1_PIN);
@@ -1501,6 +1418,7 @@ ISR(TIMER0_COMPB_vect) {
1501 1418
       #endif
1502 1419
       temp_state = PrepareTemp_2;
1503 1420
       break;
1421
+
1504 1422
     case PrepareTemp_2:
1505 1423
       #if HAS_TEMP_2
1506 1424
         START_ADC(TEMP_2_PIN);
@@ -1514,6 +1432,7 @@ ISR(TIMER0_COMPB_vect) {
1514 1432
       #endif
1515 1433
       temp_state = PrepareTemp_3;
1516 1434
       break;
1435
+
1517 1436
     case PrepareTemp_3:
1518 1437
       #if HAS_TEMP_3
1519 1438
         START_ADC(TEMP_3_PIN);
@@ -1527,6 +1446,7 @@ ISR(TIMER0_COMPB_vect) {
1527 1446
       #endif
1528 1447
       temp_state = Prepare_FILWIDTH;
1529 1448
       break;
1449
+
1530 1450
     case Prepare_FILWIDTH:
1531 1451
       #if HAS_FILAMENT_SENSOR
1532 1452
         START_ADC(FILWIDTH_PIN);
@@ -1545,6 +1465,7 @@ ISR(TIMER0_COMPB_vect) {
1545 1465
       temp_state = PrepareTemp_0;
1546 1466
       temp_count++;
1547 1467
       break;
1468
+
1548 1469
     case StartupDelay:
1549 1470
       temp_state = PrepareTemp_0;
1550 1471
       break;
@@ -1554,7 +1475,7 @@ ISR(TIMER0_COMPB_vect) {
1554 1475
     //   SERIAL_ERRORLNPGM("Temp measurement error!");
1555 1476
     //   break;
1556 1477
   } // switch(temp_state)
1557
-    
1478
+
1558 1479
   if (temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256)  = 164ms.
1559 1480
     if (!temp_meas_ready) { //Only update the raw values if they have been read. Else we could be updating them during reading.
1560 1481
       #ifndef HEATER_0_USES_MAX6675
@@ -1579,52 +1500,53 @@ ISR(TIMER0_COMPB_vect) {
1579 1500
     #if HAS_FILAMENT_SENSOR
1580 1501
       current_raw_filwidth = raw_filwidth_value >> 10;  // Divide to get to 0-16384 range since we used 1/128 IIR filter approach
1581 1502
     #endif
1582
-    
1503
+
1583 1504
     temp_meas_ready = true;
1584 1505
     temp_count = 0;
1585
-    for (int i = 0; i < EXTRUDERS; i++) raw_temp_value[i] = 0;
1506
+    for (int i = 0; i < TEMP_SENSOR_COUNT; i++) raw_temp_value[i] = 0;
1586 1507
     raw_temp_bed_value = 0;
1587 1508
 
1588
-    #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP
1589
-      #define GE0 <=
1590
-      #define LE0 >=
1509
+    #ifdef HEATER_0_USES_MAX6675
1510
+      float ct = current_temperature[0];
1511
+      if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
1512
+      if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
1591 1513
     #else
1592
-      #define GE0 >=
1593
-      #define LE0 <=
1514
+      #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP
1515
+        #define GE0 <=
1516
+      #else
1517
+        #define GE0 >=
1518
+      #endif
1519
+      if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0);
1520
+      if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0);
1594 1521
     #endif
1595
-    if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0);
1596
-    if (current_temperature_raw[0] LE0 minttemp_raw[0]) min_temp_error(0);
1597 1522
 
1598 1523
     #if EXTRUDERS > 1
1599 1524
       #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP
1600 1525
         #define GE1 <=
1601
-        #define LE1 >=
1602 1526
       #else
1603 1527
         #define GE1 >=
1604
-        #define LE1 <=
1605 1528
       #endif
1606 1529
       if (current_temperature_raw[1] GE1 maxttemp_raw[1]) max_temp_error(1);
1607
-      if (current_temperature_raw[1] LE1 minttemp_raw[1]) min_temp_error(1);
1530
+      if (minttemp_raw[1] GE0 current_temperature_raw[1]) min_temp_error(1);
1531
+
1608 1532
       #if EXTRUDERS > 2
1609 1533
         #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP
1610 1534
           #define GE2 <=
1611
-          #define LE2 >=
1612 1535
         #else
1613 1536
           #define GE2 >=
1614
-          #define LE2 <=
1615 1537
         #endif
1616 1538
         if (current_temperature_raw[2] GE2 maxttemp_raw[2]) max_temp_error(2);
1617
-        if (current_temperature_raw[2] LE2 minttemp_raw[2]) min_temp_error(2);
1539
+        if (minttemp_raw[2] GE0 current_temperature_raw[2]) min_temp_error(2);
1540
+
1618 1541
         #if EXTRUDERS > 3
1619 1542
           #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP
1620 1543
             #define GE3 <=
1621
-            #define LE3 >=
1622 1544
           #else
1623 1545
             #define GE3 >=
1624
-            #define LE3 <=
1625 1546
           #endif
1626 1547
           if (current_temperature_raw[3] GE3 maxttemp_raw[3]) max_temp_error(3);
1627
-          if (current_temperature_raw[3] LE3 minttemp_raw[3]) min_temp_error(3);
1548
+          if (minttemp_raw[3] GE0 current_temperature_raw[3]) min_temp_error(3);
1549
+
1628 1550
         #endif // EXTRUDERS > 3
1629 1551
       #endif // EXTRUDERS > 2
1630 1552
     #endif // EXTRUDERS > 1
@@ -1632,10 +1554,8 @@ ISR(TIMER0_COMPB_vect) {
1632 1554
     #if defined(BED_MAXTEMP) && (TEMP_SENSOR_BED != 0)
1633 1555
       #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP
1634 1556
         #define GEBED <=
1635
-        #define LEBED >=
1636 1557
       #else
1637 1558
         #define GEBED >=
1638
-        #define LEBED <=
1639 1559
       #endif
1640 1560
       if (current_temperature_bed_raw GEBED bed_maxttemp_raw) {
1641 1561
         target_temperature_bed = 0;

+ 3
- 8
Marlin/ultralcd.cpp View File

@@ -1,4 +1,3 @@
1
-#include "temperature.h"
2 1
 #include "ultralcd.h"
3 2
 #ifdef ULTRA_LCD
4 3
 #include "Marlin.h"
@@ -912,9 +911,9 @@ static void lcd_control_motion_menu() {
912 911
   START_MENU();
913 912
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
914 913
   #ifdef ENABLE_AUTO_BED_LEVELING
915
-    MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50);
914
+    MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.0, 50);
916 915
   #endif
917
-  MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 500, 99000);
916
+  MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 10, 99000);
918 917
   MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &max_xy_jerk, 1, 990);
919 918
   MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &max_z_jerk, 0.1, 990);
920 919
   MENU_ITEM_EDIT(float3, MSG_VE_JERK, &max_e_jerk, 1, 990);
@@ -926,7 +925,7 @@ static void lcd_control_motion_menu() {
926 925
   MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &mintravelfeedrate, 0, 999);
927 926
   MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &max_acceleration_units_per_sq_second[X_AXIS], 100, 99000, reset_acceleration_rates);
928 927
   MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &max_acceleration_units_per_sq_second[Y_AXIS], 100, 99000, reset_acceleration_rates);
929
-  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 100, 99000, reset_acceleration_rates);
928
+  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 10, 99000, reset_acceleration_rates);
930 929
   MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, reset_acceleration_rates);
931 930
   MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &retract_acceleration, 100, 99000);
932 931
   MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &travel_acceleration, 100, 99000);
@@ -1200,10 +1199,6 @@ void lcd_init() {
1200 1199
      WRITE(SHIFT_OUT,HIGH);
1201 1200
      WRITE(SHIFT_LD,HIGH);
1202 1201
      WRITE(SHIFT_EN,LOW);
1203
-  #else
1204
-     #ifdef ULTIPANEL
1205
-     #error ULTIPANEL requires an encoder
1206
-     #endif
1207 1202
   #endif // SR_LCD_2W_NL
1208 1203
 #endif//!NEWPANEL
1209 1204
 

+ 12
- 13
Marlin/ultralcd.h View File

@@ -14,10 +14,10 @@
14 14
   void lcd_reset_alert_level();
15 15
   bool lcd_detected(void);
16 16
 
17
-#ifdef DOGLCD
18
-  extern int lcd_contrast;
19
-  void lcd_setcontrast(uint8_t value);
20
-#endif
17
+  #ifdef DOGLCD
18
+    extern int lcd_contrast;
19
+    void lcd_setcontrast(uint8_t value);
20
+  #endif
21 21
 
22 22
   static unsigned char blink = 0;	// Variable for visualization of fan rotation in GLCD
23 23
 
@@ -28,27 +28,26 @@
28 28
   #define LCD_TIMEOUT_TO_STATUS 15000
29 29
 
30 30
   #ifdef ULTIPANEL
31
-  void lcd_buttons_update();
32
-  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
33
-  #ifdef REPRAPWORLD_KEYPAD
34
-    extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
35
-  #endif
31
+    void lcd_buttons_update();
32
+    extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
33
+    #ifdef REPRAPWORLD_KEYPAD
34
+      extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
35
+    #endif
36 36
   #else
37
-  FORCE_INLINE void lcd_buttons_update() {}
37
+    FORCE_INLINE void lcd_buttons_update() {}
38 38
   #endif
39 39
 
40 40
   extern int plaPreheatHotendTemp;
41 41
   extern int plaPreheatHPBTemp;
42 42
   extern int plaPreheatFanSpeed;
43
-
44 43
   extern int absPreheatHotendTemp;
45 44
   extern int absPreheatHPBTemp;
46 45
   extern int absPreheatFanSpeed;
47
-  
46
+
48 47
   extern bool cancel_heatup;
49 48
   
50 49
   #ifdef FILAMENT_LCD_DISPLAY
51
-        extern unsigned long message_millis;
50
+    extern unsigned long message_millis;
52 51
   #endif
53 52
 
54 53
   void lcd_buzz(long duration,uint16_t freq);

Loading…
Cancel
Save