diff --git a/.gitignore b/.gitignore
index aa1d42424..1e8701253 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,20 +1,116 @@
-// Our automatic versioning scheme generates the following file
-// NEVER put it in the repository
-_Version.h
+#
+# Marlin 3D Printer Firmware
+# Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+#
+# Based on Sprinter and grbl.
+# Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
-// All of the following OS, IDE and compiler generated file
-// references should be moved from this file
-// They are needed, but they belong in your global .gitignore
-// rather than in a per-project file such as this
+# Our automatic versioning scheme generates the following file
+# NEVER put it in the repository
+_Version.h
-*.o
+#
+# OS
+#
applet/
+*.DS_Store
+
+
+#
+# Misc
+#
*~
*.orig
*.rej
*.bak
-*.DS_Store
*.idea
*.s
*.i
*.ii
+*.swp
+
+
+#
+# C++
+#
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+
+#
+# C
+#
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+*.su
diff --git a/.travis.yml b/.travis.yml
index c11220292..23d673f4b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,9 @@
---
language: c
#
+notifications:
+ email: false
+ #
before_install:
#
# Fetch the tag information for the current branch
@@ -17,10 +20,10 @@ before_install:
#
install:
#
- # Install arduino 1.6.8
- - wget http://downloads-02.arduino.cc/arduino-1.6.8-linux64.tar.xz
- - tar xf arduino-1.6.8-linux64.tar.xz
- - sudo mv arduino-1.6.8 /usr/local/share/arduino
+ # Install arduino 1.6.9
+ - wget http://downloads-02.arduino.cc/arduino-1.6.9-linux64.tar.xz
+ - tar xf arduino-1.6.9-linux64.tar.xz
+ - sudo mv arduino-1.6.9 /usr/local/share/arduino
- ln -s /usr/local/share/arduino/arduino ${TRAVIS_BUILD_DIR}/buildroot/bin/arduino
#
# Install: LiquidCrystal_I2C library
@@ -53,11 +56,11 @@ before_script:
#
script:
#
- # Backup Configuration.h, Configuration_adv.h, and pins_RAMPS_14.h
+ # Backup Configuration.h, Configuration_adv.h, and pins_RAMPS.h
#
- cp Marlin/Configuration.h Marlin/Configuration.h.backup
- cp Marlin/Configuration_adv.h Marlin/Configuration_adv.h.backup
- - cp Marlin/pins_RAMPS_14.h Marlin/pins_RAMPS_14.h.backup
+ - cp Marlin/pins_RAMPS.h Marlin/pins_RAMPS.h.backup
#
# Build with the default configurations
#
@@ -76,10 +79,12 @@ script:
- build_marlin
#
# Test 3 extruders on RUMBA (can use any board with >=3 extruders defined)
+ # Include a test for LIN_ADVANCE here also
#
- opt_set MOTHERBOARD BOARD_RUMBA
- opt_set EXTRUDERS 3
- opt_set TEMP_SENSOR_2 1
+ - opt_enable_adv LIN_ADVANCE
- build_marlin
#
# Test PIDTEMPBED
@@ -88,10 +93,37 @@ script:
- opt_enable PIDTEMPBED
- build_marlin
#
- # Test AUTO_BED_LEVELING & DEBUG_LEVELING_FEATURE
+ # Test a "Fix Mounted" Probe along with Safe Homing
+ #
+ - restore_configs
+ - opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING
+ - build_marlin
+ #
+ # ...with AUTO_BED_LEVELING_FEATURE, Z_MIN_PROBE_REPEATABILITY_TEST, & DEBUG_LEVELING_FEATURE
+ #
+ - opt_enable AUTO_BED_LEVELING_FEATURE Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
+ - build_marlin
+ #
+ # Test a Sled Z Probe
+ #
+ - restore_configs
+ - opt_enable Z_PROBE_SLED
+ - build_marlin
+ #
+ # ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE
+ #
+ - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE
+ - build_marlin
+ #
+ # Test a Servo Probe
#
- restore_configs
- - opt_enable ENABLE_AUTO_BED_LEVELING DEBUG_LEVELING_FEATURE
+ - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
+ - build_marlin
+ #
+ # ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE
+ #
+ - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE
- build_marlin
#
# Test MESH_BED_LEVELING feature, with LCD
@@ -100,15 +132,18 @@ script:
- opt_enable MESH_BED_LEVELING MESH_G28_REST_ORIGIN MANUAL_BED_LEVELING ULTIMAKERCONTROLLER
- build_marlin
#
- # Test AUTO_BED_LEVELING & DEBUG_LEVELING_FEATURE with Servos
+ # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER,
+ # INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT
#
- - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR SERVO_ENDSTOP_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
+ - restore_configs
+ - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT
- build_marlin
#
- # Test EEPROM_SETTINGS & EEPROM_CHITCHAT
+ # Mixing Extruder
#
- restore_configs
- - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT
+ - opt_enable MIXING_EXTRUDER
+ - opt_set MIXING_STEPPERS 2
- build_marlin
#
# Test DUAL_X_CARRIAGE
@@ -121,126 +156,180 @@ script:
- opt_enable_adv DUAL_X_CARRIAGE
- build_marlin
#
- ### LCDS ###
+ # Test SPEAKER with BOARD_BQ_ZUM_MEGA_3D and BQ_LCD_SMART_CONTROLLER
#
+ - restore_configs
+ - opt_set MOTHERBOARD BOARD_BQ_ZUM_MEGA_3D
+ - opt_set LCD_FEEDBACK_FREQUENCY_DURATION_MS 10
+ - opt_set LCD_FEEDBACK_FREQUENCY_HZ 100
+ - opt_enable BQ_LCD_SMART_CONTROLLER SPEAKER
#
- # ULTIMAKERCONTROLLER
+ # Test SWITCHING_EXTRUDER
#
- restore_configs
- - opt_enable ULTIMAKERCONTROLLER
+ - opt_set MOTHERBOARD BOARD_RUMBA
+ - opt_set EXTRUDERS 2
+ - opt_enable NUM_SERVOS
+ - opt_set NUM_SERVOS 1
+ - opt_set TEMP_SENSOR_1 1
+ - opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER
- build_marlin
#
- # MAKRPANEL
- # Needs to use Melzi and Sanguino hardware
+ # Test MINIRAMBO for PWM_MOTOR_CURRENT
#
- #- restore_configs
- #- opt_enable MAKRPANEL
- #- build_marlin
+ - restore_configs
+ - opt_set MOTHERBOARD BOARD_MINIRAMBO
+ - build_marlin
#
- # REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, and BABYSTEPPING
+ # Test FILAMENT_CHANGE_FEATURE and LCD_INFO_MENU
#
- restore_configs
- - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING
+ - opt_enable ULTIMAKERCONTROLLER
+ - opt_enable_adv FILAMENT_CHANGE_FEATURE LCD_INFO_MENU
- build_marlin
#
- # G3D_PANEL
+ # Enable filament sensor
#
- restore_configs
- - opt_enable G3D_PANEL SDSUPPORT
+ - opt_enable FILAMENT_WIDTH_SENSOR
- build_marlin
#
- # REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+ # Enable filament sensor with LCD display
+ #
+ - opt_enable ULTIMAKERCONTROLLER FILAMENT_LCD_DISPLAY
+ - build_marlin
+ #
+ # Enable BEZIER_CURVE_SUPPORT
#
- restore_configs
- - opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT
+ - opt_enable_adv BEZIER_CURVE_SUPPORT
- build_marlin
#
- # REPRAPWORLD_KEYPAD
+ # Enable COREXY
#
- # Cant find configuration details to get it to compile
- #- restore_configs
- #- opt_enable ULTRA_LCD REPRAPWORLD_KEYPAD REPRAPWORLD_KEYPAD_MOVE_STEP
- #- build_marlin
+ - restore_configs
+ - opt_enable COREXY
+ - build_marlin
#
- # RA_CONTROL_PANEL
+ # Enable COREXZ
#
- restore_configs
- - opt_enable RA_CONTROL_PANEL
+ - opt_enable COREXZ
- build_marlin
#
- ### I2C PANELS ###
+ # Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS
#
- # LCD_I2C_SAINSMART_YWROBOT
- # Failing at the moment needs different library
- #- restore_configs
- #- opt_enable LCD_I2C_SAINSMART_YWROBOT
- #- build_marlin
+ - restore_configs
+ - opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS
+ - pins_set RAMPS X_MAX_PIN -1
+ - opt_set_adv Z2_MAX_PIN 2
+ - build_marlin
#
- # LCD_I2C_PANELOLU2
+ # Test PRINTCOUNTER
#
- restore_configs
- - opt_enable LCD_I2C_PANELOLU2
+ - opt_enable PRINTCOUNTER
- build_marlin
#
- # LCD_I2C_VIKI
+ # Test NOZZLE_PARK_FEATURE
#
- restore_configs
- - opt_enable LCD_I2C_VIKI
+ - opt_enable NOZZLE_PARK_FEATURE
- build_marlin
#
- # LCM1602
+ # Test NOZZLE_CLEAN_FEATURE
#
- restore_configs
- - opt_enable LCM1602
+ - opt_enable NOZZLE_CLEAN_FEATURE
- build_marlin
#
- # Enable FILAMENTCHANGEENABLE
+ #
+ ######## STANDARD LCD/PANELS ##############
+ #
+ # ULTRA_LCD
#
- restore_configs
- - opt_enable FILAMENTCHANGEENABLE ULTIMAKERCONTROLLER
+ - opt_enable ULTRA_LCD
- build_marlin
#
- # Enable filament sensor
+ # DOGLCD
#
- restore_configs
- - opt_enable FILAMENT_WIDTH_SENSOR
+ - opt_enable DOGLCD
- build_marlin
#
- # Enable filament sensor with LCD display
+ # ULTIMAKERCONTROLLER
#
- - opt_enable ULTIMAKERCONTROLLER FILAMENT_LCD_DISPLAY
+ - restore_configs
+ - opt_enable ULTIMAKERCONTROLLER
- build_marlin
#
- # Enable BEZIER_CURVE_SUPPORT
+ # MAKRPANEL
+ # Needs to use Melzi and Sanguino hardware
+ #
+ #- restore_configs
+ #- opt_enable MAKRPANEL
+ #- build_marlin
+ #
+ # REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, and BABYSTEPPING
#
- restore_configs
- - opt_enable_adv BEZIER_CURVE_SUPPORT
+ - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING
- build_marlin
#
- # Enable COREXY
+ # G3D_PANEL
#
- restore_configs
- - opt_enable COREXY
+ - opt_enable G3D_PANEL SDSUPPORT
- build_marlin
#
- # Enable COREXZ
+ # REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
#
- restore_configs
- - opt_enable COREXZ
+ - opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT
- build_marlin
#
- # Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS
+ # REPRAPWORLD_KEYPAD
+ #
+ # Cant find configuration details to get it to compile
+ #- restore_configs
+ #- opt_enable ULTRA_LCD REPRAPWORLD_KEYPAD REPRAPWORLD_KEYPAD_MOVE_STEP
+ #- build_marlin
+ #
+ # RA_CONTROL_PANEL
#
- restore_configs
- - opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS
- - pins_set RAMPS_14 X_MAX_PIN -1
- - opt_set_adv Z2_MAX_PIN 2
+ - opt_enable RA_CONTROL_PANEL
- build_marlin
#
- # Test PRINTCOUNTER
+ ######## I2C LCD/PANELS ##############
+ #
+ # !!!ATTENTION!!!
+ # Most I2C configurations are failing at the moment because they require
+ # a different Liquid Crystal library "LiquidTWI2".
+ #
+ # LCD_I2C_SAINSMART_YWROBOT
+ #
+ #- restore_configs
+ #- opt_enable LCD_I2C_SAINSMART_YWROBOT
+ #- build_marlin
+ #
+ # LCD_I2C_PANELOLU2
+ #
+ #- restore_configs
+ #- opt_enable LCD_I2C_PANELOLU2
+ #- build_marlin
+ #
+ # LCD_I2C_VIKI
+ #
+ #- restore_configs
+ #- opt_enable LCD_I2C_VIKI
+ #- build_marlin
+ #
+ # LCM1602
#
- restore_configs
- - opt_enable PRINTCOUNTER
+ - opt_enable LCM1602
- build_marlin
#
#
@@ -276,6 +365,7 @@ script:
# SCARA Config
#
- use_example_configs SCARA
+ - opt_enable AUTO_BED_LEVELING_FEATURE FIX_MOUNTED_PROBE USE_ZMIN_PLUG
- build_marlin
#
# tvrrug Config need to check board type for sanguino atmega644p
diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h
index 599a1bf24..ff6c6b187 100644
--- a/Marlin/Conditionals.h
+++ b/Marlin/Conditionals.h
@@ -22,750 +22,6 @@
/**
* Conditionals.h
- * Defines that depend on configuration but are not editable.
+ * OBSOLETE: Replaced by Conditionals_LCD.h and Conditionals_post.h
*/
-
-#ifndef CONDITIONALS_H
-
-/**
-* Miscellaneous
-*/
-#ifndef M_PI
- #define M_PI 3.1415926536
-#endif
-
-/**
- * This value is used by M109 when tying to calculate a ballpark safe margin
- * to prevent wait-forever situation.
- */
-#ifndef EXTRUDE_MINTEMP
- #define EXTRUDE_MINTEMP 170
-#endif
-
-#ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first
-
- #define CONFIGURATION_LCD
-
- #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
-
- #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
- #define DOGLCD
- #define ULTIPANEL
- #define NEWPANEL
- #define DEFAULT_LCD_CONTRAST 17
- #endif
-
- #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
- #define ULTRA_LCD //general LCD support, also 16x2
- #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
- #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
-
- #if ENABLED(miniVIKI)
- #define DEFAULT_LCD_CONTRAST 95
- #elif ENABLED(VIKI2)
- #define DEFAULT_LCD_CONTRAST 40
- #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
- #define DEFAULT_LCD_CONTRAST 110
- #define U8GLIB_LM6059_AF
- #define SD_DETECT_INVERTED
- #endif
-
- #define ENCODER_PULSES_PER_STEP 4
- #define ENCODER_STEPS_PER_MENU_ITEM 1
- #endif
-
- // Generic support for SSD1306 / SH1106 OLED based LCDs.
- #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
- #define ULTRA_LCD //general LCD support, also 16x2
- #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
- #endif
-
- #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
- #define ULTIMAKERCONTROLLER
- #endif
-
- #if ENABLED(BQ_LCD_SMART_CONTROLLER)
- #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
-
- #ifndef ENCODER_PULSES_PER_STEP
- #define ENCODER_PULSES_PER_STEP 4
- #endif
-
- #ifndef ENCODER_STEPS_PER_MENU_ITEM
- #define ENCODER_STEPS_PER_MENU_ITEM 1
- #endif
-
- #ifndef LONG_FILENAME_HOST_SUPPORT
- #define LONG_FILENAME_HOST_SUPPORT
- #endif
- #endif
-
- #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
- #define DOGLCD
- #define U8GLIB_ST7920
- #define REPRAP_DISCOUNT_SMART_CONTROLLER
- #endif
-
- #if ENABLED(ULTIMAKERCONTROLLER) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL) || ENABLED(RIGIDBOT_PANEL)
- #define ULTIPANEL
- #define NEWPANEL
- #endif
-
- #if ENABLED(REPRAPWORLD_KEYPAD)
- #define ULTIPANEL
- #define NEWPANEL
- #endif
-
- #if ENABLED(RA_CONTROL_PANEL)
- #define LCD_I2C_TYPE_PCA8574
- #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
- #define ULTIPANEL
- #define NEWPANEL
- #endif
-
- /**
- * I2C PANELS
- */
-
- #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
- // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
- // Make sure it is placed in the Arduino libraries directory.
- #define LCD_I2C_TYPE_PCF8575
- #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
- #define ULTIPANEL
- #define NEWPANEL
- #endif
-
- // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
- #if ENABLED(LCD_I2C_PANELOLU2)
- #define LCD_I2C_TYPE_MCP23017
- #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
- #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
-
- #ifndef ENCODER_PULSES_PER_STEP
- #define ENCODER_PULSES_PER_STEP 4
- #endif
-
- #ifndef ENCODER_STEPS_PER_MENU_ITEM
- #define ENCODER_STEPS_PER_MENU_ITEM 1
- #endif
-
- #if ENABLED(LCD_USE_I2C_BUZZER)
- #define LCD_FEEDBACK_FREQUENCY_HZ 1000
- #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
- #endif
-
- #define ULTIPANEL
- #define NEWPANEL
- #endif
-
- // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
- #if ENABLED(LCD_I2C_VIKI)
- // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
- // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
- // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
- // BTN_ENC pin (or set BTN_ENC to -1 if not used)
- #define LCD_I2C_TYPE_MCP23017
- #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
- #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
- #define ULTIPANEL
- #define NEWPANEL
- #endif
-
- // Shift register panels
- // ---------------------
- // 2 wire Non-latching LCD SR from:
- // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
-
- #if ENABLED(SAV_3DLCD)
- #define SR_LCD_2W_NL // Non latching 2 wire shift register
- #define ULTIPANEL
- #define NEWPANEL
- #endif
-
- #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
- #ifndef LCD_WIDTH
- #define LCD_WIDTH 22
- #endif
- #ifndef LCD_HEIGHT
- #define LCD_HEIGHT 5
- #endif
- #endif
-
- #if ENABLED(ULTIPANEL)
- #define NEWPANEL //enable this if you have a click-encoder panel
- #define ULTRA_LCD
- #ifndef LCD_WIDTH
- #define LCD_WIDTH 20
- #endif
- #ifndef LCD_HEIGHT
- #define LCD_HEIGHT 4
- #endif
- #else //no panel but just LCD
- #if ENABLED(ULTRA_LCD)
- #ifndef LCD_WIDTH
- #define LCD_WIDTH 16
- #endif
- #ifndef LCD_HEIGHT
- #define LCD_HEIGHT 2
- #endif
- #endif
- #endif
-
- #if ENABLED(DOGLCD)
- /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
- // \x00 intentionally skipped to avoid problems in strings
- #define LCD_STR_REFRESH "\x01"
- #define LCD_STR_FOLDER "\x02"
- #define LCD_STR_ARROW_RIGHT "\x03"
- #define LCD_STR_UPLEVEL "\x04"
- #define LCD_STR_CLOCK "\x05"
- #define LCD_STR_FEEDRATE "\x06"
- #define LCD_STR_BEDTEMP "\x07"
- #define LCD_STR_THERMOMETER "\x08"
- #define LCD_STR_DEGREE "\x09"
-
- #define LCD_STR_SPECIAL_MAX '\x09'
- // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
- // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
- #else
- /* Custom characters defined in the first 8 characters of the LCD */
- #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
- #define LCD_STR_DEGREE "\x01"
- #define LCD_STR_THERMOMETER "\x02"
- #define LCD_STR_UPLEVEL "\x03"
- #define LCD_STR_REFRESH "\x04"
- #define LCD_STR_FOLDER "\x05"
- #define LCD_STR_FEEDRATE "\x06"
- #define LCD_STR_CLOCK "\x07"
- #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
- #endif
-
- /**
- * Default LCD contrast for dogm-like LCD displays
- */
- #if ENABLED(DOGLCD)
- #define HAS_LCD_CONTRAST (DISABLED(U8GLIB_ST7920) && DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106))
- #if HAS_LCD_CONTRAST && !defined(DEFAULT_LCD_CONTRAST)
- #define DEFAULT_LCD_CONTRAST 32
- #endif
- #endif
-
-#else // CONFIGURATION_LCD
-
- #define CONDITIONALS_H
-
- #include "pins.h"
-
- #ifndef USBCON
- #define HardwareSerial_h // trick to disable the standard HWserial
- #endif
-
- #include "Arduino.h"
-
- /**
- * Set ENDSTOPPULLUPS for unused endstop switches
- */
- #if ENABLED(ENDSTOPPULLUPS)
- #if ENABLED(USE_XMAX_PLUG)
- #define ENDSTOPPULLUP_XMAX
- #endif
- #if ENABLED(USE_YMAX_PLUG)
- #define ENDSTOPPULLUP_YMAX
- #endif
- #if ENABLED(USE_ZMAX_PLUG)
- #define ENDSTOPPULLUP_ZMAX
- #endif
- #if ENABLED(USE_XMIN_PLUG)
- #define ENDSTOPPULLUP_XMIN
- #endif
- #if ENABLED(USE_YMIN_PLUG)
- #define ENDSTOPPULLUP_YMIN
- #endif
- #if ENABLED(USE_ZMIN_PLUG)
- #define ENDSTOPPULLUP_ZMIN
- #endif
- #if DISABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)
- #define ENDSTOPPULLUP_ZMIN_PROBE
- #endif
- #endif
-
- /**
- * Axis lengths
- */
- #define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS))
- #define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
- #define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
-
- /**
- * CoreXY and CoreXZ
- */
- #if ENABLED(COREXY)
- #define CORE_AXIS_1 A_AXIS // XY from A + B
- #define CORE_AXIS_2 B_AXIS
- #define NORMAL_AXIS Z_AXIS
- #elif ENABLED(COREXZ)
- #define CORE_AXIS_1 A_AXIS // XZ from A + C
- #define CORE_AXIS_2 C_AXIS
- #define NORMAL_AXIS Y_AXIS
- #elif ENABLED(COREYZ)
- #define CORE_AXIS_1 B_AXIS // YZ from B + C
- #define CORE_AXIS_2 C_AXIS
- #define NORMAL_AXIS X_AXIS
- #endif
-
- /**
- * SCARA
- */
- #if ENABLED(SCARA)
- #undef SLOWDOWN
- #define QUICK_HOME //SCARA needs Quickhome
- #endif
-
- /**
- * AUTOSET LOCATIONS OF LIMIT SWITCHES
- */
- #if ENABLED(MANUAL_HOME_POSITIONS) // Use manual limit switch locations
- #define X_HOME_POS MANUAL_X_HOME_POS
- #define Y_HOME_POS MANUAL_Y_HOME_POS
- #define Z_HOME_POS MANUAL_Z_HOME_POS
- #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits
- #if ENABLED(BED_CENTER_AT_0_0)
- #define X_HOME_POS (X_MAX_LENGTH) * (X_HOME_DIR) * 0.5
- #define Y_HOME_POS (Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5
- #else
- #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
- #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
- #endif
- #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS)
- #endif //!MANUAL_HOME_POSITIONS
-
- /**
- * Auto Bed Leveling
- */
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- // Boundaries for probing based on set limits
- #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
- #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
- #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
- #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
- #endif
-
- #define HAS_Z_ENDSTOP_SERVO (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
- #define SERVO_LEVELING (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_ENDSTOP_SERVO)
-
- /**
- * Sled Options
- */
- #if ENABLED(Z_PROBE_SLED)
- #define Z_SAFE_HOMING
- #endif
-
- /**
- * Z Safe Homing dependencies
- */
- #if ENABLED(Z_SAFE_HOMING)
- #ifndef X_PROBE_OFFSET_FROM_EXTRUDER
- #define X_PROBE_OFFSET_FROM_EXTRUDER 0
- #endif
- #ifndef Y_PROBE_OFFSET_FROM_EXTRUDER
- #define Y_PROBE_OFFSET_FROM_EXTRUDER 0
- #endif
- #ifndef Z_PROBE_OFFSET_FROM_EXTRUDER
- #define Z_PROBE_OFFSET_FROM_EXTRUDER 0
- #endif
- #ifndef XY_TRAVEL_SPEED
- #define XY_TRAVEL_SPEED 4000
- #endif
- #endif
-
- /**
- * Host keep alive
- */
- #ifndef DEFAULT_KEEPALIVE_INTERVAL
- #define DEFAULT_KEEPALIVE_INTERVAL 2
- #endif
-
- /**
- * MAX_STEP_FREQUENCY differs for TOSHIBA
- */
- #if ENABLED(CONFIG_STEPPERS_TOSHIBA)
- #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
- #else
- #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
- #endif
-
- // MS1 MS2 Stepper Driver Microstepping mode table
- #define MICROSTEP1 LOW,LOW
- #define MICROSTEP2 HIGH,LOW
- #define MICROSTEP4 LOW,HIGH
- #define MICROSTEP8 HIGH,HIGH
- #define MICROSTEP16 HIGH,HIGH
-
- /**
- * Advance calculated values
- */
- #if ENABLED(ADVANCE)
- #define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI)
- #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / (EXTRUSION_AREA))
- #endif
-
- #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
- #undef SD_DETECT_INVERTED
- #endif
-
- /**
- * Set defaults for missing (newer) options
- */
- #ifndef DISABLE_INACTIVE_X
- #define DISABLE_INACTIVE_X DISABLE_X
- #endif
- #ifndef DISABLE_INACTIVE_Y
- #define DISABLE_INACTIVE_Y DISABLE_Y
- #endif
- #ifndef DISABLE_INACTIVE_Z
- #define DISABLE_INACTIVE_Z DISABLE_Z
- #endif
- #ifndef DISABLE_INACTIVE_E
- #define DISABLE_INACTIVE_E DISABLE_E
- #endif
-
- // Power Signal Control Definitions
- // By default use ATX definition
- #ifndef POWER_SUPPLY
- #define POWER_SUPPLY 1
- #endif
- #if (POWER_SUPPLY == 1) // 1 = ATX
- #define PS_ON_AWAKE LOW
- #define PS_ON_ASLEEP HIGH
- #elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W
- #define PS_ON_AWAKE HIGH
- #define PS_ON_ASLEEP LOW
- #endif
- #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
-
- /**
- * Temp Sensor defines
- */
- #if TEMP_SENSOR_0 == -3
- #define HEATER_0_USES_MAX6675
- #define MAX6675_IS_MAX31855
- #elif TEMP_SENSOR_0 == -2
- #define HEATER_0_USES_MAX6675
- #elif TEMP_SENSOR_0 == -1
- #define HEATER_0_USES_AD595
- #elif TEMP_SENSOR_0 == 0
- #undef HEATER_0_MINTEMP
- #undef HEATER_0_MAXTEMP
- #elif TEMP_SENSOR_0 > 0
- #define THERMISTORHEATER_0 TEMP_SENSOR_0
- #define HEATER_0_USES_THERMISTOR
- #endif
-
- #if TEMP_SENSOR_1 <= -2
- #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_1"
- #elif TEMP_SENSOR_1 == -1
- #define HEATER_1_USES_AD595
- #elif TEMP_SENSOR_1 == 0
- #undef HEATER_1_MINTEMP
- #undef HEATER_1_MAXTEMP
- #elif TEMP_SENSOR_1 > 0
- #define THERMISTORHEATER_1 TEMP_SENSOR_1
- #define HEATER_1_USES_THERMISTOR
- #endif
-
- #if TEMP_SENSOR_2 <= -2
- #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_2"
- #elif TEMP_SENSOR_2 == -1
- #define HEATER_2_USES_AD595
- #elif TEMP_SENSOR_2 == 0
- #undef HEATER_2_MINTEMP
- #undef HEATER_2_MAXTEMP
- #elif TEMP_SENSOR_2 > 0
- #define THERMISTORHEATER_2 TEMP_SENSOR_2
- #define HEATER_2_USES_THERMISTOR
- #endif
-
- #if TEMP_SENSOR_3 <= -2
- #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_3"
- #elif TEMP_SENSOR_3 == -1
- #define HEATER_3_USES_AD595
- #elif TEMP_SENSOR_3 == 0
- #undef HEATER_3_MINTEMP
- #undef HEATER_3_MAXTEMP
- #elif TEMP_SENSOR_3 > 0
- #define THERMISTORHEATER_3 TEMP_SENSOR_3
- #define HEATER_3_USES_THERMISTOR
- #endif
-
- #if TEMP_SENSOR_BED <= -2
- #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_BED"
- #elif TEMP_SENSOR_BED == -1
- #define BED_USES_AD595
- #elif TEMP_SENSOR_BED == 0
- #undef BED_MINTEMP
- #undef BED_MAXTEMP
- #elif TEMP_SENSOR_BED > 0
- #define THERMISTORBED TEMP_SENSOR_BED
- #define BED_USES_THERMISTOR
- #endif
-
- /**
- * Flags for PID handling
- */
- #define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED))
- #define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED))
-
- /**
- * ARRAY_BY_EXTRUDERS based on EXTRUDERS
- */
- #if EXTRUDERS > 3
- #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3, v4 }
- #elif EXTRUDERS > 2
- #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3 }
- #elif EXTRUDERS > 1
- #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2 }
- #else
- #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1 }
- #endif
-
- #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1)
-
- /**
- * With SINGLENOZZLE all "extruders" are in the same place
- */
- #if ENABLED(SINGLENOZZLE)
- #undef EXTRUDER_OFFSET_X
- #undef EXTRUDER_OFFSET_Y
- #define EXTRUDER_OFFSET_X { 0 }
- #define EXTRUDER_OFFSET_Y { 0 }
- #endif
-
- /**
- * Z_DUAL_ENDSTOPS endstop reassignment
- */
- #if ENABLED(Z_DUAL_ENDSTOPS)
- #define _XMIN_ 100
- #define _YMIN_ 200
- #define _ZMIN_ 300
- #define _XMAX_ 101
- #define _YMAX_ 201
- #define _ZMAX_ 301
- const bool Z2_MAX_ENDSTOP_INVERTING =
- #if Z2_USE_ENDSTOP == _XMAX_
- X_MAX_ENDSTOP_INVERTING
- #define Z2_MAX_PIN X_MAX_PIN
- #undef USE_XMAX_PLUG
- #elif Z2_USE_ENDSTOP == _YMAX_
- Y_MAX_ENDSTOP_INVERTING
- #define Z2_MAX_PIN Y_MAX_PIN
- #undef USE_YMAX_PLUG
- #elif Z2_USE_ENDSTOP == _ZMAX_
- Z_MAX_ENDSTOP_INVERTING
- #define Z2_MAX_PIN Z_MAX_PIN
- #undef USE_ZMAX_PLUG
- #elif Z2_USE_ENDSTOP == _XMIN_
- X_MIN_ENDSTOP_INVERTING
- #define Z2_MAX_PIN X_MIN_PIN
- #undef USE_XMIN_PLUG
- #elif Z2_USE_ENDSTOP == _YMIN_
- Y_MIN_ENDSTOP_INVERTING
- #define Z2_MAX_PIN Y_MIN_PIN
- #undef USE_YMIN_PLUG
- #elif Z2_USE_ENDSTOP == _ZMIN_
- Z_MIN_ENDSTOP_INVERTING
- #define Z2_MAX_PIN Z_MIN_PIN
- #undef USE_ZMIN_PLUG
- #else
- 0
- #endif
- ;
- #endif
-
- /**
- * Shorthand for pin tests, used wherever needed
- */
- #define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 > -2)
- #define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0 && TEMP_SENSOR_1 > -2)
- #define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0 && TEMP_SENSOR_2 > -2)
- #define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0 && TEMP_SENSOR_3 > -2)
- #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
- #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
- #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1))
- #define HAS_HEATER_2 (PIN_EXISTS(HEATER_2))
- #define HAS_HEATER_3 (PIN_EXISTS(HEATER_3))
- #define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED))
- #define HAS_AUTO_FAN_0 (PIN_EXISTS(EXTRUDER_0_AUTO_FAN))
- #define HAS_AUTO_FAN_1 (PIN_EXISTS(EXTRUDER_1_AUTO_FAN))
- #define HAS_AUTO_FAN_2 (PIN_EXISTS(EXTRUDER_2_AUTO_FAN))
- #define HAS_AUTO_FAN_3 (PIN_EXISTS(EXTRUDER_3_AUTO_FAN))
- #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
- #define HAS_FAN0 (PIN_EXISTS(FAN))
- #define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLERFAN_PIN != FAN1_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN1_PIN)
- #define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLERFAN_PIN != FAN2_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN2_PIN)
- #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
- #define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0)
- #define HAS_SERVO_0 (PIN_EXISTS(SERVO0))
- #define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
- #define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
- #define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
- #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH))
- #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT))
- #define HAS_HOME (PIN_EXISTS(HOME))
- #define HAS_KILL (PIN_EXISTS(KILL))
- #define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
- #define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
- #define HAS_X_MIN (PIN_EXISTS(X_MIN))
- #define HAS_X_MAX (PIN_EXISTS(X_MAX))
- #define HAS_Y_MIN (PIN_EXISTS(Y_MIN))
- #define HAS_Y_MAX (PIN_EXISTS(Y_MAX))
- #define HAS_Z_MIN (PIN_EXISTS(Z_MIN))
- #define HAS_Z_MAX (PIN_EXISTS(Z_MAX))
- #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
- #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
- #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
- #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
- #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
- #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
- #define HAS_MICROSTEPS (PIN_EXISTS(X_MS1))
- #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
- #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
- #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
- #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
- #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
- #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
- #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))
- #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE))
- #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE))
- #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE))
- #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
- #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
- #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
- #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
- #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE))
- #define HAS_X_DIR (PIN_EXISTS(X_DIR))
- #define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
- #define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
- #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR))
- #define HAS_Z_DIR (PIN_EXISTS(Z_DIR))
- #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR))
- #define HAS_E0_DIR (PIN_EXISTS(E0_DIR))
- #define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
- #define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
- #define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
- #define HAS_E4_DIR (PIN_EXISTS(E4_DIR))
- #define HAS_X_STEP (PIN_EXISTS(X_STEP))
- #define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
- #define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
- #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP))
- #define HAS_Z_STEP (PIN_EXISTS(Z_STEP))
- #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP))
- #define HAS_E0_STEP (PIN_EXISTS(E0_STEP))
- #define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
- #define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
- #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
- #define HAS_E4_STEP (PIN_EXISTS(E4_STEP))
-
- #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
-
- #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
-
- #define HAS_THERMALLY_PROTECTED_BED (HAS_TEMP_BED && HAS_HEATER_BED && ENABLED(THERMAL_PROTECTION_BED))
-
- /**
- * Helper Macros for heaters and extruder fan
- */
- #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
- #if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL)
- #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
- #if EXTRUDERS > 2
- #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
- #if EXTRUDERS > 3
- #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v)
- #endif
- #endif
- #endif
- #if ENABLED(HEATERS_PARALLEL)
- #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
- #else
- #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
- #endif
- #if HAS_HEATER_BED
- #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, v)
- #endif
-
- /**
- * Up to 3 PWM fans
- */
- #if HAS_FAN2
- #define FAN_COUNT 3
- #elif HAS_FAN1
- #define FAN_COUNT 2
- #elif HAS_FAN0
- #define FAN_COUNT 1
- #else
- #define FAN_COUNT 0
- #endif
-
- #if HAS_FAN0
- #define WRITE_FAN(v) WRITE(FAN_PIN, v)
- #define WRITE_FAN0(v) WRITE_FAN(v)
- #endif
- #if HAS_FAN1
- #define WRITE_FAN1(v) WRITE(FAN1_PIN, v)
- #endif
- #if HAS_FAN2
- #define WRITE_FAN2(v) WRITE(FAN2_PIN, v)
- #endif
- #define WRITE_FAN_N(n, v) WRITE_FAN##n(v)
-
- #define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER))
-
- #if HAS_SERVOS
- #ifndef X_ENDSTOP_SERVO_NR
- #define X_ENDSTOP_SERVO_NR -1
- #endif
- #ifndef Y_ENDSTOP_SERVO_NR
- #define Y_ENDSTOP_SERVO_NR -1
- #endif
- #ifndef Z_ENDSTOP_SERVO_NR
- #define Z_ENDSTOP_SERVO_NR -1
- #endif
- #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || HAS_Z_ENDSTOP_SERVO
- #define HAS_SERVO_ENDSTOPS true
- #define SERVO_ENDSTOP_IDS { X_ENDSTOP_SERVO_NR, Y_ENDSTOP_SERVO_NR, Z_ENDSTOP_SERVO_NR }
- #endif
- #endif
-
- #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))
-
- #define PROBE_PIN_CONFIGURED (HAS_Z_MIN_PROBE_PIN || (HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)))
-
- #define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED)
-
- /**
- * Delta radius/rod trimmers
- */
- #if ENABLED(DELTA)
- #ifndef DELTA_RADIUS_TRIM_TOWER_1
- #define DELTA_RADIUS_TRIM_TOWER_1 0.0
- #endif
- #ifndef DELTA_RADIUS_TRIM_TOWER_2
- #define DELTA_RADIUS_TRIM_TOWER_2 0.0
- #endif
- #ifndef DELTA_RADIUS_TRIM_TOWER_3
- #define DELTA_RADIUS_TRIM_TOWER_3 0.0
- #endif
- #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_1
- #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
- #endif
- #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_2
- #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
- #endif
- #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_3
- #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
- #endif
- #endif
-
-#endif //CONFIGURATION_LCD
-#endif //CONDITIONALS_H
+#error "Old configurations? Please delete all #include lines from Configuration.h and Configuration_adv.h."
diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h
new file mode 100644
index 000000000..29c67bf75
--- /dev/null
+++ b/Marlin/Conditionals_LCD.h
@@ -0,0 +1,319 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Conditionals_LCD.h
+ * LCD Defines that depend on configuration but are not editable.
+ */
+
+#ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first
+#define CONDITIONALS_LCD_H
+
+ #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
+
+ #if ENABLED(CARTESIO_UI)
+ #define DOGLCD
+ #define ULTIPANEL
+ #define NEWPANEL
+ #define DEFAULT_LCD_CONTRAST 90
+ #define LCD_CONTRAST_MIN 60
+ #define LCD_CONTRAST_MAX 140
+ #endif
+
+ #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
+ #define DOGLCD
+ #define ULTIPANEL
+ #define NEWPANEL
+ #define DEFAULT_LCD_CONTRAST 17
+ #endif
+
+ #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
+ #define ULTRA_LCD //general LCD support, also 16x2
+ #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
+ #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
+
+ #if ENABLED(miniVIKI)
+ #define LCD_CONTRAST_MIN 75
+ #define LCD_CONTRAST_MAX 115
+ #define DEFAULT_LCD_CONTRAST 95
+ #elif ENABLED(VIKI2)
+ #define DEFAULT_LCD_CONTRAST 40
+ #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
+ #define LCD_CONTRAST_MIN 90
+ #define LCD_CONTRAST_MAX 130
+ #define DEFAULT_LCD_CONTRAST 110
+ #define U8GLIB_LM6059_AF
+ #define SD_DETECT_INVERTED
+ #endif
+
+ #ifndef ENCODER_PULSES_PER_STEP
+ #define ENCODER_PULSES_PER_STEP 4
+ #endif
+ #ifndef ENCODER_STEPS_PER_MENU_ITEM
+ #define ENCODER_STEPS_PER_MENU_ITEM 1
+ #endif
+ #endif
+
+ // Generic support for SSD1306 / SH1106 OLED based LCDs.
+ #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
+ #define ULTRA_LCD //general LCD support, also 16x2
+ #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
+ #endif
+
+ #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
+ #define ULTIMAKERCONTROLLER
+ #endif
+
+ #if ENABLED(BQ_LCD_SMART_CONTROLLER)
+ #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+
+ #ifndef ENCODER_PULSES_PER_STEP
+ #define ENCODER_PULSES_PER_STEP 4
+ #endif
+ #ifndef ENCODER_STEPS_PER_MENU_ITEM
+ #define ENCODER_STEPS_PER_MENU_ITEM 1
+ #endif
+
+ #ifndef LONG_FILENAME_HOST_SUPPORT
+ #define LONG_FILENAME_HOST_SUPPORT
+ #endif
+ #endif
+
+ #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
+ #define DOGLCD
+ #define U8GLIB_ST7920
+ #define REPRAP_DISCOUNT_SMART_CONTROLLER
+ #endif
+
+ #if ENABLED(ULTIMAKERCONTROLLER) \
+ || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
+ || ENABLED(G3D_PANEL) \
+ || ENABLED(RIGIDBOT_PANEL) \
+ || ENABLED(REPRAPWORLD_KEYPAD)
+ #define ULTIPANEL
+ #define NEWPANEL
+ #endif
+
+ #if ENABLED(RA_CONTROL_PANEL)
+ #define LCD_I2C_TYPE_PCA8574
+ #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
+ #define ULTIPANEL
+ #define NEWPANEL
+ #endif
+
+ #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
+ #define DOGLCD
+ #define U8GLIB_ST7920
+ #define ULTIPANEL
+ #define NEWPANEL
+ #endif
+
+ /**
+ * I2C PANELS
+ */
+
+ #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
+ // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
+ // Make sure it is placed in the Arduino libraries directory.
+ #define LCD_I2C_TYPE_PCF8575
+ #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
+ #define ULTIPANEL
+ #define NEWPANEL
+ #endif
+
+ // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
+ #if ENABLED(LCD_I2C_PANELOLU2)
+ #define LCD_I2C_TYPE_MCP23017
+ #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
+ #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
+
+ #ifndef ENCODER_PULSES_PER_STEP
+ #define ENCODER_PULSES_PER_STEP 4
+ #endif
+ #ifndef ENCODER_STEPS_PER_MENU_ITEM
+ #define ENCODER_STEPS_PER_MENU_ITEM 1
+ #endif
+
+ #define ULTIPANEL
+ #define NEWPANEL
+ #endif
+
+ // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
+ #if ENABLED(LCD_I2C_VIKI)
+ // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
+ // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
+ // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
+ // BTN_ENC pin (or set BTN_ENC to -1 if not used)
+ #define LCD_I2C_TYPE_MCP23017
+ #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
+ #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
+ #define ULTIPANEL
+ #define NEWPANEL
+
+ #define ENCODER_FEEDRATE_DEADZONE 4
+
+ #ifndef ENCODER_PULSES_PER_STEP
+ #define ENCODER_PULSES_PER_STEP 1
+ #endif
+ #ifndef ENCODER_STEPS_PER_MENU_ITEM
+ #define ENCODER_STEPS_PER_MENU_ITEM 2
+ #endif
+ #endif
+
+ // Shift register panels
+ // ---------------------
+ // 2 wire Non-latching LCD SR from:
+ // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
+
+ #if ENABLED(SAV_3DLCD)
+ #define SR_LCD_2W_NL // Non latching 2 wire shift register
+ #define ULTIPANEL
+ #define NEWPANEL
+ #endif
+
+ #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
+ #ifndef LCD_WIDTH
+ #define LCD_WIDTH 22
+ #endif
+ #ifndef LCD_HEIGHT
+ #define LCD_HEIGHT 5
+ #endif
+ #endif
+
+ #if ENABLED(ULTIPANEL)
+ #define NEWPANEL //enable this if you have a click-encoder panel
+ #define ULTRA_LCD
+ #ifndef LCD_WIDTH
+ #define LCD_WIDTH 20
+ #endif
+ #ifndef LCD_HEIGHT
+ #define LCD_HEIGHT 4
+ #endif
+ #else //no panel but just LCD
+ #if ENABLED(ULTRA_LCD)
+ #ifndef LCD_WIDTH
+ #define LCD_WIDTH 16
+ #endif
+ #ifndef LCD_HEIGHT
+ #define LCD_HEIGHT 2
+ #endif
+ #endif
+ #endif
+
+ #if ENABLED(DOGLCD)
+ /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
+ // \x00 intentionally skipped to avoid problems in strings
+ #define LCD_STR_REFRESH "\x01"
+ #define LCD_STR_FOLDER "\x02"
+ #define LCD_STR_ARROW_RIGHT "\x03"
+ #define LCD_STR_UPLEVEL "\x04"
+ #define LCD_STR_CLOCK "\x05"
+ #define LCD_STR_FEEDRATE "\x06"
+ #define LCD_STR_BEDTEMP "\x07"
+ #define LCD_STR_THERMOMETER "\x08"
+ #define LCD_STR_DEGREE "\x09"
+
+ #define LCD_STR_SPECIAL_MAX '\x09'
+ // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
+ // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
+ #else
+ /* Custom characters defined in the first 8 characters of the LCD */
+ #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
+ #define LCD_STR_DEGREE "\x01"
+ #define LCD_STR_THERMOMETER "\x02"
+ #define LCD_STR_UPLEVEL "\x03"
+ #define LCD_STR_REFRESH "\x04"
+ #define LCD_STR_FOLDER "\x05"
+ #define LCD_STR_FEEDRATE "\x06"
+ #define LCD_STR_CLOCK "\x07"
+ #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
+ #endif
+
+ /**
+ * Default LCD contrast for dogm-like LCD displays
+ */
+ #if ENABLED(DOGLCD)
+
+ #define HAS_LCD_CONTRAST ( \
+ ENABLED(MAKRPANEL) \
+ || ENABLED(CARTESIO_UI) \
+ || ENABLED(VIKI2) \
+ || ENABLED(miniVIKI) \
+ || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
+ )
+
+ #if HAS_LCD_CONTRAST
+ #ifndef LCD_CONTRAST_MIN
+ #define LCD_CONTRAST_MIN 0
+ #endif
+ #ifndef LCD_CONTRAST_MAX
+ #define LCD_CONTRAST_MAX 63
+ #endif
+ #ifndef DEFAULT_LCD_CONTRAST
+ #define DEFAULT_LCD_CONTRAST 32
+ #endif
+ #endif
+ #endif
+
+ #ifndef BOOTSCREEN_TIMEOUT
+ #define BOOTSCREEN_TIMEOUT 2500
+ #endif
+
+ /**
+ * Extruders have some combination of stepper motors and hotends
+ * so we separate these concepts into the defines:
+ *
+ * EXTRUDERS - Number of Selectable Tools
+ * HOTENDS - Number of hotends, whether connected or separate
+ * E_STEPPERS - Number of actual E stepper motors
+ * TOOL_E_INDEX - Index to use when getting/setting the tool state
+ *
+ */
+ #if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder
+ #define HOTENDS 1
+ #define E_STEPPERS EXTRUDERS
+ #define E_MANUAL EXTRUDERS
+ #define TOOL_E_INDEX current_block->active_extruder
+ #undef TEMP_SENSOR_1_AS_REDUNDANT
+ #undef HOTEND_OFFSET_X
+ #undef HOTEND_OFFSET_Y
+ #elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends
+ #define HOTENDS EXTRUDERS
+ #define E_STEPPERS 1
+ #define E_MANUAL 1
+ #define TOOL_E_INDEX 0
+ #ifndef HOTEND_OFFSET_Z
+ #define HOTEND_OFFSET_Z { 0 }
+ #endif
+ #elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend
+ #define HOTENDS 1
+ #define E_STEPPERS MIXING_STEPPERS
+ #define E_MANUAL 1
+ #define TOOL_E_INDEX 0
+ #else // One stepper, E axis, and hotend per tool
+ #define HOTENDS EXTRUDERS
+ #define E_STEPPERS EXTRUDERS
+ #define E_MANUAL EXTRUDERS
+ #define TOOL_E_INDEX current_block->active_extruder
+ #endif
+
+#endif //CONDITIONALS_LCD_H
diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h
new file mode 100644
index 000000000..59750fc28
--- /dev/null
+++ b/Marlin/Conditionals_post.h
@@ -0,0 +1,663 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Conditionals_post.h
+ * Defines that depend on configuration but are not editable.
+ */
+
+#ifndef CONDITIONALS_POST_H
+#define CONDITIONALS_POST_H
+
+ #if ENABLED(EMERGENCY_PARSER)
+ #define EMERGENCY_PARSER_CAPABILITIES " EMERGENCY_CODES:M108,M112,M410"
+ #else
+ #define EMERGENCY_PARSER_CAPABILITIES ""
+ #endif
+
+ /**
+ * Set ENDSTOPPULLUPS for unused endstop switches
+ */
+ #if ENABLED(ENDSTOPPULLUPS)
+ #if ENABLED(USE_XMAX_PLUG)
+ #define ENDSTOPPULLUP_XMAX
+ #endif
+ #if ENABLED(USE_YMAX_PLUG)
+ #define ENDSTOPPULLUP_YMAX
+ #endif
+ #if ENABLED(USE_ZMAX_PLUG)
+ #define ENDSTOPPULLUP_ZMAX
+ #endif
+ #if ENABLED(USE_XMIN_PLUG)
+ #define ENDSTOPPULLUP_XMIN
+ #endif
+ #if ENABLED(USE_YMIN_PLUG)
+ #define ENDSTOPPULLUP_YMIN
+ #endif
+ #if ENABLED(USE_ZMIN_PLUG)
+ #define ENDSTOPPULLUP_ZMIN
+ #endif
+ #if DISABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)
+ #define ENDSTOPPULLUP_ZMIN_PROBE
+ #endif
+ #endif
+
+ /**
+ * Axis lengths
+ */
+ #define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS))
+ #define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
+ #define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
+
+ /**
+ * CoreXY and CoreXZ
+ */
+ #if ENABLED(COREXY)
+ #define CORE_AXIS_1 A_AXIS // XY from A + B
+ #define CORE_AXIS_2 B_AXIS
+ #define NORMAL_AXIS Z_AXIS
+ #elif ENABLED(COREXZ)
+ #define CORE_AXIS_1 A_AXIS // XZ from A + C
+ #define CORE_AXIS_2 C_AXIS
+ #define NORMAL_AXIS Y_AXIS
+ #elif ENABLED(COREYZ)
+ #define CORE_AXIS_1 B_AXIS // YZ from B + C
+ #define CORE_AXIS_2 C_AXIS
+ #define NORMAL_AXIS X_AXIS
+ #endif
+
+ /**
+ * SCARA
+ */
+ #if ENABLED(SCARA)
+ #undef SLOWDOWN
+ #define QUICK_HOME //SCARA needs Quickhome
+ #endif
+
+ /**
+ * Set the home position based on settings or manual overrides
+ */
+ #ifdef MANUAL_X_HOME_POS
+ #define X_HOME_POS MANUAL_X_HOME_POS
+ #elif ENABLED(BED_CENTER_AT_0_0)
+ #if ENABLED(DELTA)
+ #define X_HOME_POS 0
+ #else
+ #define X_HOME_POS ((X_MAX_LENGTH) * (X_HOME_DIR) * 0.5)
+ #endif
+ #else
+ #if ENABLED(DELTA)
+ #define X_HOME_POS ((X_MAX_LENGTH) * 0.5)
+ #else
+ #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
+ #endif
+ #endif
+
+ #ifdef MANUAL_Y_HOME_POS
+ #define Y_HOME_POS MANUAL_Y_HOME_POS
+ #elif ENABLED(BED_CENTER_AT_0_0)
+ #if ENABLED(DELTA)
+ #define Y_HOME_POS 0
+ #else
+ #define Y_HOME_POS ((Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5)
+ #endif
+ #else
+ #if ENABLED(DELTA)
+ #define Y_HOME_POS ((Y_MAX_LENGTH) * 0.5)
+ #else
+ #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
+ #endif
+ #endif
+
+ #ifdef MANUAL_Z_HOME_POS
+ #define Z_HOME_POS MANUAL_Z_HOME_POS
+ #else
+ #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS)
+ #endif
+
+ /**
+ * The BLTouch Probe emulates a servo probe
+ */
+ #if ENABLED(BLTOUCH)
+ #undef Z_ENDSTOP_SERVO_NR
+ #undef Z_SERVO_ANGLES
+ #define Z_ENDSTOP_SERVO_NR 0
+ #define Z_SERVO_ANGLES {10,90} // For BLTouch 10=deploy, 90=retract
+ #undef DEACTIVATE_SERVOS_AFTER_MOVE
+ #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
+ #undef Z_MIN_ENDSTOP_INVERTING
+ #define Z_MIN_ENDSTOP_INVERTING false
+ #endif
+ #endif
+
+ /**
+ * Auto Bed Leveling and Z Probe Repeatability Test
+ */
+ #define HAS_PROBING_PROCEDURE (ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
+
+ // Boundaries for probing based on set limits
+ #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
+ #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
+ #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
+ #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
+
+ #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
+
+ /**
+ * Z Sled Probe requires Z_SAFE_HOMING
+ */
+ #if ENABLED(Z_PROBE_SLED)
+ #define Z_SAFE_HOMING
+ #endif
+
+ /**
+ * DELTA should ignore Z_SAFE_HOMING
+ */
+ #if ENABLED(DELTA)
+ #undef Z_SAFE_HOMING
+ #endif
+
+ /**
+ * Safe Homing Options
+ */
+ #if ENABLED(Z_SAFE_HOMING)
+ #ifndef Z_SAFE_HOMING_X_POINT
+ #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)
+ #endif
+ #ifndef Z_SAFE_HOMING_Y_POINT
+ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)
+ #endif
+ #endif
+
+ /**
+ * Host keep alive
+ */
+ #ifndef DEFAULT_KEEPALIVE_INTERVAL
+ #define DEFAULT_KEEPALIVE_INTERVAL 2
+ #endif
+
+ /**
+ * MAX_STEP_FREQUENCY differs for TOSHIBA
+ */
+ #if ENABLED(CONFIG_STEPPERS_TOSHIBA)
+ #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
+ #else
+ #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
+ #endif
+
+ // MS1 MS2 Stepper Driver Microstepping mode table
+ #define MICROSTEP1 LOW,LOW
+ #define MICROSTEP2 HIGH,LOW
+ #define MICROSTEP4 LOW,HIGH
+ #define MICROSTEP8 HIGH,HIGH
+ #define MICROSTEP16 HIGH,HIGH
+
+ /**
+ * Advance calculated values
+ */
+ #if ENABLED(ADVANCE)
+ #define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI)
+ #define STEPS_PER_CUBIC_MM_E (axis_steps_per_mm[E_AXIS] / (EXTRUSION_AREA))
+ #endif
+
+ #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
+ #undef SD_DETECT_INVERTED
+ #endif
+
+ /**
+ * Set defaults for missing (newer) options
+ */
+ #ifndef DISABLE_INACTIVE_X
+ #define DISABLE_INACTIVE_X DISABLE_X
+ #endif
+ #ifndef DISABLE_INACTIVE_Y
+ #define DISABLE_INACTIVE_Y DISABLE_Y
+ #endif
+ #ifndef DISABLE_INACTIVE_Z
+ #define DISABLE_INACTIVE_Z DISABLE_Z
+ #endif
+ #ifndef DISABLE_INACTIVE_E
+ #define DISABLE_INACTIVE_E DISABLE_E
+ #endif
+
+ // Power Signal Control Definitions
+ // By default use ATX definition
+ #ifndef POWER_SUPPLY
+ #define POWER_SUPPLY 1
+ #endif
+ #if (POWER_SUPPLY == 1) // 1 = ATX
+ #define PS_ON_AWAKE LOW
+ #define PS_ON_ASLEEP HIGH
+ #elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W
+ #define PS_ON_AWAKE HIGH
+ #define PS_ON_ASLEEP LOW
+ #endif
+ #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
+
+ /**
+ * Temp Sensor defines
+ */
+ #if TEMP_SENSOR_0 == -3
+ #define HEATER_0_USES_MAX6675
+ #define MAX6675_IS_MAX31855
+ #elif TEMP_SENSOR_0 == -2
+ #define HEATER_0_USES_MAX6675
+ #elif TEMP_SENSOR_0 == -1
+ #define HEATER_0_USES_AD595
+ #elif TEMP_SENSOR_0 == 0
+ #undef HEATER_0_MINTEMP
+ #undef HEATER_0_MAXTEMP
+ #elif TEMP_SENSOR_0 > 0
+ #define THERMISTORHEATER_0 TEMP_SENSOR_0
+ #define HEATER_0_USES_THERMISTOR
+ #endif
+
+ #if TEMP_SENSOR_1 <= -2
+ #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_1"
+ #elif TEMP_SENSOR_1 == -1
+ #define HEATER_1_USES_AD595
+ #elif TEMP_SENSOR_1 == 0
+ #undef HEATER_1_MINTEMP
+ #undef HEATER_1_MAXTEMP
+ #elif TEMP_SENSOR_1 > 0
+ #define THERMISTORHEATER_1 TEMP_SENSOR_1
+ #define HEATER_1_USES_THERMISTOR
+ #endif
+
+ #if TEMP_SENSOR_2 <= -2
+ #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_2"
+ #elif TEMP_SENSOR_2 == -1
+ #define HEATER_2_USES_AD595
+ #elif TEMP_SENSOR_2 == 0
+ #undef HEATER_2_MINTEMP
+ #undef HEATER_2_MAXTEMP
+ #elif TEMP_SENSOR_2 > 0
+ #define THERMISTORHEATER_2 TEMP_SENSOR_2
+ #define HEATER_2_USES_THERMISTOR
+ #endif
+
+ #if TEMP_SENSOR_3 <= -2
+ #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_3"
+ #elif TEMP_SENSOR_3 == -1
+ #define HEATER_3_USES_AD595
+ #elif TEMP_SENSOR_3 == 0
+ #undef HEATER_3_MINTEMP
+ #undef HEATER_3_MAXTEMP
+ #elif TEMP_SENSOR_3 > 0
+ #define THERMISTORHEATER_3 TEMP_SENSOR_3
+ #define HEATER_3_USES_THERMISTOR
+ #endif
+
+ #if TEMP_SENSOR_BED <= -2
+ #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_BED"
+ #elif TEMP_SENSOR_BED == -1
+ #define BED_USES_AD595
+ #elif TEMP_SENSOR_BED == 0
+ #undef BED_MINTEMP
+ #undef BED_MAXTEMP
+ #elif TEMP_SENSOR_BED > 0
+ #define THERMISTORBED TEMP_SENSOR_BED
+ #define BED_USES_THERMISTOR
+ #endif
+
+ /**
+ * Flags for PID handling
+ */
+ #define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED))
+ #define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED))
+
+ /**
+ * Default hotend offsets, if not defined
+ */
+ #if HOTENDS > 1
+ #ifndef HOTEND_OFFSET_X
+ #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
+ #endif
+ #ifndef HOTEND_OFFSET_Y
+ #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
+ #endif
+ #if !defined(HOTEND_OFFSET_Z) && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER))
+ #define HOTEND_OFFSET_Z { 0 }
+ #endif
+ #endif
+
+ /**
+ * ARRAY_BY_EXTRUDERS based on EXTRUDERS
+ */
+ #define ARRAY_BY_EXTRUDERS(args...) ARRAY_N(EXTRUDERS, args)
+ #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1)
+
+ /**
+ * ARRAY_BY_HOTENDS based on HOTENDS
+ */
+ #define ARRAY_BY_HOTENDS(args...) ARRAY_N(HOTENDS, args)
+ #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
+
+ /**
+ * Z_DUAL_ENDSTOPS endstop reassignment
+ */
+ #if ENABLED(Z_DUAL_ENDSTOPS)
+ #define _XMIN_ 100
+ #define _YMIN_ 200
+ #define _ZMIN_ 300
+ #define _XMAX_ 101
+ #define _YMAX_ 201
+ #define _ZMAX_ 301
+ #if Z2_USE_ENDSTOP == _XMAX_
+ #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
+ #define Z2_MAX_PIN X_MAX_PIN
+ #undef USE_XMAX_PLUG
+ #elif Z2_USE_ENDSTOP == _YMAX_
+ #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
+ #define Z2_MAX_PIN Y_MAX_PIN
+ #undef USE_YMAX_PLUG
+ #elif Z2_USE_ENDSTOP == _ZMAX_
+ #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
+ #define Z2_MAX_PIN Z_MAX_PIN
+ #undef USE_ZMAX_PLUG
+ #elif Z2_USE_ENDSTOP == _XMIN_
+ #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
+ #define Z2_MAX_PIN X_MIN_PIN
+ #undef USE_XMIN_PLUG
+ #elif Z2_USE_ENDSTOP == _YMIN_
+ #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
+ #define Z2_MAX_PIN Y_MIN_PIN
+ #undef USE_YMIN_PLUG
+ #elif Z2_USE_ENDSTOP == _ZMIN_
+ #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
+ #define Z2_MAX_PIN Z_MIN_PIN
+ #undef USE_ZMIN_PLUG
+ #else
+ #define Z2_MAX_ENDSTOP_INVERTING false
+ #endif
+ #endif
+
+ /**
+ * Shorthand for pin tests, used wherever needed
+ */
+ #define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 > -2)
+ #define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0 && TEMP_SENSOR_1 > -2)
+ #define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0 && TEMP_SENSOR_2 > -2)
+ #define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0 && TEMP_SENSOR_3 > -2)
+ #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
+ #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
+ #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1))
+ #define HAS_HEATER_2 (PIN_EXISTS(HEATER_2))
+ #define HAS_HEATER_3 (PIN_EXISTS(HEATER_3))
+ #define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED))
+ #define HAS_AUTO_FAN_0 (PIN_EXISTS(EXTRUDER_0_AUTO_FAN))
+ #define HAS_AUTO_FAN_1 (PIN_EXISTS(EXTRUDER_1_AUTO_FAN))
+ #define HAS_AUTO_FAN_2 (PIN_EXISTS(EXTRUDER_2_AUTO_FAN))
+ #define HAS_AUTO_FAN_3 (PIN_EXISTS(EXTRUDER_3_AUTO_FAN))
+ #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
+ #define HAS_FAN0 (PIN_EXISTS(FAN))
+ #define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLERFAN_PIN != FAN1_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN1_PIN)
+ #define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLERFAN_PIN != FAN2_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN2_PIN)
+ #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
+ #define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0)
+ #define HAS_SERVO_0 (PIN_EXISTS(SERVO0))
+ #define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
+ #define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
+ #define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
+ #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH))
+ #define HAS_FIL_RUNOUT (PIN_EXISTS(FIL_RUNOUT))
+ #define HAS_HOME (PIN_EXISTS(HOME))
+ #define HAS_KILL (PIN_EXISTS(KILL))
+ #define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
+ #define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
+ #define HAS_X_MIN (PIN_EXISTS(X_MIN))
+ #define HAS_X_MAX (PIN_EXISTS(X_MAX))
+ #define HAS_Y_MIN (PIN_EXISTS(Y_MIN))
+ #define HAS_Y_MAX (PIN_EXISTS(Y_MAX))
+ #define HAS_Z_MIN (PIN_EXISTS(Z_MIN))
+ #define HAS_Z_MAX (PIN_EXISTS(Z_MAX))
+ #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
+ #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
+ #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
+ #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
+ #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
+ #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
+ #define HAS_MICROSTEPS (PIN_EXISTS(X_MS1))
+ #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
+ #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
+ #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
+ #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
+ #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
+ #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
+ #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))
+ #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE))
+ #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE))
+ #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE))
+ #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
+ #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
+ #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
+ #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
+ #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE))
+ #define HAS_X_DIR (PIN_EXISTS(X_DIR))
+ #define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
+ #define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
+ #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR))
+ #define HAS_Z_DIR (PIN_EXISTS(Z_DIR))
+ #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR))
+ #define HAS_E0_DIR (PIN_EXISTS(E0_DIR))
+ #define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
+ #define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
+ #define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
+ #define HAS_E4_DIR (PIN_EXISTS(E4_DIR))
+ #define HAS_X_STEP (PIN_EXISTS(X_STEP))
+ #define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
+ #define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
+ #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP))
+ #define HAS_Z_STEP (PIN_EXISTS(Z_STEP))
+ #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP))
+ #define HAS_E0_STEP (PIN_EXISTS(E0_STEP))
+ #define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
+ #define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
+ #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
+ #define HAS_E4_STEP (PIN_EXISTS(E4_STEP))
+ #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
+ #define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER))
+
+ #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
+
+ #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
+
+ #define HAS_THERMALLY_PROTECTED_BED (HAS_TEMP_BED && HAS_HEATER_BED && ENABLED(THERMAL_PROTECTION_BED))
+
+ /**
+ * This value is used by M109 when trying to calculate a ballpark safe margin
+ * to prevent wait-forever situation.
+ */
+ #ifndef EXTRUDE_MINTEMP
+ #define EXTRUDE_MINTEMP 170
+ #endif
+
+ /**
+ * Helper Macros for heaters and extruder fan
+ */
+ #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
+ #if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)
+ #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
+ #if HOTENDS > 2
+ #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
+ #if HOTENDS > 3
+ #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v)
+ #endif
+ #endif
+ #endif
+ #if ENABLED(HEATERS_PARALLEL)
+ #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
+ #else
+ #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
+ #endif
+ #if HAS_HEATER_BED
+ #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, v)
+ #endif
+
+ /**
+ * Up to 3 PWM fans
+ */
+ #if HAS_FAN2
+ #define FAN_COUNT 3
+ #elif HAS_FAN1
+ #define FAN_COUNT 2
+ #elif HAS_FAN0
+ #define FAN_COUNT 1
+ #else
+ #define FAN_COUNT 0
+ #endif
+
+ #if HAS_FAN0
+ #define WRITE_FAN(v) WRITE(FAN_PIN, v)
+ #define WRITE_FAN0(v) WRITE_FAN(v)
+ #endif
+ #if HAS_FAN1
+ #define WRITE_FAN1(v) WRITE(FAN1_PIN, v)
+ #endif
+ #if HAS_FAN2
+ #define WRITE_FAN2(v) WRITE(FAN2_PIN, v)
+ #endif
+ #define WRITE_FAN_N(n, v) WRITE_FAN##n(v)
+
+ /**
+ * Servos and probes
+ */
+
+ #if HAS_SERVOS
+ #ifndef Z_ENDSTOP_SERVO_NR
+ #define Z_ENDSTOP_SERVO_NR -1
+ #endif
+ #endif
+
+ #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))
+
+ #define PROBE_PIN_CONFIGURED (HAS_Z_MIN_PROBE_PIN || (HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)))
+
+ #define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED)
+
+ #if ENABLED(Z_PROBE_ALLEN_KEY)
+ #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST
+ #endif
+
+ /**
+ * Bed Probe dependencies
+ */
+ #if HAS_BED_PROBE
+ #ifndef Z_PROBE_OFFSET_RANGE_MIN
+ #define Z_PROBE_OFFSET_RANGE_MIN -20
+ #endif
+ #ifndef Z_PROBE_OFFSET_RANGE_MAX
+ #define Z_PROBE_OFFSET_RANGE_MAX 20
+ #endif
+ #ifndef XY_PROBE_SPEED
+ #ifdef HOMING_FEEDRATE_XY
+ #define XY_PROBE_SPEED HOMING_FEEDRATE_XY
+ #else
+ #define XY_PROBE_SPEED 4000
+ #endif
+ #endif
+ #if Z_RAISE_BETWEEN_PROBINGS > Z_RAISE_PROBE_DEPLOY_STOW
+ #define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_BETWEEN_PROBINGS
+ #else
+ #define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_PROBE_DEPLOY_STOW
+ #endif
+ #else
+ #undef X_PROBE_OFFSET_FROM_EXTRUDER
+ #undef Y_PROBE_OFFSET_FROM_EXTRUDER
+ #undef Z_PROBE_OFFSET_FROM_EXTRUDER
+ #define X_PROBE_OFFSET_FROM_EXTRUDER 0
+ #define Y_PROBE_OFFSET_FROM_EXTRUDER 0
+ #define Z_PROBE_OFFSET_FROM_EXTRUDER 0
+ #endif
+
+ /**
+ * Delta radius/rod trimmers
+ */
+ #if ENABLED(DELTA)
+ #ifndef DELTA_RADIUS_TRIM_TOWER_1
+ #define DELTA_RADIUS_TRIM_TOWER_1 0.0
+ #endif
+ #ifndef DELTA_RADIUS_TRIM_TOWER_2
+ #define DELTA_RADIUS_TRIM_TOWER_2 0.0
+ #endif
+ #ifndef DELTA_RADIUS_TRIM_TOWER_3
+ #define DELTA_RADIUS_TRIM_TOWER_3 0.0
+ #endif
+ #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_1
+ #define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
+ #endif
+ #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_2
+ #define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
+ #endif
+ #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_3
+ #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
+ #endif
+ #if ENABLED(AUTO_BED_LEVELING_GRID)
+ #define DELTA_BED_LEVELING_GRID
+ #endif
+ #endif
+
+ /**
+ * When not using other bed leveling...
+ */
+ #if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(AUTO_BED_LEVELING_GRID) && DISABLED(DELTA_BED_LEVELING_GRID)
+ #define AUTO_BED_LEVELING_3POINT
+ #endif
+
+ /**
+ * Buzzer/Speaker
+ */
+ #if ENABLED(LCD_USE_I2C_BUZZER)
+ #ifndef LCD_FEEDBACK_FREQUENCY_HZ
+ #define LCD_FEEDBACK_FREQUENCY_HZ 1000
+ #endif
+ #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
+ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
+ #endif
+ #elif PIN_EXISTS(BEEPER)
+ #ifndef LCD_FEEDBACK_FREQUENCY_HZ
+ #define LCD_FEEDBACK_FREQUENCY_HZ 5000
+ #endif
+ #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
+ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
+ #endif
+ #else
+ #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
+ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
+ #endif
+ #endif
+
+ /**
+ * MIN_Z_HEIGHT_FOR_HOMING / Z_RAISE_BETWEEN_PROBINGS
+ */
+ #ifndef MIN_Z_HEIGHT_FOR_HOMING
+ #ifndef Z_RAISE_BETWEEN_PROBINGS
+ #define MIN_Z_HEIGHT_FOR_HOMING 0
+ #else
+ #define MIN_Z_HEIGHT_FOR_HOMING Z_RAISE_BETWEEN_PROBINGS
+ #endif
+ #endif
+ #ifndef Z_RAISE_BETWEEN_PROBINGS
+ #define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING
+ #endif
+
+#endif // CONDITIONALS_POST_H
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index b67d0a02f..8083c1ea7 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -384,18 +420,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -407,7 +504,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -440,6 +537,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -476,6 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -507,7 +620,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -541,8 +654,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -585,58 +701,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -645,18 +714,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -664,7 +729,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -673,14 +738,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (4*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -702,18 +767,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -745,22 +798,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 110
+#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 110
-#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -793,8 +931,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -941,6 +1081,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -953,6 +1099,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1003,7 +1155,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1063,7 +1215,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1098,7 +1252,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1130,28 +1284,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1182,7 +1324,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 61cdef140..a822c83b1 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -351,6 +402,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/M100_Free_Mem_Chk.cpp b/Marlin/M100_Free_Mem_Chk.cpp
index 276df98eb..82689465a 100644
--- a/Marlin/M100_Free_Mem_Chk.cpp
+++ b/Marlin/M100_Free_Mem_Chk.cpp
@@ -43,42 +43,23 @@
#include "Marlin.h"
#if ENABLED(M100_FREE_MEMORY_WATCHER)
-extern void* __brkval;
+extern char* __brkval;
extern size_t __heap_start, __heap_end, __flp;
-
-
-//
-// Declare all the functions we need from Marlin_Main.cpp to do the work!
-//
-
-float code_value();
-long code_value_long();
-bool code_seen(char);
-void serial_echopair_P(const char*, float);
-void serial_echopair_P(const char*, double);
-void serial_echopair_P(const char*, unsigned long);
-void serial_echopair_P(const char*, int);
-void serial_echopair_P(const char*, long);
-
-
-
+extern char __bss_end;
//
// Utility functions used by M100 to get its work done.
//
-unsigned char* top_of_stack();
+char* top_of_stack();
void prt_hex_nibble(unsigned int);
void prt_hex_byte(unsigned int);
void prt_hex_word(unsigned int);
-int how_many_E5s_are_here(unsigned char*);
-
-
-
+int how_many_E5s_are_here(char*);
void gcode_M100() {
- static int m100_not_initialized = 1;
- unsigned char* sp, *ptr;
+ static bool m100_not_initialized = true;
+ char* sp, *ptr;
int i, j, n;
//
// M100 D dumps the free memory block from __brkval to the stack pointer.
@@ -89,71 +70,67 @@ void gcode_M100() {
// probably caused by bad pointers. Any unexpected values will be flagged in
// the right hand column to help spotting them.
//
-#if ENABLED(M100_FREE_MEMORY_DUMPER) // Disable to remove Dump sub-command
- if (code_seen('D')) {
- ptr = (unsigned char*) __brkval;
- //
- // We want to start and end the dump on a nice 16 byte boundry even though
- // the values we are using are not 16 byte aligned.
- //
- SERIAL_ECHOPGM("\n__brkval : ");
- prt_hex_word((unsigned int) ptr);
- ptr = (unsigned char*)((unsigned long) ptr & 0xfff0);
- sp = top_of_stack();
- SERIAL_ECHOPGM("\nStack Pointer : ");
- prt_hex_word((unsigned int) sp);
- SERIAL_ECHOPGM("\n");
- sp = (unsigned char*)((unsigned long) sp | 0x000f);
- n = sp - ptr;
- //
- // This is the main loop of the Dump command.
- //
- while (ptr < sp) {
- prt_hex_word((unsigned int) ptr); // Print the address
- SERIAL_ECHOPGM(":");
- for (i = 0; i < 16; i++) { // and 16 data bytes
- prt_hex_byte(*(ptr + i));
- SERIAL_ECHOPGM(" ");
- delay(2);
- }
- SERIAL_ECHO("|"); // now show where non 0xE5's are
- for (i = 0; i < 16; i++) {
- delay(2);
- if (*(ptr + i) == 0xe5)
- SERIAL_ECHOPGM(" ");
- else
- SERIAL_ECHOPGM("?");
+ #if ENABLED(M100_FREE_MEMORY_DUMPER) // Disable to remove Dump sub-command
+ if (code_seen('D')) {
+ ptr = __brkval ? __brkval : &__bss_end;
+ //
+ // We want to start and end the dump on a nice 16 byte boundry even though
+ // the values we are using are not 16 byte aligned.
+ //
+ SERIAL_ECHOPGM("\nbss_end : ");
+ prt_hex_word((unsigned int) ptr);
+ ptr = (char*)((unsigned long) ptr & 0xfff0);
+ sp = top_of_stack();
+ SERIAL_ECHOPGM("\nStack Pointer : ");
+ prt_hex_word((unsigned int) sp);
+ SERIAL_EOL;
+ sp = (char*)((unsigned long) sp | 0x000f);
+ n = sp - ptr;
+ //
+ // This is the main loop of the Dump command.
+ //
+ while (ptr < sp) {
+ prt_hex_word((unsigned int) ptr); // Print the address
+ SERIAL_CHAR(':');
+ for (i = 0; i < 16; i++) { // and 16 data bytes
+ prt_hex_byte(*(ptr + i));
+ SERIAL_CHAR(' ');
+ }
+ SERIAL_CHAR('|'); // now show where non 0xE5's are
+ for (i = 0; i < 16; i++) {
+ if (*(ptr + i) == (char)0xe5)
+ SERIAL_CHAR(' ');
+ else
+ SERIAL_CHAR('?');
+ }
+ SERIAL_EOL;
+ ptr += 16;
}
- SERIAL_ECHO("\n");
- ptr += 16;
- delay(2);
+ return;
}
- SERIAL_ECHOLNPGM("Done.\n");
- return;
- }
-#endif
+ #endif
//
// M100 F requests the code to return the number of free bytes in the memory pool along with
// other vital statistics that define the memory pool.
//
if (code_seen('F')) {
#if 0
- int max_addr = (int) __brkval;
+ int max_addr = (int) __brkval ? __brkval : &__bss_end;
int max_cnt = 0;
#endif
int block_cnt = 0;
- ptr = (unsigned char*) __brkval;
+ ptr = __brkval ? __brkval : &__bss_end;
sp = top_of_stack();
n = sp - ptr;
// Scan through the range looking for the biggest block of 0xE5's we can find
for (i = 0; i < n; i++) {
- if (*(ptr + i) == (unsigned char) 0xe5) {
- j = how_many_E5s_are_here((unsigned char*) ptr + i);
+ if (*(ptr + i) == (char)0xe5) {
+ j = how_many_E5s_are_here(ptr + i);
if (j > 8) {
SERIAL_ECHOPAIR("Found ", j);
SERIAL_ECHOPGM(" bytes free at 0x");
prt_hex_word((int) ptr + i);
- SERIAL_ECHOPGM("\n");
+ SERIAL_EOL;
i += j;
block_cnt++;
}
@@ -166,45 +143,43 @@ void gcode_M100() {
}
}
if (block_cnt > 1)
- SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area.\n");
- SERIAL_ECHO("\nDone.\n");
+ SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area.");
return;
}
//
// M100 C x Corrupts x locations in the free memory pool and reports the locations of the corruption.
// This is useful to check the correctness of the M100 D and the M100 F commands.
//
-#if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
- if (code_seen('C')) {
- int x; // x gets the # of locations to corrupt within the memory pool
- x = code_value();
- SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
- ptr = (unsigned char*) __brkval;
- SERIAL_ECHOPAIR("\n__brkval : ", ptr);
- ptr += 8;
- sp = top_of_stack();
- SERIAL_ECHOPAIR("\nStack Pointer : ", sp);
- SERIAL_ECHOLNPGM("\n");
- n = sp - ptr - 64; // -64 just to keep us from finding interrupt activity that
- // has altered the stack.
- j = n / (x + 1);
- for (i = 1; i <= x; i++) {
- *(ptr + (i * j)) = i;
- SERIAL_ECHO("\nCorrupting address: 0x");
- prt_hex_word((unsigned int)(ptr + (i * j)));
+ #if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
+ if (code_seen('C')) {
+ int x = code_value_int(); // x gets the # of locations to corrupt within the memory pool
+ SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
+ ptr = __brkval ? __brkval : &__bss_end;
+ SERIAL_ECHOPAIR("\nbss_end : ", ptr);
+ ptr += 8;
+ sp = top_of_stack();
+ SERIAL_ECHOPAIR("\nStack Pointer : ", sp);
+ SERIAL_ECHOLNPGM("\n");
+ n = sp - ptr - 64; // -64 just to keep us from finding interrupt activity that
+ // has altered the stack.
+ j = n / (x + 1);
+ for (i = 1; i <= x; i++) {
+ *(ptr + (i * j)) = i;
+ SERIAL_ECHOPGM("\nCorrupting address: 0x");
+ prt_hex_word((unsigned int)(ptr + (i * j)));
+ }
+ SERIAL_ECHOLNPGM("\n");
+ return;
}
- SERIAL_ECHOLNPGM("\n");
- return;
- }
-#endif
+ #endif
//
// M100 I Initializes the free memory pool so it can be watched and prints vital
// statistics that define the free memory pool.
//
- if (m100_not_initialized || code_seen('I')) { // If no sub-command is specified, the first time
- SERIAL_ECHOLNPGM("Initializing free memory block.\n"); // this happens, it will Initialize.
- ptr = (unsigned char*) __brkval; // Repeated M100 with no sub-command will not destroy the
- SERIAL_ECHOPAIR("\n__brkval : ", ptr); // state of the initialized free memory pool.
+ if (m100_not_initialized || code_seen('I')) { // If no sub-command is specified, the first time
+ SERIAL_ECHOLNPGM("Initializing free memory block.\n"); // this happens, it will Initialize.
+ ptr = __brkval ? __brkval : &__bss_end; // Repeated M100 with no sub-command will not destroy the
+ SERIAL_ECHOPAIR("\nbss_end : ", ptr); // state of the initialized free memory pool.
ptr += 8;
sp = top_of_stack();
SERIAL_ECHOPAIR("\nStack Pointer : ", sp);
@@ -214,16 +189,15 @@ void gcode_M100() {
SERIAL_ECHO(n);
SERIAL_ECHOLNPGM(" bytes of memory initialized.\n");
for (i = 0; i < n; i++)
- *(ptr + i) = (unsigned char) 0xe5;
+ *(ptr + i) = (char)0xe5;
for (i = 0; i < n; i++) {
- if (*(ptr + i) != (unsigned char) 0xe5) {
+ if (*(ptr + i) != (char)0xe5) {
SERIAL_ECHOPAIR("? address : ", ptr + i);
SERIAL_ECHOPAIR("=", *(ptr + i));
SERIAL_ECHOLNPGM("\n");
}
}
- m100_not_initialized = 0;
- SERIAL_ECHOLNPGM("Done.\n");
+ m100_not_initialized = false;
return;
}
return;
@@ -232,8 +206,8 @@ void gcode_M100() {
// top_of_stack() returns the location of a variable on its stack frame. The value returned is above
// the stack once the function returns to the caller.
-unsigned char* top_of_stack() {
- unsigned char x;
+char* top_of_stack() {
+ char x;
return &x + 1; // x is pulled on return;
}
@@ -246,7 +220,6 @@ void prt_hex_nibble(unsigned int n) {
SERIAL_ECHO(n);
else
SERIAL_ECHO((char)('A' + n - 10));
- delay(2);
}
void prt_hex_byte(unsigned int b) {
@@ -262,10 +235,10 @@ void prt_hex_word(unsigned int w) {
// how_many_E5s_are_here() is a utility function to easily find out how many 0xE5's are
// at the specified location. Having this logic as a function simplifies the search code.
//
-int how_many_E5s_are_here(unsigned char* p) {
+int how_many_E5s_are_here(char* p) {
int n;
for (n = 0; n < 32000; n++) {
- if (*(p + n) != (unsigned char) 0xe5)
+ if (*(p + n) != (char)0xe5)
return n - 1;
}
return -1;
diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h
index ab85ab592..9f289f208 100644
--- a/Marlin/Marlin.h
+++ b/Marlin/Marlin.h
@@ -22,12 +22,6 @@
#ifndef MARLIN_H
#define MARLIN_H
-#define FORCE_INLINE __attribute__((always_inline)) inline
-/**
- * Compiler warning on unused variable.
- */
-#define UNUSED(x) (void) (x)
-
#include
#include
#include
@@ -39,25 +33,25 @@
#include
#include
+#include "MarlinConfig.h"
+#include "enum.h"
+#include "types.h"
#include "fastio.h"
-#include "Configuration.h"
-#include "pins.h"
-
-#ifndef SANITYCHECK_H
- #error "Your Configuration.h and Configuration_adv.h files are outdated!"
-#endif
-
-#include "Arduino.h"
-
-typedef unsigned long millis_t;
+#include "utility.h"
#ifdef USBCON
#include "HardwareSerial.h"
+ #if ENABLED(BLUETOOTH)
+ #define MYSERIAL bluetoothSerial
+ #else
+ #define MYSERIAL Serial
+ #endif // BLUETOOTH
+#else
+ #include "MarlinSerial.h"
+ #define MYSERIAL customizedSerial
#endif
-#include "MarlinSerial.h"
-
#include "WString.h"
#if ENABLED(PRINTCOUNTER)
@@ -66,16 +60,6 @@ typedef unsigned long millis_t;
#include "stopwatch.h"
#endif
-#ifdef USBCON
- #if ENABLED(BLUETOOTH)
- #define MYSERIAL bluetoothSerial
- #else
- #define MYSERIAL Serial
- #endif // BLUETOOTH
-#else
- #define MYSERIAL customizedSerial
-#endif
-
#define SERIAL_CHAR(x) MYSERIAL.write(x)
#define SERIAL_EOL SERIAL_CHAR('\n')
@@ -84,8 +68,9 @@ typedef unsigned long millis_t;
#define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y)
#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x))
#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x); SERIAL_EOL; }while(0)
-#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)); SERIAL_EOL; }while(0)
+#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x "\n")); }while(0)
+#define SERIAL_PROTOCOLPAIR(name, value) SERIAL_ECHOPAIR(name, value)
extern const char errormagic[] PROGMEM;
extern const char echomagic[] PROGMEM;
@@ -104,11 +89,14 @@ extern const char echomagic[] PROGMEM;
#define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value)))
+void serial_echopair_P(const char* s_P, char v);
void serial_echopair_P(const char* s_P, int v);
void serial_echopair_P(const char* s_P, long v);
void serial_echopair_P(const char* s_P, float v);
void serial_echopair_P(const char* s_P, double v);
void serial_echopair_P(const char* s_P, unsigned long v);
+FORCE_INLINE void serial_echopair_P(const char* s_P, uint8_t v) { serial_echopair_P(s_P, (int)v); }
+FORCE_INLINE void serial_echopair_P(const char* s_P, uint16_t v) { serial_echopair_P(s_P, (int)v); }
FORCE_INLINE void serial_echopair_P(const char* s_P, bool v) { serial_echopair_P(s_P, (int)v); }
FORCE_INLINE void serial_echopair_P(const char* s_P, void *v) { serial_echopair_P(s_P, (unsigned long)v); }
@@ -122,99 +110,111 @@ FORCE_INLINE void serialprintPGM(const char* str) {
}
void idle(
- #if ENABLED(FILAMENTCHANGEENABLE)
- bool no_stepper_sleep=false // pass true to keep steppers from disabling on timeout
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout
#endif
);
void manage_inactivity(bool ignore_stepper_queue = false);
-#if ENABLED(DUAL_X_CARRIAGE)
+#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
extern bool extruder_duplication_enabled;
#endif
-#if ENABLED(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
- #define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
- #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0)
+#if HAS_X2_ENABLE
+ #define enable_x() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0)
+ #define disable_x() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0)
#elif HAS_X_ENABLE
#define enable_x() X_ENABLE_WRITE( X_ENABLE_ON)
- #define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }
+ #define disable_x() do{ X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0)
#else
- #define enable_x() ;
- #define disable_x() ;
+ #define enable_x() NOOP
+ #define disable_x() NOOP
#endif
-#if HAS_Y_ENABLE
- #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- #define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
- #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
- #else
- #define enable_y() Y_ENABLE_WRITE( Y_ENABLE_ON)
- #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
- #endif
+#if HAS_Y2_ENABLE
+ #define enable_y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0)
+ #define disable_y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0)
+#elif HAS_Y_ENABLE
+ #define enable_y() Y_ENABLE_WRITE( Y_ENABLE_ON)
+ #define disable_y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0)
#else
- #define enable_y() ;
- #define disable_y() ;
+ #define enable_y() NOOP
+ #define disable_y() NOOP
#endif
-#if HAS_Z_ENABLE
- #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
- #define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
- #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
- #else
- #define enable_z() Z_ENABLE_WRITE( Z_ENABLE_ON)
- #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
- #endif
+#if HAS_Z2_ENABLE
+ #define enable_z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0)
+ #define disable_z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0)
+#elif HAS_Z_ENABLE
+ #define enable_z() Z_ENABLE_WRITE( Z_ENABLE_ON)
+ #define disable_z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0)
#else
- #define enable_z() ;
- #define disable_z() ;
+ #define enable_z() NOOP
+ #define disable_z() NOOP
#endif
-#if HAS_E0_ENABLE
- #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON)
- #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define enable_e0() /* nothing */
- #define disable_e0() /* nothing */
-#endif
+#if ENABLED(MIXING_EXTRUDER)
+
+ /**
+ * Mixing steppers synchronize their enable (and direction) together
+ */
+ #if MIXING_STEPPERS > 3
+ #define enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); }
+ #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); }
+ #elif MIXING_STEPPERS > 2
+ #define enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); }
+ #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); }
+ #else
+ #define enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); }
+ #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); }
+ #endif
+ #define enable_e1() NOOP
+ #define disable_e1() NOOP
+ #define enable_e2() NOOP
+ #define disable_e2() NOOP
+ #define enable_e3() NOOP
+ #define disable_e3() NOOP
+
+#else // !MIXING_EXTRUDER
+
+ #if HAS_E0_ENABLE
+ #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON)
+ #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
+ #else
+ #define enable_e0() NOOP
+ #define disable_e0() NOOP
+ #endif
-#if (EXTRUDERS > 1) && HAS_E1_ENABLE
- #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON)
- #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define enable_e1() /* nothing */
- #define disable_e1() /* nothing */
-#endif
+ #if E_STEPPERS > 1 && HAS_E1_ENABLE
+ #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON)
+ #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
+ #else
+ #define enable_e1() NOOP
+ #define disable_e1() NOOP
+ #endif
-#if (EXTRUDERS > 2) && HAS_E2_ENABLE
- #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON)
- #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define enable_e2() /* nothing */
- #define disable_e2() /* nothing */
-#endif
+ #if E_STEPPERS > 2 && HAS_E2_ENABLE
+ #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON)
+ #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
+ #else
+ #define enable_e2() NOOP
+ #define disable_e2() NOOP
+ #endif
-#if (EXTRUDERS > 3) && HAS_E3_ENABLE
- #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON)
- #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define enable_e3() /* nothing */
- #define disable_e3() /* nothing */
-#endif
+ #if E_STEPPERS > 3 && HAS_E3_ENABLE
+ #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON)
+ #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
+ #else
+ #define enable_e3() NOOP
+ #define disable_e3() NOOP
+ #endif
-/**
- * The axis order in all axis related arrays is X, Y, Z, E
- */
-#define NUM_AXIS 4
+#endif // !MIXING_EXTRUDER
/**
- * Axis indices as enumerated constants
- *
- * A_AXIS and B_AXIS are used by COREXY printers
- * 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.
+ * The axis order in all axis related arrays is X, Y, Z, E
*/
-enum AxisEnum {X_AXIS = 0, A_AXIS = 0, Y_AXIS = 1, B_AXIS = 1, Z_AXIS = 2, C_AXIS = 2, E_AXIS = 3, X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 5};
-
#define _AXIS(AXIS) AXIS ##_AXIS
void enable_all_steppers();
@@ -224,29 +224,14 @@ void FlushSerialRequestResend();
void ok_to_send();
void reset_bed_level();
-void prepare_move();
void kill(const char*);
-#if DISABLED(DELTA) && DISABLED(SCARA)
- void set_current_position_from_planner();
-#endif
+void quickstop_stepper();
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
void handle_filament_runout();
#endif
-/**
- * Debug flags - not yet widely applied
- */
-enum DebugFlags {
- DEBUG_NONE = 0,
- DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed
- DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output
- DEBUG_ERRORS = _BV(2), ///< Not implemented
- DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands
- DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
- DEBUG_LEVELING = _BV(5) ///< Print detailed output for homing and leveling
-};
extern uint8_t marlin_debug_flags;
#define DEBUGGING(F) (marlin_debug_flags & (DEBUG_## F))
@@ -268,29 +253,47 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
void setPwmFrequency(uint8_t pin, int val);
#endif
-#ifndef CRITICAL_SECTION_START
- #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
- #define CRITICAL_SECTION_END SREG = _sreg;
-#endif
+/**
+ * Feedrate scaling and conversion
+ */
+extern int feedrate_percentage;
+
+#define MMM_TO_MMS(MM_M) ((MM_M)/60.0)
+#define MMS_TO_MMM(MM_S) ((MM_S)*60.0)
+#define MMM_SCALED(MM_M) ((MM_M)*feedrate_percentage*0.01)
+#define MMS_SCALED(MM_S) MMM_SCALED(MM_S)
+#define MMM_TO_MMS_SCALED(MM_M) (MMS_SCALED(MMM_TO_MMS(MM_M)))
extern bool axis_relative_modes[];
-extern int feedrate_multiplier;
extern bool volumetric_enabled;
extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
-extern float current_position[NUM_AXIS];
-extern float home_offset[3]; // axis[n].home_offset
-extern float sw_endstop_min[3]; // axis[n].sw_endstop_min
-extern float sw_endstop_max[3]; // axis[n].sw_endstop_max
extern bool axis_known_position[3]; // axis[n].is_known
extern bool axis_homed[3]; // axis[n].is_homed
+extern volatile bool wait_for_heatup;
+
+extern float current_position[NUM_AXIS];
+extern float position_shift[3];
+extern float home_offset[3];
+extern float sw_endstop_min[3];
+extern float sw_endstop_max[3];
+
+#define LOGICAL_POSITION(POS, AXIS) (POS + home_offset[AXIS] + position_shift[AXIS])
+#define RAW_POSITION(POS, AXIS) (POS - home_offset[AXIS] - position_shift[AXIS])
+#define LOGICAL_X_POSITION(POS) LOGICAL_POSITION(POS, X_AXIS)
+#define LOGICAL_Y_POSITION(POS) LOGICAL_POSITION(POS, Y_AXIS)
+#define LOGICAL_Z_POSITION(POS) LOGICAL_POSITION(POS, Z_AXIS)
+#define RAW_X_POSITION(POS) RAW_POSITION(POS, X_AXIS)
+#define RAW_Y_POSITION(POS) RAW_POSITION(POS, Y_AXIS)
+#define RAW_Z_POSITION(POS) RAW_POSITION(POS, Z_AXIS)
+#define RAW_CURRENT_POSITION(AXIS) RAW_POSITION(current_position[AXIS], AXIS)
// GCode support for external objects
bool code_seen(char);
-float code_value();
-long code_value_long();
-int16_t code_value_short();
+int code_value_int();
+float code_value_temp_abs();
+float code_value_temp_diff();
#if ENABLED(DELTA)
extern float delta[3];
@@ -301,23 +304,24 @@ int16_t code_value_short();
extern float delta_diagonal_rod_trim_tower_1;
extern float delta_diagonal_rod_trim_tower_2;
extern float delta_diagonal_rod_trim_tower_3;
- void calculate_delta(float cartesian[3]);
+ void inverse_kinematics(const float cartesian[3]);
void recalc_delta_settings(float radius, float diagonal_rod);
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
extern int delta_grid_spacing[2];
void adjust_delta(float cartesian[3]);
#endif
#elif ENABLED(SCARA)
+ extern float delta[3];
extern float axis_scaling[3]; // Build size scaling
- void calculate_delta(float cartesian[3]);
- void calculate_SCARA_forward_Transform(float f_scara[3]);
+ void inverse_kinematics(const float cartesian[3]);
+ void forward_kinematics_SCARA(float f_scara[3]);
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
extern float z_endstop_adj;
#endif
-#if ENABLED(AUTO_BED_LEVELING_FEATURE)
+#if HAS_BED_PROBE
extern float zprobe_zoffset;
#endif
@@ -343,15 +347,19 @@ int16_t code_value_short();
extern int meas_delay_cm; //delay distance
#endif
-#if ENABLED(PID_ADD_EXTRUSION_RATE)
+#if ENABLED(FILAMENT_CHANGE_FEATURE)
+ extern FilamentChangeMenuResponse filament_change_menu_response;
+#endif
+
+#if ENABLED(PID_EXTRUSION_SCALING)
extern int lpq_len;
#endif
#if ENABLED(FWRETRACT)
extern bool autoretract_enabled;
extern bool retracted[EXTRUDERS]; // extruder[n].retracted
- extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift;
- extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
+ extern float retract_length, retract_length_swap, retract_feedrate_mm_s, retract_zlift;
+ extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate_mm_s;
#endif
// Print job timer
@@ -368,6 +376,23 @@ extern uint8_t active_extruder;
void print_heaterstates();
#endif
+#if ENABLED(MIXING_EXTRUDER)
+ extern float mixing_factor[MIXING_STEPPERS];
+#endif
+
void calculate_volumetric_multipliers();
+// Buzzer
+#if HAS_BUZZER && PIN_EXISTS(BEEPER)
+ #include "buzzer.h"
+#endif
+
+/**
+ * Blocking movement and shorthand functions
+ */
+inline void do_blocking_move_to(float x, float y, float z, float fr_mm_m=0.0);
+inline void do_blocking_move_to_x(float x, float fr_mm_m=0.0);
+inline void do_blocking_move_to_z(float z, float fr_mm_m=0.0);
+inline void do_blocking_move_to_xy(float x, float y, float fr_mm_m=0.0);
+
#endif //MARLIN_H
diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino
index 1869d33b5..70fd8adfc 100644
--- a/Marlin/Marlin.ino
+++ b/Marlin/Marlin.ino
@@ -34,8 +34,7 @@
/* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */
/* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */
-#include "Configuration.h"
-#include "pins.h"
+#include "MarlinConfig.h"
#if ENABLED(ULTRA_LCD)
#if ENABLED(LCD_I2C_TYPE_PCF8575)
diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h
new file mode 100644
index 000000000..64e0bac51
--- /dev/null
+++ b/Marlin/MarlinConfig.h
@@ -0,0 +1,41 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef MARLIN_CONFIG_H
+#define MARLIN_CONFIG_H
+
+#include "fastio.h"
+#include "macros.h"
+#include "boards.h"
+#include "Version.h"
+#include "Configuration.h"
+#include "Conditionals_LCD.h"
+#include "Configuration_adv.h"
+#include "pins.h"
+#ifndef USBCON
+ #define HardwareSerial_h // trick to disable the standard HWserial
+#endif
+#include "Arduino.h"
+#include "Conditionals_post.h"
+#include "SanityCheck.h"
+
+#endif // MARLIN_CONFIG_H
diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp
index e6362fc7c..9ef900265 100644
--- a/Marlin/MarlinSerial.cpp
+++ b/Marlin/MarlinSerial.cpp
@@ -21,25 +21,34 @@
*/
/**
- HardwareSerial.cpp - Hardware serial library for Wiring
+ MarlinSerial.cpp - Hardware serial library for Wiring
Copyright (c) 2006 Nicholas Zambetti. All right reserved.
Modified 23 November 2006 by David A. Mellis
Modified 28 September 2010 by Mark Sproul
+ Modified 14 February 2016 by Andreas Hardtung (added tx buffer)
*/
-#include "Marlin.h"
#include "MarlinSerial.h"
+#include "stepper.h"
+
+#include "Marlin.h"
+
#ifndef USBCON
// this next line disables the entire HardwareSerial.cpp,
// this is so I can support Attiny series and any other chip without a UART
#if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
#if UART_PRESENT(SERIAL_PORT)
- ring_buffer rx_buffer = { { 0 }, 0, 0 };
+ ring_buffer_r rx_buffer = { { 0 }, 0, 0 };
+ #if TX_BUFFER_SIZE > 0
+ ring_buffer_t tx_buffer = { { 0 }, 0, 0 };
+ static bool _written;
+ #endif
#endif
+
FORCE_INLINE void store_char(unsigned char c) {
CRITICAL_SECTION_START;
uint8_t h = rx_buffer.head;
@@ -54,14 +63,44 @@ FORCE_INLINE void store_char(unsigned char c) {
rx_buffer.head = i;
}
CRITICAL_SECTION_END;
+
+ #if ENABLED(EMERGENCY_PARSER)
+ emergency_parser(c);
+ #endif
}
+#if TX_BUFFER_SIZE > 0
+ FORCE_INLINE void _tx_udr_empty_irq(void)
+ {
+ // If interrupts are enabled, there must be more data in the output
+ // buffer. Send the next byte
+ uint8_t t = tx_buffer.tail;
+ uint8_t c = tx_buffer.buffer[t];
+ tx_buffer.tail = (t + 1) & (TX_BUFFER_SIZE - 1);
+
+ M_UDRx = c;
+
+ // clear the TXC bit -- "can be cleared by writing a one to its bit
+ // location". This makes sure flush() won't return until the bytes
+ // actually got written
+ SBI(M_UCSRxA, M_TXCx);
+
+ if (tx_buffer.head == tx_buffer.tail) {
+ // Buffer empty, so disable interrupts
+ CBI(M_UCSRxB, M_UDRIEx);
+ }
+ }
+
+ #if defined(M_USARTx_UDRE_vect)
+ ISR(M_USARTx_UDRE_vect) {
+ _tx_udr_empty_irq();
+ }
+ #endif
+
+#endif
-//#elif defined(SIG_USART_RECV)
#if defined(M_USARTx_RX_vect)
- // fixed by Mark Sproul this is on the 644/644p
- //SIGNAL(SIG_USART_RECV)
- SIGNAL(M_USARTx_RX_vect) {
+ ISR(M_USARTx_RX_vect) {
unsigned char c = M_UDRx;
store_char(c);
}
@@ -102,14 +141,25 @@ void MarlinSerial::begin(long baud) {
SBI(M_UCSRxB, M_RXENx);
SBI(M_UCSRxB, M_TXENx);
SBI(M_UCSRxB, M_RXCIEx);
+ #if TX_BUFFER_SIZE > 0
+ CBI(M_UCSRxB, M_UDRIEx);
+ _written = false;
+ #endif
}
void MarlinSerial::end() {
CBI(M_UCSRxB, M_RXENx);
CBI(M_UCSRxB, M_TXENx);
CBI(M_UCSRxB, M_RXCIEx);
+ CBI(M_UCSRxB, M_UDRIEx);
}
+void MarlinSerial::checkRx(void) {
+ if (TEST(M_UCSRxA, M_RXCx)) {
+ uint8_t c = M_UDRx;
+ store_char(c);
+ }
+}
int MarlinSerial::peek(void) {
int v;
@@ -140,7 +190,16 @@ int MarlinSerial::read(void) {
return v;
}
-void MarlinSerial::flush() {
+uint8_t MarlinSerial::available(void) {
+ CRITICAL_SECTION_START;
+ uint8_t h = rx_buffer.head;
+ uint8_t t = rx_buffer.tail;
+ CRITICAL_SECTION_END;
+ return (uint8_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1);
+}
+
+void MarlinSerial::flush(void) {
+ // RX
// don't reverse this or there may be problems if the RX interrupt
// occurs after reading the value of rx_buffer_head but before writing
// the value to rx_buffer_tail; the previous value of rx_buffer_head
@@ -151,6 +210,86 @@ void MarlinSerial::flush() {
CRITICAL_SECTION_END;
}
+#if TX_BUFFER_SIZE > 0
+ uint8_t MarlinSerial::availableForWrite(void) {
+ CRITICAL_SECTION_START;
+ uint8_t h = tx_buffer.head;
+ uint8_t t = tx_buffer.tail;
+ CRITICAL_SECTION_END;
+ return (uint8_t)(TX_BUFFER_SIZE + h - t) & (TX_BUFFER_SIZE - 1);
+ }
+
+ void MarlinSerial::write(uint8_t c) {
+ _written = true;
+ CRITICAL_SECTION_START;
+ bool emty = (tx_buffer.head == tx_buffer.tail);
+ CRITICAL_SECTION_END;
+ // If the buffer and the data register is empty, just write the byte
+ // to the data register and be done. This shortcut helps
+ // significantly improve the effective datarate at high (>
+ // 500kbit/s) bitrates, where interrupt overhead becomes a slowdown.
+ if (emty && TEST(M_UCSRxA, M_UDREx)) {
+ CRITICAL_SECTION_START;
+ M_UDRx = c;
+ SBI(M_UCSRxA, M_TXCx);
+ CRITICAL_SECTION_END;
+ return;
+ }
+ uint8_t i = (tx_buffer.head + 1) & (TX_BUFFER_SIZE - 1);
+
+ // If the output buffer is full, there's nothing for it other than to
+ // wait for the interrupt handler to empty it a bit
+ while (i == tx_buffer.tail) {
+ if (!TEST(SREG, SREG_I)) {
+ // Interrupts are disabled, so we'll have to poll the data
+ // register empty flag ourselves. If it is set, pretend an
+ // interrupt has happened and call the handler to free up
+ // space for us.
+ if (TEST(M_UCSRxA, M_UDREx))
+ _tx_udr_empty_irq();
+ } else {
+ // nop, the interrupt handler will free up space for us
+ }
+ }
+
+ tx_buffer.buffer[tx_buffer.head] = c;
+ { CRITICAL_SECTION_START;
+ tx_buffer.head = i;
+ SBI(M_UCSRxB, M_UDRIEx);
+ CRITICAL_SECTION_END;
+ }
+ return;
+ }
+
+ void MarlinSerial::flushTX(void) {
+ // TX
+ // If we have never written a byte, no need to flush. This special
+ // case is needed since there is no way to force the TXC (transmit
+ // complete) bit to 1 during initialization
+ if (!_written)
+ return;
+
+ while (TEST(M_UCSRxB, M_UDRIEx) || !TEST(M_UCSRxA, M_TXCx)) {
+ if (!TEST(SREG, SREG_I) && TEST(M_UCSRxB, M_UDRIEx))
+ // Interrupts are globally disabled, but the DR empty
+ // interrupt should be enabled, so poll the DR empty flag to
+ // prevent deadlock
+ if (TEST(M_UCSRxA, M_UDREx))
+ _tx_udr_empty_irq();
+ }
+ // If we get here, nothing is queued anymore (DRIE is disabled) and
+ // the hardware finished tranmission (TXC is set).
+}
+
+#else
+ void MarlinSerial::write(uint8_t c) {
+ while (!TEST(M_UCSRxA, M_UDREx))
+ ;
+ M_UDRx = c;
+ }
+#endif
+
+// end NEW
/// imports from print.h
@@ -310,3 +449,91 @@ MarlinSerial customizedSerial;
#if defined(USBCON) && ENABLED(BLUETOOTH)
HardwareSerial bluetoothSerial;
#endif
+
+#if ENABLED(EMERGENCY_PARSER)
+
+ // Currently looking for: M108, M112, M410
+ // If you alter the parser please don't forget to update the capabilities in Conditionals_post.h
+
+ FORCE_INLINE void emergency_parser(unsigned char c) {
+
+ static e_parser_state state = state_RESET;
+
+ switch (state) {
+ case state_RESET:
+ switch (c) {
+ case ' ': break;
+ case 'N': state = state_N; break;
+ case 'M': state = state_M; break;
+ default: state = state_IGNORE;
+ }
+ break;
+
+ case state_N:
+ switch (c) {
+ case '0': case '1': case '2':
+ case '3': case '4': case '5':
+ case '6': case '7': case '8':
+ case '9': case '-': case ' ': break;
+ case 'M': state = state_M; break;
+ default: state = state_IGNORE;
+ }
+ break;
+
+ case state_M:
+ switch (c) {
+ case ' ': break;
+ case '1': state = state_M1; break;
+ case '4': state = state_M4; break;
+ default: state = state_IGNORE;
+ }
+ break;
+
+ case state_M1:
+ switch (c) {
+ case '0': state = state_M10; break;
+ case '1': state = state_M11; break;
+ default: state = state_IGNORE;
+ }
+ break;
+
+ case state_M10:
+ state = (c == '8') ? state_M108 : state_IGNORE;
+ break;
+
+ case state_M11:
+ state = (c == '2') ? state_M112 : state_IGNORE;
+ break;
+
+ case state_M4:
+ state = (c == '1') ? state_M41 : state_IGNORE;
+ break;
+
+ case state_M41:
+ state = (c == '0') ? state_M410 : state_IGNORE;
+ break;
+
+ case state_IGNORE:
+ if (c == '\n') state = state_RESET;
+ break;
+
+ default:
+ if (c == '\n') {
+ switch (state) {
+ case state_M108:
+ wait_for_heatup = false;
+ break;
+ case state_M112:
+ kill(PSTR(MSG_KILLED));
+ break;
+ case state_M410:
+ quickstop_stepper();
+ break;
+ default:
+ break;
+ }
+ state = state_RESET;
+ }
+ }
+ }
+#endif
diff --git a/Marlin/MarlinSerial.h b/Marlin/MarlinSerial.h
index 34d234615..e76175228 100644
--- a/Marlin/MarlinSerial.h
+++ b/Marlin/MarlinSerial.h
@@ -21,21 +21,18 @@
*/
/**
- HardwareSerial.h - Hardware serial library for Wiring
+ MarlinSerial.h - Hardware serial library for Wiring
Copyright (c) 2006 Nicholas Zambetti. All right reserved.
Modified 28 September 2010 by Mark Sproul
+ Modified 14 February 2016 by Andreas Hardtung (added tx buffer)
+
*/
#ifndef MarlinSerial_h
#define MarlinSerial_h
-#include "Marlin.h"
-
-#ifndef CRITICAL_SECTION_START
- #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
- #define CRITICAL_SECTION_END SREG = _sreg;
-#endif
+#include "MarlinConfig.h"
#ifndef SERIAL_PORT
#define SERIAL_PORT 0
@@ -61,14 +58,17 @@
#define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,B)
#define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,)
#define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,)
+#define M_TXCx SERIAL_REGNAME(TXC,SERIAL_PORT,)
#define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,)
#define M_UDREx SERIAL_REGNAME(UDRE,SERIAL_PORT,)
+#define M_UDRIEx SERIAL_REGNAME(UDRIE,SERIAL_PORT,)
#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,)
#define M_UBRRxH SERIAL_REGNAME(UBRR,SERIAL_PORT,H)
#define M_UBRRxL SERIAL_REGNAME(UBRR,SERIAL_PORT,L)
#define M_RXCx SERIAL_REGNAME(RXC,SERIAL_PORT,)
#define M_USARTx_RX_vect SERIAL_REGNAME(USART,SERIAL_PORT,_RX_vect)
#define M_U2Xx SERIAL_REGNAME(U2X,SERIAL_PORT,)
+#define M_USARTx_UDRE_vect SERIAL_REGNAME(USART,SERIAL_PORT,_UDRE_vect)
#define DEC 10
@@ -87,18 +87,40 @@
#ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 128
#endif
+#ifndef TX_BUFFER_SIZE
+ #define TX_BUFFER_SIZE 32
+#endif
#if !((RX_BUFFER_SIZE == 256) ||(RX_BUFFER_SIZE == 128) ||(RX_BUFFER_SIZE == 64) ||(RX_BUFFER_SIZE == 32) ||(RX_BUFFER_SIZE == 16) ||(RX_BUFFER_SIZE == 8) ||(RX_BUFFER_SIZE == 4) ||(RX_BUFFER_SIZE == 2))
#error "RX_BUFFER_SIZE has to be a power of 2 and >= 2"
#endif
+#if !((TX_BUFFER_SIZE == 256) ||(TX_BUFFER_SIZE == 128) ||(TX_BUFFER_SIZE == 64) ||(TX_BUFFER_SIZE == 32) ||(TX_BUFFER_SIZE == 16) ||(TX_BUFFER_SIZE == 8) ||(TX_BUFFER_SIZE == 4) ||(TX_BUFFER_SIZE == 2) ||(TX_BUFFER_SIZE == 0))
+ #error TX_BUFFER_SIZE has to be a power of 2 or 0
+#endif
-struct ring_buffer {
+struct ring_buffer_r {
unsigned char buffer[RX_BUFFER_SIZE];
volatile uint8_t head;
volatile uint8_t tail;
};
+#if TX_BUFFER_SIZE > 0
+ struct ring_buffer_t {
+ unsigned char buffer[TX_BUFFER_SIZE];
+ volatile uint8_t head;
+ volatile uint8_t tail;
+ };
+#endif
+
#if UART_PRESENT(SERIAL_PORT)
- extern ring_buffer rx_buffer;
+ extern ring_buffer_r rx_buffer;
+ #if TX_BUFFER_SIZE > 0
+ extern ring_buffer_t tx_buffer;
+ #endif
+#endif
+
+#if ENABLED(EMERGENCY_PARSER)
+ #include "language.h"
+ void emergency_parser(unsigned char c);
#endif
class MarlinSerial { //: public Stream
@@ -110,39 +132,13 @@ class MarlinSerial { //: public Stream
int peek(void);
int read(void);
void flush(void);
-
- FORCE_INLINE uint8_t available(void) {
- CRITICAL_SECTION_START;
- uint8_t h = rx_buffer.head;
- uint8_t t = rx_buffer.tail;
- CRITICAL_SECTION_END;
- return (uint8_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1);
- }
-
- FORCE_INLINE void write(uint8_t c) {
- while (!TEST(M_UCSRxA, M_UDREx))
- ;
- M_UDRx = c;
- }
-
- FORCE_INLINE void checkRx(void) {
- if (TEST(M_UCSRxA, M_RXCx)) {
- unsigned char c = M_UDRx;
- CRITICAL_SECTION_START;
- uint8_t h = rx_buffer.head;
- uint8_t i = (uint8_t)(h + 1) & (RX_BUFFER_SIZE - 1);
-
- // if we should be storing the received character into the location
- // just before the tail (meaning that the head would advance to the
- // current location of the tail), we're about to overflow the buffer
- // and so we don't write the character or advance the head.
- if (i != rx_buffer.tail) {
- rx_buffer.buffer[h] = c;
- rx_buffer.head = i;
- }
- CRITICAL_SECTION_END;
- }
- }
+ uint8_t available(void);
+ void checkRx(void);
+ void write(uint8_t c);
+ #if TX_BUFFER_SIZE > 0
+ uint8_t availableForWrite(void);
+ void flushTX(void);
+ #endif
private:
void printNumber(unsigned long, uint8_t);
diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index 1feb42d7a..84493cf92 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -59,7 +59,9 @@
#include "language.h"
#include "pins_arduino.h"
#include "math.h"
-#include "buzzer.h"
+#include "nozzle.h"
+#include "duration_t.h"
+#include "types.h"
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"
@@ -107,8 +109,11 @@
* G3 - CCW ARC
* G4 - Dwell S or P
* G5 - Cubic B-spline with XYZE destination and IJPQ offsets
- * G10 - retract filament according to settings of M207
- * G11 - retract recover filament according to settings of M208
+ * G10 - Retract filament according to settings of M207
+ * G11 - Retract recover filament according to settings of M208
+ * G12 - Clean tool
+ * G20 - Set input units to inches
+ * G21 - Set input units to millimeters
* G28 - Home one or more axes
* G29 - Detailed Z probe, probes the bed at 3 or more points. Will fail if you haven't homed yet.
* G30 - Single Z probe, probes bed at current XY location.
@@ -154,16 +159,17 @@
* M84 - Disable steppers until next move,
* or use S to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout.
* M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default)
- * M92 - Set planner.axis_steps_per_unit - same syntax as G92
+ * M92 - Set planner.axis_steps_per_mm - same syntax as G92
* M104 - Set extruder target temp
* M105 - Read current temp
* M106 - Fan on
* M107 - Fan off
+ * M108 - Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature.
* M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
* Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
* IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F
* M110 - Set the current line number
- * M111 - Set debug flags with S. See flag bits defined in Marlin.h.
+ * M111 - Set debug flags with S. See flag bits defined in enum.h.
* M112 - Emergency stop
* M113 - Get or set the timeout interval for Host Keepalive "busy" messages
* M114 - Output current position to serial port
@@ -178,22 +184,30 @@
* M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
* M140 - Set bed target temp
* M145 - Set the heatup state H B F for S (0=PLA, 1=ABS)
+ * M149 - Set temperature units
* M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work.
+ * M163 - Set a single proportion for a mixing extruder. Requires MIXING_EXTRUDER.
+ * M164 - Save the mix as a virtual extruder. Requires MIXING_EXTRUDER and MIXING_VIRTUAL_TOOLS.
+ * M165 - Set the proportions for a mixing extruder. Use parameters ABCDHI to set the mixing factors. Requires MIXING_EXTRUDER.
* M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
* Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
- * M200 - set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).:D-
+ * M200 - Set filament diameter, D, setting E axis units to cubic. (Use S0 to revert to linear units.)
* M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
* M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
- * M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
- * M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2
- * M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
+ * M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec
+ * M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in units/sec^2
+ * M205 - Set advanced settings. Current units apply:
+ S T minimum speeds
+ B
+ X, Z, E
* M206 - Set additional homing offset
- * M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
- * M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
- * M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
- * M218 - Set hotend offset (in mm): T X Y
- * M220 - Set speed factor override percentage: S
- * M221 - Set extrude factor override percentage: S
+ * M207 - Set Retract Length: S, Feedrate: F, and Z lift: Z
+ * M208 - Set Recover (unretract) Additional (!) Length: S and Feedrate: F
+ * M209 - Turn Automatic Retract Detection on/off: S (For slicers that don't support G10/11).
+ Every normal extrude-only move will be classified as retract depending on the direction.
+ * M218 - Set a tool offset: T X Y
+ * M220 - Set Feedrate Percentage: S ("FR" on your LCD)
+ * M221 - Set Flow Percentage: S
* M226 - Wait until the specified pin reaches the state required: P S
* M240 - Trigger a camera to take a photograph
* M250 - Set LCD contrast C (value 0..63)
@@ -208,13 +222,13 @@
* M400 - Finish all moves
* M401 - Lower Z probe if present
* M402 - Raise Z probe if present
- * M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
- * M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder
- * M406 - Turn off Filament Sensor extrusion control
- * M407 - Display measured filament diameter
+ * M404 - Display or set the Nominal Filament Width: [ N ]
+ * M405 - Enable Filament Sensor extrusion control. Optional delay between sensor and extruder: D
+ * M406 - Disable Filament Sensor extrusion control
+ * M407 - Display measured filament diameter in millimeters
* M410 - Quickstop. Abort all the planned moves
* M420 - Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable
- * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z
+ * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z
* M428 - Set the home_offset logically based on the current_position
* M500 - Store parameters in EEPROM
* M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily).
@@ -225,6 +239,7 @@
* M665 - Set delta configurations: L R S
* M666 - Set delta endstop adjustment
* M605 - Set dual x-carriage movement mode: S [ X R ]
+ * M851 - Set Z probe's Z offset in current units. (Negative values apply to probes that extend below the nozzle.)
* M907 - Set digital trimpot motor current using axis codes.
* M908 - Control digital trimpot directly.
* M909 - DAC_STEPPER_CURRENT: Print digipot/DAC current value
@@ -243,15 +258,12 @@
*
* ************ Custom codes - This can change to suit future G-code regulations
* M100 - Watch Free Memory (For Debugging Only)
- * M851 - Set Z probe's Z offset (mm above extruder -- The value will always be negative)
-
-
* M928 - Start SD logging (M928 filename.g) - ended by M29
* M999 - Restart after being stopped by error
*
* "T" Codes
*
- * T0-T3 - Select a tool by index (usually an extruder) [ F ]
+ * T0-T3 - Select a tool by index (usually an extruder) [ F ]
*
*/
@@ -271,7 +283,6 @@ bool Running = true;
uint8_t marlin_debug_flags = DEBUG_NONE;
-static float feedrate = 1500.0, saved_feedrate;
float current_position[NUM_AXIS] = { 0.0 };
static float destination[NUM_AXIS] = { 0.0 };
bool axis_known_position[3] = { false };
@@ -279,16 +290,36 @@ bool axis_homed[3] = { false };
static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0;
-static char* current_command, *current_command_args;
-static int cmd_queue_index_r = 0;
-static int cmd_queue_index_w = 0;
-static int commands_in_queue = 0;
static char command_queue[BUFSIZE][MAX_CMD_SIZE];
+static char* current_command, *current_command_args;
+static uint8_t cmd_queue_index_r = 0,
+ cmd_queue_index_w = 0,
+ commands_in_queue = 0;
+
+#if ENABLED(INCH_MODE_SUPPORT)
+ float linear_unit_factor = 1.0;
+ float volumetric_unit_factor = 1.0;
+#endif
+#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
+ TempUnit input_temp_units = TEMPUNIT_C;
+#endif
+
+/**
+ * Feed rates are often configured with mm/m
+ * but the planner and stepper like mm/s units.
+ */
+const float homing_feedrate_mm_m[] = {
+ #if ENABLED(DELTA)
+ HOMING_FEEDRATE_Z, HOMING_FEEDRATE_Z,
+ #else
+ HOMING_FEEDRATE_XY, HOMING_FEEDRATE_XY,
+ #endif
+ HOMING_FEEDRATE_Z, 0
+};
+static float feedrate_mm_m = 1500.0, saved_feedrate_mm_m;
+int feedrate_percentage = 100, saved_feedrate_percentage;
-const float homing_feedrate[] = HOMING_FEEDRATE;
bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
-int feedrate_multiplier = 100; //100->1 200->2
-int saved_feedrate_multiplier;
int extruder_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
bool volumetric_enabled = false;
float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA);
@@ -315,7 +346,7 @@ uint8_t active_extruder = 0;
// Relative Mode. Enable with G91, disable with G90.
static bool relative_mode = false;
-bool cancel_heatup = false;
+volatile bool wait_for_heatup = true;
const char errormagic[] PROGMEM = "Error:";
const char echomagic[] PROGMEM = "echo:";
@@ -323,7 +354,7 @@ const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
static int serial_count = 0;
-// GCode parameter pointer used by code_seen(), code_value(), etc.
+// GCode parameter pointer used by code_seen(), code_value_float(), etc.
static char* seen_pointer;
// Next Immediate GCode Command pointer. NULL if none.
@@ -343,12 +374,32 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL
Stopwatch print_job_timer = Stopwatch();
#endif
+// Buzzer - I2C on the LCD or a BEEPER_PIN
+#if ENABLED(LCD_USE_I2C_BUZZER)
+ #define BUZZ(d,f) lcd_buzz(d, f)
+#elif HAS_BUZZER
+ Buzzer buzzer;
+ #define BUZZ(d,f) buzzer.tone(d, f)
+#else
+ #define BUZZ(d,f) NOOP
+#endif
+
static uint8_t target_extruder;
-#if ENABLED(AUTO_BED_LEVELING_FEATURE)
- int xy_travel_speed = XY_TRAVEL_SPEED;
+#if HAS_BED_PROBE
float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
+#endif
+
+#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]))
+
+#if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ int xy_probe_feedrate_mm_m = XY_PROBE_SPEED;
bool bed_leveling_in_progress = false;
+ #define XY_PROBE_FEEDRATE_MM_M xy_probe_feedrate_mm_m
+#elif defined(XY_PROBE_SPEED)
+ #define XY_PROBE_FEEDRATE_MM_M XY_PROBE_SPEED
+#else
+ #define XY_PROBE_FEEDRATE_MM_M MMS_TO_MMM(PLANNER_XY_FEEDRATE())
#endif
#if ENABLED(Z_DUAL_ENDSTOPS) && DISABLED(DELTA)
@@ -356,25 +407,18 @@ static uint8_t target_extruder;
#endif
// Extruder offsets
-#if EXTRUDERS > 1
- #ifndef EXTRUDER_OFFSET_X
- #define EXTRUDER_OFFSET_X { 0 } // X offsets for each extruder
- #endif
- #ifndef EXTRUDER_OFFSET_Y
- #define EXTRUDER_OFFSET_Y { 0 } // Y offsets for each extruder
- #endif
- float extruder_offset[][EXTRUDERS] = {
- EXTRUDER_OFFSET_X,
- EXTRUDER_OFFSET_Y
- #if ENABLED(DUAL_X_CARRIAGE)
- , { 0 } // Z offsets for each extruder
+#if HOTENDS > 1
+ float hotend_offset[][HOTENDS] = {
+ HOTEND_OFFSET_X,
+ HOTEND_OFFSET_Y
+ #ifdef HOTEND_OFFSET_Z
+ , HOTEND_OFFSET_Z
#endif
};
#endif
-#if HAS_SERVO_ENDSTOPS
- const int servo_endstop_id[] = SERVO_ENDSTOP_IDS;
- const int servo_endstop_angle[][2] = SERVO_ENDSTOP_ANGLES;
+#if HAS_Z_SERVO_ENDSTOP
+ const int z_servo_angle[2] = Z_SERVO_ANGLES;
#endif
#if ENABLED(BARICUDA)
@@ -390,11 +434,11 @@ static uint8_t target_extruder;
float retract_length = RETRACT_LENGTH;
float retract_length_swap = RETRACT_LENGTH_SWAP;
- float retract_feedrate = RETRACT_FEEDRATE;
+ float retract_feedrate_mm_s = RETRACT_FEEDRATE;
float retract_zlift = RETRACT_ZLIFT;
float retract_recover_length = RETRACT_RECOVER_LENGTH;
float retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
- float retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
+ float retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE;
#endif // FWRETRACT
@@ -414,7 +458,8 @@ static uint8_t target_extruder;
#define TOWER_2 Y_AXIS
#define TOWER_3 Z_AXIS
- float delta[3] = { 0 };
+ float delta[3];
+ float cartesian_position[3] = { 0 };
#define SIN_60 0.8660254037844386
#define COS_60 0.5
float endstop_adj[3] = { 0 };
@@ -433,19 +478,20 @@ static uint8_t target_extruder;
float delta_diagonal_rod_2_tower_1 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_1);
float delta_diagonal_rod_2_tower_2 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_2);
float delta_diagonal_rod_2_tower_3 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_3);
- //float delta_diagonal_rod_2 = sq(delta_diagonal_rod);
float delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
+ float delta_clip_start_height = Z_MAX_POS;
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
int delta_grid_spacing[2] = { 0, 0 };
float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS];
#endif
+ float delta_safe_distance_from_top();
#else
static bool home_all_axis = true;
#endif
#if ENABLED(SCARA)
float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND;
- static float delta[3] = { 0 };
+ float delta[3];
float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1
#endif
@@ -464,10 +510,26 @@ static uint8_t target_extruder;
static bool filament_ran_out = false;
#endif
+#if ENABLED(FILAMENT_CHANGE_FEATURE)
+ FilamentChangeMenuResponse filament_change_menu_response;
+#endif
+
+#if ENABLED(MIXING_EXTRUDER)
+ float mixing_factor[MIXING_STEPPERS];
+ #if MIXING_VIRTUAL_TOOLS > 1
+ float mixing_virtual_tool_mix[MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS];
+ #endif
+#endif
+
static bool send_ok[BUFSIZE];
#if HAS_SERVOS
Servo servo[NUM_SERVOS];
+ #define MOVE_SERVO(I, P) servo[I].move(P)
+ #if HAS_Z_SERVO_ENDSTOP
+ #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[0])
+ #define STOW_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[1])
+ #endif
#endif
#ifdef CHDK
@@ -475,22 +537,11 @@ static bool send_ok[BUFSIZE];
boolean chdkActive = false;
#endif
-#if ENABLED(PID_ADD_EXTRUSION_RATE)
+#if ENABLED(PID_EXTRUSION_SCALING)
int lpq_len = 20;
#endif
#if ENABLED(HOST_KEEPALIVE_FEATURE)
-
- // States for managing Marlin and host communication
- // Marlin sends messages if blocked or busy
- enum MarlinBusyState {
- NOT_BUSY, // Not in a handler
- IN_HANDLER, // Processing a GCode
- IN_PROCESS, // Known to be blocking command input (as in G29)
- PAUSED_FOR_USER, // Blocking pending any input
- PAUSED_FOR_INPUT // Blocking pending text input (concept)
- };
-
static MarlinBusyState busy_state = NOT_BUSY;
static millis_t next_busy_signal_ms = 0;
uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL;
@@ -510,6 +561,8 @@ void stop();
void get_available_commands();
void process_next_command();
+void prepare_move_to_destination();
+void set_current_from_steppers_for_axis(AxisEnum axis);
#if ENABLED(ARC_SUPPORT)
void plan_arc(float target[NUM_AXIS], float* offset, uint8_t clockwise);
@@ -519,41 +572,67 @@ void process_next_command();
void plan_cubic_move(const float offset[4]);
#endif
+void serial_echopair_P(const char* s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); }
void serial_echopair_P(const char* s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_P(const char* s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_P(const char* s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_P(const char* s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
+void tool_change(const uint8_t tmp_extruder, const float fr_mm_m=0.0, bool no_move=false);
static void report_current_position();
#if ENABLED(DEBUG_LEVELING_FEATURE)
- void print_xyz(const char* prefix, const float x, const float y, const float z) {
- SERIAL_ECHO(prefix);
- SERIAL_ECHOPAIR(": (", x);
+ void print_xyz(const char* prefix, const char* suffix, const float x, const float y, const float z) {
+ serialprintPGM(prefix);
+ SERIAL_ECHOPAIR("(", x);
SERIAL_ECHOPAIR(", ", y);
SERIAL_ECHOPAIR(", ", z);
- SERIAL_ECHOLNPGM(")");
+ SERIAL_ECHOPGM(")");
+
+ if (suffix) serialprintPGM(suffix);
+ else SERIAL_EOL;
}
- void print_xyz(const char* prefix, const float xyz[]) {
- print_xyz(prefix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
+
+ void print_xyz(const char* prefix, const char* suffix, const float xyz[]) {
+ print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
}
+
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
- void print_xyz(const char* prefix, const vector_3 &xyz) {
- print_xyz(prefix, xyz.x, xyz.y, xyz.z);
+ void print_xyz(const char* prefix, const char* suffix, const vector_3 &xyz) {
+ print_xyz(prefix, suffix, xyz.x, xyz.y, xyz.z);
}
#endif
- #define DEBUG_POS(PREFIX,VAR) do{ SERIAL_ECHOPGM(PREFIX); print_xyz(" > " STRINGIFY(VAR), VAR); }while(0)
+
+ #define DEBUG_POS(SUFFIX,VAR) do { \
+ print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0)
#endif
+/**
+ * sync_plan_position
+ * Set planner / stepper positions to the cartesian current_position.
+ * The stepper code translates these coordinates into step units.
+ * Allows translation between steps and millimeters for cartesian & core robots
+ */
+inline void sync_plan_position() {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position);
+ #endif
+ planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
+}
+inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); }
+
#if ENABLED(DELTA) || ENABLED(SCARA)
inline void sync_plan_position_delta() {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_delta", current_position);
#endif
- calculate_delta(current_position);
+ inverse_kinematics(current_position);
planner.set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
}
+ #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position_delta()
+#else
+ #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position()
#endif
#if ENABLED(SDSUPPORT)
@@ -663,14 +742,16 @@ void setup_killpin() {
#endif
}
-void setup_filrunoutpin() {
- #if HAS_FILRUNOUT
- pinMode(FILRUNOUT_PIN, INPUT);
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
+
+ void setup_filrunoutpin() {
+ pinMode(FIL_RUNOUT_PIN, INPUT);
#if ENABLED(ENDSTOPPULLUP_FIL_RUNOUT)
- WRITE(FILRUNOUT_PIN, HIGH);
+ WRITE(FIL_RUNOUT_PIN, HIGH);
#endif
- #endif
-}
+ }
+
+#endif
// Set home pin
void setup_homepin(void) {
@@ -724,14 +805,9 @@ void servo_init() {
servo[3].detach();
#endif
- #if HAS_SERVO_ENDSTOPS
-
- endstops.enable_z_probe(false);
-
+ #if HAS_Z_SERVO_ENDSTOP
/**
- * Set position of all defined Servo Endstops
- *
- * ** UNSAFE! - NEEDS UPDATE! **
+ * Set position of Z Servo Endstop
*
* The servo might be deployed and positioned too low to stow
* when starting up the machine or rebooting the board.
@@ -739,12 +815,12 @@ void servo_init() {
* homing has been done - no homing with z-probe without init!
*
*/
- for (int i = 0; i < 3; i++)
- if (servo_endstop_id[i] >= 0)
- servo[servo_endstop_id[i]].move(servo_endstop_angle[i][1]);
-
- #endif // HAS_SERVO_ENDSTOPS
+ STOW_Z_SERVO();
+ #endif
+ #if HAS_BED_PROBE
+ endstops.enable_z_probe(false);
+ #endif
}
/**
@@ -784,8 +860,12 @@ void setup() {
MCUCR = 0x80;
#endif
+ #if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ setup_filrunoutpin();
+ #endif
+
setup_killpin();
- setup_filrunoutpin();
+
setup_powerhold();
#if HAS_STEPPER_RESET
@@ -829,17 +909,17 @@ void setup() {
// Send "ok" after commands by default
for (int8_t i = 0; i < BUFSIZE; i++) send_ok[i] = true;
- // loads data from EEPROM if available else uses defaults (and resets step acceleration rate)
+ // Load data from EEPROM if available (or use defaults)
+ // This also updates variables in the planner, elsewhere
Config_RetrieveSettings();
- lcd_init();
+ // Initialize current position based on home_offset
+ memcpy(current_position, home_offset, sizeof(home_offset));
- thermalManager.init(); // Initialize temperature loop
+ // Vital to init stepper/planner equivalent for current_position
+ SYNC_PLAN_POSITION_KINEMATIC();
- #if ENABLED(DELTA) || ENABLED(SCARA)
- // Vital to init kinematic equivalent for X0 Y0 Z0
- sync_plan_position_delta();
- #endif
+ thermalManager.init(); // Initialize temperature loop
#if ENABLED(USE_WATCHDOG)
watchdog_init();
@@ -865,7 +945,7 @@ void setup() {
dac_init();
#endif
- #if ENABLED(Z_PROBE_SLED)
+ #if ENABLED(Z_PROBE_SLED) && PIN_EXISTS(SLED)
pinMode(SLED_PIN, OUTPUT);
digitalWrite(SLED_PIN, LOW); // turn it off
#endif // Z_PROBE_SLED
@@ -881,6 +961,25 @@ void setup() {
pinMode(STAT_LED_BLUE, OUTPUT);
digitalWrite(STAT_LED_BLUE, LOW); // turn it off
#endif
+
+ lcd_init();
+ #if ENABLED(SHOW_BOOTSCREEN)
+ #if ENABLED(DOGLCD)
+ safe_delay(BOOTSCREEN_TIMEOUT);
+ #elif ENABLED(ULTRA_LCD)
+ bootscreen();
+ lcd_init();
+ #endif
+ #endif
+
+ #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
+ // Initialize mixing to 100% color 1
+ for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
+ mixing_factor[i] = (i == 0) ? 1 : 0;
+ for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS; t++)
+ for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
+ mixing_virtual_tool_mix[t][i] = mixing_factor[i];
+ #endif
}
/**
@@ -930,8 +1029,11 @@ void loop() {
#endif // SDSUPPORT
- commands_in_queue--;
- cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE;
+ // The queue may be reset by a command handler or by code invoked by idle() within a handler
+ if (commands_in_queue) {
+ --commands_in_queue;
+ cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE;
+ }
}
endstops.report_state();
idle();
@@ -1042,8 +1144,12 @@ inline void get_serial_commands() {
}
}
- // If command was e-stop process now
- if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED));
+ #if DISABLED(EMERGENCY_PARSER)
+ // If command was e-stop process now
+ if (strcmp(command, "M108") == 0) wait_for_heatup = false;
+ if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED));
+ if (strcmp(command, "M410") == 0) { quickstop_stepper(); }
+ #endif
#if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0
last_command_time = ms;
@@ -1101,17 +1207,13 @@ inline void get_serial_commands() {
) {
if (card_eof) {
SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
- print_job_timer.stop();
- char time[30];
- millis_t t = print_job_timer.duration();
- int hours = t / 60 / 60, minutes = (t / 60) % 60;
- sprintf_P(time, PSTR("%i " MSG_END_HOUR " %i " MSG_END_MINUTE), hours, minutes);
- SERIAL_ECHO_START;
- SERIAL_ECHOLN(time);
- lcd_setstatus(time, true);
card.printingHasFinished();
card.checkautostart(true);
}
+ else if (n == -1) {
+ SERIAL_ERROR_START;
+ SERIAL_ECHOLNPGM(MSG_SD_ERR_READ);
+ }
if (sd_char == '#') stop_buffering = true;
sd_comment_mode = false; //for new command
@@ -1156,7 +1258,7 @@ void get_available_commands() {
#endif
}
-bool code_has_value() {
+inline bool code_has_value() {
int i = 1;
char c = seen_pointer[i];
while (c == ' ') c = seen_pointer[++i];
@@ -1165,7 +1267,7 @@ bool code_has_value() {
return NUMERIC(c);
}
-float code_value() {
+inline float code_value_float() {
float ret;
char* e = strchr(seen_pointer, 'E');
if (e) {
@@ -1178,9 +1280,82 @@ float code_value() {
return ret;
}
-long code_value_long() { return strtol(seen_pointer + 1, NULL, 10); }
+inline unsigned long code_value_ulong() { return strtoul(seen_pointer + 1, NULL, 10); }
+
+inline long code_value_long() { return strtol(seen_pointer + 1, NULL, 10); }
+
+inline int code_value_int() { return (int)strtol(seen_pointer + 1, NULL, 10); }
+
+inline uint16_t code_value_ushort() { return (uint16_t)strtoul(seen_pointer + 1, NULL, 10); }
+
+inline uint8_t code_value_byte() { return (uint8_t)(constrain(strtol(seen_pointer + 1, NULL, 10), 0, 255)); }
+
+inline bool code_value_bool() { return code_value_byte() > 0; }
+
+#if ENABLED(INCH_MODE_SUPPORT)
+ inline void set_input_linear_units(LinearUnit units) {
+ switch (units) {
+ case LINEARUNIT_INCH:
+ linear_unit_factor = 25.4;
+ break;
+ case LINEARUNIT_MM:
+ default:
+ linear_unit_factor = 1.0;
+ break;
+ }
+ volumetric_unit_factor = pow(linear_unit_factor, 3.0);
+ }
+
+ inline float axis_unit_factor(int axis) {
+ return (axis == E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor);
+ }
+
+ inline float code_value_linear_units() { return code_value_float() * linear_unit_factor; }
+ inline float code_value_axis_units(int axis) { return code_value_float() * axis_unit_factor(axis); }
+ inline float code_value_per_axis_unit(int axis) { return code_value_float() / axis_unit_factor(axis); }
+
+#else
+
+ inline float code_value_linear_units() { return code_value_float(); }
+ inline float code_value_axis_units(int axis) { UNUSED(axis); return code_value_float(); }
+ inline float code_value_per_axis_unit(int axis) { UNUSED(axis); return code_value_float(); }
+
+#endif
+
+#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
+ inline void set_input_temp_units(TempUnit units) { input_temp_units = units; }
+
+ float code_value_temp_abs() {
+ switch (input_temp_units) {
+ case TEMPUNIT_C:
+ return code_value_float();
+ case TEMPUNIT_F:
+ return (code_value_float() - 32) * 0.5555555556;
+ case TEMPUNIT_K:
+ return code_value_float() - 272.15;
+ default:
+ return code_value_float();
+ }
+ }
+
+ float code_value_temp_diff() {
+ switch (input_temp_units) {
+ case TEMPUNIT_C:
+ case TEMPUNIT_K:
+ return code_value_float();
+ case TEMPUNIT_F:
+ return code_value_float() * 0.5555555556;
+ default:
+ return code_value_float();
+ }
+ }
+#else
+ float code_value_temp_abs() { return code_value_float(); }
+ float code_value_temp_diff() { return code_value_float(); }
+#endif
-int16_t code_value_short() { return (int16_t)strtol(seen_pointer + 1, NULL, 10); }
+FORCE_INLINE millis_t code_value_millis() { return code_value_ulong(); }
+inline millis_t code_value_millis_from_seconds() { return code_value_float() * 1000; }
bool code_seen(char code) {
seen_pointer = strchr(current_command_args, code);
@@ -1194,16 +1369,15 @@ bool code_seen(char code) {
*/
bool get_target_extruder_from_command(int code) {
if (code_seen('T')) {
- short t = code_value_short();
- if (t >= EXTRUDERS) {
+ if (code_value_byte() >= EXTRUDERS) {
SERIAL_ECHO_START;
SERIAL_CHAR('M');
SERIAL_ECHO(code);
- SERIAL_ECHOPAIR(" " MSG_INVALID_EXTRUDER " ", t);
+ SERIAL_ECHOPAIR(" " MSG_INVALID_EXTRUDER " ", code_value_byte());
SERIAL_EOL;
return true;
}
- target_extruder = t;
+ target_extruder = code_value_byte();
}
else
target_extruder = active_extruder;
@@ -1231,6 +1405,10 @@ XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH);
XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm, HOME_BUMP_MM);
XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
+#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
+ bool extruder_duplication_enabled = false; // Used in Dual X mode 2
+#endif
+
#if ENABLED(DUAL_X_CARRIAGE)
#define DXC_FULL_CONTROL_MODE 0
@@ -1241,7 +1419,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
static float x_home_pos(int extruder) {
if (extruder == 0)
- return base_home_pos(X_AXIS) + home_offset[X_AXIS];
+ return LOGICAL_X_POSITION(base_home_pos(X_AXIS));
else
/**
* In dual carriage mode the extruder offset provides an override of the
@@ -1249,7 +1427,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
* This allow soft recalibration of the second extruder offset position
* without firmware reflash (through the M218 command).
*/
- return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
+ return (hotend_offset[X_AXIS][1] > 0) ? hotend_offset[X_AXIS][1] : X2_HOME_POS;
}
static int x_home_dir(int extruder) {
@@ -1257,12 +1435,11 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
}
static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1
- static bool active_extruder_parked = false; // used in mode 1 & 2
- static float raised_parked_position[NUM_AXIS]; // used in mode 1
- static millis_t delayed_move_time = 0; // used in mode 1
+ static bool active_extruder_parked = false; // used in mode 1 & 2
+ static float raised_parked_position[NUM_AXIS]; // used in mode 1
+ static millis_t delayed_move_time = 0; // used in mode 1
static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
- static float duplicate_extruder_temp_offset = 0; // used in mode 2
- bool extruder_duplication_enabled = false; // used in mode 2
+ static float duplicate_extruder_temp_offset = 0; // used in mode 2
#endif //DUAL_X_CARRIAGE
@@ -1276,11 +1453,11 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
* at the same positions relative to the machine.
*/
static void update_software_endstops(AxisEnum axis) {
- float offs = home_offset[axis] + position_shift[axis];
+ float offs = LOGICAL_POSITION(0, axis);
#if ENABLED(DUAL_X_CARRIAGE)
if (axis == X_AXIS) {
- float dual_max_x = max(extruder_offset[X_AXIS][1], X2_MAX_POS);
+ float dual_max_x = max(hotend_offset[X_AXIS][1], X2_MAX_POS);
if (active_extruder != 0) {
sw_endstop_min[X_AXIS] = X2_MIN_POS + offs;
sw_endstop_max[X_AXIS] = dual_max_x + offs;
@@ -1299,6 +1476,23 @@ static void update_software_endstops(AxisEnum axis) {
sw_endstop_max[axis] = base_max_pos(axis) + offs;
}
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPAIR("For ", axis_codes[axis]);
+ SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]);
+ SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]);
+ SERIAL_ECHOPAIR("\n sw_endstop_min = ", sw_endstop_min[axis]);
+ SERIAL_ECHOPAIR("\n sw_endstop_max = ", sw_endstop_max[axis]);
+ SERIAL_EOL;
+ }
+ #endif
+
+ #if ENABLED(DELTA)
+ if (axis == Z_AXIS) {
+ delta_clip_start_height = sw_endstop_max[axis] - delta_safe_distance_from_top();
+ }
+ #endif
+
}
/**
@@ -1318,8 +1512,8 @@ static void set_home_offset(AxisEnum axis, float v) {
static void set_axis_is_at_home(AxisEnum axis) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("set_axis_is_at_home(", axis);
- SERIAL_ECHOLNPGM(") >>>");
+ SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis);
+ SERIAL_ECHOLNPGM(")");
}
#endif
@@ -1330,7 +1524,7 @@ static void set_axis_is_at_home(AxisEnum axis) {
if (active_extruder != 0)
current_position[X_AXIS] = x_home_pos(active_extruder);
else
- current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS];
+ current_position[X_AXIS] = LOGICAL_X_POSITION(base_home_pos(X_AXIS));
update_software_endstops(X_AXIS);
return;
}
@@ -1341,7 +1535,7 @@ static void set_axis_is_at_home(AxisEnum axis) {
if (axis == X_AXIS || axis == Y_AXIS) {
float homeposition[3];
- for (int i = 0; i < 3; i++) homeposition[i] = base_home_pos(i);
+ LOOP_XYZ(i) homeposition[i] = LOGICAL_POSITION(base_home_pos(i), i);
// SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]);
// SERIAL_ECHOPGM("homeposition[y]= "); SERIAL_ECHOLN(homeposition[1]);
@@ -1350,24 +1544,13 @@ static void set_axis_is_at_home(AxisEnum axis) {
* Works out real Homeposition angles using inverse kinematics,
* and calculates homing offset using forward kinematics
*/
- calculate_delta(homeposition);
-
- // SERIAL_ECHOPGM("base Theta= "); SERIAL_ECHO(delta[X_AXIS]);
- // SERIAL_ECHOPGM(" base Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
-
- for (int i = 0; i < 2; i++) delta[i] -= home_offset[i];
+ inverse_kinematics(homeposition);
+ forward_kinematics_SCARA(delta);
- // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(home_offset[X_AXIS]);
- // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(home_offset[Y_AXIS]);
- // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
- // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
-
- calculate_SCARA_forward_Transform(delta);
-
- // SERIAL_ECHOPGM("Delta X="); SERIAL_ECHO(delta[X_AXIS]);
+ // SERIAL_ECHOPAIR("Delta X=", delta[X_AXIS]);
// SERIAL_ECHOPGM(" Delta Y="); SERIAL_ECHOLN(delta[Y_AXIS]);
- current_position[axis] = delta[axis];
+ current_position[axis] = LOGICAL_POSITION(delta[axis], axis);
/**
* SCARA home positions are based on configuration since the actual
@@ -1379,15 +1562,15 @@ static void set_axis_is_at_home(AxisEnum axis) {
else
#endif
{
- current_position[axis] = base_home_pos(axis) + home_offset[axis];
+ current_position[axis] = LOGICAL_POSITION(base_home_pos(axis), axis);
update_software_endstops(axis);
- #if ENABLED(AUTO_BED_LEVELING_FEATURE) && Z_HOME_DIR < 0
+ #if HAS_BED_PROBE && Z_HOME_DIR < 0 && DISABLED(Z_MIN_PROBE_ENDSTOP)
if (axis == Z_AXIS) {
current_position[Z_AXIS] -= zprobe_zoffset;
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("> zprobe_zoffset==", zprobe_zoffset);
+ SERIAL_ECHOPAIR("> zprobe_zoffset = ", zprobe_zoffset);
SERIAL_EOL;
}
#endif
@@ -1396,7 +1579,9 @@ static void set_axis_is_at_home(AxisEnum axis) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("> home_offset[axis]==", home_offset[axis]);
+ SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]);
+ SERIAL_ECHOPAIR("] = ", home_offset[axis]);
+ SERIAL_EOL;
DEBUG_POS("", current_position);
}
#endif
@@ -1412,7 +1597,7 @@ static void set_axis_is_at_home(AxisEnum axis) {
/**
* Some planner shorthand inline functions
*/
-inline void set_homing_bump_feedrate(AxisEnum axis) {
+inline float get_homing_bump_feedrate(AxisEnum axis) {
const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
int hbd = homing_bump_divisor[axis];
if (hbd < 1) {
@@ -1420,7 +1605,7 @@ inline void set_homing_bump_feedrate(AxisEnum axis) {
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1");
}
- feedrate = homing_feedrate[axis] / hbd;
+ return homing_feedrate_mm_m[axis] / hbd;
}
//
// line_to_current_position
@@ -1428,552 +1613,588 @@ inline void set_homing_bump_feedrate(AxisEnum axis) {
// (or from wherever it has been told it is located).
//
inline void line_to_current_position() {
- planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate / 60, active_extruder);
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder);
}
+
inline void line_to_z(float zPosition) {
- planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate / 60, active_extruder);
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder);
}
+
+inline void line_to_axis_pos(AxisEnum axis, float where, float fr_mm_m = 0.0) {
+ float old_feedrate_mm_m = feedrate_mm_m;
+ current_position[axis] = where;
+ feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[axis];
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder);
+ stepper.synchronize();
+ feedrate_mm_m = old_feedrate_mm_m;
+}
+
//
// line_to_destination
// Move the planner, not necessarily synced with current_position
//
-inline void line_to_destination(float mm_m) {
- planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], mm_m / 60, active_extruder);
-}
-inline void line_to_destination() {
- line_to_destination(feedrate);
-}
-/**
- * sync_plan_position
- * Set planner / stepper positions to the cartesian current_position.
- * The stepper code translates these coordinates into step units.
- * Allows translation between steps and units (mm) for cartesian & core robots
- */
-inline void sync_plan_position() {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position);
- #endif
- planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
+inline void line_to_destination(float fr_mm_m) {
+ planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS(fr_mm_m), active_extruder);
}
-inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); }
+inline void line_to_destination() { line_to_destination(feedrate_mm_m); }
+
inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
-static void setup_for_endstop_move() {
- saved_feedrate = feedrate;
- saved_feedrate_multiplier = feedrate_multiplier;
- feedrate_multiplier = 100;
- refresh_cmd_timeout();
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("setup_for_endstop_move > endstops.enable()");
- #endif
- endstops.enable();
-}
+#if ENABLED(DELTA)
+ /**
+ * Calculate delta, start a line, and set current_position to destination
+ */
+ void prepare_move_to_destination_raw() {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination);
+ #endif
+ refresh_cmd_timeout();
+ inverse_kinematics(destination);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder);
+ set_current_to_destination();
+ }
+#endif
-#if ENABLED(AUTO_BED_LEVELING_FEATURE)
+/**
+ * Plan a move to (X, Y, Z) and set the current_position
+ * The final current_position may not be the one that was requested
+ */
+void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) {
+ float old_feedrate_mm_m = feedrate_mm_m;
- #if ENABLED(DELTA)
- /**
- * Calculate delta, start a line, and set current_position to destination
- */
- void prepare_move_raw() {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_raw", destination);
- #endif
- refresh_cmd_timeout();
- calculate_delta(destination);
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder);
- set_current_to_destination();
- }
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, x, y, z);
#endif
- #if ENABLED(AUTO_BED_LEVELING_GRID)
+ #if ENABLED(DELTA)
- #if DISABLED(DELTA)
+ feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M;
- static void set_bed_level_equation_lsq(double* plane_equation_coefficients) {
+ set_destination_to_current(); // sync destination at the start
- //planner.bed_level_matrix.debug("bed level before");
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_to_current", destination);
+ #endif
+ // when in the danger zone
+ if (current_position[Z_AXIS] > delta_clip_start_height) {
+ if (z > delta_clip_start_height) { // staying in the danger zone
+ destination[X_AXIS] = x; // move directly (uninterpolated)
+ destination[Y_AXIS] = y;
+ destination[Z_AXIS] = z;
+ prepare_move_to_destination_raw(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
- planner.bed_level_matrix.set_to_identity();
- if (DEBUGGING(LEVELING)) {
- vector_3 uncorrected_position = planner.adjusted_position();
- DEBUG_POS(">>> set_bed_level_equation_lsq", uncorrected_position);
- DEBUG_POS(">>> set_bed_level_equation_lsq", current_position);
- }
+ if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
#endif
-
- vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1);
- planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
-
- vector_3 corrected_position = planner.adjusted_position();
- current_position[X_AXIS] = corrected_position.x;
- current_position[Y_AXIS] = corrected_position.y;
- current_position[Z_AXIS] = corrected_position.z;
-
+ return;
+ }
+ else {
+ destination[Z_AXIS] = delta_clip_start_height;
+ prepare_move_to_destination_raw(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", corrected_position);
+ if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
#endif
-
- sync_plan_position();
- }
-
- #endif // !DELTA
-
- #else // !AUTO_BED_LEVELING_GRID
-
- static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) {
-
- planner.bed_level_matrix.set_to_identity();
-
- vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1);
- vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2);
- vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3);
- vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal();
-
- if (planeNormal.z < 0) {
- planeNormal.x = -planeNormal.x;
- planeNormal.y = -planeNormal.y;
- planeNormal.z = -planeNormal.z;
}
+ }
- planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
-
- vector_3 corrected_position = planner.adjusted_position();
-
+ if (z > current_position[Z_AXIS]) { // raising?
+ destination[Z_AXIS] = z;
+ prepare_move_to_destination_raw(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- vector_3 uncorrected_position = corrected_position;
- DEBUG_POS("set_bed_level_equation_3pts", uncorrected_position);
- }
+ if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
#endif
+ }
- current_position[X_AXIS] = corrected_position.x;
- current_position[Y_AXIS] = corrected_position.y;
- current_position[Z_AXIS] = corrected_position.z;
+ destination[X_AXIS] = x;
+ destination[Y_AXIS] = y;
+ prepare_move_to_destination(); // set_current_to_destination
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position);
+ #endif
+ if (z < current_position[Z_AXIS]) { // lowering?
+ destination[Z_AXIS] = z;
+ prepare_move_to_destination_raw(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", corrected_position);
+ if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
#endif
-
- sync_plan_position();
}
- #endif // !AUTO_BED_LEVELING_GRID
-
- static void run_z_probe() {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to");
+ #endif
- /**
- * To prevent stepper_inactive_time from running out and
- * EXTRUDER_RUNOUT_PREVENT from extruding
- */
- refresh_cmd_timeout();
+ #else
- #if ENABLED(DELTA)
+ // If Z needs to raise, do it before moving XY
+ if (current_position[Z_AXIS] < z) {
+ feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[Z_AXIS];
+ current_position[Z_AXIS] = z;
+ line_to_current_position();
+ }
- float start_z = current_position[Z_AXIS];
- long start_steps = stepper.position(Z_AXIS);
+ feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M;
+ current_position[X_AXIS] = x;
+ current_position[Y_AXIS] = y;
+ line_to_current_position();
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("run_z_probe (DELTA) 1");
- #endif
-
- // move down slowly until you find the bed
- feedrate = homing_feedrate[Z_AXIS] / 4;
- destination[Z_AXIS] = -10;
- prepare_move_raw(); // this will also set_current_to_destination
- stepper.synchronize();
- endstops.hit_on_purpose(); // clear endstop hit flags
-
- /**
- * We have to let the planner know where we are right now as it
- * is not where we said to go.
- */
- long stop_steps = stepper.position(Z_AXIS);
- float mm = start_z - float(start_steps - stop_steps) / planner.axis_steps_per_unit[Z_AXIS];
- current_position[Z_AXIS] = mm;
-
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position);
- #endif
-
- sync_plan_position_delta();
-
- #else // !DELTA
-
- planner.bed_level_matrix.set_to_identity();
- feedrate = homing_feedrate[Z_AXIS];
-
- // Move down until the Z probe (or endstop?) is triggered
- float zPosition = -(Z_MAX_LENGTH + 10);
- line_to_z(zPosition);
- stepper.synchronize();
-
- // Tell the planner where we ended up - Get this from the stepper handler
- zPosition = stepper.get_axis_position_mm(Z_AXIS);
- planner.set_position_mm(
- current_position[X_AXIS], current_position[Y_AXIS], zPosition,
- current_position[E_AXIS]
- );
-
- // move up the retract distance
- zPosition += home_bump_mm(Z_AXIS);
- line_to_z(zPosition);
- stepper.synchronize();
- endstops.hit_on_purpose(); // clear endstop hit flags
+ // If Z needs to lower, do it after moving XY
+ if (current_position[Z_AXIS] > z) {
+ feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[Z_AXIS];
+ current_position[Z_AXIS] = z;
+ line_to_current_position();
+ }
- // move back down slowly to find bed
- set_homing_bump_feedrate(Z_AXIS);
+ #endif
- zPosition -= home_bump_mm(Z_AXIS) * 2;
- line_to_z(zPosition);
- stepper.synchronize();
- endstops.hit_on_purpose(); // clear endstop hit flags
+ stepper.synchronize();
- // Get the current stepper position after bumping an endstop
- current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
- sync_plan_position();
+ feedrate_mm_m = old_feedrate_mm_m;
+}
+void do_blocking_move_to_x(float x, float fr_mm_m/*=0.0*/) {
+ do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m);
+}
+void do_blocking_move_to_z(float z, float fr_mm_m/*=0.0*/) {
+ do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_m);
+}
+void do_blocking_move_to_xy(float x, float y, float fr_mm_m/*=0.0*/) {
+ do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_m);
+}
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position);
- #endif
+//
+// Prepare to do endstop or probe moves
+// with custom feedrates.
+//
+// - Save current feedrates
+// - Reset the rate multiplier
+// - Reset the command timeout
+// - Enable the endstops (for endstop moves)
+//
+static void setup_for_endstop_or_probe_move() {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position);
+ #endif
+ saved_feedrate_mm_m = feedrate_mm_m;
+ saved_feedrate_percentage = feedrate_percentage;
+ feedrate_percentage = 100;
+ refresh_cmd_timeout();
+}
- #endif // !DELTA
- }
+static void clean_up_after_endstop_or_probe_move() {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position);
+ #endif
+ feedrate_mm_m = saved_feedrate_mm_m;
+ feedrate_percentage = saved_feedrate_percentage;
+ refresh_cmd_timeout();
+}
+#if HAS_BED_PROBE
/**
- * Plan a move to (X, Y, Z) and set the current_position
- * The final current_position may not be the one that was requested
+ * Raise Z to a minimum height to make room for a probe to move
*/
- static void do_blocking_move_to(float x, float y, float z) {
- float oldFeedRate = feedrate;
-
+ inline void do_probe_raise(float z_raise) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z);
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPAIR("do_probe_raise(", z_raise);
+ SERIAL_ECHOLNPGM(")");
+ }
#endif
+ float z_dest = LOGICAL_Z_POSITION(z_raise);
- #if ENABLED(DELTA)
-
- feedrate = XY_TRAVEL_SPEED;
-
- destination[X_AXIS] = x;
- destination[Y_AXIS] = y;
- destination[Z_AXIS] = z;
-
- if (x == current_position[X_AXIS] && y == current_position[Y_AXIS])
- prepare_move_raw(); // this will also set_current_to_destination
- else
- prepare_move(); // this will also set_current_to_destination
+ if (zprobe_zoffset < 0)
+ z_dest -= zprobe_zoffset;
- stepper.synchronize();
-
- #else
+ if (z_dest > current_position[Z_AXIS])
+ do_blocking_move_to_z(z_dest);
+ }
- feedrate = homing_feedrate[Z_AXIS];
+#endif //HAS_BED_PROBE
- current_position[Z_AXIS] = z;
- line_to_current_position();
- stepper.synchronize();
+#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE)
+ static bool axis_unhomed_error(const bool x, const bool y, const bool z) {
+ const bool xx = x && !axis_homed[X_AXIS],
+ yy = y && !axis_homed[Y_AXIS],
+ zz = z && !axis_homed[Z_AXIS];
+ if (xx || yy || zz) {
+ SERIAL_ECHO_START;
+ SERIAL_ECHOPGM(MSG_HOME " ");
+ if (xx) SERIAL_ECHOPGM(MSG_X);
+ if (yy) SERIAL_ECHOPGM(MSG_Y);
+ if (zz) SERIAL_ECHOPGM(MSG_Z);
+ SERIAL_ECHOLNPGM(" " MSG_FIRST);
+
+ #if ENABLED(ULTRA_LCD)
+ char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1
+ strcat_P(message, PSTR(MSG_HOME " "));
+ if (xx) strcat_P(message, PSTR(MSG_X));
+ if (yy) strcat_P(message, PSTR(MSG_Y));
+ if (zz) strcat_P(message, PSTR(MSG_Z));
+ strcat_P(message, PSTR(" " MSG_FIRST));
+ lcd_setstatus(message);
+ #endif
+ return true;
+ }
+ return false;
+ }
+#endif
- feedrate = xy_travel_speed;
+#if ENABLED(Z_PROBE_SLED)
- current_position[X_AXIS] = x;
- current_position[Y_AXIS] = y;
- line_to_current_position();
- stepper.synchronize();
+ #ifndef SLED_DOCKING_OFFSET
+ #define SLED_DOCKING_OFFSET 0
+ #endif
+ /**
+ * Method to dock/undock a sled designed by Charles Bell.
+ *
+ * stow[in] If false, move to MAX_X and engage the solenoid
+ * If true, move to MAX_X and release the solenoid
+ */
+ static void dock_sled(bool stow) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPAIR("dock_sled(", stow);
+ SERIAL_ECHOLNPGM(")");
+ }
#endif
- feedrate = oldFeedRate;
- }
+ // Dock sled a bit closer to ensure proper capturing
+ do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0));
- inline void do_blocking_move_to_xy(float x, float y) {
- do_blocking_move_to(x, y, current_position[Z_AXIS]);
+ #if PIN_EXISTS(SLED)
+ digitalWrite(SLED_PIN, !stow); // switch solenoid
+ #endif
}
- inline void do_blocking_move_to_x(float x) {
- do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]);
+#endif // Z_PROBE_SLED
+#if ENABLED(Z_PROBE_ALLEN_KEY)
+ void run_deploy_moves_script() {
+ #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Y
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_1_X, Z_PROBE_ALLEN_KEY_DEPLOY_1_Y, Z_PROBE_ALLEN_KEY_DEPLOY_1_Z, Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE);
+ #endif
+ #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_X
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Y
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_2_X, Z_PROBE_ALLEN_KEY_DEPLOY_2_Y, Z_PROBE_ALLEN_KEY_DEPLOY_2_Z, Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE);
+ #endif
+ #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Y
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_3_X, Z_PROBE_ALLEN_KEY_DEPLOY_3_Y, Z_PROBE_ALLEN_KEY_DEPLOY_3_Z, Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE);
+ #endif
+ #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_X
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Y
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_4_X, Z_PROBE_ALLEN_KEY_DEPLOY_4_Y, Z_PROBE_ALLEN_KEY_DEPLOY_4_Z, Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE);
+ #endif
+ #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_X
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_5_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Y
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z, Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE);
+ #endif
}
-
- inline void do_blocking_move_to_z(float z) {
- do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z);
+ void run_stow_moves_script() {
+ #if defined(Z_PROBE_ALLEN_KEY_STOW_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_1_X
+ #define Z_PROBE_ALLEN_KEY_STOW_1_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Y
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_1_X, Z_PROBE_ALLEN_KEY_STOW_1_Y, Z_PROBE_ALLEN_KEY_STOW_1_Z, Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE);
+ #endif
+ #if defined(Z_PROBE_ALLEN_KEY_STOW_2_X) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_2_X
+ #define Z_PROBE_ALLEN_KEY_STOW_2_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Y
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_2_X, Z_PROBE_ALLEN_KEY_STOW_2_Y, Z_PROBE_ALLEN_KEY_STOW_2_Z, Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE);
+ #endif
+ #if defined(Z_PROBE_ALLEN_KEY_STOW_3_X) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_3_X
+ #define Z_PROBE_ALLEN_KEY_STOW_3_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Y
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_3_X, Z_PROBE_ALLEN_KEY_STOW_3_Y, Z_PROBE_ALLEN_KEY_STOW_3_Z, Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE);
+ #endif
+ #if defined(Z_PROBE_ALLEN_KEY_STOW_4_X) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_4_X
+ #define Z_PROBE_ALLEN_KEY_STOW_4_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Y
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_4_X, Z_PROBE_ALLEN_KEY_STOW_4_Y, Z_PROBE_ALLEN_KEY_STOW_4_Z, Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE);
+ #endif
+ #if defined(Z_PROBE_ALLEN_KEY_STOW_5_X) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Z)
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_5_X
+ #define Z_PROBE_ALLEN_KEY_STOW_5_X current_position[X_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Y
+ #define Z_PROBE_ALLEN_KEY_STOW_5_Y current_position[Y_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_5_Z current_position[Z_AXIS]
+ #endif
+ #ifndef Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE
+ #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0
+ #endif
+ do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z, Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE);
+ #endif
}
+#endif
- inline void raise_z_after_probing() {
- do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING);
- }
+#if HAS_BED_PROBE
- static void clean_up_after_endstop_move() {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("clean_up_after_endstop_move > ENDSTOPS_ONLY_FOR_HOMING > endstops.not_homing()");
+ // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed.
+ #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST)
+ #if ENABLED(Z_MIN_PROBE_ENDSTOP)
+ #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING)
+ #else
+ #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)
#endif
- endstops.not_homing();
- feedrate = saved_feedrate;
- feedrate_multiplier = saved_feedrate_multiplier;
- refresh_cmd_timeout();
- }
+ #endif
- #if HAS_BED_PROBE
+ #define DEPLOY_PROBE() set_probe_deployed( true )
+ #define STOW_PROBE() set_probe_deployed( false )
- static void deploy_z_probe() {
+ // returns false for ok and true for failure
+ static bool set_probe_deployed(bool deploy) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("deploy_z_probe", current_position);
+ if (DEBUGGING(LEVELING)) {
+ DEBUG_POS("set_probe_deployed", current_position);
+ SERIAL_ECHOPAIR("deploy: ", deploy);
+ SERIAL_EOL;
+ }
#endif
- if (endstops.z_probe_enabled) return;
+ if (endstops.z_probe_enabled == deploy) return false;
- #if HAS_SERVO_ENDSTOPS
-
- // Engage Z Servo endstop if enabled
- if (servo_endstop_id[Z_AXIS] >= 0) servo[servo_endstop_id[Z_AXIS]].move(servo_endstop_angle[Z_AXIS][0]);
+ // Make room for probe
+ do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW);
+ #if ENABLED(Z_PROBE_SLED)
+ if (axis_unhomed_error(true, false, false)) { stop(); return true; }
#elif ENABLED(Z_PROBE_ALLEN_KEY)
- feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
+ if (axis_unhomed_error(true, true, true )) { stop(); return true; }
+ #endif
+ float oldXpos = current_position[X_AXIS]; // save x position
+ float oldYpos = current_position[Y_AXIS]; // save y position
+
+ #ifdef _TRIGGERED_WHEN_STOWED_TEST
// If endstop is already false, the Z probe is deployed
- #if ENABLED(Z_MIN_PROBE_ENDSTOP)
- bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
- if (z_probe_endstop)
- #else
- bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
- if (z_min_endstop)
- #endif
- {
-
- // Move to the start position to initiate deployment
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X;
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y;
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z;
- prepare_move_raw(); // this will also set_current_to_destination
-
- // Move to engage deployment
- if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE)
- feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE;
- if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X)
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X;
- if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y)
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y;
- if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z;
- prepare_move_raw();
-
- #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)
- feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
-
- // Move to trigger deployment
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)
- feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X)
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X;
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y)
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y;
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z)
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z;
-
- prepare_move_raw();
- #endif
- }
+ if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions.
+ // Would a goto be less ugly?
+ //while (!_TRIGGERED_WHEN_STOWED_TEST) { idle(); // would offer the opportunity
+ // for a triggered when stowed manual probe.
+ #endif
- // Partially Home X,Y for safety
- destination[X_AXIS] = destination[X_AXIS] * 0.75;
- destination[Y_AXIS] = destination[Y_AXIS] * 0.75;
- prepare_move_raw(); // this will also set_current_to_destination
+ #if ENABLED(Z_PROBE_SLED)
+ dock_sled(!deploy);
+ #elif HAS_Z_SERVO_ENDSTOP
+ servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[((deploy) ? 0 : 1)]);
+ #elif ENABLED(Z_PROBE_ALLEN_KEY)
+ if (!deploy) run_stow_moves_script();
+ else run_deploy_moves_script();
+ #else
+ // Nothing to be done. Just enable_z_probe below...
+ #endif
- stepper.synchronize();
+ #ifdef _TRIGGERED_WHEN_STOWED_TEST
+ }; // opened before the probe specific actions
- #if ENABLED(Z_MIN_PROBE_ENDSTOP)
- z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
- if (z_probe_endstop)
- #else
- z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
- if (z_min_endstop)
- #endif
- {
- if (IsRunning()) {
- SERIAL_ERROR_START;
- SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
- LCD_ALERTMESSAGEPGM("Err: ZPROBE");
- }
- stop();
+ if (_TRIGGERED_WHEN_STOWED_TEST == deploy) {
+ if (IsRunning()) {
+ SERIAL_ERROR_START;
+ SERIAL_ERRORLNPGM("Z-Probe failed");
+ LCD_ALERTMESSAGEPGM("Err: ZPROBE");
}
-
- #endif // Z_PROBE_ALLEN_KEY
-
- #if ENABLED(FIX_MOUNTED_PROBE)
- // Noting to be done. Just set endstops.z_probe_enabled
+ stop();
+ return true;
+ }
#endif
- endstops.enable_z_probe();
-
+ do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy
+ endstops.enable_z_probe( deploy );
+ return false;
}
- static void stow_z_probe(bool doRaise = true) {
- #if !(HAS_SERVO_ENDSTOPS && (Z_RAISE_AFTER_PROBING > 0))
- UNUSED(doRaise);
- #endif
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position);
- #endif
-
- if (!endstops.z_probe_enabled) return;
-
- #if HAS_SERVO_ENDSTOPS
-
- // Retract Z Servo endstop if enabled
- if (servo_endstop_id[Z_AXIS] >= 0) {
-
- #if Z_RAISE_AFTER_PROBING > 0
- if (doRaise) {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("Raise Z (after) by ", Z_RAISE_AFTER_PROBING);
- SERIAL_EOL;
- SERIAL_ECHO("> SERVO_ENDSTOPS > raise_z_after_probing()");
- SERIAL_EOL;
- }
- #endif
- raise_z_after_probing(); // this also updates current_position
- stepper.synchronize();
- }
- #endif
-
- // Change the Z servo angle
- servo[servo_endstop_id[Z_AXIS]].move(servo_endstop_angle[Z_AXIS][1]);
- }
-
- #elif ENABLED(Z_PROBE_ALLEN_KEY)
+ // Do a single Z probe and return with current_position[Z_AXIS]
+ // at the height where the probe triggered.
+ static float run_z_probe() {
- // Move up for safety
- feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
+ // Prevent stepper_inactive_time from running out and EXTRUDER_RUNOUT_PREVENT from extruding
+ refresh_cmd_timeout();
- #if Z_RAISE_AFTER_PROBING > 0
- destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
- prepare_move_raw(); // this will also set_current_to_destination
- #endif
+ #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ planner.bed_level_matrix.set_to_identity();
+ #endif
- // Move to the start position to initiate retraction
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y;
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z;
- prepare_move_raw();
-
- // Move the nozzle down to push the Z probe into retracted position
- if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)
- feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
- if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X)
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
- if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y)
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y;
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z;
- prepare_move_raw();
-
- // Move up for safety
- if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE)
- feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
- if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X)
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X;
- if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y)
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y;
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z;
- prepare_move_raw();
-
- // Home XY for safety
- feedrate = homing_feedrate[X_AXIS] / 2;
- destination[X_AXIS] = 0;
- destination[Y_AXIS] = 0;
- prepare_move_raw(); // this will also set_current_to_destination
+ #if ENABLED(PROBE_DOUBLE_TOUCH)
+ do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST);
+ endstops.hit_on_purpose();
+ set_current_from_steppers_for_axis(Z_AXIS);
+ SYNC_PLAN_POSITION_KINEMATIC();
- stepper.synchronize();
+ // move up the retract distance
+ do_blocking_move_to_z(current_position[Z_AXIS] + home_bump_mm(Z_AXIS), Z_PROBE_SPEED_FAST);
+ #else
+ // move fast, close to the bed
+ do_blocking_move_to_z(home_bump_mm(Z_AXIS), Z_PROBE_SPEED_FAST);
+ #endif
- #if ENABLED(Z_MIN_PROBE_ENDSTOP)
- bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
- if (!z_probe_endstop)
- #else
- bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
- if (!z_min_endstop)
- #endif
- {
- if (IsRunning()) {
- SERIAL_ERROR_START;
- SERIAL_ERRORLNPGM("Z-Probe failed to retract!");
- LCD_ALERTMESSAGEPGM("Err: ZPROBE");
- }
- stop();
- }
- #endif // Z_PROBE_ALLEN_KEY
+ // move down slowly to find bed
+ do_blocking_move_to_z(current_position[Z_AXIS] -2.0*home_bump_mm(Z_AXIS), Z_PROBE_SPEED_SLOW);
+ endstops.hit_on_purpose();
+ set_current_from_steppers_for_axis(Z_AXIS);
+ SYNC_PLAN_POSITION_KINEMATIC();
- #if ENABLED(FIX_MOUNTED_PROBE)
- // Nothing to do here. Just clear endstops.z_probe_enabled
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position);
#endif
- endstops.enable_z_probe(false);
+ return current_position[Z_AXIS];
}
- #endif // HAS_BED_PROBE
-
- enum ProbeAction {
- ProbeStay = 0,
- ProbeDeploy = _BV(0),
- ProbeStow = _BV(1),
- ProbeDeployAndStow = (ProbeDeploy | ProbeStow)
- };
- // Probe bed height at position (x,y), returns the measured z value
- static float probe_pt(float x, float y, float z_before, ProbeAction probe_action = ProbeDeployAndStow, int verbose_level = 1) {
+ //
+ // - Move to the given XY
+ // - Deploy the probe, if not already deployed
+ // - Probe the bed, get the Z position
+ // - Depending on the 'stow' flag
+ // - Stow the probe, or
+ // - Raise to the BETWEEN height
+ // - Return the probed Z position
+ //
+ static float probe_pt(float x, float y, bool stow = true, int verbose_level = 1) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOLNPGM("probe_pt >>>");
- SERIAL_ECHOPAIR("> ProbeAction:", probe_action);
- SERIAL_EOL;
+ SERIAL_ECHOPAIR(">>> probe_pt(", x);
+ SERIAL_ECHOPAIR(", ", y);
+ SERIAL_ECHOPAIR(", ", stow ? "stow" : "no stow");
+ SERIAL_ECHOLNPGM(")");
DEBUG_POS("", current_position);
}
#endif
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("Z Raise to z_before ", z_before);
- SERIAL_EOL;
- SERIAL_ECHOPAIR("> do_blocking_move_to_z ", z_before);
- SERIAL_EOL;
- }
- #endif
+ float old_feedrate_mm_m = feedrate_mm_m;
- // Move Z up to the z_before height, then move the Z probe to the given XY
- do_blocking_move_to_z(z_before); // this also updates current_position
+ // Ensure a minimum height before moving the probe
+ do_probe_raise(Z_RAISE_BETWEEN_PROBINGS);
+ // Move to the XY where we shall probe
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("> do_blocking_move_to_xy ", x - (X_PROBE_OFFSET_FROM_EXTRUDER));
+ SERIAL_ECHOPAIR("> do_blocking_move_to_xy(", x - (X_PROBE_OFFSET_FROM_EXTRUDER));
SERIAL_ECHOPAIR(", ", y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
- SERIAL_EOL;
+ SERIAL_ECHOLNPGM(")");
}
#endif
-
- // this also updates current_position
+ feedrate_mm_m = XY_PROBE_FEEDRATE_MM_M;
do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
- #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
- if (probe_action & ProbeDeploy) {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy");
- #endif
- deploy_z_probe();
- }
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
#endif
+ if (DEPLOY_PROBE()) return NAN;
- run_z_probe();
- float measured_z = current_position[Z_AXIS];
+ float measured_z = run_z_probe();
- #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
- if (probe_action & ProbeStow) {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeStow (stow_z_probe will do Z Raise)");
- #endif
- stow_z_probe();
- }
- #endif
+ if (stow) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
+ #endif
+ if (STOW_PROBE()) return NAN;
+ }
+ else {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> do_probe_raise");
+ #endif
+ do_probe_raise(Z_RAISE_BETWEEN_PROBINGS);
+ }
if (verbose_level > 2) {
SERIAL_PROTOCOLPGM("Bed X: ");
@@ -1989,9 +2210,89 @@ static void setup_for_endstop_move() {
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt");
#endif
+ feedrate_mm_m = old_feedrate_mm_m;
+
return measured_z;
}
+#endif // HAS_BED_PROBE
+
+#if ENABLED(AUTO_BED_LEVELING_FEATURE)
+
+ #if ENABLED(AUTO_BED_LEVELING_GRID)
+
+ #if DISABLED(DELTA)
+
+ static void set_bed_level_equation_lsq(double* plane_equation_coefficients) {
+
+ //planner.bed_level_matrix.debug("bed level before");
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ planner.bed_level_matrix.set_to_identity();
+ if (DEBUGGING(LEVELING)) {
+ vector_3 uncorrected_position = planner.adjusted_position();
+ DEBUG_POS(">>> set_bed_level_equation_lsq", uncorrected_position);
+ DEBUG_POS(">>> set_bed_level_equation_lsq", current_position);
+ }
+ #endif
+
+ vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1);
+ planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
+
+ vector_3 corrected_position = planner.adjusted_position();
+ current_position[X_AXIS] = corrected_position.x;
+ current_position[Y_AXIS] = corrected_position.y;
+ current_position[Z_AXIS] = corrected_position.z;
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", corrected_position);
+ #endif
+
+ SYNC_PLAN_POSITION_KINEMATIC();
+ }
+
+ #endif // !DELTA
+
+ #else // !AUTO_BED_LEVELING_GRID
+
+ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) {
+
+ planner.bed_level_matrix.set_to_identity();
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ vector_3 uncorrected_position = planner.adjusted_position();
+ DEBUG_POS("set_bed_level_equation_3pts", uncorrected_position);
+ }
+ #endif
+
+ vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1);
+ vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2);
+ vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3);
+ vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal();
+
+ if (planeNormal.z < 0) {
+ planeNormal.x = -planeNormal.x;
+ planeNormal.y = -planeNormal.y;
+ planeNormal.z = -planeNormal.z;
+ }
+
+ planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
+ vector_3 corrected_position = planner.adjusted_position();
+
+ current_position[X_AXIS] = corrected_position.x;
+ current_position[Y_AXIS] = corrected_position.y;
+ current_position[Z_AXIS] = corrected_position.z;
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", corrected_position);
+ #endif
+
+ SYNC_PLAN_POSITION_KINEMATIC();
+ }
+
+ #endif // !AUTO_BED_LEVELING_GRID
+
#if ENABLED(DELTA)
/**
@@ -2038,111 +2339,31 @@ static void setup_for_endstop_move() {
*/
static void print_bed_level() {
for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
- for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
- SERIAL_PROTOCOL_F(bed_level[x][y], 2);
- SERIAL_PROTOCOLCHAR(' ');
- }
- SERIAL_EOL;
- }
- }
-
- /**
- * Reset calibration results to zero.
- */
- void reset_bed_level() {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("reset_bed_level");
- #endif
- for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
- for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
- bed_level[x][y] = 0.0;
- }
- }
- }
-
- #endif // DELTA
-
- #if HAS_SERVO_ENDSTOPS && DISABLED(Z_PROBE_SLED)
-
- void raise_z_for_servo() {
- float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_PROBING;
- /**
- * The zprobe_zoffset is negative any switch below the nozzle, so
- * multiply by Z_HOME_DIR (-1) to move enough away from bed for the probe
- */
- z_dest += axis_homed[Z_AXIS] ? zprobe_zoffset * Z_HOME_DIR : zpos;
- if (zpos < z_dest) do_blocking_move_to_z(z_dest); // also updates current_position
- }
-
- #endif
-
-#endif // AUTO_BED_LEVELING_FEATURE
-
-#if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || ENABLED(AUTO_BED_LEVELING_FEATURE)
- static void axis_unhomed_error(bool xyz=false) {
- if (xyz) {
- LCD_MESSAGEPGM(MSG_XYZ_UNHOMED);
- SERIAL_ECHO_START;
- SERIAL_ECHOLNPGM(MSG_XYZ_UNHOMED);
- }
- else {
- LCD_MESSAGEPGM(MSG_YX_UNHOMED);
- SERIAL_ECHO_START;
- SERIAL_ECHOLNPGM(MSG_YX_UNHOMED);
- }
- }
-#endif
-
-#if ENABLED(Z_PROBE_SLED)
-
- #ifndef SLED_DOCKING_OFFSET
- #define SLED_DOCKING_OFFSET 0
- #endif
-
- /**
- * Method to dock/undock a sled designed by Charles Bell.
- *
- * dock[in] If true, move to MAX_X and engage the electromagnet
- * offset[in] The additional distance to move to adjust docking location
- */
- static void dock_sled(bool dock, int offset = 0) {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("dock_sled(", dock);
- SERIAL_ECHOLNPGM(")");
+ for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
+ SERIAL_PROTOCOL_F(bed_level[x][y], 2);
+ SERIAL_PROTOCOLCHAR(' ');
+ }
+ SERIAL_EOL;
}
- #endif
-
- if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) {
- axis_unhomed_error(true);
- return;
}
- if (endstops.z_probe_enabled == !dock) return; // already docked/undocked?
-
- float oldXpos = current_position[X_AXIS]; // save x position
- if (dock) {
- #if Z_RAISE_AFTER_PROBING > 0
- raise_z_after_probing(); // raise Z
+ /**
+ * Reset calibration results to zero.
+ */
+ void reset_bed_level() {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("reset_bed_level");
#endif
- // Dock sled a bit closer to ensure proper capturing
- do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1);
- digitalWrite(SLED_PIN, LOW); // turn off magnet
- }
- else {
- float z_loc = current_position[Z_AXIS];
- if (z_loc < Z_RAISE_BEFORE_PROBING + 5) z_loc = Z_RAISE_BEFORE_PROBING;
- do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], z_loc); // this also updates current_position
- digitalWrite(SLED_PIN, HIGH); // turn on magnet
+ for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
+ for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
+ bed_level[x][y] = 0.0;
+ }
+ }
}
- do_blocking_move_to_x(oldXpos); // return to position before docking
-
- endstops.enable_z_probe(!dock); // logically disable docked probe
- }
-
-#endif // Z_PROBE_SLED
+ #endif // DELTA
+#endif // AUTO_BED_LEVELING_FEATURE
/**
* Home an individual axis
@@ -2151,193 +2372,121 @@ static void setup_for_endstop_move() {
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
static void homeaxis(AxisEnum axis) {
+ #define HOMEAXIS_DO(LETTER) \
+ ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
+
+ if (!(axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0)) return;
+
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR(">>> homeaxis(", axis);
SERIAL_ECHOLNPGM(")");
}
#endif
- #define HOMEAXIS_DO(LETTER) \
- ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
-
- if (axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) {
-
- int axis_home_dir =
- #if ENABLED(DUAL_X_CARRIAGE)
- (axis == X_AXIS) ? x_home_dir(active_extruder) :
- #endif
- home_dir(axis);
-
- // Set the axis position as setup for the move
- current_position[axis] = 0;
- sync_plan_position();
- #if ENABLED(Z_PROBE_SLED)
- #define _Z_SERVO_TEST (axis != Z_AXIS) // deploy Z, servo.move XY
- #define _Z_PROBE_SUBTEST false // Z will never be invoked
- #define _Z_DEPLOY (dock_sled(false))
- #define _Z_STOW (dock_sled(true))
- #elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)
- #define _Z_SERVO_TEST (axis != Z_AXIS) // servo.move XY
- #define _Z_PROBE_SUBTEST false // Z will never be invoked
- #define _Z_DEPLOY (deploy_z_probe())
- #define _Z_STOW (stow_z_probe())
- #elif HAS_SERVO_ENDSTOPS
- #define _Z_SERVO_TEST true // servo.move X, Y, Z
- #define _Z_PROBE_SUBTEST (axis == Z_AXIS) // Z is a probe
+ int axis_home_dir =
+ #if ENABLED(DUAL_X_CARRIAGE)
+ (axis == X_AXIS) ? x_home_dir(active_extruder) :
#endif
+ home_dir(axis);
- if (axis == Z_AXIS) {
- // If there's a Z probe that needs deployment...
- #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)
- // ...and homing Z towards the bed? Deploy it.
- if (axis_home_dir < 0) _Z_DEPLOY;
+ // Homing Z towards the bed? Deploy the Z probe or endstop.
+ #if HAS_BED_PROBE && DISABLED(Z_MIN_PROBE_ENDSTOP)
+ if (axis == Z_AXIS && axis_home_dir < 0) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
#endif
+ if (DEPLOY_PROBE()) return;
}
+ #endif
- #if HAS_SERVO_ENDSTOPS
- // Engage an X or Y Servo endstop if enabled
- if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) {
- servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][0]);
- if (_Z_PROBE_SUBTEST) endstops.z_probe_enabled = true;
- }
- #endif
-
- // Set a flag for Z motor locking
- #if ENABLED(Z_DUAL_ENDSTOPS)
- if (axis == Z_AXIS) stepper.set_homing_flag(true);
- #endif
-
- // Move towards the endstop until an endstop is triggered
- destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
- feedrate = homing_feedrate[axis];
- line_to_destination();
- stepper.synchronize();
+ // Set the axis position as setup for the move
+ current_position[axis] = 0;
+ sync_plan_position();
- // Set the axis position as setup for the move
- current_position[axis] = 0;
- sync_plan_position();
+ // Set a flag for Z motor locking
+ #if ENABLED(Z_DUAL_ENDSTOPS)
+ if (axis == Z_AXIS) stepper.set_homing_flag(true);
+ #endif
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)");
- #endif
- endstops.enable(false); // Disable endstops while moving away
+ // Move towards the endstop until an endstop is triggered
+ line_to_axis_pos(axis, 1.5 * max_length(axis) * axis_home_dir);
- // Move away from the endstop by the axis HOME_BUMP_MM
- destination[axis] = -home_bump_mm(axis) * axis_home_dir;
- line_to_destination();
- stepper.synchronize();
+ // Set the axis position as setup for the move
+ current_position[axis] = 0;
+ sync_plan_position();
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
- #endif
- endstops.enable(true); // Enable endstops for next homing move
+ // Move away from the endstop by the axis HOME_BUMP_MM
+ line_to_axis_pos(axis, -home_bump_mm(axis) * axis_home_dir);
- // Slow down the feedrate for the next move
- set_homing_bump_feedrate(axis);
+ // Move slowly towards the endstop until triggered
+ line_to_axis_pos(axis, 2 * home_bump_mm(axis) * axis_home_dir, get_homing_bump_feedrate(axis));
- // Move slowly towards the endstop until triggered
- destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir;
- line_to_destination();
- stepper.synchronize();
+ // reset current_position to 0 to reflect hitting endpoint
+ current_position[axis] = 0;
+ sync_plan_position();
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position);
- #endif
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position);
+ #endif
- #if ENABLED(Z_DUAL_ENDSTOPS)
- if (axis == Z_AXIS) {
- float adj = fabs(z_endstop_adj);
- bool lockZ1;
- if (axis_home_dir > 0) {
- adj = -adj;
- lockZ1 = (z_endstop_adj > 0);
- }
- else
- lockZ1 = (z_endstop_adj < 0);
+ #if ENABLED(Z_DUAL_ENDSTOPS)
+ if (axis == Z_AXIS) {
+ float adj = fabs(z_endstop_adj);
+ bool lockZ1;
+ if (axis_home_dir > 0) {
+ adj = -adj;
+ lockZ1 = (z_endstop_adj > 0);
+ }
+ else
+ lockZ1 = (z_endstop_adj < 0);
- if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
- sync_plan_position();
+ if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
- // Move to the adjusted endstop height
- feedrate = homing_feedrate[axis];
- destination[Z_AXIS] = adj;
- line_to_destination();
- stepper.synchronize();
+ // Move to the adjusted endstop height
+ line_to_axis_pos(axis, adj);
- if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false);
- stepper.set_homing_flag(false);
- } // Z_AXIS
- #endif
+ if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false);
+ stepper.set_homing_flag(false);
+ } // Z_AXIS
+ #endif
- #if ENABLED(DELTA)
- // retrace by the amount specified in endstop_adj
- if (endstop_adj[axis] * axis_home_dir < 0) {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)");
- #endif
- endstops.enable(false); // Disable endstops while moving away
- sync_plan_position();
- destination[axis] = endstop_adj[axis];
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]);
- DEBUG_POS("", destination);
- }
- #endif
- line_to_destination();
- stepper.synchronize();
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
- #endif
- endstops.enable(true); // Enable endstops for next homing move
- }
+ #if ENABLED(DELTA)
+ // retrace by the amount specified in endstop_adj
+ if (endstop_adj[axis] * axis_home_dir < 0) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
- else {
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("> endstop_adj * axis_home_dir = ", endstop_adj[axis] * axis_home_dir);
- SERIAL_EOL;
- }
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]);
+ DEBUG_POS("", current_position);
}
#endif
- #endif
-
- // Set the axis position to its home position (plus home offsets)
- set_axis_is_at_home(axis);
- sync_plan_position();
+ line_to_axis_pos(axis, endstop_adj[axis]);
+ }
+ #endif
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position);
- #endif
+ // Set the axis position to its home position (plus home offsets)
+ set_axis_is_at_home(axis);
- destination[axis] = current_position[axis];
- feedrate = 0.0;
- endstops.hit_on_purpose(); // clear endstop hit flags
- axis_known_position[axis] = true;
- axis_homed[axis] = true;
+ SYNC_PLAN_POSITION_KINEMATIC();
- // Put away the Z probe
- #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)
- if (axis == Z_AXIS && axis_home_dir < 0) {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_STOW));
- #endif
- _Z_STOW;
- }
- #endif
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position);
+ #endif
- // Retract Servo endstop if enabled
- #if HAS_SERVO_ENDSTOPS
- if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_ENDSTOPS > Stow with servo.move()");
- #endif
- servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]);
- if (_Z_PROBE_SUBTEST) endstops.enable_z_probe(false);
- }
- #endif
+ destination[axis] = current_position[axis];
+ endstops.hit_on_purpose(); // clear endstop hit flags
+ axis_known_position[axis] = true;
+ axis_homed[axis] = true;
- }
+ // Put away the Z probe
+ #if HAS_BED_PROBE && DISABLED(Z_MIN_PROBE_ENDSTOP)
+ if (axis == Z_AXIS && axis_home_dir < 0) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
+ #endif
+ if (STOW_PROBE()) return;
+ }
+ #endif
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
@@ -2353,52 +2502,77 @@ static void homeaxis(AxisEnum axis) {
if (retracting == retracted[active_extruder]) return;
- float oldFeedrate = feedrate;
+ float old_feedrate_mm_m = feedrate_mm_m;
set_destination_to_current();
if (retracting) {
- feedrate = retract_feedrate * 60;
+ feedrate_mm_m = MMS_TO_MMM(retract_feedrate_mm_s);
current_position[E_AXIS] += (swapping ? retract_length_swap : retract_length) / volumetric_multiplier[active_extruder];
sync_plan_position_e();
- prepare_move();
+ prepare_move_to_destination();
if (retract_zlift > 0.01) {
current_position[Z_AXIS] -= retract_zlift;
- #if ENABLED(DELTA)
- sync_plan_position_delta();
- #else
- sync_plan_position();
- #endif
- prepare_move();
+ SYNC_PLAN_POSITION_KINEMATIC();
+ prepare_move_to_destination();
}
}
else {
if (retract_zlift > 0.01) {
current_position[Z_AXIS] += retract_zlift;
- #if ENABLED(DELTA)
- sync_plan_position_delta();
- #else
- sync_plan_position();
- #endif
+ SYNC_PLAN_POSITION_KINEMATIC();
}
- feedrate = retract_recover_feedrate * 60;
+ feedrate_mm_m = MMS_TO_MMM(retract_recover_feedrate_mm_s);
float move_e = swapping ? retract_length_swap + retract_recover_length_swap : retract_length + retract_recover_length;
current_position[E_AXIS] -= move_e / volumetric_multiplier[active_extruder];
sync_plan_position_e();
- prepare_move();
+ prepare_move_to_destination();
}
- feedrate = oldFeedrate;
+ feedrate_mm_m = old_feedrate_mm_m;
retracted[active_extruder] = retracting;
} // retract()
#endif // FWRETRACT
+#if ENABLED(MIXING_EXTRUDER)
+
+ void normalize_mix() {
+ float mix_total = 0.0;
+ for (int i = 0; i < MIXING_STEPPERS; i++) {
+ float v = mixing_factor[i];
+ if (v < 0) v = mixing_factor[i] = 0;
+ mix_total += v;
+ }
+ // Scale all values if they don't add up to ~1.0
+ if (mix_total < 0.9999 || mix_total > 1.0001) {
+ SERIAL_PROTOCOLLNPGM("Warning: Mix factors must add up to 1.0. Scaling.");
+ float mix_scale = 1.0 / mix_total;
+ for (int i = 0; i < MIXING_STEPPERS; i++)
+ mixing_factor[i] *= mix_scale;
+ }
+ }
+
+ #if ENABLED(DIRECT_MIXING_IN_G1)
+ // Get mixing parameters from the GCode
+ // Factors that are left out are set to 0
+ // The total "must" be 1.0 (but it will be normalized)
+ void gcode_get_mix() {
+ const char* mixing_codes = "ABCDHI";
+ for (int i = 0; i < MIXING_STEPPERS; i++)
+ mixing_factor[i] = code_seen(mixing_codes[i]) ? code_value_float() : 0;
+
+ normalize_mix();
+ }
+ #endif
+
+#endif
+
/**
* ***************************************************************************
* ***************************** G-CODE HANDLING *****************************
@@ -2413,23 +2587,32 @@ static void homeaxis(AxisEnum axis) {
* - Set the feedrate, if included
*/
void gcode_get_destination() {
- for (int i = 0; i < NUM_AXIS; i++) {
+ LOOP_XYZE(i) {
if (code_seen(axis_codes[i]))
- destination[i] = code_value() + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0);
+ destination[i] = code_value_axis_units(i) + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0);
else
destination[i] = current_position[i];
}
- if (code_seen('F')) {
- float next_feedrate = code_value();
- if (next_feedrate > 0.0) feedrate = next_feedrate;
- }
+
+ if (code_seen('F') && code_value_linear_units() > 0.0)
+ feedrate_mm_m = code_value_linear_units();
+
+ #if ENABLED(PRINTCOUNTER)
+ if (!DEBUGGING(DRYRUN))
+ print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]);
+ #endif
+
+ // Get ABCDHI mixing factors
+ #if ENABLED(MIXING_EXTRUDER) && ENABLED(DIRECT_MIXING_IN_G1)
+ gcode_get_mix();
+ #endif
}
void unknown_command_error() {
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND);
SERIAL_ECHO(current_command);
- SERIAL_ECHOPGM("\"\n");
+ SERIAL_ECHOLNPGM("\"");
}
#if ENABLED(HOST_KEEPALIVE_FEATURE)
@@ -2487,7 +2670,7 @@ inline void gcode_G0_G1() {
#endif //FWRETRACT
- prepare_move();
+ prepare_move_to_destination();
}
}
@@ -2512,8 +2695,8 @@ inline void gcode_G0_G1() {
// Center of arc as offset from current_position
float arc_offset[2] = {
- code_seen('I') ? code_value() : 0,
- code_seen('J') ? code_value() : 0
+ code_seen('I') ? code_value_axis_units(X_AXIS) : 0,
+ code_seen('J') ? code_value_axis_units(Y_AXIS) : 0
};
// Send an arc to the planner
@@ -2528,18 +2711,18 @@ inline void gcode_G0_G1() {
* G4: Dwell S or P
*/
inline void gcode_G4() {
- millis_t codenum = 0;
+ millis_t dwell_ms = 0;
- if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait
- if (code_seen('S')) codenum = code_value() * 1000UL; // seconds to wait
+ if (code_seen('P')) dwell_ms = code_value_millis(); // milliseconds to wait
+ if (code_seen('S')) dwell_ms = code_value_millis_from_seconds(); // seconds to wait
stepper.synchronize();
refresh_cmd_timeout();
- codenum += previous_cmd_ms; // keep track of when we started waiting
+ dwell_ms += previous_cmd_ms; // keep track of when we started waiting
if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL);
- while (PENDING(millis(), codenum)) idle();
+ while (PENDING(millis(), dwell_ms)) idle();
}
#if ENABLED(BEZIER_CURVE_SUPPORT)
@@ -2560,10 +2743,10 @@ inline void gcode_G4() {
gcode_get_destination();
float offset[] = {
- code_seen('I') ? code_value() : 0.0,
- code_seen('J') ? code_value() : 0.0,
- code_seen('P') ? code_value() : 0.0,
- code_seen('Q') ? code_value() : 0.0
+ code_seen('I') ? code_value_axis_units(X_AXIS) : 0.0,
+ code_seen('J') ? code_value_axis_units(Y_AXIS) : 0.0,
+ code_seen('P') ? code_value_axis_units(X_AXIS) : 0.0,
+ code_seen('Q') ? code_value_axis_units(Y_AXIS) : 0.0
};
plan_cubic_move(offset);
@@ -2581,7 +2764,7 @@ inline void gcode_G4() {
inline void gcode_G10_G11(bool doRetract=false) {
#if EXTRUDERS > 1
if (doRetract) {
- retracted_swap[active_extruder] = (code_seen('S') && code_value_short() == 1); // checks for swap retract argument
+ retracted_swap[active_extruder] = (code_seen('S') && code_value_bool()); // checks for swap retract argument
}
#endif
retract(doRetract
@@ -2593,6 +2776,79 @@ inline void gcode_G4() {
#endif //FWRETRACT
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ /**
+ * G12: Clean the nozzle
+ */
+ inline void gcode_G12() {
+ // Don't allow nozzle cleaning without homing first
+ if (axis_unhomed_error(true, true, true)) { return; }
+
+ uint8_t const pattern = code_seen('P') ? code_value_ushort() : 0;
+ uint8_t const strokes = code_seen('S') ? code_value_ushort() : NOZZLE_CLEAN_STROKES;
+ uint8_t const objects = code_seen('T') ? code_value_ushort() : 3;
+
+ Nozzle::clean(pattern, strokes, objects);
+ }
+#endif
+
+#if ENABLED(INCH_MODE_SUPPORT)
+ /**
+ * G20: Set input mode to inches
+ */
+ inline void gcode_G20() {
+ set_input_linear_units(LINEARUNIT_INCH);
+ }
+
+ /**
+ * G21: Set input mode to millimeters
+ */
+ inline void gcode_G21() {
+ set_input_linear_units(LINEARUNIT_MM);
+ }
+#endif
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ /**
+ * G27: Park the nozzle
+ */
+ inline void gcode_G27() {
+ // Don't allow nozzle parking without homing first
+ if (axis_unhomed_error(true, true, true)) { return; }
+ uint8_t const z_action = code_seen('P') ? code_value_ushort() : 0;
+ Nozzle::park(z_action);
+ }
+#endif // NOZZLE_PARK_FEATURE
+
+#if ENABLED(QUICK_HOME)
+
+ static void quick_home_xy() {
+
+ // Pretend the current position is 0,0
+ current_position[X_AXIS] = current_position[Y_AXIS] = 0.0;
+ sync_plan_position();
+
+ int x_axis_home_dir =
+ #if ENABLED(DUAL_X_CARRIAGE)
+ x_home_dir(active_extruder)
+ #else
+ home_dir(X_AXIS)
+ #endif
+ ;
+
+ float mlx = max_length(X_AXIS),
+ mly = max_length(Y_AXIS),
+ mlratio = mlx > mly ? mly / mlx : mlx / mly,
+ fr_mm_m = min(homing_feedrate_mm_m[X_AXIS], homing_feedrate_mm_m[Y_AXIS]) * sqrt(sq(mlratio) + 1.0);
+
+ do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_m);
+ endstops.hit_on_purpose(); // clear endstop hit flags
+ current_position[X_AXIS] = current_position[Y_AXIS] = 0.0;
+
+ }
+
+#endif // QUICK_HOME
+
/**
* G28: Home all axes according to settings
*
@@ -2611,7 +2867,7 @@ inline void gcode_G4() {
inline void gcode_G28() {
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("gcode_G28 >>>");
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(">>> gcode_G28");
#endif
// Wait for planner moves to finish!
@@ -2625,51 +2881,70 @@ inline void gcode_G28() {
#endif
#endif
+ // Always home with tool 0 active
+ #if HOTENDS > 1
+ uint8_t old_tool_index = active_extruder;
+ tool_change(0, 0, true);
+ #endif
+
+ #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
+ extruder_duplication_enabled = false;
+ #endif
+
/**
* For mesh bed leveling deactivate the mesh calculations, will be turned
* on again when homing all axis
*/
#if ENABLED(MESH_BED_LEVELING)
- uint8_t mbl_was_active = mbl.active;
- mbl.active = false;
+ float pre_home_z = MESH_HOME_SEARCH_Z;
+ if (mbl.active()) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL was active");
+ #endif
+ // Save known Z position if already homed
+ if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
+ pre_home_z = current_position[Z_AXIS];
+ pre_home_z += mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS));
+ }
+ mbl.set_active(false);
+ current_position[Z_AXIS] = pre_home_z;
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("Set Z to pre_home_z", current_position);
+ #endif
+ }
#endif
- setup_for_endstop_move();
-
- /**
- * Directly after a reset this is all 0. Later we get a hint if we have
- * to raise z or not.
- */
- set_destination_to_current();
+ setup_for_endstop_or_probe_move();
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
+ #endif
+ endstops.enable(true); // Enable endstops for next homing move
- feedrate = 0.0;
#if ENABLED(DELTA)
/**
- * A delta can only safely home all axis at the same time
- * all axis have to home at the same time
+ * A delta can only safely home all axes at the same time
*/
// Pretend the current position is 0,0,0
- for (int i = X_AXIS; i <= Z_AXIS; i++) current_position[i] = 0;
+ // This is like quick_home_xy() but for 3 towers.
+ current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = 0.0;
sync_plan_position();
// Move all carriages up together until the first endstop is hit.
- for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * (Z_MAX_LENGTH);
- feedrate = 1.732 * homing_feedrate[X_AXIS];
- line_to_destination();
+ current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = 3.0 * (Z_MAX_LENGTH);
+ feedrate_mm_m = 1.732 * homing_feedrate_mm_m[X_AXIS];
+ line_to_current_position();
stepper.synchronize();
endstops.hit_on_purpose(); // clear endstop hit flags
+ current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = 0.0;
- // Destination reached
- for (int i = X_AXIS; i <= Z_AXIS; i++) current_position[i] = destination[i];
-
- // take care of back off and rehome now we are all at the top
+ // take care of back off and rehome. Now one carriage is at the top.
HOMEAXIS(X);
HOMEAXIS(Y);
HOMEAXIS(Z);
- sync_plan_position_delta();
+ SYNC_PLAN_POSITION_KINEMATIC();
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("(DELTA)", current_position);
@@ -2677,12 +2952,12 @@ inline void gcode_G28() {
#else // NOT DELTA
- bool homeX = code_seen(axis_codes[X_AXIS]),
- homeY = code_seen(axis_codes[Y_AXIS]),
- homeZ = code_seen(axis_codes[Z_AXIS]);
+ bool homeX = code_seen('X'), homeY = code_seen('Y'), homeZ = code_seen('Z');
home_all_axis = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
+ set_destination_to_current();
+
#if Z_HOME_DIR > 0 // If homing away from BED do Z first
if (home_all_axis || homeZ) {
@@ -2692,97 +2967,51 @@ inline void gcode_G28() {
#endif
}
- #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0
+ #else
- // Raise Z before homing any other axes and z is not already high enough (never lower z)
- if (current_position[Z_AXIS] <= MIN_Z_HEIGHT_FOR_HOMING) {
- destination[Z_AXIS] = MIN_Z_HEIGHT_FOR_HOMING;
- feedrate = planner.max_feedrate[Z_AXIS] * 60; // feedrate (mm/m) = max_feedrate (mm/s)
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("Raise Z (before homing) to ", (MIN_Z_HEIGHT_FOR_HOMING));
- SERIAL_EOL;
- DEBUG_POS("> (home_all_axis || homeZ)", current_position);
- DEBUG_POS("> (home_all_axis || homeZ)", destination);
- }
- #endif
- line_to_destination();
- stepper.synchronize();
+ if (home_all_axis || homeX || homeY) {
+ // Raise Z before homing any other axes and z is not already high enough (never lower z)
+ destination[Z_AXIS] = LOGICAL_Z_POSITION(MIN_Z_HEIGHT_FOR_HOMING);
+ if (destination[Z_AXIS] > current_position[Z_AXIS]) {
- /**
- * Update the current Z position even if it currently not real from
- * Z-home otherwise each call to line_to_destination() will want to
- * move Z-axis by MIN_Z_HEIGHT_FOR_HOMING.
- */
- current_position[Z_AXIS] = destination[Z_AXIS];
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPAIR("Raise Z (before homing) to ", destination[Z_AXIS]);
+ SERIAL_EOL;
+ }
+ #endif
+
+ do_blocking_move_to_z(destination[Z_AXIS]);
+ }
}
+
#endif
#if ENABLED(QUICK_HOME)
- if (home_all_axis || (homeX && homeY)) { // First diagonal move
-
- current_position[X_AXIS] = current_position[Y_AXIS] = 0;
-
- #if ENABLED(DUAL_X_CARRIAGE)
- int x_axis_home_dir = x_home_dir(active_extruder);
- extruder_duplication_enabled = false;
- #else
- int x_axis_home_dir = home_dir(X_AXIS);
- #endif
-
- sync_plan_position();
-
- float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS),
- mlratio = mlx > mly ? mly / mlx : mlx / mly;
-
- destination[X_AXIS] = 1.5 * mlx * x_axis_home_dir;
- destination[Y_AXIS] = 1.5 * mly * home_dir(Y_AXIS);
- feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1);
- line_to_destination();
- stepper.synchronize();
-
- set_axis_is_at_home(X_AXIS);
- set_axis_is_at_home(Y_AXIS);
- sync_plan_position();
-
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 1", current_position);
- #endif
+ if (home_all_axis || (homeX && homeY)) quick_home_xy();
- destination[X_AXIS] = current_position[X_AXIS];
- destination[Y_AXIS] = current_position[Y_AXIS];
- line_to_destination();
- feedrate = 0.0;
- stepper.synchronize();
- endstops.hit_on_purpose(); // clear endstop hit flags
+ #endif
- current_position[X_AXIS] = destination[X_AXIS];
- current_position[Y_AXIS] = destination[Y_AXIS];
- #if DISABLED(SCARA)
- current_position[Z_AXIS] = destination[Z_AXIS];
- #endif
+ #if ENABLED(HOME_Y_BEFORE_X)
+ // Home Y
+ if (home_all_axis || homeY) {
+ HOMEAXIS(Y);
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 2", current_position);
+ if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
#endif
}
- #endif // QUICK_HOME
-
- #if ENABLED(HOME_Y_BEFORE_X)
- // Home Y
- if (home_all_axis || homeY) HOMEAXIS(Y);
#endif
// Home X
if (home_all_axis || homeX) {
#if ENABLED(DUAL_X_CARRIAGE)
int tmp_extruder = active_extruder;
- extruder_duplication_enabled = false;
active_extruder = !active_extruder;
HOMEAXIS(X);
- inactive_extruder_x_pos = current_position[X_AXIS];
+ inactive_extruder_x_pos = RAW_X_POSITION(current_position[X_AXIS]);
active_extruder = tmp_extruder;
HOMEAXIS(X);
// reset state used by the different modes
@@ -2828,16 +3057,14 @@ inline void gcode_G28() {
* enough to reach Z_SAFE_HOMING XY positions.
* Just make sure the planner is in sync.
*/
- sync_plan_position();
+ SYNC_PLAN_POSITION_KINEMATIC();
/**
- * Set the Z probe (or just the nozzle) destination to the safe
- * homing point
+ * Move the Z probe (or just the nozzle) to the safe homing point
*/
destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - (X_PROBE_OFFSET_FROM_EXTRUDER));
destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER));
- destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height
- feedrate = XY_TRAVEL_SPEED;
+ destination[Z_AXIS] = current_position[Z_AXIS]; // Z is already at the right height
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
@@ -2847,50 +3074,31 @@ inline void gcode_G28() {
#endif
// Move in the XY plane
- line_to_destination();
- stepper.synchronize();
+ do_blocking_move_to_xy(destination[X_AXIS], destination[Y_AXIS]);
+ }
- /**
- * Update the current positions for XY, Z is still at least at
- * MIN_Z_HEIGHT_FOR_HOMING height, no changes there.
- */
- current_position[X_AXIS] = destination[X_AXIS];
- current_position[Y_AXIS] = destination[Y_AXIS];
+ // Let's see if X and Y are homed
+ if (axis_unhomed_error(true, true, false)) return;
+
+ /**
+ * Make sure the Z probe is within the physical limits
+ * NOTE: This doesn't necessarily ensure the Z probe is also
+ * within the bed!
+ */
+ float cpx = RAW_CURRENT_POSITION(X_AXIS), cpy = RAW_CURRENT_POSITION(Y_AXIS);
+ if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
+ && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
+ && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
+ && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) {
// Home the Z axis
HOMEAXIS(Z);
}
-
- else if (homeZ) { // Don't need to Home Z twice
-
- // Let's see if X and Y are homed
- if (axis_homed[X_AXIS] && axis_homed[Y_AXIS]) {
-
- /**
- * Make sure the Z probe is within the physical limits
- * NOTE: This doesn't necessarily ensure the Z probe is also
- * within the bed!
- */
- float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS];
- if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
- && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
- && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
- && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) {
-
- // Home the Z axis
- HOMEAXIS(Z);
- }
- else {
- LCD_MESSAGEPGM(MSG_ZPROBE_OUT);
- SERIAL_ECHO_START;
- SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT);
- }
- }
- else {
- axis_unhomed_error();
- }
-
- } // !home_all_axes && homeZ
+ else {
+ LCD_MESSAGEPGM(MSG_ZPROBE_OUT);
+ SERIAL_ECHO_START;
+ SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT);
+ }
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
@@ -2912,81 +3120,120 @@ inline void gcode_G28() {
#endif // Z_HOME_DIR < 0
- sync_plan_position();
-
- #endif // else DELTA
-
- #if ENABLED(SCARA)
- sync_plan_position_delta();
- #endif
+ SYNC_PLAN_POSITION_KINEMATIC();
- #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
- endstops.enable(false);
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOLNPGM("ENDSTOPS_ONLY_FOR_HOMING endstops.enable(false)");
- }
- #endif
+ #endif // !DELTA (gcode_G28)
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.not_homing()");
#endif
+ endstops.not_homing();
+ endstops.hit_on_purpose(); // clear endstop hit flags
// Enable mesh leveling again
#if ENABLED(MESH_BED_LEVELING)
- if (mbl_was_active && home_all_axis) {
- current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
- sync_plan_position();
- mbl.active = 1;
- #if ENABLED(MESH_G28_REST_ORIGIN)
- current_position[Z_AXIS] = 0.0;
- set_destination_to_current();
- feedrate = homing_feedrate[Z_AXIS];
- line_to_destination();
- stepper.synchronize();
- #endif
+ if (mbl.has_mesh()) {
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("mbl_was_active", current_position);
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL has mesh");
#endif
+ if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL Z homing");
+ #endif
+ current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
+ #if Z_HOME_DIR > 0
+ + Z_MAX_POS
+ #endif
+ ;
+ SYNC_PLAN_POSITION_KINEMATIC();
+ mbl.set_active(true);
+ #if ENABLED(MESH_G28_REST_ORIGIN)
+ current_position[Z_AXIS] = 0.0;
+ set_destination_to_current();
+ feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS];
+ line_to_destination();
+ stepper.synchronize();
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("MBL Rest Origin", current_position);
+ #endif
+ #else
+ current_position[Z_AXIS] = MESH_HOME_SEARCH_Z -
+ mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS))
+ #if Z_HOME_DIR > 0
+ + Z_MAX_POS
+ #endif
+ ;
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("MBL adjusted MESH_HOME_SEARCH_Z", current_position);
+ #endif
+ #endif
+ }
+ else if ((axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) && (homeX || homeY)) {
+ current_position[Z_AXIS] = pre_home_z;
+ SYNC_PLAN_POSITION_KINEMATIC();
+ mbl.set_active(true);
+ current_position[Z_AXIS] = pre_home_z -
+ mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS));
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("MBL Home X or Y", current_position);
+ #endif
+ }
}
#endif
- feedrate = saved_feedrate;
- feedrate_multiplier = saved_feedrate_multiplier;
- refresh_cmd_timeout();
- endstops.hit_on_purpose(); // clear endstop hit flags
+ #if ENABLED(DELTA)
+ // move to a height where we can use the full xy-area
+ do_blocking_move_to_z(delta_clip_start_height);
+ #endif
+
+ clean_up_after_endstop_or_probe_move();
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOLNPGM("<<< gcode_G28");
- }
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28");
+ #endif
+
+ // Restore the active tool after homing
+ #if HOTENDS > 1
+ tool_change(old_tool_index, 0, true);
#endif
report_current_position();
}
-#if ENABLED(MESH_BED_LEVELING)
+#if HAS_PROBING_PROCEDURE
+
+ void out_of_range_error(const char* p_edge) {
+ SERIAL_PROTOCOLPGM("?Probe ");
+ serialprintPGM(p_edge);
+ SERIAL_PROTOCOLLNPGM(" position out of range.");
+ }
- enum MeshLevelingState { MeshReport, MeshStart, MeshNext, MeshSet, MeshSetZOffset };
+#endif
+#if ENABLED(MESH_BED_LEVELING)
inline void _mbl_goto_xy(float x, float y) {
- saved_feedrate = feedrate;
- feedrate = homing_feedrate[X_AXIS];
+ float old_feedrate_mm_m = feedrate_mm_m;
+ feedrate_mm_m = homing_feedrate_mm_m[X_AXIS];
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
- #if MIN_Z_HEIGHT_FOR_HOMING > 0
+ #if Z_RAISE_BETWEEN_PROBINGS > MIN_Z_HEIGHT_FOR_HOMING
+ + Z_RAISE_BETWEEN_PROBINGS
+ #elif MIN_Z_HEIGHT_FOR_HOMING > 0
+ MIN_Z_HEIGHT_FOR_HOMING
#endif
;
line_to_current_position();
- current_position[X_AXIS] = x + home_offset[X_AXIS];
- current_position[Y_AXIS] = y + home_offset[Y_AXIS];
+ current_position[X_AXIS] = LOGICAL_X_POSITION(x);
+ current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
line_to_current_position();
- #if MIN_Z_HEIGHT_FOR_HOMING > 0
- current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
+ #if Z_RAISE_BETWEEN_PROBINGS > 0 || MIN_Z_HEIGHT_FOR_HOMING > 0
+ current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z);
line_to_current_position();
#endif
- feedrate = saved_feedrate;
+ feedrate_mm_m = old_feedrate_mm_m;
stepper.synchronize();
}
@@ -3001,6 +3248,7 @@ inline void gcode_G28() {
* S2 Probe the next mesh point
* S3 Xn Yn Zn.nn Manually modify a single point
* S4 Zn.nn Set z offset. Positive away from bed, negative closer to bed.
+ * S5 Reset and disable mesh
*
* The S0 report the points as below
*
@@ -3013,26 +3261,22 @@ inline void gcode_G28() {
inline void gcode_G29() {
static int probe_point = -1;
- MeshLevelingState state = code_seen('S') ? (MeshLevelingState)code_value_short() : MeshReport;
- if (state < 0 || state > 4) {
- SERIAL_PROTOCOLLNPGM("S out of range (0-4).");
+ MeshLevelingState state = code_seen('S') ? (MeshLevelingState)code_value_byte() : MeshReport;
+ if (state < 0 || state > 5) {
+ SERIAL_PROTOCOLLNPGM("S out of range (0-5).");
return;
}
int8_t px, py;
- float z;
switch (state) {
case MeshReport:
- if (mbl.active) {
- SERIAL_PROTOCOLPGM("Num X,Y: ");
- SERIAL_PROTOCOL(MESH_NUM_X_POINTS);
- SERIAL_PROTOCOLCHAR(',');
- SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
- SERIAL_PROTOCOLPGM("\nZ search height: ");
- SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z);
- SERIAL_PROTOCOLPGM("\nZ offset: ");
- SERIAL_PROTOCOL_F(mbl.z_offset, 5);
+ if (mbl.has_mesh()) {
+ SERIAL_PROTOCOLPAIR("State: ", mbl.active() ? "On" : "Off");
+ SERIAL_PROTOCOLPAIR("\nNum X,Y: ", MESH_NUM_X_POINTS);
+ SERIAL_PROTOCOLCHAR(','); SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
+ SERIAL_PROTOCOLPAIR("\nZ search height: ", MESH_HOME_SEARCH_Z);
+ SERIAL_PROTOCOLPGM("\nZ offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
SERIAL_PROTOCOLLNPGM("\nMeasured points:");
for (py = 0; py < MESH_NUM_Y_POINTS; py++) {
for (px = 0; px < MESH_NUM_X_POINTS; px++) {
@@ -3059,9 +3303,13 @@ inline void gcode_G28() {
}
// For each G29 S2...
if (probe_point == 0) {
- // For the intial G29 S2 make Z a positive value (e.g., 4.0)
- current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
- sync_plan_position();
+ // For the initial G29 S2 make Z a positive value (e.g., 4.0)
+ current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
+ #if Z_HOME_DIR > 0
+ + Z_MAX_POS
+ #endif
+ ;
+ SYNC_PLAN_POSITION_KINEMATIC();
}
else {
// For G29 S2 after adjusting Z.
@@ -3076,7 +3324,9 @@ inline void gcode_G28() {
else {
// One last "return to the bed" (as originally coded) at completion
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
- #if MIN_Z_HEIGHT_FOR_HOMING > 0
+ #if Z_RAISE_BETWEEN_PROBINGS > MIN_Z_HEIGHT_FOR_HOMING
+ + Z_RAISE_BETWEEN_PROBINGS
+ #elif MIN_Z_HEIGHT_FOR_HOMING > 0
+ MIN_Z_HEIGHT_FOR_HOMING
#endif
;
@@ -3086,53 +3336,63 @@ inline void gcode_G28() {
// After recording the last point, activate the mbl and home
SERIAL_PROTOCOLLNPGM("Mesh probing done.");
probe_point = -1;
- mbl.active = true;
+ mbl.set_has_mesh(true);
enqueue_and_echo_commands_P(PSTR("G28"));
}
break;
case MeshSet:
if (code_seen('X')) {
- px = code_value_long() - 1;
+ px = code_value_int() - 1;
if (px < 0 || px >= MESH_NUM_X_POINTS) {
- SERIAL_PROTOCOLPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").\n");
+ SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").");
return;
}
}
else {
- SERIAL_PROTOCOLPGM("X not entered.\n");
+ SERIAL_PROTOCOLLNPGM("X not entered.");
return;
}
if (code_seen('Y')) {
- py = code_value_long() - 1;
+ py = code_value_int() - 1;
if (py < 0 || py >= MESH_NUM_Y_POINTS) {
- SERIAL_PROTOCOLPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").\n");
+ SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").");
return;
}
}
else {
- SERIAL_PROTOCOLPGM("Y not entered.\n");
+ SERIAL_PROTOCOLLNPGM("Y not entered.");
return;
}
if (code_seen('Z')) {
- z = code_value();
+ mbl.z_values[py][px] = code_value_axis_units(Z_AXIS);
}
else {
- SERIAL_PROTOCOLPGM("Z not entered.\n");
+ SERIAL_PROTOCOLLNPGM("Z not entered.");
return;
}
- mbl.z_values[py][px] = z;
break;
case MeshSetZOffset:
if (code_seen('Z')) {
- z = code_value();
+ mbl.z_offset = code_value_axis_units(Z_AXIS);
}
else {
- SERIAL_PROTOCOLPGM("Z not entered.\n");
+ SERIAL_PROTOCOLLNPGM("Z not entered.");
return;
}
- mbl.z_offset = z;
+ break;
+
+ case MeshReset:
+ if (mbl.active()) {
+ current_position[Z_AXIS] +=
+ mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS)) - MESH_HOME_SEARCH_Z;
+ mbl.reset();
+ SYNC_PLAN_POSITION_KINEMATIC();
+ }
+ else
+ mbl.reset();
+
} // switch(state)
report_current_position();
@@ -3140,12 +3400,6 @@ inline void gcode_G28() {
#elif ENABLED(AUTO_BED_LEVELING_FEATURE)
- void out_of_range_error(const char* p_edge) {
- SERIAL_PROTOCOLPGM("?Probe ");
- serialprintPGM(p_edge);
- SERIAL_PROTOCOLLNPGM(" position out of range.");
- }
-
/**
* G29: Detailed Z probe, probes the bed at 3 or more points.
* Will fail if the printer has not been homed with G28.
@@ -3158,7 +3412,7 @@ inline void gcode_G28() {
* Not supported by non-linear delta printer bed leveling.
* Example: "G29 P4"
*
- * S Set the XY travel speed between probe points (in mm/min)
+ * S Set the XY travel speed between probe points (in units/min)
*
* D Dry-Run mode. Just evaluate the bed Topology - Don't apply
* or clean the rotation Matrix. Useful to check the topology
@@ -3188,25 +3442,22 @@ inline void gcode_G28() {
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOLNPGM("gcode_G29 >>>");
+ SERIAL_ECHOLNPGM(">>> gcode_G29");
DEBUG_POS("", current_position);
}
#endif
// Don't allow auto-leveling without homing first
- if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) {
- axis_unhomed_error(true);
- return;
- }
+ if (axis_unhomed_error(true, true, true)) return;
- int verbose_level = code_seen('V') ? code_value_short() : 1;
+ int verbose_level = code_seen('V') ? code_value_int() : 1;
if (verbose_level < 0 || verbose_level > 4) {
SERIAL_ECHOLNPGM("?(V)erbose Level is implausible (0-4).");
return;
}
- bool dryrun = code_seen('D'),
- deploy_probe_for_each_reading = code_seen('E');
+ bool dryrun = code_seen('D');
+ bool stow_probe_after_each = code_seen('E');
#if ENABLED(AUTO_BED_LEVELING_GRID)
@@ -3215,52 +3466,52 @@ inline void gcode_G28() {
#endif
if (verbose_level > 0) {
- SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n");
- if (dryrun) SERIAL_ECHOLNPGM("Running in DRY-RUN mode");
+ SERIAL_PROTOCOLLNPGM("G29 Auto Bed Leveling");
+ if (dryrun) SERIAL_PROTOCOLLNPGM("Running in DRY-RUN mode");
}
int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
#if DISABLED(DELTA)
- if (code_seen('P')) auto_bed_leveling_grid_points = code_value_short();
+ if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int();
if (auto_bed_leveling_grid_points < 2) {
- SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n");
+ SERIAL_PROTOCOLLNPGM("?Number of probed (P)oints is implausible (2 minimum).");
return;
}
#endif
- xy_travel_speed = code_seen('S') ? code_value_short() : XY_TRAVEL_SPEED;
+ xy_probe_feedrate_mm_m = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED;
- int left_probe_bed_position = code_seen('L') ? code_value_short() : LEFT_PROBE_BED_POSITION,
- right_probe_bed_position = code_seen('R') ? code_value_short() : RIGHT_PROBE_BED_POSITION,
- front_probe_bed_position = code_seen('F') ? code_value_short() : FRONT_PROBE_BED_POSITION,
- back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION;
+ int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LOGICAL_X_POSITION(LEFT_PROBE_BED_POSITION),
+ right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : LOGICAL_X_POSITION(RIGHT_PROBE_BED_POSITION),
+ front_probe_bed_position = code_seen('F') ? (int)code_value_axis_units(Y_AXIS) : LOGICAL_Y_POSITION(FRONT_PROBE_BED_POSITION),
+ back_probe_bed_position = code_seen('B') ? (int)code_value_axis_units(Y_AXIS) : LOGICAL_Y_POSITION(BACK_PROBE_BED_POSITION);
- bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
+ bool left_out_l = left_probe_bed_position < LOGICAL_X_POSITION(MIN_PROBE_X),
left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - (MIN_PROBE_EDGE),
- right_out_r = right_probe_bed_position > MAX_PROBE_X,
+ right_out_r = right_probe_bed_position > LOGICAL_X_POSITION(MAX_PROBE_X),
right_out = right_out_r || right_probe_bed_position < left_probe_bed_position + MIN_PROBE_EDGE,
- front_out_f = front_probe_bed_position < MIN_PROBE_Y,
+ front_out_f = front_probe_bed_position < LOGICAL_Y_POSITION(MIN_PROBE_Y),
front_out = front_out_f || front_probe_bed_position > back_probe_bed_position - (MIN_PROBE_EDGE),
- back_out_b = back_probe_bed_position > MAX_PROBE_Y,
+ back_out_b = back_probe_bed_position > LOGICAL_Y_POSITION(MAX_PROBE_Y),
back_out = back_out_b || back_probe_bed_position < front_probe_bed_position + MIN_PROBE_EDGE;
if (left_out || right_out || front_out || back_out) {
if (left_out) {
out_of_range_error(PSTR("(L)eft"));
- left_probe_bed_position = left_out_l ? MIN_PROBE_X : right_probe_bed_position - (MIN_PROBE_EDGE);
+ left_probe_bed_position = left_out_l ? LOGICAL_X_POSITION(MIN_PROBE_X) : right_probe_bed_position - (MIN_PROBE_EDGE);
}
if (right_out) {
out_of_range_error(PSTR("(R)ight"));
- right_probe_bed_position = right_out_r ? MAX_PROBE_X : left_probe_bed_position + MIN_PROBE_EDGE;
+ right_probe_bed_position = right_out_r ? LOGICAL_Y_POSITION(MAX_PROBE_X) : left_probe_bed_position + MIN_PROBE_EDGE;
}
if (front_out) {
out_of_range_error(PSTR("(F)ront"));
- front_probe_bed_position = front_out_f ? MIN_PROBE_Y : back_probe_bed_position - (MIN_PROBE_EDGE);
+ front_probe_bed_position = front_out_f ? LOGICAL_Y_POSITION(MIN_PROBE_Y) : back_probe_bed_position - (MIN_PROBE_EDGE);
}
if (back_out) {
out_of_range_error(PSTR("(B)ack"));
- back_probe_bed_position = back_out_b ? MAX_PROBE_Y : front_probe_bed_position + MIN_PROBE_EDGE;
+ back_probe_bed_position = back_out_b ? LOGICAL_Y_POSITION(MAX_PROBE_Y) : front_probe_bed_position + MIN_PROBE_EDGE;
}
return;
}
@@ -3296,22 +3547,17 @@ inline void gcode_G28() {
if (DEBUGGING(LEVELING)) DEBUG_POS("AFTER matrix.set_to_identity", uncorrected_position);
#endif
- sync_plan_position();
+ SYNC_PLAN_POSITION_KINEMATIC();
#endif // !DELTA
}
- #if ENABLED(Z_PROBE_SLED)
- dock_sled(false); // engage (un-dock) the Z probe
- #elif ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || (ENABLED(DELTA) && SERVO_LEVELING)
- deploy_z_probe();
- #endif
-
stepper.synchronize();
- setup_for_endstop_move();
+ setup_for_endstop_or_probe_move();
- feedrate = homing_feedrate[Z_AXIS];
+ // Deploy the probe. Probe will raise if needed.
+ if (DEPLOY_PROBE()) return;
bed_leveling_in_progress = true;
@@ -3325,7 +3571,7 @@ inline void gcode_G28() {
delta_grid_spacing[0] = xGridSpacing;
delta_grid_spacing[1] = yGridSpacing;
float zoffset = zprobe_zoffset;
- if (code_seen(axis_codes[Z_AXIS])) zoffset += code_value();
+ if (code_seen('Z')) zoffset += code_value_axis_units(Z_AXIS);
#else // !DELTA
/**
* solve the plane equation ax + by + d = z
@@ -3336,7 +3582,7 @@ inline void gcode_G28() {
* so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z
*/
- int abl2 = auto_bed_leveling_grid_points * auto_bed_leveling_grid_points;
+ int abl2 = sq(auto_bed_leveling_grid_points);
double eqnAMatrix[abl2 * 3], // "A" matrix of the linear system of equations
eqnBVector[abl2], // "B" vector of Z points
@@ -3367,44 +3613,13 @@ inline void gcode_G28() {
for (int xCount = xStart; xCount != xStop; xCount += xInc) {
double xProbe = left_probe_bed_position + xGridSpacing * xCount;
- // raise extruder
- float measured_z,
- z_before = probePointCounter ? Z_RAISE_BETWEEN_PROBINGS + current_position[Z_AXIS] : Z_RAISE_BEFORE_PROBING + home_offset[Z_AXIS];
-
- if (probePointCounter) {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("z_before = (between) ", (Z_RAISE_BETWEEN_PROBINGS + current_position[Z_AXIS]));
- SERIAL_EOL;
- }
- #endif
- }
- else {
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("z_before = (before) ", Z_RAISE_BEFORE_PROBING + home_offset[Z_AXIS]);
- SERIAL_EOL;
- }
- #endif
- }
-
#if ENABLED(DELTA)
// Avoid probing the corners (outside the round or hexagon print surface) on a delta printer.
- float distance_from_center = sqrt(xProbe * xProbe + yProbe * yProbe);
+ float distance_from_center = HYPOT(xProbe, yProbe);
if (distance_from_center > DELTA_PROBEABLE_RADIUS) continue;
#endif //DELTA
- ProbeAction act;
- if (deploy_probe_for_each_reading) // G29 E - Stow between probes
- act = ProbeDeployAndStow;
- else if (yCount == 0 && xCount == xStart)
- act = ProbeDeploy;
- else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc)
- act = ProbeStow;
- else
- act = ProbeStay;
-
- measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
+ float measured_z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
#if DISABLED(DELTA)
mean += measured_z;
@@ -3425,12 +3640,39 @@ inline void gcode_G28() {
} //xProbe
} //yProbe
+ #else // !AUTO_BED_LEVELING_GRID
+
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position);
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling");
#endif
- clean_up_after_endstop_move();
+ // Probe at 3 arbitrary points
+ float z_at_pt_1 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_1_X),
+ LOGICAL_Y_POSITION(ABL_PROBE_PT_1_Y),
+ stow_probe_after_each, verbose_level),
+ z_at_pt_2 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_2_X),
+ LOGICAL_Y_POSITION(ABL_PROBE_PT_2_Y),
+ stow_probe_after_each, verbose_level),
+ z_at_pt_3 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_3_X),
+ LOGICAL_Y_POSITION(ABL_PROBE_PT_3_Y),
+ stow_probe_after_each, verbose_level);
+
+ if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
+
+ #endif // !AUTO_BED_LEVELING_GRID
+
+ // Raise to _Z_RAISE_PROBE_DEPLOY_STOW. Stow the probe.
+ if (STOW_PROBE()) return;
+ // Restore state after probing
+ clean_up_after_endstop_or_probe_move();
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position);
+ #endif
+
+ // Calculate leveling, print reports, correct the position
+ #if ENABLED(AUTO_BED_LEVELING_GRID)
#if ENABLED(DELTA)
if (!dryrun) extrapolate_unprobed_bed_level();
@@ -3464,17 +3706,17 @@ inline void gcode_G28() {
// Show the Topography map if enabled
if (do_topography_map) {
- SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n");
- SERIAL_PROTOCOLPGM(" +--- BACK --+\n");
- SERIAL_PROTOCOLPGM(" | |\n");
- SERIAL_PROTOCOLPGM(" L | (+) | R\n");
- SERIAL_PROTOCOLPGM(" E | | I\n");
- SERIAL_PROTOCOLPGM(" F | (-) N (+) | G\n");
- SERIAL_PROTOCOLPGM(" T | | H\n");
- SERIAL_PROTOCOLPGM(" | (-) | T\n");
- SERIAL_PROTOCOLPGM(" | |\n");
- SERIAL_PROTOCOLPGM(" O-- FRONT --+\n");
- SERIAL_PROTOCOLPGM(" (0,0)\n");
+ SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n"
+ " +--- BACK --+\n"
+ " | |\n"
+ " L | (+) | R\n"
+ " E | | I\n"
+ " F | (-) N (+) | G\n"
+ " T | | H\n"
+ " | (-) | T\n"
+ " | |\n"
+ " O-- FRONT --+\n"
+ " (0,0)");
float min_diff = 999;
@@ -3501,7 +3743,7 @@ inline void gcode_G28() {
} // yy
SERIAL_EOL;
if (verbose_level > 3) {
- SERIAL_PROTOCOLPGM(" \nCorrected Bed Height vs. Bed Topology: \n");
+ SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:");
for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
@@ -3526,50 +3768,11 @@ inline void gcode_G28() {
}
} //do_topography_map
#endif //!DELTA
+ #endif // AUTO_BED_LEVELING_GRID
- #else // !AUTO_BED_LEVELING_GRID
-
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOLNPGM("> 3-point Leveling");
- }
- #endif
-
- // Actions for each probe
- ProbeAction p1, p2, p3;
- if (deploy_probe_for_each_reading)
- p1 = p2 = p3 = ProbeDeployAndStow;
- else
- p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow;
-
- // Probe at 3 arbitrary points
- float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS],
- ABL_PROBE_PT_1_Y + home_offset[Y_AXIS],
- Z_RAISE_BEFORE_PROBING + home_offset[Z_AXIS],
- p1, verbose_level),
- z_at_pt_2 = probe_pt( ABL_PROBE_PT_2_X + home_offset[X_AXIS],
- ABL_PROBE_PT_2_Y + home_offset[Y_AXIS],
- current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS,
- p2, verbose_level),
- z_at_pt_3 = probe_pt( ABL_PROBE_PT_3_X + home_offset[X_AXIS],
- ABL_PROBE_PT_3_Y + home_offset[Y_AXIS],
- current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS,
- p3, verbose_level);
- clean_up_after_endstop_move();
- if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
-
- #endif // !AUTO_BED_LEVELING_GRID
-
- #if ENABLED(DELTA)
- // Allen Key Probe for Delta
- #if ENABLED(Z_PROBE_ALLEN_KEY) || SERVO_LEVELING
- stow_z_probe();
- #elif Z_RAISE_AFTER_PROBING > 0
- raise_z_after_probing(); // for non Allen Key probes, such as simple mechanical probe
- #endif
- #else // !DELTA
+ #if DISABLED(DELTA)
if (verbose_level > 0)
- planner.bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
+ planner.bed_level_matrix.debug("\n\nBed Level Correction Matrix:");
if (!dryrun) {
/**
@@ -3580,13 +3783,12 @@ inline void gcode_G28() {
float x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER,
z_tmp = current_position[Z_AXIS],
- real_z = stepper.get_axis_position_mm(Z_AXIS); //get the real Z (since planner.adjusted_position is now correcting the plane)
+ stepper_z = stepper.get_axis_position_mm(Z_AXIS); //get the real Z (since planner.adjusted_position is now correcting the plane)
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > z_tmp = ", z_tmp);
- SERIAL_EOL;
- SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > real_z = ", real_z);
+ SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > stepper_z = ", stepper_z);
+ SERIAL_ECHOPAIR(" ... z_tmp = ", z_tmp);
SERIAL_EOL;
}
#endif
@@ -3594,28 +3796,6 @@ inline void gcode_G28() {
// Apply the correction sending the Z probe offset
apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp);
- /*
- * Get the current Z position and send it to the planner.
- *
- * >> (z_tmp - real_z) : The rotated current Z minus the uncorrected Z
- * (most recent planner.set_position_mm/sync_plan_position)
- *
- * >> zprobe_zoffset : Z distance from nozzle to Z probe
- * (set by default, M851, EEPROM, or Menu)
- *
- * >> Z_RAISE_AFTER_PROBING : The distance the Z probe will have lifted
- * after the last probe
- *
- * >> Should home_offset[Z_AXIS] be included?
- *
- *
- * Discussion: home_offset[Z_AXIS] was applied in G28 to set the
- * starting Z. If Z is not tweaked in G29 -and- the Z probe in G29 is
- * not actually "homing" Z... then perhaps it should not be included
- * here. The purpose of home_offset[] is to adjust for inaccurate
- * endstops, not for reasonably accurate probes. If it were added
- * here, it could be seen as a compensating factor for the Z probe.
- */
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR("> AFTER apply_rotation_xyz > z_tmp = ", z_tmp);
@@ -3623,53 +3803,29 @@ inline void gcode_G28() {
}
#endif
- current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z)
- #if HAS_SERVO_ENDSTOPS || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED)
- + Z_RAISE_AFTER_PROBING
- #endif
- ;
- // current_position[Z_AXIS] += home_offset[Z_AXIS]; // The Z probe determines Z=0, not "Z home"
- sync_plan_position();
+ // Adjust the current Z and send it to the planner.
+ current_position[Z_AXIS] += z_tmp - stepper_z;
+ SYNC_PLAN_POSITION_KINEMATIC();
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("> corrected Z in G29", current_position);
#endif
}
-
- // Sled assembly for Cartesian bots
- #if ENABLED(Z_PROBE_SLED)
- dock_sled(true); // dock the sled
- #elif Z_RAISE_AFTER_PROBING > 0
- // Raise Z axis for non-delta and non servo based probes
- #if !defined(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED)
- raise_z_after_probing();
- #endif
- #endif
-
#endif // !DELTA
- #if ENABLED(MECHANICAL_PROBE)
- stow_z_probe();
- #endif
-
#ifdef Z_PROBE_END_SCRIPT
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHO("Z Probe End Script: ");
+ SERIAL_ECHOPGM("Z Probe End Script: ");
SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT);
}
#endif
enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT));
- #if HAS_BED_PROBE
- endstops.enable_z_probe(false);
- #endif
stepper.synchronize();
#endif
#if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOLNPGM("<<< gcode_G29");
- }
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G29");
#endif
bed_leveling_in_progress = false;
@@ -3679,59 +3835,64 @@ inline void gcode_G28() {
KEEPALIVE_STATE(IN_HANDLER);
}
- #if DISABLED(Z_PROBE_SLED) // could be avoided
+#endif //AUTO_BED_LEVELING_FEATURE
- /**
- * G30: Do a single Z probe at the current XY
- */
- inline void gcode_G30() {
- #if HAS_SERVO_ENDSTOPS
- raise_z_for_servo();
- #endif
- deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here.
+#if HAS_BED_PROBE
- stepper.synchronize();
- // TODO: clear the leveling matrix or the planner will be set incorrectly
- setup_for_endstop_move(); // Too late. Must be done before deploying.
+ /**
+ * G30: Do a single Z probe at the current XY
+ */
+ inline void gcode_G30() {
- feedrate = homing_feedrate[Z_AXIS];
+ setup_for_endstop_or_probe_move();
- run_z_probe();
- SERIAL_PROTOCOLPGM("Bed X: ");
- SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001);
- SERIAL_PROTOCOLPGM(" Y: ");
- SERIAL_PROTOCOL(current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER + 0.0001);
- SERIAL_PROTOCOLPGM(" Z: ");
- SERIAL_PROTOCOL(current_position[Z_AXIS] + 0.0001);
- SERIAL_EOL;
+ // TODO: clear the leveling matrix or the planner will be set incorrectly
+ float measured_z = probe_pt(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
+ current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER,
+ true, 1);
- clean_up_after_endstop_move(); // Too early. must be done after the stowing.
+ SERIAL_PROTOCOLPGM("Bed X: ");
+ SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001);
+ SERIAL_PROTOCOLPGM(" Y: ");
+ SERIAL_PROTOCOL(current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER + 0.0001);
+ SERIAL_PROTOCOLPGM(" Z: ");
+ SERIAL_PROTOCOL(measured_z + 0.0001);
+ SERIAL_EOL;
- #if HAS_SERVO_ENDSTOPS
- raise_z_for_servo();
- #endif
- stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here.
+ clean_up_after_endstop_or_probe_move();
- report_current_position();
- }
+ report_current_position();
+ }
- #endif //!Z_PROBE_SLED
+ #if ENABLED(Z_PROBE_SLED)
-#endif //AUTO_BED_LEVELING_FEATURE
+ /**
+ * G31: Deploy the Z probe
+ */
+ inline void gcode_G31() { DEPLOY_PROBE(); }
+
+ /**
+ * G32: Stow the Z probe
+ */
+ inline void gcode_G32() { STOW_PROBE(); }
+
+ #endif // Z_PROBE_SLED
+
+#endif // HAS_BED_PROBE
/**
* G92: Set current position to given X Y Z E
*/
inline void gcode_G92() {
- bool didE = code_seen(axis_codes[E_AXIS]);
+ bool didE = code_seen('E');
if (!didE) stepper.synchronize();
bool didXYZ = false;
- for (int i = 0; i < NUM_AXIS; i++) {
+ LOOP_XYZE(i) {
if (code_seen(axis_codes[i])) {
float p = current_position[i],
- v = code_value();
+ v = code_value_axis_units(i);
current_position[i] = v;
@@ -3742,38 +3903,29 @@ inline void gcode_G92() {
}
}
}
- if (didXYZ) {
- #if ENABLED(DELTA) || ENABLED(SCARA)
- sync_plan_position_delta();
- #else
- sync_plan_position();
- #endif
- }
- else if (didE) {
+ if (didXYZ)
+ SYNC_PLAN_POSITION_KINEMATIC();
+ else if (didE)
sync_plan_position_e();
- }
}
#if ENABLED(ULTIPANEL)
/**
- * M0: // M0 - Unconditional stop - Wait for user button press on LCD
- * M1: // M1 - Conditional stop - Wait for user button press on LCD
+ * M0: Unconditional stop - Wait for user button press on LCD
+ * M1: Conditional stop - Wait for user button press on LCD
*/
inline void gcode_M0_M1() {
char* args = current_command_args;
- uint8_t test_value = 12;
- SERIAL_ECHOPAIR("TEST", test_value);
-
millis_t codenum = 0;
bool hasP = false, hasS = false;
if (code_seen('P')) {
- codenum = code_value_short(); // milliseconds to wait
+ codenum = code_value_millis(); // milliseconds to wait
hasP = codenum > 0;
}
if (code_seen('S')) {
- codenum = code_value() * 1000UL; // seconds to wait
+ codenum = code_value_millis_from_seconds(); // seconds to wait
hasS = codenum > 0;
}
@@ -3911,13 +4063,16 @@ inline void gcode_M17() {
* M31: Get the time since the start of SD Print (or last M109)
*/
inline void gcode_M31() {
- millis_t t = print_job_timer.duration();
- int min = t / 60, sec = t % 60;
- char time[30];
- sprintf_P(time, PSTR("%i min, %i sec"), min, sec);
+ char buffer[21];
+ duration_t elapsed = print_job_timer.duration();
+ elapsed.toString(buffer);
+
+ lcd_setstatus(buffer);
+
SERIAL_ECHO_START;
- SERIAL_ECHOLN(time);
- lcd_setstatus(time);
+ SERIAL_ECHOPGM("Print time: ");
+ SERIAL_ECHOLN(buffer);
+
thermalManager.autotempShutdown();
}
@@ -3987,50 +4142,37 @@ inline void gcode_M31() {
* S Pin status from 0 - 255
*/
inline void gcode_M42() {
- if (code_seen('S')) {
- int pin_status = code_value_short();
- if (pin_status < 0 || pin_status > 255) return;
+ if (!code_seen('S')) return;
- int pin_number = code_seen('P') ? code_value_short() : LED_PIN;
- if (pin_number < 0) return;
+ int pin_status = code_value_int();
+ if (pin_status < 0 || pin_status > 255) return;
- for (uint8_t i = 0; i < COUNT(sensitive_pins); i++)
- if (pin_number == sensitive_pins[i]) return;
+ int pin_number = code_seen('P') ? code_value_int() : LED_PIN;
+ if (pin_number < 0) return;
- pinMode(pin_number, OUTPUT);
- digitalWrite(pin_number, pin_status);
- analogWrite(pin_number, pin_status);
+ for (uint8_t i = 0; i < COUNT(sensitive_pins); i++)
+ if (pin_number == sensitive_pins[i]) return;
- #if FAN_COUNT > 0
- switch (pin_number) {
- #if HAS_FAN0
- case FAN_PIN: fanSpeeds[0] = pin_status; break;
- #endif
- #if HAS_FAN1
- case FAN1_PIN: fanSpeeds[1] = pin_status; break;
- #endif
- #if HAS_FAN2
- case FAN2_PIN: fanSpeeds[2] = pin_status; break;
- #endif
- }
- #endif
+ pinMode(pin_number, OUTPUT);
+ digitalWrite(pin_number, pin_status);
+ analogWrite(pin_number, pin_status);
- } // code_seen('S')
+ #if FAN_COUNT > 0
+ switch (pin_number) {
+ #if HAS_FAN0
+ case FAN_PIN: fanSpeeds[0] = pin_status; break;
+ #endif
+ #if HAS_FAN1
+ case FAN1_PIN: fanSpeeds[1] = pin_status; break;
+ #endif
+ #if HAS_FAN2
+ case FAN2_PIN: fanSpeeds[2] = pin_status; break;
+ #endif
+ }
+ #endif
}
-#if ENABLED(AUTO_BED_LEVELING_FEATURE) && ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
-
- /**
- * This is redundant since the SanityCheck.h already checks for a valid
- * Z_MIN_PROBE_PIN, but here for clarity.
- */
- #if ENABLED(Z_MIN_PROBE_ENDSTOP)
- #if !HAS_Z_MIN_PROBE_PIN
- #error "You must define Z_MIN_PROBE_PIN to enable Z probe repeatability calculation."
- #endif
- #elif !HAS_Z_MIN
- #error "You must define Z_MIN_PIN to enable Z probe repeatability calculation."
- #endif
+#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
/**
* M48: Z probe repeatability measurement function.
@@ -4052,83 +4194,59 @@ inline void gcode_M42() {
*/
inline void gcode_M48() {
- if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) {
- axis_unhomed_error(true);
- return;
- }
-
- double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50];
- int8_t verbose_level = 1, n_samples = 10, n_legs = 0, schizoid_flag = 0;
+ if (axis_unhomed_error(true, true, true)) return;
- if (code_seen('V')) {
- verbose_level = code_value_short();
- if (verbose_level < 0 || verbose_level > 4) {
- SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n");
- return;
- }
+ int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
+ if (verbose_level < 0 || verbose_level > 4) {
+ SERIAL_PROTOCOLLNPGM("?Verbose Level not plausible (0-4).");
+ return;
}
if (verbose_level > 0)
- SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n");
+ SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability test");
- if (code_seen('P')) {
- n_samples = code_value_short();
- if (n_samples < 4 || n_samples > 50) {
- SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n");
- return;
- }
+ int8_t n_samples = code_seen('P') ? code_value_byte() : 10;
+ if (n_samples < 4 || n_samples > 50) {
+ SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50).");
+ return;
}
float X_current = current_position[X_AXIS],
- Y_current = current_position[Y_AXIS],
- Z_current = current_position[Z_AXIS],
- X_probe_location = X_current + X_PROBE_OFFSET_FROM_EXTRUDER,
- Y_probe_location = Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER,
- Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING;
- bool deploy_probe_for_each_reading = code_seen('E');
-
- if (code_seen('X')) {
- X_probe_location = code_value();
- #if DISABLED(DELTA)
- if (X_probe_location < MIN_PROBE_X || X_probe_location > MAX_PROBE_X) {
- out_of_range_error(PSTR("X"));
- return;
- }
- #endif
- }
+ Y_current = current_position[Y_AXIS];
- if (code_seen('Y')) {
- Y_probe_location = code_value();
- #if DISABLED(DELTA)
- if (Y_probe_location < MIN_PROBE_Y || Y_probe_location > MAX_PROBE_Y) {
- out_of_range_error(PSTR("Y"));
- return;
- }
- #endif
- }
+ bool stow_probe_after_each = code_seen('E');
- #if ENABLED(DELTA)
- if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) {
- SERIAL_PROTOCOLPGM("? (X,Y) location outside of probeable radius.\n");
+ float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER;
+ #if DISABLED(DELTA)
+ if (X_probe_location < LOGICAL_X_POSITION(MIN_PROBE_X) || X_probe_location > LOGICAL_X_POSITION(MAX_PROBE_X)) {
+ out_of_range_error(PSTR("X"));
return;
}
#endif
- bool seen_L = code_seen('L');
-
- if (seen_L) {
- n_legs = code_value_short();
- if (n_legs < 0 || n_legs > 15) {
- SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n");
+ float Y_probe_location = code_seen('Y') ? code_value_axis_units(Y_AXIS) : Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER;
+ #if DISABLED(DELTA)
+ if (Y_probe_location < LOGICAL_Y_POSITION(MIN_PROBE_Y) || Y_probe_location > LOGICAL_Y_POSITION(MAX_PROBE_Y)) {
+ out_of_range_error(PSTR("Y"));
return;
}
- if (n_legs == 1) n_legs = 2;
- }
+ #else
+ if (HYPOT(RAW_X_POSITION(X_probe_location), RAW_Y_POSITION(Y_probe_location)) > DELTA_PROBEABLE_RADIUS) {
+ SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius.");
+ return;
+ }
+ #endif
- if (code_seen('S')) {
- schizoid_flag++;
- if (!seen_L) n_legs = 7;
+ bool seen_L = code_seen('L');
+ uint8_t n_legs = seen_L ? code_value_byte() : 0;
+ if (n_legs > 15) {
+ SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15).");
+ return;
}
+ if (n_legs == 1) n_legs = 2;
+
+ bool schizoid_flag = code_seen('S');
+ if (schizoid_flag && !seen_L) n_legs = 7;
/**
* Now get everything to the specified probe point So we can safely do a
@@ -4136,57 +4254,42 @@ inline void gcode_M42() {
* we don't want to use that as a starting point for each probe.
*/
if (verbose_level > 2)
- SERIAL_PROTOCOLPGM("Positioning the probe...\n");
+ SERIAL_PROTOCOLLNPGM("Positioning the probe...");
#if ENABLED(DELTA)
// we don't do bed level correction in M48 because we want the raw data when we probe
reset_bed_level();
- #else
+ #elif ENABLED(AUTO_BED_LEVELING_FEATURE)
// we don't do bed level correction in M48 because we want the raw data when we probe
planner.bed_level_matrix.set_to_identity();
#endif
- if (Z_start_location < Z_RAISE_BEFORE_PROBING * 2.0)
- do_blocking_move_to_z(Z_start_location);
-
- do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER));
-
- /**
- * OK, do the initial probe to get us close to the bed.
- * Then retrace the right amount and use that in subsequent probes
- */
- setup_for_endstop_move();
+ setup_for_endstop_or_probe_move();
- probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING,
- deploy_probe_for_each_reading ? ProbeDeployAndStow : ProbeDeploy,
- verbose_level);
+ // Move to the first point, deploy, and probe
+ probe_pt(X_probe_location, Y_probe_location, stow_probe_after_each, verbose_level);
- raise_z_after_probing();
+ randomSeed(millis());
+ double mean = 0, sigma = 0, sample_set[n_samples];
for (uint8_t n = 0; n < n_samples; n++) {
- randomSeed(millis());
- delay(500);
if (n_legs) {
- float radius, angle = random(0.0, 360.0);
int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise
-
- radius = random(
- #if ENABLED(DELTA)
- DELTA_PROBEABLE_RADIUS / 8, DELTA_PROBEABLE_RADIUS / 3
- #else
- 5, X_MAX_LENGTH / 8
- #endif
- );
+ float angle = random(0.0, 360.0),
+ radius = random(
+ #if ENABLED(DELTA)
+ DELTA_PROBEABLE_RADIUS / 8, DELTA_PROBEABLE_RADIUS / 3
+ #else
+ 5, X_MAX_LENGTH / 8
+ #endif
+ );
if (verbose_level > 3) {
SERIAL_ECHOPAIR("Starting radius: ", radius);
SERIAL_ECHOPAIR(" angle: ", angle);
- delay(100);
- if (dir > 0)
- SERIAL_ECHO(" Direction: Counter Clockwise \n");
- else
- SERIAL_ECHO(" Direction: Clockwise \n");
- delay(100);
+ SERIAL_ECHOPGM(" Direction: ");
+ if (dir > 0) SERIAL_ECHOPGM("Counter-");
+ SERIAL_ECHOLNPGM("Clockwise");
}
for (uint8_t l = 0; l < n_legs - 1; l++) {
@@ -4218,49 +4321,34 @@ inline void gcode_M42() {
#else
// If we have gone out too far, we can do a simple fix and scale the numbers
// back in closer to the origin.
- while (sqrt(X_current * X_current + Y_current * Y_current) > DELTA_PROBEABLE_RADIUS) {
+ while (HYPOT(X_current, Y_current) > DELTA_PROBEABLE_RADIUS) {
X_current /= 1.25;
Y_current /= 1.25;
if (verbose_level > 3) {
SERIAL_ECHOPAIR("Pulling point towards center:", X_current);
SERIAL_ECHOPAIR(", ", Y_current);
SERIAL_EOL;
- delay(50);
}
}
#endif
if (verbose_level > 3) {
- SERIAL_PROTOCOL("Going to:");
- SERIAL_ECHOPAIR("x: ", X_current);
- SERIAL_ECHOPAIR("y: ", Y_current);
- SERIAL_ECHOPAIR(" z: ", current_position[Z_AXIS]);
+ SERIAL_PROTOCOLPGM("Going to:");
+ SERIAL_ECHOPAIR(" X", X_current);
+ SERIAL_ECHOPAIR(" Y", Y_current);
+ SERIAL_ECHOPAIR(" Z", current_position[Z_AXIS]);
SERIAL_EOL;
- delay(55);
}
do_blocking_move_to_xy(X_current, Y_current);
} // n_legs loop
} // n_legs
- /**
- * We don't really have to do this move, but if we don't we can see a
- * funny shift in the Z Height because the user might not have the
- * Z_RAISE_BEFORE_PROBING height identical to the Z_RAISE_BETWEEN_PROBING
- * height. This gets us back to the probe location at the same height that
- * we have been running around the circle at.
- */
- do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER));
- if (deploy_probe_for_each_reading)
- sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeDeployAndStow, verbose_level);
- else {
- if (n == n_samples - 1)
- sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeStow, verbose_level); else
- sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeStay, verbose_level);
- }
+ // Probe a single point
+ sample_set[n] = probe_pt(X_probe_location, Y_probe_location, stow_probe_after_each, verbose_level);
/**
* Get the current mean for the data points we have so far
*/
- sum = 0.0;
+ double sum = 0.0;
for (uint8_t j = 0; j <= n; j++) sum += sample_set[j];
mean = sum / (n + 1);
@@ -4269,50 +4357,47 @@ inline void gcode_M42() {
* data points we have so far
*/
sum = 0.0;
- for (uint8_t j = 0; j <= n; j++) {
- float ss = sample_set[j] - mean;
- sum += ss * ss;
- }
+ for (uint8_t j = 0; j <= n; j++)
+ sum += sq(sample_set[j] - mean);
+
sigma = sqrt(sum / (n + 1));
- if (verbose_level > 1) {
- SERIAL_PROTOCOL(n + 1);
- SERIAL_PROTOCOLPGM(" of ");
- SERIAL_PROTOCOL((int)n_samples);
- SERIAL_PROTOCOLPGM(" z: ");
- SERIAL_PROTOCOL_F(current_position[Z_AXIS], 6);
- delay(50);
- if (verbose_level > 2) {
- SERIAL_PROTOCOLPGM(" mean: ");
- SERIAL_PROTOCOL_F(mean, 6);
- SERIAL_PROTOCOLPGM(" sigma: ");
- SERIAL_PROTOCOL_F(sigma, 6);
+ if (verbose_level > 0) {
+ if (verbose_level > 1) {
+ SERIAL_PROTOCOL(n + 1);
+ SERIAL_PROTOCOLPGM(" of ");
+ SERIAL_PROTOCOL((int)n_samples);
+ SERIAL_PROTOCOLPGM(" z: ");
+ SERIAL_PROTOCOL_F(current_position[Z_AXIS], 6);
+ if (verbose_level > 2) {
+ SERIAL_PROTOCOLPGM(" mean: ");
+ SERIAL_PROTOCOL_F(mean, 6);
+ SERIAL_PROTOCOLPGM(" sigma: ");
+ SERIAL_PROTOCOL_F(sigma, 6);
+ }
}
+ SERIAL_EOL;
}
- if (verbose_level > 0) SERIAL_EOL;
- delay(50);
- do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
- } // End of probe loop code
- // raise_z_after_probing();
+ } // End of probe loop
+
+ if (STOW_PROBE()) return;
if (verbose_level > 0) {
SERIAL_PROTOCOLPGM("Mean: ");
SERIAL_PROTOCOL_F(mean, 6);
SERIAL_EOL;
- delay(25);
}
SERIAL_PROTOCOLPGM("Standard Deviation: ");
SERIAL_PROTOCOL_F(sigma, 6);
SERIAL_EOL; SERIAL_EOL;
- delay(25);
- clean_up_after_endstop_move();
+ clean_up_after_endstop_or_probe_move();
report_current_position();
}
-#endif // AUTO_BED_LEVELING_FEATURE && Z_MIN_PROBE_REPEATABILITY_TEST
+#endif // Z_MIN_PROBE_REPEATABILITY_TEST
/**
* M75: Start print timer
@@ -4330,12 +4415,12 @@ inline void gcode_M76() { print_job_timer.pause(); }
inline void gcode_M77() { print_job_timer.stop(); }
#if ENABLED(PRINTCOUNTER)
- /*+
+ /**
* M78: Show print statistics
*/
inline void gcode_M78() {
// "M78 S78" will reset the statistics
- if (code_seen('S') && code_value_short() == 78)
+ if (code_seen('S') && code_value_int() == 78)
print_job_timer.initStats();
else print_job_timer.showStats();
}
@@ -4348,33 +4433,32 @@ inline void gcode_M104() {
if (get_target_extruder_from_command(104)) return;
if (DEBUGGING(DRYRUN)) return;
+ #if ENABLED(SINGLENOZZLE)
+ if (target_extruder != active_extruder) return;
+ #endif
+
if (code_seen('S')) {
- float temp = code_value();
- thermalManager.setTargetHotend(temp, target_extruder);
+ thermalManager.setTargetHotend(code_value_temp_abs(), target_extruder);
#if ENABLED(DUAL_X_CARRIAGE)
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
- thermalManager.setTargetHotend(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset, 1);
+ thermalManager.setTargetHotend(code_value_temp_abs() == 0.0 ? 0.0 : code_value_temp_abs() + duplicate_extruder_temp_offset, 1);
#endif
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
/**
+ * Stop the timer at the end of print, starting is managed by
+ * 'heat and wait' M109.
* We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
* stand by mode, for instance in a dual extruder setup, without affecting
* the running print timer.
*/
- if (temp <= (EXTRUDE_MINTEMP)/2) {
+ if (code_value_temp_abs() <= (EXTRUDE_MINTEMP)/2) {
print_job_timer.stop();
LCD_MESSAGEPGM(WELCOME_MSG);
}
- /**
- * We do not check if the timer is already running because this check will
- * be done for us inside the Stopwatch::start() method thus a running timer
- * will not restart.
- */
- else print_job_timer.start();
#endif
- if (temp > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
+ if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
}
}
@@ -4386,66 +4470,45 @@ inline void gcode_M104() {
SERIAL_PROTOCOL_F(thermalManager.degHotend(target_extruder), 1);
SERIAL_PROTOCOLPGM(" /");
SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(target_extruder), 1);
+ #if ENABLED(SHOW_TEMP_ADC_VALUES)
+ SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[target_extruder] / OVERSAMPLENR);
+ SERIAL_CHAR(')');
+ #endif
#endif
#if HAS_TEMP_BED
SERIAL_PROTOCOLPGM(" B:");
SERIAL_PROTOCOL_F(thermalManager.degBed(), 1);
SERIAL_PROTOCOLPGM(" /");
SERIAL_PROTOCOL_F(thermalManager.degTargetBed(), 1);
- #endif
- #if EXTRUDERS > 1
- for (int8_t e = 0; e < EXTRUDERS; ++e) {
- SERIAL_PROTOCOLPGM(" T");
- SERIAL_PROTOCOL(e);
- SERIAL_PROTOCOLCHAR(':');
- SERIAL_PROTOCOL_F(thermalManager.degHotend(e), 1);
- SERIAL_PROTOCOLPGM(" /");
- SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(e), 1);
- }
- #endif
- #if HAS_TEMP_BED
- SERIAL_PROTOCOLPGM(" B@:");
- #ifdef BED_WATTS
- SERIAL_PROTOCOL(((BED_WATTS) * thermalManager.getHeaterPower(-1)) / 127);
- SERIAL_PROTOCOLCHAR('W');
- #else
- SERIAL_PROTOCOL(thermalManager.getHeaterPower(-1));
+ #if ENABLED(SHOW_TEMP_ADC_VALUES)
+ SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_bed_raw / OVERSAMPLENR);
+ SERIAL_CHAR(')');
#endif
#endif
- SERIAL_PROTOCOLPGM(" @:");
- #ifdef EXTRUDER_WATTS
- SERIAL_PROTOCOL(((EXTRUDER_WATTS) * thermalManager.getHeaterPower(target_extruder)) / 127);
- SERIAL_PROTOCOLCHAR('W');
- #else
- SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder));
- #endif
- #if EXTRUDERS > 1
- for (int8_t e = 0; e < EXTRUDERS; ++e) {
- SERIAL_PROTOCOLPGM(" @");
- SERIAL_PROTOCOL(e);
+ #if HOTENDS > 1
+ HOTEND_LOOP() {
+ SERIAL_PROTOCOLPAIR(" T", e);
SERIAL_PROTOCOLCHAR(':');
- #ifdef EXTRUDER_WATTS
- SERIAL_PROTOCOL(((EXTRUDER_WATTS) * thermalManager.getHeaterPower(e)) / 127);
- SERIAL_PROTOCOLCHAR('W');
- #else
- SERIAL_PROTOCOL(thermalManager.getHeaterPower(e));
+ SERIAL_PROTOCOL_F(thermalManager.degHotend(e), 1);
+ SERIAL_PROTOCOLPGM(" /");
+ SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(e), 1);
+ #if ENABLED(SHOW_TEMP_ADC_VALUES)
+ SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[e] / OVERSAMPLENR);
+ SERIAL_CHAR(')');
#endif
}
#endif
- #if ENABLED(SHOW_TEMP_ADC_VALUES)
- #if HAS_TEMP_BED
- SERIAL_PROTOCOLPGM(" ADC B:");
- SERIAL_PROTOCOL_F(thermalManager.degBed(), 1);
- SERIAL_PROTOCOLPGM("C->");
- SERIAL_PROTOCOL_F(thermalManager.rawBedTemp() / OVERSAMPLENR, 0);
- #endif
- for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
- SERIAL_PROTOCOLPGM(" T");
- SERIAL_PROTOCOL(cur_extruder);
+ SERIAL_PROTOCOLPGM(" @:");
+ SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder));
+ #if HAS_TEMP_BED
+ SERIAL_PROTOCOLPGM(" B@:");
+ SERIAL_PROTOCOL(thermalManager.getHeaterPower(-1));
+ #endif
+ #if HOTENDS > 1
+ HOTEND_LOOP() {
+ SERIAL_PROTOCOLPAIR(" @", e);
SERIAL_PROTOCOLCHAR(':');
- SERIAL_PROTOCOL_F(thermalManager.degHotend(cur_extruder), 1);
- SERIAL_PROTOCOLPGM("C->");
- SERIAL_PROTOCOL_F(thermalManager.rawHotendTemp(cur_extruder) / OVERSAMPLENR, 0);
+ SERIAL_PROTOCOL(thermalManager.getHeaterPower(e));
}
#endif
}
@@ -4477,8 +4540,8 @@ inline void gcode_M105() {
* P Fan index, if more than one fan
*/
inline void gcode_M106() {
- uint16_t s = code_seen('S') ? code_value_short() : 255,
- p = code_seen('P') ? code_value_short() : 0;
+ uint16_t s = code_seen('S') ? code_value_ushort() : 255,
+ p = code_seen('P') ? code_value_ushort() : 0;
NOMORE(s, 255);
if (p < FAN_COUNT) fanSpeeds[p] = s;
}
@@ -4487,12 +4550,43 @@ inline void gcode_M105() {
* M107: Fan Off
*/
inline void gcode_M107() {
- uint16_t p = code_seen('P') ? code_value_short() : 0;
+ uint16_t p = code_seen('P') ? code_value_ushort() : 0;
if (p < FAN_COUNT) fanSpeeds[p] = 0;
}
#endif // FAN_COUNT > 0
+#if DISABLED(EMERGENCY_PARSER)
+
+ /**
+ * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature.
+ */
+ inline void gcode_M108() { wait_for_heatup = false; }
+
+
+ /**
+ * M112: Emergency Stop
+ */
+ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
+
+
+ /**
+ * M410: Quickstop - Abort all planned moves
+ *
+ * This will stop the carriages mid-move, so most likely they
+ * will be out of sync with the stepper position after this.
+ */
+ inline void gcode_M410() { quickstop_stepper(); }
+
+#endif
+
+ #ifndef MIN_COOLING_SLOPE_DEG
+ #define MIN_COOLING_SLOPE_DEG 1.50
+ #endif
+ #ifndef MIN_COOLING_SLOPE_TIME
+ #define MIN_COOLING_SLOPE_TIME 60
+ #endif
+
/**
* M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
* Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
@@ -4502,13 +4596,16 @@ inline void gcode_M109() {
if (get_target_extruder_from_command(109)) return;
if (DEBUGGING(DRYRUN)) return;
+ #if ENABLED(SINGLENOZZLE)
+ if (target_extruder != active_extruder) return;
+ #endif
+
bool no_wait_for_cooling = code_seen('S');
if (no_wait_for_cooling || code_seen('R')) {
- float temp = code_value();
- thermalManager.setTargetHotend(temp, target_extruder);
+ thermalManager.setTargetHotend(code_value_temp_abs(), target_extruder);
#if ENABLED(DUAL_X_CARRIAGE)
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
- thermalManager.setTargetHotend(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset, 1);
+ thermalManager.setTargetHotend(code_value_temp_abs() == 0.0 ? 0.0 : code_value_temp_abs() + duplicate_extruder_temp_offset, 1);
#endif
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
@@ -4517,7 +4614,7 @@ inline void gcode_M109() {
* stand by mode, for instance in a dual extruder setup, without affecting
* the running print timer.
*/
- if (temp <= (EXTRUDE_MINTEMP)/2) {
+ if (code_value_temp_abs() <= (EXTRUDE_MINTEMP)/2) {
print_job_timer.stop();
LCD_MESSAGEPGM(WELCOME_MSG);
}
@@ -4529,7 +4626,7 @@ inline void gcode_M109() {
else print_job_timer.start();
#endif
- if (temp > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
+ if (thermalManager.isHeatingHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
}
#if ENABLED(AUTOTEMP)
@@ -4545,20 +4642,27 @@ inline void gcode_M109() {
#define TEMP_CONDITIONS (wants_to_cool ? thermalManager.isCoolingHotend(target_extruder) : thermalManager.isHeatingHotend(target_extruder))
#endif //TEMP_RESIDENCY_TIME > 0
- float theTarget = -1;
- bool wants_to_cool;
- cancel_heatup = false;
- millis_t now, next_temp_ms = 0;
+ float theTarget = -1.0, old_temp = 9999.0;
+ bool wants_to_cool = false;
+ wait_for_heatup = true;
+ millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
KEEPALIVE_STATE(NOT_BUSY);
do {
+ // Target temperature might be changed during the loop
+ if (theTarget != thermalManager.degTargetHotend(target_extruder)) {
+ wants_to_cool = thermalManager.isCoolingHotend(target_extruder);
+ theTarget = thermalManager.degTargetHotend(target_extruder);
+
+ // Exit if S, continue if S, R, or R
+ if (no_wait_for_cooling && wants_to_cool) break;
+ }
+
now = millis();
if (ELAPSED(now, next_temp_ms)) { //Print temp & remaining time every 1s while waiting
next_temp_ms = now + 1000UL;
- #if HAS_TEMP_HOTEND || HAS_TEMP_BED
- print_heaterstates();
- #endif
+ print_heaterstates();
#if TEMP_RESIDENCY_TIME > 0
SERIAL_PROTOCOLPGM(" W:");
if (residency_start_ms) {
@@ -4573,38 +4677,38 @@ inline void gcode_M109() {
#endif
}
- // Target temperature might be changed during the loop
- if (theTarget != thermalManager.degTargetHotend(target_extruder)) {
- wants_to_cool = thermalManager.isCoolingHotend(target_extruder);
- theTarget = thermalManager.degTargetHotend(target_extruder);
-
- // Exit if S, continue if S, R, or R
- if (no_wait_for_cooling && wants_to_cool) break;
-
- // Prevent a wait-forever situation if R is misused i.e. M109 R0
- // Try to calculate a ballpark safe margin by halving EXTRUDE_MINTEMP
- if (wants_to_cool && theTarget < (EXTRUDE_MINTEMP)/2) break;
- }
-
idle();
refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out
+ float temp = thermalManager.degHotend(target_extruder);
+
#if TEMP_RESIDENCY_TIME > 0
- float temp_diff = fabs(theTarget - thermalManager.degHotend(target_extruder));
+ float temp_diff = fabs(theTarget - temp);
if (!residency_start_ms) {
// Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time.
- if (temp_diff < TEMP_WINDOW) residency_start_ms = millis();
+ if (temp_diff < TEMP_WINDOW) residency_start_ms = now;
}
else if (temp_diff > TEMP_HYSTERESIS) {
// Restart the timer whenever the temperature falls outside the hysteresis.
- residency_start_ms = millis();
+ residency_start_ms = now;
}
#endif //TEMP_RESIDENCY_TIME > 0
- } while (!cancel_heatup && TEMP_CONDITIONS);
+ // Prevent a wait-forever situation if R is misused i.e. M109 R0
+ if (wants_to_cool) {
+ // break after MIN_COOLING_SLOPE_TIME seconds
+ // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG
+ if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
+ if (old_temp - temp < MIN_COOLING_SLOPE_DEG) break;
+ next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME;
+ old_temp = temp;
+ }
+ }
+
+ } while (wait_for_heatup && TEMP_CONDITIONS);
LCD_MESSAGEPGM(MSG_HEATING_COMPLETE);
KEEPALIVE_STATE(IN_HANDLER);
@@ -4612,6 +4716,13 @@ inline void gcode_M109() {
#if HAS_TEMP_BED
+ #ifndef MIN_COOLING_SLOPE_DEG_BED
+ #define MIN_COOLING_SLOPE_DEG_BED 1.50
+ #endif
+ #ifndef MIN_COOLING_SLOPE_TIME_BED
+ #define MIN_COOLING_SLOPE_TIME_BED 60
+ #endif
+
/**
* M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
* Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
@@ -4621,7 +4732,22 @@ inline void gcode_M109() {
LCD_MESSAGEPGM(MSG_BED_HEATING);
bool no_wait_for_cooling = code_seen('S');
- if (no_wait_for_cooling || code_seen('R')) thermalManager.setTargetBed(code_value());
+ if (no_wait_for_cooling || code_seen('R')) {
+ thermalManager.setTargetBed(code_value_temp_abs());
+ #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
+ if (code_value_temp_abs() > BED_MINTEMP) {
+ /**
+ * We start the timer when 'heating and waiting' command arrives, LCD
+ * functions never wait. Cooling down managed by extruders.
+ *
+ * We do not check if the timer is already running because this check will
+ * be done for us inside the Stopwatch::start() method thus a running timer
+ * will not restart.
+ */
+ print_job_timer.start();
+ }
+ #endif
+ }
#if TEMP_BED_RESIDENCY_TIME > 0
millis_t residency_start_ms = 0;
@@ -4632,14 +4758,25 @@ inline void gcode_M109() {
#define TEMP_BED_CONDITIONS (wants_to_cool ? thermalManager.isCoolingBed() : thermalManager.isHeatingBed())
#endif //TEMP_BED_RESIDENCY_TIME > 0
- float theTarget = -1;
- bool wants_to_cool;
- cancel_heatup = false;
- millis_t now, next_temp_ms = 0;
+ float theTarget = -1.0, old_temp = 9999.0;
+ bool wants_to_cool = false;
+ wait_for_heatup = true;
+ millis_t now, next_temp_ms = 0, next_cool_check_ms = 0;
KEEPALIVE_STATE(NOT_BUSY);
+ target_extruder = active_extruder; // for print_heaterstates
+
do {
+ // Target temperature might be changed during the loop
+ if (theTarget != thermalManager.degTargetBed()) {
+ wants_to_cool = thermalManager.isCoolingBed();
+ theTarget = thermalManager.degTargetBed();
+
+ // Exit if S, continue if S, R, or R
+ if (no_wait_for_cooling && wants_to_cool) break;
+ }
+
now = millis();
if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up.
next_temp_ms = now + 1000UL;
@@ -4658,38 +4795,39 @@ inline void gcode_M109() {
#endif
}
- // Target temperature might be changed during the loop
- if (theTarget != thermalManager.degTargetBed()) {
- wants_to_cool = thermalManager.isCoolingBed();
- theTarget = thermalManager.degTargetBed();
-
- // Exit if S, continue if S, R, or R
- if (no_wait_for_cooling && wants_to_cool) break;
-
- // Prevent a wait-forever situation if R is misused i.e. M190 R0
- // Simply don't wait to cool a bed under 30C
- if (wants_to_cool && theTarget < 30) break;
- }
-
idle();
refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out
+ float temp = thermalManager.degBed();
+
#if TEMP_BED_RESIDENCY_TIME > 0
- float temp_diff = fabs(theTarget - thermalManager.degBed());
+ float temp_diff = fabs(theTarget - temp);
if (!residency_start_ms) {
// Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
- if (temp_diff < TEMP_BED_WINDOW) residency_start_ms = millis();
+ if (temp_diff < TEMP_BED_WINDOW) residency_start_ms = now;
}
else if (temp_diff > TEMP_BED_HYSTERESIS) {
// Restart the timer whenever the temperature falls outside the hysteresis.
- residency_start_ms = millis();
+ residency_start_ms = now;
}
#endif //TEMP_BED_RESIDENCY_TIME > 0
- } while (!cancel_heatup && TEMP_BED_CONDITIONS);
+ // Prevent a wait-forever situation if R is misused i.e. M190 R0
+ if (wants_to_cool) {
+ // break after MIN_COOLING_SLOPE_TIME_BED seconds
+ // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED
+ if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
+ if (old_temp - temp < MIN_COOLING_SLOPE_DEG_BED) break;
+ next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_BED;
+ old_temp = temp;
+ }
+ }
+
+ } while (wait_for_heatup && TEMP_BED_CONDITIONS);
+
LCD_MESSAGEPGM(MSG_BED_DONE);
KEEPALIVE_STATE(IN_HANDLER);
}
@@ -4707,7 +4845,7 @@ inline void gcode_M110() {
* M111: Set the debug level
*/
inline void gcode_M111() {
- marlin_debug_flags = code_seen('S') ? code_value_short() : DEBUG_NONE;
+ marlin_debug_flags = code_seen('S') ? code_value_byte() : (uint8_t) DEBUG_NONE;
const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO;
const static char str_debug_2[] PROGMEM = MSG_DEBUG_INFO;
@@ -4742,11 +4880,6 @@ inline void gcode_M111() {
SERIAL_EOL;
}
-/**
- * M112: Emergency Stop
- */
-inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
-
#if ENABLED(HOST_KEEPALIVE_FEATURE)
/**
@@ -4756,7 +4889,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
*/
inline void gcode_M113() {
if (code_seen('S')) {
- host_keepalive_interval = (uint8_t)code_value_short();
+ host_keepalive_interval = code_value_byte();
NOMORE(host_keepalive_interval, 60);
}
else {
@@ -4774,7 +4907,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
/**
* M126: Heater 1 valve open
*/
- inline void gcode_M126() { baricuda_valve_pressure = code_seen('S') ? constrain(code_value(), 0, 255) : 255; }
+ inline void gcode_M126() { baricuda_valve_pressure = code_seen('S') ? code_value_byte() : 255; }
/**
* M127: Heater 1 valve close
*/
@@ -4785,7 +4918,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
/**
* M128: Heater 2 valve open
*/
- inline void gcode_M128() { baricuda_e_to_p_pressure = code_seen('S') ? constrain(code_value(), 0, 255) : 255; }
+ inline void gcode_M128() { baricuda_e_to_p_pressure = code_seen('S') ? code_value_byte() : 255; }
/**
* M129: Heater 2 valve close
*/
@@ -4799,7 +4932,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
*/
inline void gcode_M140() {
if (DEBUGGING(DRYRUN)) return;
- if (code_seen('S')) thermalManager.setTargetBed(code_value());
+ if (code_seen('S')) thermalManager.setTargetBed(code_value_temp_abs());
}
#if ENABLED(ULTIPANEL)
@@ -4812,7 +4945,7 @@ inline void gcode_M140() {
* F
*/
inline void gcode_M145() {
- int8_t material = code_seen('S') ? code_value_short() : 0;
+ int8_t material = code_seen('S') ? (int8_t)code_value_int() : 0;
if (material < 0 || material > 1) {
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_MATERIAL_INDEX);
@@ -4822,33 +4955,33 @@ inline void gcode_M140() {
switch (material) {
case 0:
if (code_seen('H')) {
- v = code_value_short();
- plaPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
+ v = code_value_int();
+ preheatHotendTemp1 = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
}
if (code_seen('F')) {
- v = code_value_short();
- plaPreheatFanSpeed = constrain(v, 0, 255);
+ v = code_value_int();
+ preheatFanSpeed1 = constrain(v, 0, 255);
}
#if TEMP_SENSOR_BED != 0
if (code_seen('B')) {
- v = code_value_short();
- plaPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15);
+ v = code_value_int();
+ preheatBedTemp1 = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15);
}
#endif
break;
case 1:
if (code_seen('H')) {
- v = code_value_short();
- absPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
+ v = code_value_int();
+ preheatHotendTemp2 = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
}
if (code_seen('F')) {
- v = code_value_short();
- absPreheatFanSpeed = constrain(v, 0, 255);
+ v = code_value_int();
+ preheatFanSpeed2 = constrain(v, 0, 255);
}
#if TEMP_SENSOR_BED != 0
if (code_seen('B')) {
- v = code_value_short();
- absPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15);
+ v = code_value_int();
+ preheatBedTemp2 = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15);
}
#endif
break;
@@ -4858,6 +4991,21 @@ inline void gcode_M140() {
#endif
+#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
+ /**
+ * M149: Set temperature units
+ */
+ inline void gcode_M149() {
+ if (code_seen('C')) {
+ set_input_temp_units(TEMPUNIT_C);
+ } else if (code_seen('K')) {
+ set_input_temp_units(TEMPUNIT_K);
+ } else if (code_seen('F')) {
+ set_input_temp_units(TEMPUNIT_F);
+ }
+ }
+#endif
+
#if HAS_POWER_SWITCH
/**
@@ -4931,10 +5079,10 @@ inline void gcode_M83() { axis_relative_modes[E_AXIS] = true; }
*/
inline void gcode_M18_M84() {
if (code_seen('S')) {
- stepper_inactive_time = code_value() * 1000UL;
+ stepper_inactive_time = code_value_millis_from_seconds();
}
else {
- bool all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])) || (code_seen(axis_codes[E_AXIS])));
+ bool all_axis = !((code_seen('X')) || (code_seen('Y')) || (code_seen('Z')) || (code_seen('E')));
if (all_axis) {
stepper.finish_and_disable();
}
@@ -4959,7 +5107,7 @@ inline void gcode_M18_M84() {
* M85: Set inactivity shutdown timer with parameter S. To disable set zero (default)
*/
inline void gcode_M85() {
- if (code_seen('S')) max_inactive_time = code_value() * 1000UL;
+ if (code_seen('S')) max_inactive_time = code_value_millis_from_seconds();
}
/**
@@ -4967,23 +5115,24 @@ inline void gcode_M85() {
* (Follows the same syntax as G92)
*/
inline void gcode_M92() {
- for (int8_t i = 0; i < NUM_AXIS; i++) {
+ LOOP_XYZE(i) {
if (code_seen(axis_codes[i])) {
if (i == E_AXIS) {
- float value = code_value();
+ float value = code_value_per_axis_unit(i);
if (value < 20.0) {
- float factor = planner.axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab.
+ float factor = planner.axis_steps_per_mm[i] / value; // increase e constants if M92 E14 is given for netfab.
planner.max_e_jerk *= factor;
- planner.max_feedrate[i] *= factor;
- planner.axis_steps_per_sqr_second[i] *= factor;
+ planner.max_feedrate_mm_s[i] *= factor;
+ planner.max_acceleration_steps_per_s2[i] *= factor;
}
- planner.axis_steps_per_unit[i] = value;
+ planner.axis_steps_per_mm[i] = value;
}
else {
- planner.axis_steps_per_unit[i] = code_value();
+ planner.axis_steps_per_mm[i] = code_value_per_axis_unit(i);
}
}
}
+ planner.refresh_positioning();
}
/**
@@ -5009,15 +5158,15 @@ static void report_current_position() {
SERIAL_EOL;
SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
- SERIAL_PROTOCOL(delta[X_AXIS] + home_offset[X_AXIS]);
+ SERIAL_PROTOCOL(delta[X_AXIS]);
SERIAL_PROTOCOLPGM(" Psi+Theta (90):");
- SERIAL_PROTOCOL(delta[Y_AXIS] - delta[X_AXIS] - 90 + home_offset[Y_AXIS]);
+ SERIAL_PROTOCOL(delta[Y_AXIS] - delta[X_AXIS] - 90);
SERIAL_EOL;
SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
- SERIAL_PROTOCOL(delta[X_AXIS] / 90 * planner.axis_steps_per_unit[X_AXIS]);
+ SERIAL_PROTOCOL(delta[X_AXIS] / 90 * planner.axis_steps_per_mm[X_AXIS]);
SERIAL_PROTOCOLPGM(" Psi+Theta:");
- SERIAL_PROTOCOL((delta[Y_AXIS] - delta[X_AXIS]) / 90 * planner.axis_steps_per_unit[Y_AXIS]);
+ SERIAL_PROTOCOL((delta[Y_AXIS] - delta[X_AXIS]) / 90 * planner.axis_steps_per_mm[Y_AXIS]);
SERIAL_EOL; SERIAL_EOL;
#endif
}
@@ -5063,9 +5212,9 @@ inline void gcode_M121() { endstops.enable_globally(false); }
*/
inline void gcode_M150() {
SendColors(
- code_seen('R') ? (byte)code_value_short() : 0,
- code_seen('U') ? (byte)code_value_short() : 0,
- code_seen('B') ? (byte)code_value_short() : 0
+ code_seen('R') ? code_value_byte() : 0,
+ code_seen('U') ? code_value_byte() : 0,
+ code_seen('B') ? code_value_byte() : 0
);
}
@@ -5092,11 +5241,11 @@ inline void gcode_M121() { endstops.enable_globally(false); }
inline void gcode_M155() {
// Set the target address
if (code_seen('A'))
- i2c.address((uint8_t) code_value_short());
+ i2c.address(code_value_byte());
// Add a new byte to the buffer
else if (code_seen('B'))
- i2c.addbyte((int) code_value_short());
+ i2c.addbyte(code_value_int());
// Flush the buffer to the bus
else if (code_seen('S')) i2c.send();
@@ -5111,8 +5260,8 @@ inline void gcode_M121() { endstops.enable_globally(false); }
* Usage: M156 A B
*/
inline void gcode_M156() {
- uint8_t addr = code_seen('A') ? code_value_short() : 0;
- int bytes = code_seen('B') ? code_value_short() : 1;
+ uint8_t addr = code_seen('A') ? code_value_byte() : 0;
+ int bytes = code_seen('B') ? code_value_int() : 1;
if (addr && bytes > 0 && bytes <= 32) {
i2c.address(addr);
@@ -5127,25 +5276,24 @@ inline void gcode_M121() { endstops.enable_globally(false); }
#endif //EXPERIMENTAL_I2CBUS
/**
- * M200: Set filament diameter and set E axis units to cubic millimeters
+ * M200: Set filament diameter and set E axis units to cubic units
*
* T - Optional extruder number. Current extruder if omitted.
- * D - Diameter of the filament. Use "D0" to set units back to millimeters.
+ * D - Diameter of the filament. Use "D0" to switch back to linear units on the E axis.
*/
inline void gcode_M200() {
if (get_target_extruder_from_command(200)) return;
if (code_seen('D')) {
- float diameter = code_value();
// setting any extruder filament size disables volumetric on the assumption that
// slicers either generate in extruder values as cubic mm or as as filament feeds
// for all extruders
- volumetric_enabled = (diameter != 0.0);
+ volumetric_enabled = (code_value_linear_units() != 0.0);
if (volumetric_enabled) {
- filament_size[target_extruder] = diameter;
+ filament_size[target_extruder] = code_value_linear_units();
// make sure all extruders have some sane value for the filament size
- for (int i = 0; i < EXTRUDERS; i++)
+ for (uint8_t i = 0; i < COUNT(filament_size); i++)
if (! filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA;
}
}
@@ -5160,9 +5308,9 @@ inline void gcode_M200() {
* M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
*/
inline void gcode_M201() {
- for (int8_t i = 0; i < NUM_AXIS; i++) {
+ LOOP_XYZE(i) {
if (code_seen(axis_codes[i])) {
- planner.max_acceleration_units_per_sq_second[i] = code_value();
+ planner.max_acceleration_mm_per_s2[i] = code_value_axis_units(i);
}
}
// steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
@@ -5171,26 +5319,24 @@ inline void gcode_M201() {
#if 0 // Not used for Sprinter/grbl gen6
inline void gcode_M202() {
- for (int8_t i = 0; i < NUM_AXIS; i++) {
- if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value() * planner.axis_steps_per_unit[i];
+ LOOP_XYZE(i) {
+ if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units(i) * planner.axis_steps_per_mm[i];
}
}
#endif
/**
- * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
+ * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec
*/
inline void gcode_M203() {
- for (int8_t i = 0; i < NUM_AXIS; i++) {
- if (code_seen(axis_codes[i])) {
- planner.max_feedrate[i] = code_value();
- }
- }
+ LOOP_XYZE(i)
+ if (code_seen(axis_codes[i]))
+ planner.max_feedrate_mm_s[i] = code_value_axis_units(i);
}
/**
- * M204: Set Accelerations in mm/sec^2 (M204 P1200 R3000 T3000)
+ * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000)
*
* P = Printing moves
* R = Retract only (no X, Y, Z) moves
@@ -5200,22 +5346,22 @@ inline void gcode_M203() {
*/
inline void gcode_M204() {
if (code_seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments.
- planner.travel_acceleration = planner.acceleration = code_value();
+ planner.travel_acceleration = planner.acceleration = code_value_linear_units();
SERIAL_ECHOPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);
SERIAL_EOL;
}
if (code_seen('P')) {
- planner.acceleration = code_value();
+ planner.acceleration = code_value_linear_units();
SERIAL_ECHOPAIR("Setting Print Acceleration: ", planner.acceleration);
SERIAL_EOL;
}
if (code_seen('R')) {
- planner.retract_acceleration = code_value();
+ planner.retract_acceleration = code_value_linear_units();
SERIAL_ECHOPAIR("Setting Retract Acceleration: ", planner.retract_acceleration);
SERIAL_EOL;
}
if (code_seen('T')) {
- planner.travel_acceleration = code_value();
+ planner.travel_acceleration = code_value_linear_units();
SERIAL_ECHOPAIR("Setting Travel Acceleration: ", planner.travel_acceleration);
SERIAL_EOL;
}
@@ -5224,36 +5370,36 @@ inline void gcode_M204() {
/**
* M205: Set Advanced Settings
*
- * S = Min Feed Rate (mm/s)
- * T = Min Travel Feed Rate (mm/s)
+ * S = Min Feed Rate (units/s)
+ * T = Min Travel Feed Rate (units/s)
* B = Min Segment Time (µs)
- * X = Max XY Jerk (mm/s/s)
- * Z = Max Z Jerk (mm/s/s)
- * E = Max E Jerk (mm/s/s)
+ * X = Max XY Jerk (units/sec^2)
+ * Z = Max Z Jerk (units/sec^2)
+ * E = Max E Jerk (units/sec^2)
*/
inline void gcode_M205() {
- if (code_seen('S')) planner.min_feedrate = code_value();
- if (code_seen('T')) planner.min_travel_feedrate = code_value();
- if (code_seen('B')) planner.min_segment_time = code_value();
- if (code_seen('X')) planner.max_xy_jerk = code_value();
- if (code_seen('Z')) planner.max_z_jerk = code_value();
- if (code_seen('E')) planner.max_e_jerk = code_value();
+ if (code_seen('S')) planner.min_feedrate_mm_s = code_value_linear_units();
+ if (code_seen('T')) planner.min_travel_feedrate_mm_s = code_value_linear_units();
+ if (code_seen('B')) planner.min_segment_time = code_value_millis();
+ if (code_seen('X')) planner.max_xy_jerk = code_value_linear_units();
+ if (code_seen('Z')) planner.max_z_jerk = code_value_axis_units(Z_AXIS);
+ if (code_seen('E')) planner.max_e_jerk = code_value_axis_units(E_AXIS);
}
/**
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
*/
inline void gcode_M206() {
- for (int8_t i = X_AXIS; i <= Z_AXIS; i++)
+ LOOP_XYZ(i)
if (code_seen(axis_codes[i]))
- set_home_offset((AxisEnum)i, code_value());
+ set_home_offset((AxisEnum)i, code_value_axis_units(i));
#if ENABLED(SCARA)
- if (code_seen('T')) set_home_offset(X_AXIS, code_value()); // Theta
- if (code_seen('P')) set_home_offset(Y_AXIS, code_value()); // Psi
+ if (code_seen('T')) set_home_offset(X_AXIS, code_value_axis_units(X_AXIS)); // Theta
+ if (code_seen('P')) set_home_offset(Y_AXIS, code_value_axis_units(Y_AXIS)); // Psi
#endif
- sync_plan_position();
+ SYNC_PLAN_POSITION_KINEMATIC();
report_current_position();
}
@@ -5269,12 +5415,12 @@ inline void gcode_M206() {
* C = Gamma (Tower 3) diagonal rod trim
*/
inline void gcode_M665() {
- if (code_seen('L')) delta_diagonal_rod = code_value();
- if (code_seen('R')) delta_radius = code_value();
- if (code_seen('S')) delta_segments_per_second = code_value();
- if (code_seen('A')) delta_diagonal_rod_trim_tower_1 = code_value();
- if (code_seen('B')) delta_diagonal_rod_trim_tower_2 = code_value();
- if (code_seen('C')) delta_diagonal_rod_trim_tower_3 = code_value();
+ if (code_seen('L')) delta_diagonal_rod = code_value_linear_units();
+ if (code_seen('R')) delta_radius = code_value_linear_units();
+ if (code_seen('S')) delta_segments_per_second = code_value_float();
+ if (code_seen('A')) delta_diagonal_rod_trim_tower_1 = code_value_linear_units();
+ if (code_seen('B')) delta_diagonal_rod_trim_tower_2 = code_value_linear_units();
+ if (code_seen('C')) delta_diagonal_rod_trim_tower_3 = code_value_linear_units();
recalc_delta_settings(delta_radius, delta_diagonal_rod);
}
/**
@@ -5286,9 +5432,9 @@ inline void gcode_M206() {
SERIAL_ECHOLNPGM(">>> gcode_M666");
}
#endif
- for (int8_t i = X_AXIS; i <= Z_AXIS; i++) {
+ LOOP_XYZ(i) {
if (code_seen(axis_codes[i])) {
- endstop_adj[i] = code_value();
+ endstop_adj[i] = code_value_axis_units(i);
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPGM("endstop_adj[");
@@ -5312,7 +5458,7 @@ inline void gcode_M206() {
* M666: For Z Dual Endstop setup, set z axis offset to the z2 axis.
*/
inline void gcode_M666() {
- if (code_seen('Z')) z_endstop_adj = code_value();
+ if (code_seen('Z')) z_endstop_adj = code_value_axis_units(Z_AXIS);
SERIAL_ECHOPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
SERIAL_EOL;
}
@@ -5324,32 +5470,32 @@ inline void gcode_M206() {
/**
* M207: Set firmware retraction values
*
- * S[+mm] retract_length
- * W[+mm] retract_length_swap (multi-extruder)
- * F[mm/min] retract_feedrate
- * Z[mm] retract_zlift
+ * S[+units] retract_length
+ * W[+units] retract_length_swap (multi-extruder)
+ * F[units/min] retract_feedrate_mm_s
+ * Z[units] retract_zlift
*/
inline void gcode_M207() {
- if (code_seen('S')) retract_length = code_value();
- if (code_seen('F')) retract_feedrate = code_value() / 60;
- if (code_seen('Z')) retract_zlift = code_value();
+ if (code_seen('S')) retract_length = code_value_axis_units(E_AXIS);
+ if (code_seen('F')) retract_feedrate_mm_s = MMM_TO_MMS(code_value_axis_units(E_AXIS));
+ if (code_seen('Z')) retract_zlift = code_value_axis_units(Z_AXIS);
#if EXTRUDERS > 1
- if (code_seen('W')) retract_length_swap = code_value();
+ if (code_seen('W')) retract_length_swap = code_value_axis_units(E_AXIS);
#endif
}
/**
* M208: Set firmware un-retraction values
*
- * S[+mm] retract_recover_length (in addition to M207 S*)
- * W[+mm] retract_recover_length_swap (multi-extruder)
- * F[mm/min] retract_recover_feedrate
+ * S[+units] retract_recover_length (in addition to M207 S*)
+ * W[+units] retract_recover_length_swap (multi-extruder)
+ * F[units/min] retract_recover_feedrate_mm_s
*/
inline void gcode_M208() {
- if (code_seen('S')) retract_recover_length = code_value();
- if (code_seen('F')) retract_recover_feedrate = code_value() / 60;
+ if (code_seen('S')) retract_recover_length = code_value_axis_units(E_AXIS);
+ if (code_seen('F')) retract_recover_feedrate_mm_s = MMM_TO_MMS(code_value_axis_units(E_AXIS));
#if EXTRUDERS > 1
- if (code_seen('W')) retract_recover_length_swap = code_value();
+ if (code_seen('W')) retract_recover_length_swap = code_value_axis_units(E_AXIS);
#endif
}
@@ -5359,7 +5505,7 @@ inline void gcode_M206() {
*/
inline void gcode_M209() {
if (code_seen('S')) {
- int t = code_value_short();
+ int t = code_value_int();
switch (t) {
case 0:
autoretract_enabled = false;
@@ -5377,59 +5523,57 @@ inline void gcode_M206() {
#endif // FWRETRACT
-#if EXTRUDERS > 1
+#if HOTENDS > 1
/**
- * M218 - set hotend offset (in mm)
+ * M218 - set hotend offset (in linear units)
*
* T
* X
* Y
- * Z - Available with DUAL_X_CARRIAGE
+ * Z - Available with DUAL_X_CARRIAGE and SWITCHING_EXTRUDER
*/
inline void gcode_M218() {
if (get_target_extruder_from_command(218)) return;
- if (code_seen('X')) extruder_offset[X_AXIS][target_extruder] = code_value();
- if (code_seen('Y')) extruder_offset[Y_AXIS][target_extruder] = code_value();
+ if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value_axis_units(X_AXIS);
+ if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value_axis_units(Y_AXIS);
- #if ENABLED(DUAL_X_CARRIAGE)
- if (code_seen('Z')) extruder_offset[Z_AXIS][target_extruder] = code_value();
+ #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER)
+ if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value_axis_units(Z_AXIS);
#endif
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
- for (int e = 0; e < EXTRUDERS; e++) {
+ HOTEND_LOOP() {
SERIAL_CHAR(' ');
- SERIAL_ECHO(extruder_offset[X_AXIS][e]);
+ SERIAL_ECHO(hotend_offset[X_AXIS][e]);
SERIAL_CHAR(',');
- SERIAL_ECHO(extruder_offset[Y_AXIS][e]);
- #if ENABLED(DUAL_X_CARRIAGE)
+ SERIAL_ECHO(hotend_offset[Y_AXIS][e]);
+ #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER)
SERIAL_CHAR(',');
- SERIAL_ECHO(extruder_offset[Z_AXIS][e]);
+ SERIAL_ECHO(hotend_offset[Z_AXIS][e]);
#endif
}
SERIAL_EOL;
}
-#endif // EXTRUDERS > 1
+#endif // HOTENDS > 1
/**
* M220: Set speed percentage factor, aka "Feed Rate" (M220 S95)
*/
inline void gcode_M220() {
- if (code_seen('S')) feedrate_multiplier = code_value();
+ if (code_seen('S')) feedrate_percentage = code_value_int();
}
/**
* M221: Set extrusion percentage (M221 T0 S95)
*/
inline void gcode_M221() {
- if (code_seen('S')) {
- int sval = code_value();
- if (get_target_extruder_from_command(221)) return;
- extruder_multiplier[target_extruder] = sval;
- }
+ if (get_target_extruder_from_command(221)) return;
+ if (code_seen('S'))
+ extruder_multiplier[target_extruder] = code_value_int();
}
/**
@@ -5437,9 +5581,9 @@ inline void gcode_M221() {
*/
inline void gcode_M226() {
if (code_seen('P')) {
- int pin_number = code_value();
+ int pin_number = code_value_int();
- int pin_state = code_seen('S') ? code_value() : -1; // required pin state - default is inverted
+ int pin_state = code_seen('S') ? code_value_int() : -1; // required pin state - default is inverted
if (pin_state >= -1 && pin_state <= 1) {
@@ -5481,28 +5625,27 @@ inline void gcode_M226() {
#if HAS_SERVOS
/**
- * M280: Get or set servo position. P S
+ * M280: Get or set servo position. P [S]
*/
inline void gcode_M280() {
- int servo_index = code_seen('P') ? code_value_short() : -1;
- int servo_position = 0;
- if (code_seen('S')) {
- servo_position = code_value_short();
- if (servo_index >= 0 && servo_index < NUM_SERVOS)
- servo[servo_index].move(servo_position);
+ if (!code_seen('P')) return;
+ int servo_index = code_value_int();
+ if (servo_index >= 0 && servo_index < NUM_SERVOS) {
+ if (code_seen('S'))
+ MOVE_SERVO(servo_index, code_value_int());
else {
- SERIAL_ERROR_START;
- SERIAL_ERROR("Servo ");
- SERIAL_ERROR(servo_index);
- SERIAL_ERRORLN(" out of range");
+ SERIAL_ECHO_START;
+ SERIAL_ECHOPGM(" Servo ");
+ SERIAL_ECHO(servo_index);
+ SERIAL_ECHOPGM(": ");
+ SERIAL_ECHOLN(servo[servo_index].read());
}
}
- else if (servo_index >= 0) {
- SERIAL_ECHO_START;
- SERIAL_ECHO(" Servo ");
- SERIAL_ECHO(servo_index);
- SERIAL_ECHO(": ");
- SERIAL_ECHOLN(servo[servo_index].read());
+ else {
+ SERIAL_ERROR_START;
+ SERIAL_ERROR("Servo ");
+ SERIAL_ERROR(servo_index);
+ SERIAL_ERRORLN(" out of range");
}
}
@@ -5514,10 +5657,13 @@ inline void gcode_M226() {
* M300: Play beep sound S P
*/
inline void gcode_M300() {
- uint16_t beepS = code_seen('S') ? code_value_short() : 110;
- uint32_t beepP = code_seen('P') ? code_value_long() : 1000;
- if (beepP > 5000) beepP = 5000; // limit to 5 seconds
- buzz(beepP, beepS);
+ uint16_t const frequency = code_seen('S') ? code_value_ushort() : 260;
+ uint16_t duration = code_seen('P') ? code_value_ushort() : 1000;
+
+ // Limits the tone duration to 0-5 seconds.
+ NOMORE(duration, 5000);
+
+ BUZZ(duration, frequency);
}
#endif // HAS_BUZZER
@@ -5531,7 +5677,7 @@ inline void gcode_M226() {
* I[float] Ki term (unscaled)
* D[float] Kd term (unscaled)
*
- * With PID_ADD_EXTRUSION_RATE:
+ * With PID_EXTRUSION_SCALING:
*
* C[float] Kc term
* L[float] LPQ length
@@ -5540,32 +5686,32 @@ inline void gcode_M226() {
// multi-extruder PID patch: M301 updates or prints a single extruder's PID values
// default behaviour (omitting E parameter) is to update for extruder 0 only
- int e = code_seen('E') ? code_value() : 0; // extruder being updated
-
- if (e < EXTRUDERS) { // catch bad input value
- if (code_seen('P')) PID_PARAM(Kp, e) = code_value();
- if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value());
- if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value());
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- if (code_seen('C')) PID_PARAM(Kc, e) = code_value();
- if (code_seen('L')) lpq_len = code_value();
+ int e = code_seen('E') ? code_value_int() : 0; // extruder being updated
+
+ if (e < HOTENDS) { // catch bad input value
+ if (code_seen('P')) PID_PARAM(Kp, e) = code_value_float();
+ if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value_float());
+ if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value_float());
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ if (code_seen('C')) PID_PARAM(Kc, e) = code_value_float();
+ if (code_seen('L')) lpq_len = code_value_float();
NOMORE(lpq_len, LPQ_MAX_LEN);
#endif
thermalManager.updatePID();
SERIAL_ECHO_START;
- #if ENABLED(PID_PARAMS_PER_EXTRUDER)
- SERIAL_ECHO(" e:"); // specify extruder in serial output
+ #if ENABLED(PID_PARAMS_PER_HOTEND)
+ SERIAL_ECHOPGM(" e:"); // specify extruder in serial output
SERIAL_ECHO(e);
- #endif // PID_PARAMS_PER_EXTRUDER
- SERIAL_ECHO(" p:");
+ #endif // PID_PARAMS_PER_HOTEND
+ SERIAL_ECHOPGM(" p:");
SERIAL_ECHO(PID_PARAM(Kp, e));
- SERIAL_ECHO(" i:");
+ SERIAL_ECHOPGM(" i:");
SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
- SERIAL_ECHO(" d:");
+ SERIAL_ECHOPGM(" d:");
SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- SERIAL_ECHO(" c:");
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ SERIAL_ECHOPGM(" c:");
//Kc does not have scaling applied above, or in resetting defaults
SERIAL_ECHO(PID_PARAM(Kc, e));
#endif
@@ -5582,18 +5728,18 @@ inline void gcode_M226() {
#if ENABLED(PIDTEMPBED)
inline void gcode_M304() {
- if (code_seen('P')) thermalManager.bedKp = code_value();
- if (code_seen('I')) thermalManager.bedKi = scalePID_i(code_value());
- if (code_seen('D')) thermalManager.bedKd = scalePID_d(code_value());
+ if (code_seen('P')) thermalManager.bedKp = code_value_float();
+ if (code_seen('I')) thermalManager.bedKi = scalePID_i(code_value_float());
+ if (code_seen('D')) thermalManager.bedKd = scalePID_d(code_value_float());
thermalManager.updatePID();
SERIAL_ECHO_START;
- SERIAL_ECHO(" p:");
+ SERIAL_ECHOPGM(" p:");
SERIAL_ECHO(thermalManager.bedKp);
- SERIAL_ECHO(" i:");
+ SERIAL_ECHOPGM(" i:");
SERIAL_ECHO(unscalePID_i(thermalManager.bedKi));
- SERIAL_ECHO(" d:");
+ SERIAL_ECHOPGM(" d:");
SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd));
}
@@ -5641,7 +5787,7 @@ inline void gcode_M226() {
* M250: Read and optionally set the LCD contrast
*/
inline void gcode_M250() {
- if (code_seen('C')) lcd_setcontrast(code_value_short() & 0x3F);
+ if (code_seen('C')) set_lcd_contrast(code_value_int());
SERIAL_PROTOCOLPGM("lcd contrast value: ");
SERIAL_PROTOCOL(lcd_contrast);
SERIAL_EOL;
@@ -5652,10 +5798,36 @@ inline void gcode_M226() {
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
/**
- * M302: Allow cold extrudes, or set the minimum extrude S.
+ * M302: Allow cold extrudes, or set the minimum extrude temperature
+ *
+ * S sets the minimum extrude temperature
+ * P enables (1) or disables (0) cold extrusion
+ *
+ * Examples:
+ *
+ * M302 ; report current cold extrusion state
+ * M302 P0 ; enable cold extrusion checking
+ * M302 P1 ; disables cold extrusion checking
+ * M302 S0 ; always allow extrusion (disables checking)
+ * M302 S170 ; only allow extrusion above 170
+ * M302 S170 P1 ; set min extrude temp to 170 but leave disabled
*/
inline void gcode_M302() {
- thermalManager.extrude_min_temp = code_seen('S') ? code_value() : 0;
+ bool seen_S = code_seen('S');
+ if (seen_S) {
+ thermalManager.extrude_min_temp = code_value_temp_abs();
+ thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0);
+ }
+
+ if (code_seen('P'))
+ thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || code_value_bool();
+ else if (!seen_S) {
+ // Report current state
+ SERIAL_ECHO_START;
+ SERIAL_ECHOPAIR("Cold extrudes are ", (thermalManager.allow_cold_extrude ? "en" : "dis"));
+ SERIAL_ECHOPAIR("abled (min temp ", int(thermalManager.extrude_min_temp + 0.5));
+ SERIAL_ECHOLNPGM("C)");
+ }
}
#endif // PREVENT_DANGEROUS_EXTRUDE
@@ -5670,13 +5842,13 @@ inline void gcode_M226() {
*/
inline void gcode_M303() {
#if HAS_PID_HEATING
- int e = code_seen('E') ? code_value_short() : 0;
- int c = code_seen('C') ? code_value_short() : 5;
- bool u = code_seen('U') && code_value_short() != 0;
+ int e = code_seen('E') ? code_value_int() : 0;
+ int c = code_seen('C') ? code_value_int() : 5;
+ bool u = code_seen('U') && code_value_bool();
- float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0);
+ float temp = code_seen('S') ? code_value_temp_abs() : (e < 0 ? 70.0 : 150.0);
- if (e >= 0 && e < EXTRUDERS)
+ if (e >= 0 && e < HOTENDS)
target_extruder = e;
KEEPALIVE_STATE(NOT_BUSY); // don't send "busy: processing" messages during autotune output
@@ -5693,15 +5865,15 @@ inline void gcode_M303() {
#if ENABLED(SCARA)
bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) {
//SoftEndsEnabled = false; // Ignore soft endstops during calibration
- //SERIAL_ECHOLN(" Soft endstops disabled ");
+ //SERIAL_ECHOLNPGM(" Soft endstops disabled");
if (IsRunning()) {
//gcode_get_destination(); // For X Y Z E F
delta[X_AXIS] = delta_x;
delta[Y_AXIS] = delta_y;
- calculate_SCARA_forward_Transform(delta);
+ forward_kinematics_SCARA(delta);
destination[X_AXIS] = delta[X_AXIS] / axis_scaling[X_AXIS];
destination[Y_AXIS] = delta[Y_AXIS] / axis_scaling[Y_AXIS];
- prepare_move();
+ prepare_move_to_destination();
//ok_to_send();
return true;
}
@@ -5712,7 +5884,7 @@ inline void gcode_M303() {
* M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
*/
inline bool gcode_M360() {
- SERIAL_ECHOLN(" Cal: Theta 0 ");
+ SERIAL_ECHOLNPGM(" Cal: Theta 0");
return SCARA_move_to_cal(0, 120);
}
@@ -5720,7 +5892,7 @@ inline void gcode_M303() {
* M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
*/
inline bool gcode_M361() {
- SERIAL_ECHOLN(" Cal: Theta 90 ");
+ SERIAL_ECHOLNPGM(" Cal: Theta 90");
return SCARA_move_to_cal(90, 130);
}
@@ -5728,7 +5900,7 @@ inline void gcode_M303() {
* M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
*/
inline bool gcode_M362() {
- SERIAL_ECHOLN(" Cal: Psi 0 ");
+ SERIAL_ECHOLNPGM(" Cal: Psi 0");
return SCARA_move_to_cal(60, 180);
}
@@ -5736,7 +5908,7 @@ inline void gcode_M303() {
* M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
*/
inline bool gcode_M363() {
- SERIAL_ECHOLN(" Cal: Psi 90 ");
+ SERIAL_ECHOLNPGM(" Cal: Psi 90");
return SCARA_move_to_cal(50, 90);
}
@@ -5744,7 +5916,7 @@ inline void gcode_M303() {
* M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
*/
inline bool gcode_M364() {
- SERIAL_ECHOLN(" Cal: Theta-Psi 90 ");
+ SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
return SCARA_move_to_cal(45, 135);
}
@@ -5752,11 +5924,9 @@ inline void gcode_M303() {
* M365: SCARA calibration: Scaling factor, X, Y, Z axis
*/
inline void gcode_M365() {
- for (int8_t i = X_AXIS; i <= Z_AXIS; i++) {
- if (code_seen(axis_codes[i])) {
- axis_scaling[i] = code_value();
- }
- }
+ LOOP_XYZ(i)
+ if (code_seen(axis_codes[i]))
+ axis_scaling[i] = code_value_float();
}
#endif // SCARA
@@ -5816,38 +5986,28 @@ inline void gcode_M303() {
*/
inline void gcode_M400() { stepper.synchronize(); }
-#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_SERVO_ENDSTOPS || ENABLED(Z_PROBE_ALLEN_KEY))
+#if HAS_BED_PROBE
/**
* M401: Engage Z Servo endstop if available
*/
- inline void gcode_M401() {
- #if HAS_SERVO_ENDSTOPS
- raise_z_for_servo();
- #endif
- deploy_z_probe();
- }
+ inline void gcode_M401() { DEPLOY_PROBE(); }
/**
* M402: Retract Z Servo endstop if enabled
*/
- inline void gcode_M402() {
- #if HAS_SERVO_ENDSTOPS
- raise_z_for_servo();
- #endif
- stow_z_probe(false);
- }
+ inline void gcode_M402() { STOW_PROBE(); }
-#endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
+#endif // HAS_BED_PROBE
#if ENABLED(FILAMENT_WIDTH_SENSOR)
/**
- * M404: Display or set the nominal filament width (3mm, 1.75mm ) W<3.0>
+ * M404: Display or set (in current units) the nominal filament width (3mm, 1.75mm ) W<3.0>
*/
inline void gcode_M404() {
if (code_seen('W')) {
- filament_width_nominal = code_value();
+ filament_width_nominal = code_value_linear_units();
}
else {
SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");
@@ -5859,7 +6019,9 @@ inline void gcode_M400() { stepper.synchronize(); }
* M405: Turn on filament sensor for control
*/
inline void gcode_M405() {
- if (code_seen('D')) meas_delay_cm = code_value();
+ // This is technically a linear measurement, but since it's quantized to centimeters and is a different unit than
+ // everything else, it uses code_value_int() instead of code_value_linear_units().
+ if (code_seen('D')) meas_delay_cm = code_value_int();
NOMORE(meas_delay_cm, MAX_MEASUREMENT_DELAY);
if (filwidth_delay_index2 == -1) { // Initialize the ring buffer if not done since startup
@@ -5894,57 +6056,35 @@ inline void gcode_M400() { stepper.synchronize(); }
#endif // FILAMENT_WIDTH_SENSOR
-#if DISABLED(DELTA) && DISABLED(SCARA)
- void set_current_position_from_planner() {
- stepper.synchronize();
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- vector_3 pos = planner.adjusted_position(); // values directly from steppers...
- current_position[X_AXIS] = pos.x;
- current_position[Y_AXIS] = pos.y;
- current_position[Z_AXIS] = pos.z;
- #else
- current_position[X_AXIS] = stepper.get_axis_position_mm(X_AXIS);
- current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS);
- current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS);
- #endif
- sync_plan_position(); // ...re-apply to planner position
- }
-#endif
-
-/**
- * M410: Quickstop - Abort all planned moves
- *
- * This will stop the carriages mid-move, so most likely they
- * will be out of sync with the stepper position after this.
- */
-inline void gcode_M410() {
+void quickstop_stepper() {
stepper.quick_stop();
- #if DISABLED(DELTA) && DISABLED(SCARA)
- set_current_position_from_planner();
+ #if DISABLED(SCARA)
+ stepper.synchronize();
+ LOOP_XYZ(i) set_current_from_steppers_for_axis((AxisEnum)i);
+ SYNC_PLAN_POSITION_KINEMATIC();
#endif
}
-
#if ENABLED(MESH_BED_LEVELING)
/**
* M420: Enable/Disable Mesh Bed Leveling
*/
- inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.active = !!code_value_short(); }
+ inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.set_has_mesh(code_value_bool()); }
/**
* M421: Set a single Mesh Bed Leveling Z coordinate
- * Use either 'M421 X Y Z' or 'M421 I J Z'
+ * Use either 'M421 X Y Z' or 'M421 I J Z'
*/
inline void gcode_M421() {
- int8_t px, py;
+ int8_t px = 0, py = 0;
float z = 0;
bool hasX, hasY, hasZ, hasI, hasJ;
- if ((hasX = code_seen('X'))) px = mbl.probe_index_x(code_value());
- if ((hasY = code_seen('Y'))) py = mbl.probe_index_y(code_value());
- if ((hasI = code_seen('I'))) px = code_value();
- if ((hasJ = code_seen('J'))) py = code_value();
- if ((hasZ = code_seen('Z'))) z = code_value();
+ if ((hasX = code_seen('X'))) px = mbl.probe_index_x(code_value_axis_units(X_AXIS));
+ if ((hasY = code_seen('Y'))) py = mbl.probe_index_y(code_value_axis_units(Y_AXIS));
+ if ((hasI = code_seen('I'))) px = code_value_axis_units(X_AXIS);
+ if ((hasJ = code_seen('J'))) py = code_value_axis_units(Y_AXIS);
+ if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS);
if (hasX && hasY && hasZ) {
@@ -5984,10 +6124,10 @@ inline void gcode_M410() {
*/
inline void gcode_M428() {
bool err = false;
- for (int8_t i = X_AXIS; i <= Z_AXIS; i++) {
+ LOOP_XYZ(i) {
if (axis_homed[i]) {
- float base = (current_position[i] > (sw_endstop_min[i] + sw_endstop_max[i]) / 2) ? base_home_pos(i) : 0,
- diff = current_position[i] - base;
+ float base = (current_position[i] > (sw_endstop_min[i] + sw_endstop_max[i]) * 0.5) ? base_home_pos(i) : 0,
+ diff = current_position[i] - LOGICAL_POSITION(base, i);
if (diff > -20 && diff < 20) {
set_home_offset((AxisEnum)i, home_offset[i] - diff);
}
@@ -5995,9 +6135,7 @@ inline void gcode_M428() {
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_M428_TOO_FAR);
LCD_ALERTMESSAGEPGM("Err: Too far!");
- #if HAS_BUZZER
- buzz(200, 40);
- #endif
+ BUZZ(200, 40);
err = true;
break;
}
@@ -6005,13 +6143,11 @@ inline void gcode_M428() {
}
if (!err) {
- sync_plan_position();
+ SYNC_PLAN_POSITION_KINEMATIC();
report_current_position();
LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED);
- #if HAS_BUZZER
- buzz(200, 659);
- buzz(200, 698);
- #endif
+ BUZZ(200, 659);
+ BUZZ(200, 698);
}
}
@@ -6040,7 +6176,7 @@ inline void gcode_M502() {
* M503: print settings currently in memory
*/
inline void gcode_M503() {
- Config_PrintSettings(code_seen('S') && code_value() == 0);
+ Config_PrintSettings(code_seen('S') && !code_value_bool());
}
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
@@ -6049,21 +6185,21 @@ inline void gcode_M503() {
* M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>)
*/
inline void gcode_M540() {
- if (code_seen('S')) stepper.abort_on_endstop_hit = (code_value() > 0);
+ if (code_seen('S')) stepper.abort_on_endstop_hit = code_value_bool();
}
#endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
-#ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET
+#if HAS_BED_PROBE
- inline void gcode_SET_Z_PROBE_OFFSET() {
+ inline void gcode_M851() {
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET);
SERIAL_CHAR(' ');
if (code_seen('Z')) {
- float value = code_value();
+ float value = code_value_axis_units(Z_AXIS);
if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) {
zprobe_zoffset = value;
SERIAL_ECHO(zprobe_zoffset);
@@ -6071,6 +6207,7 @@ inline void gcode_M503() {
else {
SERIAL_ECHOPGM(MSG_Z_MIN);
SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN);
+ SERIAL_CHAR(' ');
SERIAL_ECHOPGM(MSG_Z_MAX);
SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX);
}
@@ -6082,9 +6219,9 @@ inline void gcode_M503() {
SERIAL_EOL;
}
-#endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET
+#endif // HAS_BED_PROBE
-#if ENABLED(FILAMENTCHANGEENABLE)
+#if ENABLED(FILAMENT_CHANGE_FEATURE)
/**
* M600: Pause for filament change
@@ -6106,129 +6243,162 @@ inline void gcode_M503() {
return;
}
+ // Show initial message and wait for synchronize steppers
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INIT);
+ stepper.synchronize();
+
float lastpos[NUM_AXIS];
- #if ENABLED(DELTA)
- float fr60 = feedrate / 60;
- #endif
- for (int i = 0; i < NUM_AXIS; i++)
+ // Save current position of all axes
+ LOOP_XYZE(i)
lastpos[i] = destination[i] = current_position[i];
+ // Define runplan for move axes
#if ENABLED(DELTA)
- #define RUNPLAN calculate_delta(destination); \
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], fr60, active_extruder);
+ #define RUNPLAN(RATE_MM_S) inverse_kinematics(destination); \
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], RATE_MM_S, active_extruder);
#else
- #define RUNPLAN line_to_destination();
+ #define RUNPLAN(RATE_MM_S) line_to_destination(MMS_TO_MMM(RATE_MM_S));
#endif
- //retract by E
- if (code_seen('E')) destination[E_AXIS] += code_value();
- #ifdef FILAMENTCHANGE_FIRSTRETRACT
- else destination[E_AXIS] += FILAMENTCHANGE_FIRSTRETRACT;
+ KEEPALIVE_STATE(IN_HANDLER);
+
+ // Initial retract before move to filament change position
+ if (code_seen('E')) destination[E_AXIS] += code_value_axis_units(E_AXIS);
+ #if defined(FILAMENT_CHANGE_RETRACT_LENGTH) && FILAMENT_CHANGE_RETRACT_LENGTH > 0
+ else destination[E_AXIS] -= FILAMENT_CHANGE_RETRACT_LENGTH;
#endif
- RUNPLAN;
+ RUNPLAN(FILAMENT_CHANGE_RETRACT_FEEDRATE);
- //lift Z
- if (code_seen('Z')) destination[Z_AXIS] += code_value();
- #ifdef FILAMENTCHANGE_ZADD
- else destination[Z_AXIS] += FILAMENTCHANGE_ZADD;
- #endif
+ // Lift Z axis
+ float z_lift = code_seen('Z') ? code_value_axis_units(Z_AXIS) :
+ #if defined(FILAMENT_CHANGE_Z_ADD) && FILAMENT_CHANGE_Z_ADD > 0
+ FILAMENT_CHANGE_Z_ADD
+ #else
+ 0
+ #endif
+ ;
- RUNPLAN;
+ if (z_lift > 0) {
+ destination[Z_AXIS] += z_lift;
+ NOMORE(destination[Z_AXIS], Z_MAX_POS);
+ RUNPLAN(FILAMENT_CHANGE_Z_FEEDRATE);
+ }
- //move xy
- if (code_seen('X')) destination[X_AXIS] = code_value();
- #ifdef FILAMENTCHANGE_XPOS
- else destination[X_AXIS] = FILAMENTCHANGE_XPOS;
+ // Move XY axes to filament exchange position
+ if (code_seen('X')) destination[X_AXIS] = code_value_axis_units(X_AXIS);
+ #ifdef FILAMENT_CHANGE_X_POS
+ else destination[X_AXIS] = FILAMENT_CHANGE_X_POS;
#endif
- if (code_seen('Y')) destination[Y_AXIS] = code_value();
- #ifdef FILAMENTCHANGE_YPOS
- else destination[Y_AXIS] = FILAMENTCHANGE_YPOS;
+ if (code_seen('Y')) destination[Y_AXIS] = code_value_axis_units(Y_AXIS);
+ #ifdef FILAMENT_CHANGE_Y_POS
+ else destination[Y_AXIS] = FILAMENT_CHANGE_Y_POS;
#endif
- RUNPLAN;
+ RUNPLAN(FILAMENT_CHANGE_XY_FEEDRATE);
+
+ stepper.synchronize();
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_UNLOAD);
- if (code_seen('L')) destination[E_AXIS] += code_value();
- #ifdef FILAMENTCHANGE_FINALRETRACT
- else destination[E_AXIS] += FILAMENTCHANGE_FINALRETRACT;
+ // Unload filament
+ if (code_seen('L')) destination[E_AXIS] += code_value_axis_units(E_AXIS);
+ #if defined(FILAMENT_CHANGE_UNLOAD_LENGTH) && FILAMENT_CHANGE_UNLOAD_LENGTH > 0
+ else destination[E_AXIS] -= FILAMENT_CHANGE_UNLOAD_LENGTH;
#endif
- RUNPLAN;
+ RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE);
- //finish moves
+ // Synchronize steppers and then disable extruders steppers for manual filament changing
stepper.synchronize();
- //disable extruder steppers so filament can be removed
disable_e0();
disable_e1();
disable_e2();
disable_e3();
delay(100);
- LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
- #if DISABLED(AUTO_FILAMENT_CHANGE)
+
+ #if HAS_BUZZER
millis_t next_tick = 0;
#endif
- KEEPALIVE_STATE(PAUSED_FOR_USER);
+
+ // Wait for filament insert by user and press button
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
+
while (!lcd_clicked()) {
- #if DISABLED(AUTO_FILAMENT_CHANGE)
+ #if HAS_BUZZER
millis_t ms = millis();
- if (ELAPSED(ms, next_tick)) {
- lcd_quick_feedback();
- next_tick = ms + 2500UL; // feedback every 2.5s while waiting
+ if (ms >= next_tick) {
+ BUZZ(300, 2000);
+ next_tick = ms + 2500; // Beep every 2.5s while waiting
}
- idle(true);
- #else
- current_position[E_AXIS] += AUTO_FILAMENT_CHANGE_LENGTH;
- destination[E_AXIS] = current_position[E_AXIS];
- line_to_destination(AUTO_FILAMENT_CHANGE_FEEDRATE);
- stepper.synchronize();
#endif
- } // while(!lcd_clicked)
- KEEPALIVE_STATE(IN_HANDLER);
- lcd_quick_feedback(); // click sound feedback
+ idle(true);
+ }
+ delay(100);
+ while (lcd_clicked()) idle(true);
+ delay(100);
- #if ENABLED(AUTO_FILAMENT_CHANGE)
- current_position[E_AXIS] = 0;
- stepper.synchronize();
+ // Show load message
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD);
+
+ // Load filament
+ if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS);
+ #if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0
+ else destination[E_AXIS] += FILAMENT_CHANGE_LOAD_LENGTH;
#endif
- //return to normal
- if (code_seen('L')) destination[E_AXIS] -= code_value();
- #ifdef FILAMENTCHANGE_FINALRETRACT
- else destination[E_AXIS] -= FILAMENTCHANGE_FINALRETRACT;
+ RUNPLAN(FILAMENT_CHANGE_LOAD_FEEDRATE);
+ stepper.synchronize();
+
+ #if defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) && FILAMENT_CHANGE_EXTRUDE_LENGTH > 0
+ do {
+ // Extrude filament to get into hotend
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_EXTRUDE);
+ destination[E_AXIS] += FILAMENT_CHANGE_EXTRUDE_LENGTH;
+ RUNPLAN(FILAMENT_CHANGE_EXTRUDE_FEEDRATE);
+ stepper.synchronize();
+ // Ask user if more filament should be extruded
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_OPTION);
+ while (filament_change_menu_response == FILAMENT_CHANGE_RESPONSE_WAIT_FOR) idle(true);
+ KEEPALIVE_STATE(IN_HANDLER);
+ } while (filament_change_menu_response != FILAMENT_CHANGE_RESPONSE_RESUME_PRINT);
#endif
- current_position[E_AXIS] = destination[E_AXIS]; //the long retract of L is compensated by manual filament feeding
- sync_plan_position_e();
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_RESUME);
- RUNPLAN; //should do nothing
+ KEEPALIVE_STATE(IN_HANDLER);
- lcd_reset_alert_level();
+ // Set extruder to saved position
+ current_position[E_AXIS] = lastpos[E_AXIS];
+ destination[E_AXIS] = lastpos[E_AXIS];
+ planner.set_e_position_mm(current_position[E_AXIS]);
#if ENABLED(DELTA)
// Move XYZ to starting position, then E
- calculate_delta(lastpos);
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], fr60, active_extruder);
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], lastpos[E_AXIS], fr60, active_extruder);
+ inverse_kinematics(lastpos);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], FILAMENT_CHANGE_XY_FEEDRATE, active_extruder);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], lastpos[E_AXIS], FILAMENT_CHANGE_XY_FEEDRATE, active_extruder);
#else
// Move XY to starting position, then Z, then E
destination[X_AXIS] = lastpos[X_AXIS];
destination[Y_AXIS] = lastpos[Y_AXIS];
- line_to_destination();
+ RUNPLAN(FILAMENT_CHANGE_XY_FEEDRATE);
destination[Z_AXIS] = lastpos[Z_AXIS];
- line_to_destination();
- destination[E_AXIS] = lastpos[E_AXIS];
- line_to_destination();
+ RUNPLAN(FILAMENT_CHANGE_Z_FEEDRATE);
#endif
+ stepper.synchronize();
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
filament_ran_out = false;
#endif
+ // Show status screen
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_STATUS);
}
-#endif // FILAMENTCHANGEENABLE
+#endif // FILAMENT_CHANGE_FEATURE
#if ENABLED(DUAL_X_CARRIAGE)
@@ -6238,7 +6408,7 @@ inline void gcode_M503() {
* M605 S0: Full control mode. The slicer has full control over x-carriage movement
* M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement
* M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn
- * millimeters x-offset and an optional differential hotend temperature of
+ * units x-offset and an optional differential hotend temperature of
* mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate
* the first with a spacing of 100mm in the x direction and 2 degrees hotter.
*
@@ -6246,21 +6416,21 @@ inline void gcode_M503() {
*/
inline void gcode_M605() {
stepper.synchronize();
- if (code_seen('S')) dual_x_carriage_mode = code_value();
+ if (code_seen('S')) dual_x_carriage_mode = code_value_byte();
switch (dual_x_carriage_mode) {
case DXC_DUPLICATION_MODE:
- if (code_seen('X')) duplicate_extruder_x_offset = max(code_value(), X2_MIN_POS - x_home_pos(0));
- if (code_seen('R')) duplicate_extruder_temp_offset = code_value();
+ if (code_seen('X')) duplicate_extruder_x_offset = max(code_value_axis_units(X_AXIS), X2_MIN_POS - x_home_pos(0));
+ if (code_seen('R')) duplicate_extruder_temp_offset = code_value_temp_diff();
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
SERIAL_CHAR(' ');
- SERIAL_ECHO(extruder_offset[X_AXIS][0]);
+ SERIAL_ECHO(hotend_offset[X_AXIS][0]);
SERIAL_CHAR(',');
- SERIAL_ECHO(extruder_offset[Y_AXIS][0]);
+ SERIAL_ECHO(hotend_offset[Y_AXIS][0]);
SERIAL_CHAR(' ');
SERIAL_ECHO(duplicate_extruder_x_offset);
SERIAL_CHAR(',');
- SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]);
+ SERIAL_ECHOLN(hotend_offset[Y_AXIS][1]);
break;
case DXC_FULL_CONTROL_MODE:
case DXC_AUTO_PARK_MODE:
@@ -6274,39 +6444,59 @@ inline void gcode_M503() {
delayed_move_time = 0;
}
-#endif // DUAL_X_CARRIAGE
+#elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
+
+ inline void gcode_M605() {
+ stepper.synchronize();
+ extruder_duplication_enabled = code_seen('S') && code_value_int() == 2;
+ SERIAL_ECHO_START;
+ SERIAL_ECHOPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF);
+ SERIAL_EOL;
+ }
+
+#endif // M605
+
+#if ENABLED(LIN_ADVANCE)
+ /**
+ * M905: Set advance factor
+ */
+ inline void gcode_M905() {
+ stepper.synchronize();
+ stepper.advance_M905(code_seen('K') ? code_value_float() : -1.0);
+ }
+#endif
/**
* M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S
*/
inline void gcode_M907() {
#if HAS_DIGIPOTSS
- for (int i = 0; i < NUM_AXIS; i++)
- if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value());
- if (code_seen('B')) stepper.digipot_current(4, code_value());
- if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value());
+ LOOP_XYZE(i)
+ if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int());
+ if (code_seen('B')) stepper.digipot_current(4, code_value_int());
+ if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
- if (code_seen('X')) stepper.digipot_current(0, code_value());
+ if (code_seen('X')) stepper.digipot_current(0, code_value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
- if (code_seen('Z')) stepper.digipot_current(1, code_value());
+ if (code_seen('Z')) stepper.digipot_current(1, code_value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
- if (code_seen('E')) stepper.digipot_current(2, code_value());
+ if (code_seen('E')) stepper.digipot_current(2, code_value_int());
#endif
#if ENABLED(DIGIPOT_I2C)
// this one uses actual amps in floating point
- for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value());
+ LOOP_XYZE(i) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value_float());
// for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
- for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value());
+ for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value_float());
#endif
#if ENABLED(DAC_STEPPER_CURRENT)
if (code_seen('S')) {
- float dac_percent = code_value();
+ float dac_percent = code_value_float();
for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent);
}
- for (uint8_t i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) dac_current_percent(i, code_value());
+ LOOP_XYZE(i) if (code_seen(axis_codes[i])) dac_current_percent(i, code_value_float());
#endif
}
@@ -6318,14 +6508,14 @@ inline void gcode_M907() {
inline void gcode_M908() {
#if HAS_DIGIPOTSS
stepper.digitalPotWrite(
- code_seen('P') ? code_value() : 0,
- code_seen('S') ? code_value() : 0
+ code_seen('P') ? code_value_int() : 0,
+ code_seen('S') ? code_value_int() : 0
);
#endif
#ifdef DAC_STEPPER_CURRENT
dac_current_raw(
- code_seen('P') ? code_value_long() : -1,
- code_seen('S') ? code_value_short() : 0
+ code_seen('P') ? code_value_byte() : -1,
+ code_seen('S') ? code_value_ushort() : 0
);
#endif
}
@@ -6344,9 +6534,9 @@ inline void gcode_M907() {
// M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
inline void gcode_M350() {
- if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.microstep_mode(i, code_value());
- for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_mode(i, (uint8_t)code_value());
- if (code_seen('B')) stepper.microstep_mode(4, code_value());
+ if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.microstep_mode(i, code_value_byte());
+ LOOP_XYZE(i) if (code_seen(axis_codes[i])) stepper.microstep_mode(i, code_value_byte());
+ if (code_seen('B')) stepper.microstep_mode(4, code_value_byte());
stepper.microstep_readings();
}
@@ -6355,14 +6545,14 @@ inline void gcode_M907() {
* S# determines MS1 or MS2, X# sets the pin high/low.
*/
inline void gcode_M351() {
- if (code_seen('S')) switch (code_value_short()) {
+ if (code_seen('S')) switch (code_value_byte()) {
case 1:
- for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, code_value(), -1);
- if (code_seen('B')) stepper.microstep_ms(4, code_value(), -1);
+ LOOP_XYZE(i) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, code_value_byte(), -1);
+ if (code_seen('B')) stepper.microstep_ms(4, code_value_byte(), -1);
break;
case 2:
- for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, -1, code_value());
- if (code_seen('B')) stepper.microstep_ms(4, -1, code_value());
+ LOOP_XYZE(i) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, -1, code_value_byte());
+ if (code_seen('B')) stepper.microstep_ms(4, -1, code_value_byte());
break;
}
stepper.microstep_readings();
@@ -6370,6 +6560,60 @@ inline void gcode_M907() {
#endif // HAS_MICROSTEPS
+#if ENABLED(MIXING_EXTRUDER)
+
+ /**
+ * M163: Set a single mix factor for a mixing extruder
+ * This is called "weight" by some systems.
+ *
+ * S[index] The channel index to set
+ * P[float] The mix value
+ *
+ */
+ inline void gcode_M163() {
+ int mix_index = code_seen('S') ? code_value_int() : 0;
+ float mix_value = code_seen('P') ? code_value_float() : 0.0;
+ if (mix_index < MIXING_STEPPERS) mixing_factor[mix_index] = mix_value;
+ }
+
+ #if MIXING_VIRTUAL_TOOLS > 1
+
+ /**
+ * M164: Store the current mix factors as a virtual tool.
+ *
+ * S[index] The virtual tool to store
+ *
+ */
+ inline void gcode_M164() {
+ int tool_index = code_seen('S') ? code_value_int() : 0;
+ if (tool_index < MIXING_VIRTUAL_TOOLS) {
+ normalize_mix();
+ for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
+ mixing_virtual_tool_mix[tool_index][i] = mixing_factor[i];
+ }
+ }
+
+ #endif
+
+ #if ENABLED(DIRECT_MIXING_IN_G1)
+ /**
+ * M165: Set multiple mix factors for a mixing extruder.
+ * Factors that are left out will be set to 0.
+ * All factors together must add up to 1.0.
+ *
+ * A[factor] Mix factor for extruder stepper 1
+ * B[factor] Mix factor for extruder stepper 2
+ * C[factor] Mix factor for extruder stepper 3
+ * D[factor] Mix factor for extruder stepper 4
+ * H[factor] Mix factor for extruder stepper 5
+ * I[factor] Mix factor for extruder stepper 6
+ *
+ */
+ inline void gcode_M165() { gcode_get_mix(); }
+ #endif
+
+#endif // MIXING_EXTRUDER
+
/**
* M999: Restart after being stopped
*
@@ -6384,163 +6628,354 @@ inline void gcode_M999() {
Running = true;
lcd_reset_alert_level();
- if (code_seen('S') && code_value_short() == 1) return;
+ if (code_seen('S') && code_value_bool()) return;
// gcode_LastN = Stopped_gcode_LastN;
FlushSerialRequestResend();
}
-/**
- * T0-T3: Switch tool, usually switching extruders
- *
- * F[mm/min] Set the movement feedrate
- */
-inline void gcode_T(uint8_t tmp_extruder) {
- if (tmp_extruder >= EXTRUDERS) {
- SERIAL_ECHO_START;
- SERIAL_CHAR('T');
- SERIAL_PROTOCOL_F(tmp_extruder, DEC);
- SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
- return;
+#if ENABLED(SWITCHING_EXTRUDER)
+ inline void move_extruder_servo(uint8_t e) {
+ const int angles[2] = SWITCHING_EXTRUDER_SERVO_ANGLES;
+ MOVE_SERVO(SWITCHING_EXTRUDER_SERVO_NR, angles[e]);
}
+#endif
+
+inline void invalid_extruder_error(const uint8_t &e) {
+ SERIAL_ECHO_START;
+ SERIAL_CHAR('T');
+ SERIAL_PROTOCOL_F(e, DEC);
+ SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
+}
+
+void tool_change(const uint8_t tmp_extruder, const float fr_mm_m/*=0.0*/, bool no_move/*=false*/) {
+ #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
+
+ if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) {
+ invalid_extruder_error(tmp_extruder);
+ return;
+ }
+
+ // T0-Tnnn: Switch virtual tool by changing the mix
+ for (uint8_t j = 0; j < MIXING_STEPPERS; j++)
+ mixing_factor[j] = mixing_virtual_tool_mix[tmp_extruder][j];
+
+ #else //!MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1
- float stored_feedrate = feedrate;
+ #if HOTENDS > 1
+
+ if (tmp_extruder >= EXTRUDERS) {
+ invalid_extruder_error(tmp_extruder);
+ return;
+ }
+
+ float old_feedrate_mm_m = feedrate_mm_m;
+
+ feedrate_mm_m = fr_mm_m > 0.0 ? (old_feedrate_mm_m = fr_mm_m) : XY_PROBE_FEEDRATE_MM_M;
+
+ if (tmp_extruder != active_extruder) {
+ if (!no_move && axis_unhomed_error(true, true, true)) {
+ SERIAL_ECHOLNPGM("No move on toolchange");
+ no_move = true;
+ }
+
+ // Save current position to destination, for use later
+ set_destination_to_current();
+
+ #if ENABLED(DUAL_X_CARRIAGE)
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPGM("Dual X Carriage Mode ");
+ switch (dual_x_carriage_mode) {
+ case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break;
+ case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break;
+ case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break;
+ }
+ }
+ #endif
- if (code_seen('F')) {
- float next_feedrate = code_value();
- if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate;
- }
- else {
- #ifdef XY_TRAVEL_SPEED
- feedrate = XY_TRAVEL_SPEED;
- #else
- feedrate = min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]);
- #endif
- }
+ if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() &&
+ (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder))
+ ) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPAIR("Raise to ", current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT); SERIAL_EOL;
+ SERIAL_ECHOPAIR("MoveX to ", x_home_pos(active_extruder)); SERIAL_EOL;
+ SERIAL_ECHOPAIR("Lower to ", current_position[Z_AXIS]); SERIAL_EOL;
+ }
+ #endif
+ // Park old head: 1) raise 2) move to park position 3) lower
+ for (uint8_t i = 0; i < 3; i++)
+ planner.buffer_line(
+ i == 0 ? current_position[X_AXIS] : x_home_pos(active_extruder),
+ current_position[Y_AXIS],
+ current_position[Z_AXIS] + (i == 2 ? 0 : TOOLCHANGE_PARK_ZLIFT),
+ current_position[E_AXIS],
+ planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS],
+ active_extruder
+ );
+ stepper.synchronize();
+ }
- #if EXTRUDERS > 1
- if (tmp_extruder != active_extruder) {
- // Save current position to return to after applying extruder offset
- set_destination_to_current();
- #if ENABLED(DUAL_X_CARRIAGE)
- if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() &&
- (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder))) {
- // Park old head: 1) raise 2) move to park position 3) lower
- planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT,
- current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder);
- planner.buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT,
- current_position[E_AXIS], planner.max_feedrate[X_AXIS], active_extruder);
- planner.buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS],
- current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder);
- stepper.synchronize();
- }
+ // apply Y & Z extruder offset (x offset is already used in determining home pos)
+ current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder];
+ current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
+ active_extruder = tmp_extruder;
- // apply Y & Z extruder offset (x offset is already used in determining home pos)
- current_position[Y_AXIS] -= extruder_offset[Y_AXIS][active_extruder] - extruder_offset[Y_AXIS][tmp_extruder];
- current_position[Z_AXIS] -= extruder_offset[Z_AXIS][active_extruder] - extruder_offset[Z_AXIS][tmp_extruder];
- active_extruder = tmp_extruder;
+ // This function resets the max/min values - the current position may be overwritten below.
+ set_axis_is_at_home(X_AXIS);
- // This function resets the max/min values - the current position may be overwritten below.
- set_axis_is_at_home(X_AXIS);
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position);
+ #endif
- if (dual_x_carriage_mode == DXC_FULL_CONTROL_MODE) {
- current_position[X_AXIS] = inactive_extruder_x_pos;
- inactive_extruder_x_pos = destination[X_AXIS];
- }
- else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) {
- active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position
- if (active_extruder_parked)
- current_position[X_AXIS] = inactive_extruder_x_pos;
- else
- current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
- inactive_extruder_x_pos = destination[X_AXIS];
- extruder_duplication_enabled = false;
- }
- else {
- // record raised toolhead position for use by unpark
- memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
- raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT;
- active_extruder_parked = true;
- delayed_move_time = 0;
- }
- // No extra case for AUTO_BED_LEVELING_FEATURE in DUAL_X_CARRIAGE. Does that mean they don't work together?
- #else // !DUAL_X_CARRIAGE
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- // Offset extruder, make sure to apply the bed level rotation matrix
- vector_3 tmp_offset_vec = vector_3(extruder_offset[X_AXIS][tmp_extruder],
- extruder_offset[Y_AXIS][tmp_extruder],
- 0),
- act_offset_vec = vector_3(extruder_offset[X_AXIS][active_extruder],
- extruder_offset[Y_AXIS][active_extruder],
- 0),
- offset_vec = tmp_offset_vec - act_offset_vec;
+ switch (dual_x_carriage_mode) {
+ case DXC_FULL_CONTROL_MODE:
+ current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos);
+ inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]);
+ break;
+ case DXC_DUPLICATION_MODE:
+ active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position
+ if (active_extruder_parked)
+ current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos);
+ else
+ current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
+ inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]);
+ extruder_duplication_enabled = false;
+ break;
+ default:
+ // record raised toolhead position for use by unpark
+ memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
+ raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT;
+ active_extruder_parked = true;
+ delayed_move_time = 0;
+ break;
+ }
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- SERIAL_ECHOLNPGM(">>> gcode_T");
- tmp_offset_vec.debug("tmp_offset_vec");
- act_offset_vec.debug("act_offset_vec");
- offset_vec.debug("offset_vec (BEFORE)");
- DEBUG_POS("BEFORE rotation", current_position);
+ SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no");
+ SERIAL_EOL;
+ DEBUG_POS("New extruder (parked)", current_position);
+ }
+ #endif
+
+ // No extra case for AUTO_BED_LEVELING_FEATURE in DUAL_X_CARRIAGE. Does that mean they don't work together?
+ #else // !DUAL_X_CARRIAGE
+
+ #if ENABLED(SWITCHING_EXTRUDER)
+ // <0 if the new nozzle is higher, >0 if lower. A bigger raise when lower.
+ float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder],
+ z_raise = 0.3 + (z_diff > 0.0 ? z_diff : 0.0);
+
+ // Always raise by some amount
+ planner.buffer_line(
+ current_position[X_AXIS],
+ current_position[Y_AXIS],
+ current_position[Z_AXIS] + z_raise,
+ current_position[E_AXIS],
+ planner.max_feedrate_mm_s[Z_AXIS],
+ active_extruder
+ );
+ stepper.synchronize();
+
+ move_extruder_servo(active_extruder);
+ delay(500);
+
+ // Move back down, if needed
+ if (z_raise != z_diff) {
+ planner.buffer_line(
+ current_position[X_AXIS],
+ current_position[Y_AXIS],
+ current_position[Z_AXIS] + z_diff,
+ current_position[E_AXIS],
+ planner.max_feedrate_mm_s[Z_AXIS],
+ active_extruder
+ );
+ stepper.synchronize();
}
#endif
- offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix));
+ /**
+ * Set current_position to the position of the new nozzle.
+ * Offsets are based on linear distance, so we need to get
+ * the resulting position in coordinate space.
+ *
+ * - With grid or 3-point leveling, offset XYZ by a tilted vector
+ * - With mesh leveling, update Z for the new position
+ * - Otherwise, just use the raw linear distance
+ *
+ * Software endstops are altered here too. Consider a case where:
+ * E0 at X=0 ... E1 at X=10
+ * When we switch to E1 now X=10, but E1 can't move left.
+ * To express this we apply the change in XY to the software endstops.
+ * E1 can move farther right than E0, so the right limit is extended.
+ *
+ * Note that we don't adjust the Z software endstops. Why not?
+ * Consider a case where Z=0 (here) and switching to E1 makes Z=1
+ * because the bed is 1mm lower at the new position. As long as
+ * the first nozzle is out of the way, the carriage should be
+ * allowed to move 1mm lower. This technically "breaks" the
+ * Z software endstop. But this is technically correct (and
+ * there is no viable alternative).
+ */
+ #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ // Offset extruder, make sure to apply the bed level rotation matrix
+ vector_3 tmp_offset_vec = vector_3(hotend_offset[X_AXIS][tmp_extruder],
+ hotend_offset[Y_AXIS][tmp_extruder],
+ 0),
+ act_offset_vec = vector_3(hotend_offset[X_AXIS][active_extruder],
+ hotend_offset[Y_AXIS][active_extruder],
+ 0),
+ offset_vec = tmp_offset_vec - act_offset_vec;
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ tmp_offset_vec.debug("tmp_offset_vec");
+ act_offset_vec.debug("act_offset_vec");
+ offset_vec.debug("offset_vec (BEFORE)");
+ }
+ #endif
+
+ offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix));
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) offset_vec.debug("offset_vec (AFTER)");
+ #endif
+
+ // Adjustments to the current position
+ float xydiff[2] = { offset_vec.x, offset_vec.y };
+ current_position[Z_AXIS] += offset_vec.z;
+
+ #else // !AUTO_BED_LEVELING_FEATURE
+
+ float xydiff[2] = {
+ hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder],
+ hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder]
+ };
+
+ #if ENABLED(MESH_BED_LEVELING)
+
+ if (mbl.active()) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Z before MBL: ", current_position[Z_AXIS]);
+ #endif
+ float xpos = RAW_CURRENT_POSITION(X_AXIS),
+ ypos = RAW_CURRENT_POSITION(Y_AXIS);
+ current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos);
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPAIR(" after: ", current_position[Z_AXIS]);
+ SERIAL_EOL;
+ }
+ #endif
+ }
+
+ #endif // MESH_BED_LEVELING
- current_position[X_AXIS] += offset_vec.x;
- current_position[Y_AXIS] += offset_vec.y;
- current_position[Z_AXIS] += offset_vec.z;
+ #endif // !AUTO_BED_LEVELING_FEATURE
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
- offset_vec.debug("offset_vec (AFTER)");
- DEBUG_POS("AFTER rotation", current_position);
- SERIAL_ECHOLNPGM("<<< gcode_T");
+ SERIAL_ECHOPAIR("Offset Tool XY by { ", xydiff[X_AXIS]);
+ SERIAL_ECHOPAIR(", ", xydiff[Y_AXIS]);
+ SERIAL_ECHOLNPGM(" }");
}
#endif
- #else // !AUTO_BED_LEVELING_FEATURE
-
- // The newly-selected extruder is actually at...
- for (int i=X_AXIS; i<=Y_AXIS; i++) {
- float diff = extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder];
- current_position[i] += diff;
- position_shift[i] += diff; // Offset the coordinate space
+ // The newly-selected extruder XY is actually at...
+ current_position[X_AXIS] += xydiff[X_AXIS];
+ current_position[Y_AXIS] += xydiff[Y_AXIS];
+ for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) {
+ position_shift[i] += xydiff[i];
update_software_endstops((AxisEnum)i);
}
- #endif // !AUTO_BED_LEVELING_FEATURE
+ // Set the new active extruder
+ active_extruder = tmp_extruder;
- // Set the new active extruder
- active_extruder = tmp_extruder;
+ #endif // !DUAL_X_CARRIAGE
- #endif // !DUAL_X_CARRIAGE
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("Sync After Toolchange", current_position);
+ #endif
- // Tell the planner the new "current position"
- #if ENABLED(DELTA)
- sync_plan_position_delta();
- #else
- sync_plan_position();
- #endif
+ // Tell the planner the new "current position"
+ SYNC_PLAN_POSITION_KINEMATIC();
- // Move to the "old position" (move the extruder into place)
- if (IsRunning()) prepare_move();
+ // Move to the "old position" (move the extruder into place)
+ if (!no_move && IsRunning()) {
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination);
+ #endif
+ prepare_move_to_destination();
+ }
- } // (tmp_extruder != active_extruder)
+ } // (tmp_extruder != active_extruder)
- #if ENABLED(EXT_SOLENOID)
stepper.synchronize();
- disable_all_solenoids();
- enable_solenoid_on_active_extruder();
- #endif // EXT_SOLENOID
- #endif // EXTRUDERS > 1
+ #if ENABLED(EXT_SOLENOID)
+ disable_all_solenoids();
+ enable_solenoid_on_active_extruder();
+ #endif // EXT_SOLENOID
- feedrate = stored_feedrate;
+ feedrate_mm_m = old_feedrate_mm_m;
- SERIAL_ECHO_START;
- SERIAL_ECHO(MSG_ACTIVE_EXTRUDER);
- SERIAL_PROTOCOLLN((int)active_extruder);
+ #else // HOTENDS <= 1
+
+ // Set the new active extruder
+ active_extruder = tmp_extruder;
+
+ UNUSED(fr_mm_m);
+ UNUSED(no_move);
+
+ #endif // HOTENDS <= 1
+
+ SERIAL_ECHO_START;
+ SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER);
+ SERIAL_PROTOCOLLN((int)active_extruder);
+
+ #endif //!MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1
+}
+
+/**
+ * T0-T3: Switch tool, usually switching extruders
+ *
+ * F[units/min] Set the movement feedrate
+ * S1 Don't move the tool in XY after change
+ */
+inline void gcode_T(uint8_t tmp_extruder) {
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ SERIAL_ECHOPAIR(">>> gcode_T(", tmp_extruder);
+ SERIAL_ECHOLNPGM(")");
+ DEBUG_POS("BEFORE", current_position);
+ }
+ #endif
+
+ #if HOTENDS == 1 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1)
+
+ tool_change(tmp_extruder);
+
+ #elif HOTENDS > 1
+
+ tool_change(
+ tmp_extruder,
+ code_seen('F') ? code_value_axis_units(X_AXIS) : 0.0,
+ (tmp_extruder == active_extruder) || (code_seen('S') && code_value_bool())
+ );
+
+ #endif
+
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ DEBUG_POS("AFTER", current_position);
+ SERIAL_ECHOLNPGM("<<< gcode_T");
+ }
+ #endif
}
/**
@@ -6608,12 +7043,10 @@ void process_next_command() {
// G2, G3
#if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
-
case 2: // G2 - CW ARC
case 3: // G3 - CCW ARC
gcode_G2_G3(codenum == 2);
break;
-
#endif
// G4 Dwell
@@ -6622,23 +7055,41 @@ void process_next_command() {
break;
#if ENABLED(BEZIER_CURVE_SUPPORT)
-
// G5
case 5: // G5 - Cubic B_spline
gcode_G5();
break;
-
#endif // BEZIER_CURVE_SUPPORT
#if ENABLED(FWRETRACT)
-
case 10: // G10: retract
case 11: // G11: retract_recover
gcode_G10_G11(codenum == 10);
break;
-
#endif // FWRETRACT
+ #if ENABLED(NOZZLE_CLEAN_FEATURE)
+ case 12:
+ gcode_G12(); // G12: Nozzle Clean
+ break;
+ #endif // NOZZLE_CLEAN_FEATURE
+
+ #if ENABLED(INCH_MODE_SUPPORT)
+ case 20: //G20: Inch Mode
+ gcode_G20();
+ break;
+
+ case 21: //G21: MM Mode
+ gcode_G21();
+ break;
+ #endif // INCH_MODE_SUPPORT
+
+ #if ENABLED(NOZZLE_PARK_FEATURE)
+ case 27: // G27: Nozzle Park
+ gcode_G27();
+ break;
+ #endif // NOZZLE_PARK_FEATURE
+
case 28: // G28: Home all axes, one at a time
gcode_G28();
break;
@@ -6647,26 +7098,26 @@ void process_next_command() {
case 29: // G29 Detailed Z probe, probes the bed at 3 or more points.
gcode_G29();
break;
- #endif
-
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ #endif // AUTO_BED_LEVELING_FEATURE
- #if DISABLED(Z_PROBE_SLED)
+ #if HAS_BED_PROBE
- case 30: // G30 Single Z probe
- gcode_G30();
- break;
+ case 30: // G30 Single Z probe
+ gcode_G30();
+ break;
- #else // Z_PROBE_SLED
+ #if ENABLED(Z_PROBE_SLED)
case 31: // G31: dock the sled
+ gcode_G31();
+ break;
+
case 32: // G32: undock the sled
- dock_sled(codenum == 31);
+ gcode_G32();
break;
#endif // Z_PROBE_SLED
-
- #endif // AUTO_BED_LEVELING_FEATURE
+ #endif // HAS_BED_PROBE
case 90: // G90
relative_mode = false;
@@ -6694,7 +7145,6 @@ void process_next_command() {
break;
#if ENABLED(SDSUPPORT)
-
case 20: // M20 - list SD card
gcode_M20(); break;
case 21: // M21 - init SD card
@@ -6727,7 +7177,6 @@ void process_next_command() {
case 928: //M928 - Start SD write
gcode_M928(); break;
-
#endif //SDSUPPORT
case 31: //M31 take time since the start of the SD print or an M109 command
@@ -6738,11 +7187,11 @@ void process_next_command() {
gcode_M42();
break;
- #if ENABLED(AUTO_BED_LEVELING_FEATURE) && ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
+ #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
case 48: // M48 Z probe repeatability
gcode_M48();
break;
- #endif // AUTO_BED_LEVELING_FEATURE && Z_MIN_PROBE_REPEATABILITY_TEST
+ #endif // Z_MIN_PROBE_REPEATABILITY_TEST
case 75: // Start print timer
gcode_M75();
@@ -6780,16 +7229,26 @@ void process_next_command() {
gcode_M111();
break;
- case 112: // M112: Emergency Stop
- gcode_M112();
- break;
+ #if DISABLED(EMERGENCY_PARSER)
- #if ENABLED(HOST_KEEPALIVE_FEATURE)
+ case 108: // M108: Cancel Waiting
+ gcode_M108();
+ break;
+
+ case 112: // M112: Emergency Stop
+ gcode_M112();
+ break;
+ case 410: // M410 quickstop - Abort all the planned moves.
+ gcode_M410();
+ break;
+
+ #endif
+
+ #if ENABLED(HOST_KEEPALIVE_FEATURE)
case 113: // M113: Set Host Keepalive interval
gcode_M113();
break;
-
#endif
case 140: // M140: Set bed temp
@@ -6897,6 +7356,12 @@ void process_next_command() {
#endif
+ #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
+ case 149:
+ gcode_M149();
+ break;
+ #endif
+
#if ENABLED(BLINKM)
case 150: // M150
@@ -6917,7 +7382,23 @@ void process_next_command() {
#endif //EXPERIMENTAL_I2CBUS
- case 200: // M200 D set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).
+ #if ENABLED(MIXING_EXTRUDER)
+ case 163: // M163 S P set weight for a mixing extruder
+ gcode_M163();
+ break;
+ #if MIXING_VIRTUAL_TOOLS > 1
+ case 164: // M164 S save current mix as a virtual extruder
+ gcode_M164();
+ break;
+ #endif
+ #if ENABLED(DIRECT_MIXING_IN_G1)
+ case 165: // M165 [ABCDHI] set multiple mix weights
+ gcode_M165();
+ break;
+ #endif
+ #endif
+
+ case 200: // M200 D Set filament diameter and set E axis units to cubic. (Use S0 to revert to linear units.)
gcode_M200();
break;
case 201: // M201
@@ -6928,7 +7409,7 @@ void process_next_command() {
gcode_M202();
break;
#endif
- case 203: // M203 max feedrate mm/sec
+ case 203: // M203 max feedrate units/sec
gcode_M203();
break;
case 204: // M204 acclereration S normal moves T filmanent only moves
@@ -6954,28 +7435,28 @@ void process_next_command() {
#endif
#if ENABLED(FWRETRACT)
- case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop]
+ case 207: // M207 - Set Retract Length: S, Feedrate: F, and Z lift: Z
gcode_M207();
break;
- case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
+ case 208: // M208 - Set Recover (unretract) Additional (!) Length: S and Feedrate: F
gcode_M208();
break;
- case 209: // M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
+ case 209: // M209 - Turn Automatic Retract Detection on/off: S (For slicers that don't support G10/11). Every normal extrude-only move will be classified as retract depending on the direction.
gcode_M209();
break;
#endif // FWRETRACT
- #if EXTRUDERS > 1
- case 218: // M218 - set hotend offset (in mm), T X Y
+ #if HOTENDS > 1
+ case 218: // M218 - Set a tool offset: T X Y
gcode_M218();
break;
#endif
- case 220: // M220 S- set speed factor override percentage
+ case 220: // M220 - Set Feedrate Percentage: S ("FR" on your LCD)
gcode_M220();
break;
- case 221: // M221 S- set extrude factor override percentage
+ case 221: // M221 - Set Flow Percentage: S
gcode_M221();
break;
@@ -7054,14 +7535,14 @@ void process_next_command() {
gcode_M400();
break;
- #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_SERVO_ENDSTOPS || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED)
+ #if HAS_BED_PROBE
case 401:
gcode_M401();
break;
case 402:
gcode_M402();
break;
- #endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
+ #endif // HAS_BED_PROBE
#if ENABLED(FILAMENT_WIDTH_SENSOR)
case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width
@@ -7078,10 +7559,6 @@ void process_next_command() {
break;
#endif // ENABLED(FILAMENT_WIDTH_SENSOR)
- case 410: // M410 quickstop - Abort all the planned moves.
- gcode_M410();
- break;
-
#if ENABLED(MESH_BED_LEVELING)
case 420: // M420 Enable/Disable Mesh Bed Leveling
gcode_M420();
@@ -7114,17 +7591,17 @@ void process_next_command() {
break;
#endif
- #ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET
- case CUSTOM_M_CODE_SET_Z_PROBE_OFFSET:
- gcode_SET_Z_PROBE_OFFSET();
+ #if HAS_BED_PROBE
+ case 851:
+ gcode_M851();
break;
- #endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET
+ #endif // HAS_BED_PROBE
- #if ENABLED(FILAMENTCHANGEENABLE)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
gcode_M600();
break;
- #endif // FILAMENTCHANGEENABLE
+ #endif // FILAMENT_CHANGE_FEATURE
#if ENABLED(DUAL_X_CARRIAGE)
case 605:
@@ -7132,6 +7609,12 @@ void process_next_command() {
break;
#endif // DUAL_X_CARRIAGE
+ #if ENABLED(LIN_ADVANCE)
+ case 905: // M905 Set advance factor.
+ gcode_M905();
+ break;
+ #endif
+
case 907: // M907 Set digital trimpot motor current using axis codes.
gcode_M907();
break;
@@ -7244,7 +7727,13 @@ void clamp_to_software_endstops(float target[3]) {
delta_diagonal_rod_2_tower_3 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_3);
}
- void calculate_delta(float cartesian[3]) {
+ void inverse_kinematics(const float in_cartesian[3]) {
+
+ const float cartesian[3] = {
+ RAW_X_POSITION(in_cartesian[X_AXIS]),
+ RAW_Y_POSITION(in_cartesian[Y_AXIS]),
+ RAW_Z_POSITION(in_cartesian[Z_AXIS])
+ };
delta[TOWER_1] = sqrt(delta_diagonal_rod_2_tower_1
- sq(delta_tower1_x - cartesian[X_AXIS])
@@ -7269,6 +7758,98 @@ void clamp_to_software_endstops(float target[3]) {
*/
}
+ float delta_safe_distance_from_top() {
+ float cartesian[3] = {
+ LOGICAL_X_POSITION(0),
+ LOGICAL_Y_POSITION(0),
+ LOGICAL_Z_POSITION(0)
+ };
+ inverse_kinematics(cartesian);
+ float distance = delta[TOWER_3];
+ cartesian[Y_AXIS] = LOGICAL_Y_POSITION(DELTA_PRINTABLE_RADIUS);
+ inverse_kinematics(cartesian);
+ return abs(distance - delta[TOWER_3]);
+ }
+
+ void forward_kinematics_DELTA(float z1, float z2, float z3) {
+ //As discussed in Wikipedia "Trilateration"
+ //we are establishing a new coordinate
+ //system in the plane of the three carriage points.
+ //This system will have the origin at tower1 and
+ //tower2 is on the x axis. tower3 is in the X-Y
+ //plane with a Z component of zero. We will define unit
+ //vectors in this coordinate system in our original
+ //coordinate system. Then when we calculate the
+ //Xnew, Ynew and Znew values, we can translate back into
+ //the original system by moving along those unit vectors
+ //by the corresponding values.
+ // https://en.wikipedia.org/wiki/Trilateration
+
+ // Variable names matched to Marlin, c-version
+ // and avoiding a vector library
+ // by Andreas Hardtung 2016-06-7
+ // based on a Java function from
+ // "Delta Robot Kinematics by Steve Graves" V3
+
+ // Result is in cartesian_position[].
+
+ //Create a vector in old coordinates along x axis of new coordinate
+ float p12[3] = { delta_tower2_x - delta_tower1_x, delta_tower2_y - delta_tower1_y, z2 - z1 };
+
+ //Get the Magnitude of vector.
+ float d = sqrt( p12[0]*p12[0] + p12[1]*p12[1] + p12[2]*p12[2] );
+
+ //Create unit vector by dividing by magnitude.
+ float ex[3] = { p12[0]/d, p12[1]/d, p12[2]/d };
+
+ //Now find vector from the origin of the new system to the third point.
+ float p13[3] = { delta_tower3_x - delta_tower1_x, delta_tower3_y - delta_tower1_y, z3 - z1 };
+
+ //Now use dot product to find the component of this vector on the X axis.
+ float i = ex[0]*p13[0] + ex[1]*p13[1] + ex[2]*p13[2];
+
+ //Now create a vector along the x axis that represents the x component of p13.
+ float iex[3] = { ex[0]*i, ex[1]*i, ex[2]*i };
+
+ //Now subtract the X component away from the original vector leaving only the Y component. We use the
+ //variable that will be the unit vector after we scale it.
+ float ey[3] = { p13[0] - iex[0], p13[1] - iex[1], p13[2] - iex[2]};
+
+ //The magnitude of Y component
+ float j = sqrt(sq(ey[0]) + sq(ey[1]) + sq(ey[2]));
+
+ //Now make vector a unit vector
+ ey[0] /= j; ey[1] /= j; ey[2] /= j;
+
+ //The cross product of the unit x and y is the unit z
+ //float[] ez = vectorCrossProd(ex, ey);
+ float ez[3] = { ex[1]*ey[2] - ex[2]*ey[1], ex[2]*ey[0] - ex[0]*ey[2], ex[0]*ey[1] - ex[1]*ey[0] };
+
+ //Now we have the d, i and j values defined in Wikipedia.
+ //We can plug them into the equations defined in
+ //Wikipedia for Xnew, Ynew and Znew
+ float Xnew = (delta_diagonal_rod_2_tower_1 - delta_diagonal_rod_2_tower_2 + d*d)/(d*2);
+ float Ynew = ((delta_diagonal_rod_2_tower_1 - delta_diagonal_rod_2_tower_3 + i*i + j*j)/2 - i*Xnew) /j;
+ float Znew = sqrt(delta_diagonal_rod_2_tower_1 - Xnew*Xnew - Ynew*Ynew);
+
+ //Now we can start from the origin in the old coords and
+ //add vectors in the old coords that represent the
+ //Xnew, Ynew and Znew to find the point in the old system
+ cartesian_position[X_AXIS] = delta_tower1_x + ex[0]*Xnew + ey[0]*Ynew - ez[0]*Znew;
+ cartesian_position[Y_AXIS] = delta_tower1_y + ex[1]*Xnew + ey[1]*Ynew - ez[1]*Znew;
+ cartesian_position[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew;
+ };
+
+ void forward_kinematics_DELTA(float point[3]) {
+ forward_kinematics_DELTA(point[X_AXIS], point[Y_AXIS], point[Z_AXIS]);
+ }
+
+ void set_cartesian_from_steppers() {
+ forward_kinematics_DELTA(stepper.get_axis_position_mm(X_AXIS),
+ stepper.get_axis_position_mm(Y_AXIS),
+ stepper.get_axis_position_mm(Z_AXIS));
+ }
+
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
// Adjust print surface height by linear interpolation over the bed_level array.
@@ -7277,8 +7858,8 @@ void clamp_to_software_endstops(float target[3]) {
int half = (AUTO_BED_LEVELING_GRID_POINTS - 1) / 2;
float h1 = 0.001 - half, h2 = half - 0.001,
- grid_x = max(h1, min(h2, cartesian[X_AXIS] / delta_grid_spacing[0])),
- grid_y = max(h1, min(h2, cartesian[Y_AXIS] / delta_grid_spacing[1]));
+ grid_x = max(h1, min(h2, RAW_X_POSITION(cartesian[X_AXIS]) / delta_grid_spacing[0])),
+ grid_y = max(h1, min(h2, RAW_Y_POSITION(cartesian[Y_AXIS]) / delta_grid_spacing[1]));
int floor_x = floor(grid_x), floor_y = floor(grid_y);
float ratio_x = grid_x - floor_x, ratio_y = grid_y - floor_y,
z1 = bed_level[floor_x + half][floor_y + half],
@@ -7313,116 +7894,88 @@ void clamp_to_software_endstops(float target[3]) {
#endif // DELTA
+void set_current_from_steppers_for_axis(AxisEnum axis) {
+ #if ENABLED(DELTA)
+ set_cartesian_from_steppers();
+ current_position[axis] = LOGICAL_POSITION(cartesian_position[axis], axis);
+ #elif ENABLED(AUTO_BED_LEVELING_FEATURE)
+ vector_3 pos = planner.adjusted_position();
+ current_position[axis] = axis == X_AXIS ? pos.x : axis == Y_AXIS ? pos.y : pos.z;
+ #else
+ current_position[axis] = stepper.get_axis_position_mm(axis); // CORE handled transparently
+ #endif
+}
+
#if ENABLED(MESH_BED_LEVELING)
// This function is used to split lines on mesh borders so each segment is only part of one mesh area
-void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) {
- if (!mbl.active) {
- planner.buffer_line(x, y, z, e, feed_rate, extruder);
- set_current_to_destination();
- return;
- }
- int pcx = mbl.cel_index_x(current_position[X_AXIS] - home_offset[X_AXIS]);
- int pcy = mbl.cel_index_y(current_position[Y_AXIS] - home_offset[Y_AXIS]);
- int cx = mbl.cel_index_x(x - home_offset[X_AXIS]);
- int cy = mbl.cel_index_y(y - home_offset[Y_AXIS]);
- NOMORE(pcx, MESH_NUM_X_POINTS - 2);
- NOMORE(pcy, MESH_NUM_Y_POINTS - 2);
- NOMORE(cx, MESH_NUM_X_POINTS - 2);
- NOMORE(cy, MESH_NUM_Y_POINTS - 2);
- if (pcx == cx && pcy == cy) {
+void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) {
+ int cx1 = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)),
+ cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)),
+ cx2 = mbl.cell_index_x(RAW_X_POSITION(destination[X_AXIS])),
+ cy2 = mbl.cell_index_y(RAW_Y_POSITION(destination[Y_AXIS]));
+ NOMORE(cx1, MESH_NUM_X_POINTS - 2);
+ NOMORE(cy1, MESH_NUM_Y_POINTS - 2);
+ NOMORE(cx2, MESH_NUM_X_POINTS - 2);
+ NOMORE(cy2, MESH_NUM_Y_POINTS - 2);
+
+ if (cx1 == cx2 && cy1 == cy2) {
// Start and end on same mesh square
- planner.buffer_line(x, y, z, e, feed_rate, extruder);
+ line_to_destination(fr_mm_m);
set_current_to_destination();
return;
}
- float nx, ny, nz, ne, normalized_dist;
- if (cx > pcx && TEST(x_splits, cx)) {
- nx = mbl.get_probe_x(cx) + home_offset[X_AXIS];
- normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]);
- ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist;
- nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist;
- ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
- CBI(x_splits, cx);
- }
- else if (cx < pcx && TEST(x_splits, pcx)) {
- nx = mbl.get_probe_x(pcx) + home_offset[X_AXIS];
- normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]);
- ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist;
- nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist;
- ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
- CBI(x_splits, pcx);
- }
- else if (cy > pcy && TEST(y_splits, cy)) {
- ny = mbl.get_probe_y(cy) + home_offset[Y_AXIS];
- normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]);
- nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist;
- nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist;
- ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
- CBI(y_splits, cy);
- }
- else if (cy < pcy && TEST(y_splits, pcy)) {
- ny = mbl.get_probe_y(pcy) + home_offset[Y_AXIS];
- normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]);
- nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist;
- nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist;
- ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
- CBI(y_splits, pcy);
+
+ #define MBL_SEGMENT_END(A) (current_position[A ##_AXIS] + (destination[A ##_AXIS] - current_position[A ##_AXIS]) * normalized_dist)
+
+ float normalized_dist, end[NUM_AXIS];
+
+ // Split at the left/front border of the right/top square
+ int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
+ if (cx2 != cx1 && TEST(x_splits, gcx)) {
+ memcpy(end, destination, sizeof(end));
+ destination[X_AXIS] = LOGICAL_X_POSITION(mbl.get_probe_x(gcx));
+ normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
+ destination[Y_AXIS] = MBL_SEGMENT_END(Y);
+ CBI(x_splits, gcx);
+ }
+ else if (cy2 != cy1 && TEST(y_splits, gcy)) {
+ memcpy(end, destination, sizeof(end));
+ destination[Y_AXIS] = LOGICAL_Y_POSITION(mbl.get_probe_y(gcy));
+ normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
+ destination[X_AXIS] = MBL_SEGMENT_END(X);
+ CBI(y_splits, gcy);
}
else {
// Already split on a border
- planner.buffer_line(x, y, z, e, feed_rate, extruder);
+ line_to_destination(fr_mm_m);
set_current_to_destination();
return;
}
- // Do the split and look for more borders
- destination[X_AXIS] = nx;
- destination[Y_AXIS] = ny;
- destination[Z_AXIS] = nz;
- destination[E_AXIS] = ne;
- mesh_buffer_line(nx, ny, nz, ne, feed_rate, extruder, x_splits, y_splits);
- destination[X_AXIS] = x;
- destination[Y_AXIS] = y;
- destination[Z_AXIS] = z;
- destination[E_AXIS] = e;
- mesh_buffer_line(x, y, z, e, feed_rate, extruder, x_splits, y_splits);
-}
-#endif // MESH_BED_LEVELING
-#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
+ destination[Z_AXIS] = MBL_SEGMENT_END(Z);
+ destination[E_AXIS] = MBL_SEGMENT_END(E);
- inline void prevent_dangerous_extrude(float& curr_e, float& dest_e) {
- if (DEBUGGING(DRYRUN)) return;
- float de = dest_e - curr_e;
- if (de) {
- if (thermalManager.tooColdToExtrude(active_extruder)) {
- curr_e = dest_e; // Behave as if the move really took place, but ignore E part
- SERIAL_ECHO_START;
- SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
- }
- #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
- if (labs(de) > EXTRUDE_MAXLENGTH) {
- curr_e = dest_e; // Behave as if the move really took place, but ignore E part
- SERIAL_ECHO_START;
- SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
- }
- #endif
- }
- }
+ // Do the split and look for more borders
+ mesh_line_to_destination(fr_mm_m, x_splits, y_splits);
-#endif // PREVENT_DANGEROUS_EXTRUDE
+ // Restore destination from stack
+ memcpy(destination, end, sizeof(end));
+ mesh_line_to_destination(fr_mm_m, x_splits, y_splits);
+}
+#endif // MESH_BED_LEVELING
#if ENABLED(DELTA) || ENABLED(SCARA)
- inline bool prepare_move_delta(float target[NUM_AXIS]) {
+ inline bool prepare_kinematic_move_to(float target[NUM_AXIS]) {
float difference[NUM_AXIS];
- for (int8_t i = 0; i < NUM_AXIS; i++) difference[i] = target[i] - current_position[i];
+ LOOP_XYZE(i) difference[i] = target[i] - current_position[i];
float cartesian_mm = sqrt(sq(difference[X_AXIS]) + sq(difference[Y_AXIS]) + sq(difference[Z_AXIS]));
if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]);
if (cartesian_mm < 0.000001) return false;
- float _feedrate = feedrate * feedrate_multiplier / 6000.0;
- float seconds = cartesian_mm / _feedrate;
+ float _feedrate_mm_s = MMM_TO_MMS_SCALED(feedrate_mm_m);
+ float seconds = cartesian_mm / _feedrate_mm_s;
int steps = max(1, int(delta_segments_per_second * seconds));
float inv_steps = 1.0/steps;
@@ -7434,39 +7987,40 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
float fraction = float(s) * inv_steps;
- for (int8_t i = 0; i < NUM_AXIS; i++)
+ LOOP_XYZE(i)
target[i] = current_position[i] + difference[i] * fraction;
- calculate_delta(target);
+ inverse_kinematics(target);
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ #if ENABLED(DELTA) && ENABLED(AUTO_BED_LEVELING_FEATURE)
if (!bed_leveling_in_progress) adjust_delta(target);
#endif
- //DEBUG_POS("prepare_move_delta", target);
- //DEBUG_POS("prepare_move_delta", delta);
+ //DEBUG_POS("prepare_kinematic_move_to", target);
+ //DEBUG_POS("prepare_kinematic_move_to", delta);
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], _feedrate, active_extruder);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], _feedrate_mm_s, active_extruder);
}
return true;
}
#endif // DELTA || SCARA
-#if ENABLED(SCARA)
- inline bool prepare_move_scara(float target[NUM_AXIS]) { return prepare_move_delta(target); }
-#endif
-
#if ENABLED(DUAL_X_CARRIAGE)
- inline bool prepare_move_dual_x_carriage() {
+ inline bool prepare_move_to_destination_dualx() {
if (active_extruder_parked) {
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
// move duplicate extruder into correct duplication position.
- planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
+ planner.set_position_mm(
+ LOGICAL_X_POSITION(inactive_extruder_x_pos),
+ current_position[Y_AXIS],
+ current_position[Z_AXIS],
+ current_position[E_AXIS]
+ );
planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset,
- current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[X_AXIS], 1);
- sync_plan_position();
+ current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1);
+ SYNC_PLAN_POSITION_KINEMATIC();
stepper.synchronize();
extruder_duplication_enabled = true;
active_extruder_parked = false;
@@ -7485,9 +8039,9 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
}
delayed_move_time = 0;
// unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
- planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder);
- planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]), active_extruder);
- planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder);
+ planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], PLANNER_XY_FEEDRATE(), active_extruder);
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
active_extruder_parked = false;
}
}
@@ -7498,31 +8052,56 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate,
#if DISABLED(DELTA) && DISABLED(SCARA)
- inline bool prepare_move_cartesian() {
- // Do not use feedrate_multiplier for E or Z only moves
+ inline bool prepare_move_to_destination_cartesian() {
+ // Do not use feedrate_percentage for E or Z only moves
if (current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS]) {
line_to_destination();
}
else {
#if ENABLED(MESH_BED_LEVELING)
- mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder);
- return false;
- #else
- line_to_destination(feedrate * feedrate_multiplier / 100.0);
+ if (mbl.active()) {
+ mesh_line_to_destination(MMM_SCALED(feedrate_mm_m));
+ return false;
+ }
+ else
#endif
+ line_to_destination(MMM_SCALED(feedrate_mm_m));
}
return true;
}
#endif // !DELTA && !SCARA
+#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
+
+ inline void prevent_dangerous_extrude(float& curr_e, float& dest_e) {
+ if (DEBUGGING(DRYRUN)) return;
+ float de = dest_e - curr_e;
+ if (de) {
+ if (thermalManager.tooColdToExtrude(active_extruder)) {
+ curr_e = dest_e; // Behave as if the move really took place, but ignore E part
+ SERIAL_ECHO_START;
+ SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
+ }
+ #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
+ if (labs(de) > EXTRUDE_MAXLENGTH) {
+ curr_e = dest_e; // Behave as if the move really took place, but ignore E part
+ SERIAL_ECHO_START;
+ SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
+ }
+ #endif
+ }
+ }
+
+#endif // PREVENT_DANGEROUS_EXTRUDE
+
/**
* Prepare a single move and get ready for the next one
*
* (This may call planner.buffer_line several times to put
* smaller moves into the planner for DELTA or SCARA.)
*/
-void prepare_move() {
+void prepare_move_to_destination() {
clamp_to_software_endstops(destination);
refresh_cmd_timeout();
@@ -7530,15 +8109,13 @@ void prepare_move() {
prevent_dangerous_extrude(current_position[E_AXIS], destination[E_AXIS]);
#endif
- #if ENABLED(SCARA)
- if (!prepare_move_scara(destination)) return;
- #elif ENABLED(DELTA)
- if (!prepare_move_delta(destination)) return;
+ #if ENABLED(DELTA) || ENABLED(SCARA)
+ if (!prepare_kinematic_move_to(destination)) return;
#else
#if ENABLED(DUAL_X_CARRIAGE)
- if (!prepare_move_dual_x_carriage()) return;
+ if (!prepare_move_to_destination_dualx()) return;
#endif
- if (!prepare_move_cartesian()) return;
+ if (!prepare_move_to_destination_cartesian()) return;
#endif
set_current_to_destination();
@@ -7560,7 +8137,7 @@ void prepare_move() {
uint8_t clockwise // Clockwise?
) {
- float radius = hypot(offset[X_AXIS], offset[Y_AXIS]),
+ float radius = HYPOT(offset[X_AXIS], offset[Y_AXIS]),
center_X = current_position[X_AXIS] + offset[X_AXIS],
center_Y = current_position[Y_AXIS] + offset[Y_AXIS],
linear_travel = target[Z_AXIS] - current_position[Z_AXIS],
@@ -7579,7 +8156,7 @@ void prepare_move() {
if (angular_travel == 0 && current_position[X_AXIS] == target[X_AXIS] && current_position[Y_AXIS] == target[Y_AXIS])
angular_travel += RADIANS(360);
- float mm_of_travel = hypot(angular_travel * radius, fabs(linear_travel));
+ float mm_of_travel = HYPOT(angular_travel * radius, fabs(linear_travel));
if (mm_of_travel < 0.001) return;
uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT));
if (segments == 0) segments = 1;
@@ -7615,7 +8192,7 @@ void prepare_move() {
* This is important when there are successive arc motions.
*/
// Vector rotation matrix values
- float cos_T = 1 - 0.5 * theta_per_segment * theta_per_segment; // Small angle approximation
+ float cos_T = 1 - 0.5 * sq(theta_per_segment); // Small angle approximation
float sin_T = theta_per_segment;
float arc_target[NUM_AXIS];
@@ -7629,7 +8206,7 @@ void prepare_move() {
// Initialize the extruder axis
arc_target[E_AXIS] = current_position[E_AXIS];
- float feed_rate = feedrate * feedrate_multiplier / 60 / 100.0;
+ float fr_mm_s = MMM_TO_MMS_SCALED(feedrate_mm_m);
millis_t next_idle_ms = millis() + 200UL;
@@ -7669,25 +8246,25 @@ void prepare_move() {
clamp_to_software_endstops(arc_target);
#if ENABLED(DELTA) || ENABLED(SCARA)
- calculate_delta(arc_target);
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ inverse_kinematics(arc_target);
+ #if ENABLED(DELTA) && ENABLED(AUTO_BED_LEVELING_FEATURE)
adjust_delta(arc_target);
#endif
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], feed_rate, active_extruder);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], fr_mm_s, active_extruder);
#else
- planner.buffer_line(arc_target[X_AXIS], arc_target[Y_AXIS], arc_target[Z_AXIS], arc_target[E_AXIS], feed_rate, active_extruder);
+ planner.buffer_line(arc_target[X_AXIS], arc_target[Y_AXIS], arc_target[Z_AXIS], arc_target[E_AXIS], fr_mm_s, active_extruder);
#endif
}
// Ensure last segment arrives at target location.
#if ENABLED(DELTA) || ENABLED(SCARA)
- calculate_delta(target);
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ inverse_kinematics(target);
+ #if ENABLED(DELTA) && ENABLED(AUTO_BED_LEVELING_FEATURE)
adjust_delta(target);
#endif
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], feed_rate, active_extruder);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], fr_mm_s, active_extruder);
#else
- planner.buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], feed_rate, active_extruder);
+ planner.buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], fr_mm_s, active_extruder);
#endif
// As far as the parser is concerned, the position is now == target. In reality the
@@ -7700,7 +8277,7 @@ void prepare_move() {
#if ENABLED(BEZIER_CURVE_SUPPORT)
void plan_cubic_move(const float offset[4]) {
- cubic_b_spline(current_position, destination, offset, feedrate * feedrate_multiplier / 60 / 100.0, active_extruder);
+ cubic_b_spline(current_position, destination, offset, MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder);
// As far as the parser is concerned, the position is now == target. In reality the
// motion control system might still be processing the action and the real tool position
@@ -7720,14 +8297,14 @@ void prepare_move() {
nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s
if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON || thermalManager.soft_pwm_bed > 0
|| E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled...
- #if EXTRUDERS > 1
+ #if E_STEPPERS > 1
|| E1_ENABLE_READ == E_ENABLE_ON
#if HAS_X2_ENABLE
|| X2_ENABLE_READ == X_ENABLE_ON
#endif
- #if EXTRUDERS > 2
+ #if E_STEPPERS > 2
|| E2_ENABLE_READ == E_ENABLE_ON
- #if EXTRUDERS > 3
+ #if E_STEPPERS > 3
|| E3_ENABLE_READ == E_ENABLE_ON
#endif
#endif
@@ -7749,7 +8326,7 @@ void prepare_move() {
#if ENABLED(SCARA)
- void calculate_SCARA_forward_Transform(float f_scara[3]) {
+ void forward_kinematics_SCARA(float f_scara[3]) {
// Perform forward kinematics, and place results in delta[3]
// The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
@@ -7775,16 +8352,17 @@ void prepare_move() {
//SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]);
}
- void calculate_delta(float cartesian[3]) {
- //reverse kinematics.
- // Perform reversed kinematics, and place results in delta[3]
- // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
+ void inverse_kinematics(const float cartesian[3]) {
+ // Inverse kinematics.
+ // Perform SCARA IK and place results in delta[3].
+ // The maths and first version were done by QHARLEY.
+ // Integrated, tweaked by Joachim Cerny in June 2014.
float SCARA_pos[2];
static float SCARA_C2, SCARA_S2, SCARA_K1, SCARA_K2, SCARA_theta, SCARA_psi;
- SCARA_pos[X_AXIS] = cartesian[X_AXIS] * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y
- SCARA_pos[Y_AXIS] = cartesian[Y_AXIS] * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor.
+ SCARA_pos[X_AXIS] = RAW_X_POSITION(cartesian[X_AXIS]) * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y
+ SCARA_pos[Y_AXIS] = RAW_Y_POSITION(cartesian[Y_AXIS]) * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor.
#if (Linkage_1 == Linkage_2)
SCARA_C2 = ((sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS])) / (2 * (float)L1_2)) - 1;
@@ -7802,7 +8380,7 @@ void prepare_move() {
delta[X_AXIS] = SCARA_theta * SCARA_RAD2DEG; // Multiply by 180/Pi - theta is support arm angle
delta[Y_AXIS] = (SCARA_theta + SCARA_psi) * SCARA_RAD2DEG; // - equal to sub arm angle (inverted motor)
- delta[Z_AXIS] = cartesian[Z_AXIS];
+ delta[Z_AXIS] = RAW_Z_POSITION(cartesian[Z_AXIS]);
/**
SERIAL_ECHOPGM("cartesian x="); SERIAL_ECHO(cartesian[X_AXIS]);
@@ -7835,8 +8413,9 @@ void prepare_move() {
float max_temp = 0.0;
if (ELAPSED(millis(), next_status_led_update_ms)) {
next_status_led_update_ms += 500; // Update every 0.5s
- for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder)
- max_temp = max(max(max_temp, thermalManager.degHotend(cur_extruder)), thermalManager.degTargetHotend(cur_extruder));
+ HOTEND_LOOP() {
+ max_temp = max(max(max_temp, thermalManager.degHotend(e)), thermalManager.degTargetHotend(e));
+ }
#if HAS_TEMP_BED
max_temp = max(max(max_temp, thermalManager.degTargetBed()), thermalManager.degBed());
#endif
@@ -7875,21 +8454,27 @@ void disable_all_steppers() {
* Standard idle routine keeps the machine alive
*/
void idle(
- #if ENABLED(FILAMENTCHANGEENABLE)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
bool no_stepper_sleep/*=false*/
#endif
) {
- thermalManager.manage_heater();
+ lcd_update();
+ host_keepalive();
manage_inactivity(
- #if ENABLED(FILAMENTCHANGEENABLE)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
no_stepper_sleep
#endif
);
- host_keepalive();
- lcd_update();
+
+ thermalManager.manage_heater();
+
#if ENABLED(PRINTCOUNTER)
print_job_timer.tick();
#endif
+
+ #if HAS_BUZZER && PIN_EXISTS(BEEPER)
+ buzzer.tick();
+ #endif
}
/**
@@ -7906,8 +8491,8 @@ void idle(
*/
void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
- #if HAS_FILRUNOUT
- if (IS_SD_PRINTING && !(READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING))
+ #if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ if ((IS_SD_PRINTING || print_job_timer.isRunning()) && !(READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING))
handle_filament_runout();
#endif
@@ -7983,25 +8568,29 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
#endif
#if ENABLED(EXTRUDER_RUNOUT_PREVENT)
- if (ELAPSED(ms, previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL))
- if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
+ if (ELAPSED(ms, previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)
+ && thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
+ #if ENABLED(SWITCHING_EXTRUDER)
+ bool oldstatus = E0_ENABLE_READ;
+ enable_e0();
+ #else // !SWITCHING_EXTRUDER
bool oldstatus;
switch (active_extruder) {
case 0:
oldstatus = E0_ENABLE_READ;
enable_e0();
break;
- #if EXTRUDERS > 1
+ #if E_STEPPERS > 1
case 1:
oldstatus = E1_ENABLE_READ;
enable_e1();
break;
- #if EXTRUDERS > 2
+ #if E_STEPPERS > 2
case 2:
oldstatus = E2_ENABLE_READ;
enable_e2();
break;
- #if EXTRUDERS > 3
+ #if E_STEPPERS > 3
case 3:
oldstatus = E3_ENABLE_READ;
enable_e3();
@@ -8010,37 +8599,43 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
#endif
#endif
}
- float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
- planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
- destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_unit[E_AXIS],
- (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_unit[E_AXIS], active_extruder);
+ #endif // !SWITCHING_EXTRUDER
+
+ float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
+ planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
+ destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS],
+ MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder);
current_position[E_AXIS] = oldepos;
destination[E_AXIS] = oldedes;
planner.set_e_position_mm(oldepos);
previous_cmd_ms = ms; // refresh_cmd_timeout()
stepper.synchronize();
- switch (active_extruder) {
- case 0:
- E0_ENABLE_WRITE(oldstatus);
- break;
- #if EXTRUDERS > 1
- case 1:
- E1_ENABLE_WRITE(oldstatus);
+ #if ENABLED(SWITCHING_EXTRUDER)
+ E0_ENABLE_WRITE(oldstatus);
+ #else
+ switch (active_extruder) {
+ case 0:
+ E0_ENABLE_WRITE(oldstatus);
break;
- #if EXTRUDERS > 2
- case 2:
- E2_ENABLE_WRITE(oldstatus);
+ #if E_STEPPERS > 1
+ case 1:
+ E1_ENABLE_WRITE(oldstatus);
break;
- #if EXTRUDERS > 3
- case 3:
- E3_ENABLE_WRITE(oldstatus);
+ #if E_STEPPERS > 2
+ case 2:
+ E2_ENABLE_WRITE(oldstatus);
break;
+ #if E_STEPPERS > 3
+ case 3:
+ E3_ENABLE_WRITE(oldstatus);
+ break;
+ #endif
#endif
#endif
- #endif
- }
+ }
+ #endif // !SWITCHING_EXTRUDER
}
- #endif
+ #endif // EXTRUDER_RUNOUT_PREVENT
#if ENABLED(DUAL_X_CARRIAGE)
// handle delayed move timeout
@@ -8048,7 +8643,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
// travel moves have been received so enact them
delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
set_destination_to_current();
- prepare_move();
+ prepare_move_to_destination();
}
#endif
@@ -8060,12 +8655,17 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
}
void kill(const char* lcd_msg) {
+ SERIAL_ERROR_START;
+ SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
+
#if ENABLED(ULTRA_LCD)
- lcd_setalertstatuspgm(lcd_msg);
+ kill_screen(lcd_msg);
#else
UNUSED(lcd_msg);
#endif
+ for (int i = 5; i--;) delay(100); // Wait a short time
+
cli(); // Stop interrupts
thermalManager.disable_all_heaters();
disable_all_steppers();
@@ -8074,13 +8674,6 @@ void kill(const char* lcd_msg) {
pinMode(PS_ON_PIN, INPUT);
#endif
- SERIAL_ERROR_START;
- SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
-
- // FMC small patch to update the LCD before ending
- sei(); // enable interrupts
- for (int i = 5; i--; lcd_update()) delay(200); // Wait a short time
- cli(); // disable interrupts
suicide();
while (1) {
#if ENABLED(USE_WATCHDOG)
@@ -8180,6 +8773,6 @@ float calculate_volumetric_multiplier(float diameter) {
}
void calculate_volumetric_multipliers() {
- for (int i = 0; i < EXTRUDERS; i++)
+ for (uint8_t i = 0; i < COUNT(filament_size); i++)
volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
}
diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h
index 3fa6788a7..6f1b73b1f 100644
--- a/Marlin/SanityCheck.h
+++ b/Marlin/SanityCheck.h
@@ -25,59 +25,61 @@
*
* Test configuration values for errors at compile-time.
*/
-#ifndef SANITYCHECK_H
-#define SANITYCHECK_H
/**
* Due to the high number of issues related with old versions of Arduino IDE
- * we are now warning our users to update their toolkits. In a future Marlin
- * release we will stop supporting old IDE versions and will require user
- * action to proceed with compilation in such environments.
+ * we now prevent Marlin from compiling with older toolkits.
*/
#if !defined(ARDUINO) || ARDUINO < 10600
#error "Versions of Arduino IDE prior to 1.6.0 are no longer supported, please update your toolkit."
#endif
/**
- * Marlin release, version and default string
+ * We try our best to include sanity checks for all the changes configuration
+ * directives because people have a tendency to use outdated config files with
+ * the bleding edge source code, but sometimes this is not enough. This check
+ * will force a minimum config file revision, otherwise Marlin will not build.
*/
-#ifndef SHORT_BUILD_VERSION
- #error "SHORT_BUILD_VERSION Information must be specified"
-#endif
-
-#ifndef DETAILED_BUILD_VERSION
- #error "BUILD_VERSION Information must be specified"
-#endif
-
-#ifndef STRING_DISTRIBUTION_DATE
- #error "STRING_DISTRIBUTION_DATE Information must be specified"
-#endif
-
-#ifndef PROTOCOL_VERSION
- #error "PROTOCOL_VERSION Information must be specified"
-#endif
-
-#ifndef MACHINE_NAME
- #error "MACHINE_NAME Information must be specified"
-#endif
-
-#ifndef SOURCE_CODE_URL
- #error "SOURCE_CODE_URL Information must be specified"
+#if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION
+ #error "You are using an old Configuration.h file, update it before building Marlin."
#endif
-#ifndef DEFAULT_MACHINE_UUID
- #error "DEFAULT_MACHINE_UUID Information must be specified"
+#if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION
+ #error "You are using an old Configuration_adv.h file, update it before building Marlin."
#endif
-#ifndef WEBSITE_URL
- #error "WEBSITE_URL Information must be specified"
+/**
+ * Marlin release, version and default string
+ */
+#ifndef SHORT_BUILD_VERSION
+ #error "SHORT_BUILD_VERSION must be specified."
+#elif !defined(DETAILED_BUILD_VERSION)
+ #error "BUILD_VERSION must be specified."
+#elif !defined(STRING_DISTRIBUTION_DATE)
+ #error "STRING_DISTRIBUTION_DATE must be specified."
+#elif !defined(PROTOCOL_VERSION)
+ #error "PROTOCOL_VERSION must be specified."
+#elif !defined(MACHINE_NAME)
+ #error "MACHINE_NAME must be specified."
+#elif !defined(SOURCE_CODE_URL)
+ #error "SOURCE_CODE_URL must be specified."
+#elif !defined(DEFAULT_MACHINE_UUID)
+ #error "DEFAULT_MACHINE_UUID must be specified."
+#elif !defined(WEBSITE_URL)
+ #error "WEBSITE_URL must be specified."
#endif
/**
* Dual Stepper Drivers
*/
-#if ENABLED(Z_DUAL_STEPPER_DRIVERS) && ENABLED(Y_DUAL_STEPPER_DRIVERS)
- #error "You cannot have dual stepper drivers for both Y and Z."
+#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE)
+ #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
+#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR)
+ #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
+#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR)
+ #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)."
+#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR)
+ #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
#endif
/**
@@ -110,18 +112,29 @@
#endif
#endif
+/**
+ * Filament Runout needs a pin and either SD Support or Auto print start detection
+ */
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ #if !HAS_FIL_RUNOUT
+ #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
+ #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART)
+ #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
+ #endif
+#endif
+
/**
* Filament Change with Extruder Runout Prevention
*/
-#if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)
- #error "EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE."
+#if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)
+ #error "EXTRUDER_RUNOUT_PREVENT is incompatible with FILAMENT_CHANGE_FEATURE."
#endif
/**
* Individual axis homing is useless for DELTAS
*/
#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA)
- #error INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics.
+ #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
#endif
/**
@@ -141,41 +154,62 @@
#error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
#endif
- #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- #error "EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS."
- #endif
+#elif ENABLED(SINGLENOZZLE)
+ #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
+#endif
- #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
- #error "EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS."
+/**
+ * Only one type of extruder allowed
+ */
+#if (ENABLED(SWITCHING_EXTRUDER) && (ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER))) \
+ || (ENABLED(SINGLENOZZLE) && ENABLED(MIXING_EXTRUDER))
+ #error "Please define only one type of extruder: SINGLENOZZLE, SWITCHING_EXTRUDER, or MIXING_EXTRUDER."
+#endif
+
+/**
+ * Single Stepper Dual Extruder with switching servo
+ */
+#if ENABLED(SWITCHING_EXTRUDER)
+ #if ENABLED(DUAL_X_CARRIAGE)
+ #error "SWITCHING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
+ #elif EXTRUDERS != 2
+ #error "SWITCHING_EXTRUDER requires exactly 2 EXTRUDERS."
+ #elif NUM_SERVOS < 1
+ #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
#endif
+#endif
-#elif ENABLED(SINGLENOZZLE)
- #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
+/**
+ * Mixing Extruder requirements
+ */
+#if ENABLED(MIXING_EXTRUDER)
+ #if EXTRUDERS > 1
+ #error "MIXING_EXTRUDER currently only supports one extruder."
+ #endif
+ #if MIXING_STEPPERS < 2
+ #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
+ #endif
+ #if ENABLED(FILAMENT_SENSOR)
+ #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
+ #endif
#endif
/**
* Limited number of servos
*/
-#if NUM_SERVOS > 4
- #error "The maximum number of SERVOS in Marlin is 4."
-#endif
#if defined(NUM_SERVOS) && NUM_SERVOS > 0
- #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0
- #if X_ENDSTOP_SERVO_NR >= NUM_SERVOS
- #error "X_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS."
- #elif Y_ENDSTOP_SERVO_NR >= NUM_SERVOS
- #error "Y_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS."
- #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS
- #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS."
- #endif
+ #if NUM_SERVOS > 4
+ #error "The maximum number of SERVOS in Marlin is 4."
+ #elif HAS_Z_SERVO_ENDSTOP && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS
+ #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS."
#endif
#endif
/**
* Servo deactivation depends on servo endstops
*/
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_SERVO_ENDSTOPS
- #error "At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE."
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_ENDSTOP
+ #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE."
#endif
/**
@@ -198,12 +232,10 @@
#if ENABLED(MESH_BED_LEVELING)
#if ENABLED(DELTA)
#error "MESH_BED_LEVELING does not yet support DELTA printers."
- #endif
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ #elif ENABLED(AUTO_BED_LEVELING_FEATURE)
#error "Select AUTO_BED_LEVELING_FEATURE or MESH_BED_LEVELING, not both."
- #endif
- #if MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7
- #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS need to be less than 8."
+ #elif MESH_NUM_X_POINTS > 9 || MESH_NUM_Y_POINTS > 9
+ #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS must be less than 10."
#endif
#elif ENABLED(MANUAL_BED_LEVELING)
#error "MESH_BED_LEVELING is required for MANUAL_BED_LEVELING."
@@ -215,6 +247,21 @@
#if PROBE_SELECTED
+ #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA)
+ #error "You cannot use Z_PROBE_SLED with DELTA."
+ #endif
+
+ /**
+ * NUM_SERVOS is required for a Z servo probe
+ */
+ #if HAS_Z_SERVO_ENDSTOP
+ #ifndef NUM_SERVOS
+ #error "You must set NUM_SERVOS for a Z servo probe (Z_ENDSTOP_SERVO_NR)."
+ #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS
+ #error "Z_ENDSTOP_SERVO_NR must be less than NUM_SERVOS."
+ #endif
+ #endif
+
/**
* A probe needs a pin
*/
@@ -223,10 +270,16 @@
#endif
/**
- * Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+ * Require a Z min pin
*/
- #if HAS_Z_MIN && HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
- #error "A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN."
+ #if HAS_Z_MIN
+ // Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+ #if HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
+ #error "A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN."
+ #endif
+ #elif !HAS_Z_MIN_PROBE_PIN || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP))
+ // A pin was set for the Z probe, but not enabled.
+ #error "A probe requires a Z_MIN or Z_PROBE pin. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin."
#endif
/**
@@ -239,11 +292,10 @@
/**
* Only allow one probe option to be defined
*/
- #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \
- || (ENABLED(MECHANICAL_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \
- || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \
- || (HAS_Z_ENDSTOP_SERVO && ENABLED(Z_PROBE_SLED))
- #error "Please define only one type of probe: Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
+ #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \
+ || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \
+ || (HAS_Z_SERVO_ENDSTOP && ENABLED(Z_PROBE_SLED))
+ #error "Please define only one type of probe: Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
#endif
/**
@@ -274,38 +326,68 @@
//#if Z_ENDSTOP_SERVO_NR < 0
// #error "You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_MIN_PROBE_ENDSTOP."
//#endif
- //#ifndef SERVO_ENDSTOP_ANGLES
- // #error "You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP."
+ //#ifndef Z_SERVO_ANGLES
+ // #error "You must have Z_SERVO_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP."
//#endif
#endif
+ /**
+ * Make sure Z raise values are set
+ */
+ #if defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
+ #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_RAISE_PROBE_DEPLOY_STOW instead."
+ #elif !defined(Z_RAISE_PROBE_DEPLOY_STOW)
+ #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration."
+ #elif !defined(Z_RAISE_BETWEEN_PROBINGS)
+ #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration."
+ #elif Z_RAISE_PROBE_DEPLOY_STOW < 0
+ #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0."
+ #elif Z_RAISE_BETWEEN_PROBINGS < 0
+ #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 0."
+ #endif
+
#else
/**
- * Require some kind of probe for bed leveling
+ * Require some kind of probe for bed leveling and probe testing
*/
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
+ #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
+ #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
+ #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
#endif
#endif
+/**
+ * Make sure Z_SAFE_HOMING point is reachable
+ */
+#if ENABLED(Z_SAFE_HOMING)
+ #if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X
+ #if HAS_BED_PROBE
+ #error "Z_SAFE_HOMING_X_POINT can't be reached by the Z probe."
+ #else
+ #error "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle."
+ #endif
+ #elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y
+ #if HAS_BED_PROBE
+ #error "Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe."
+ #else
+ #error "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle."
+ #endif
+ #endif
+#endif // Z_SAFE_HOMING
+
/**
* Auto Bed Leveling
*/
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
/**
- * Require a Z min pin
+ * Delta has limited bed leveling options
*/
- #if !PIN_EXISTS(Z_MIN)
- #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z probe, but not enable it.
- #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
- #error "You must have a Z_MIN or Z_PROBE endstop to enable Z_MIN_PROBE_REPEATABILITY_TEST."
- #else
- #error "AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin."
- #endif
- #endif
+ #if ENABLED(DELTA) && DISABLED(AUTO_BED_LEVELING_GRID)
+ #error "You must use AUTO_BED_LEVELING_GRID for DELTA bed leveling."
#endif
/**
@@ -351,6 +433,13 @@
#endif // AUTO_BED_LEVELING_FEATURE
+/**
+ * Advance Extrusion
+ */
+#if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE)
+ #error "You can enable ADVANCE or LIN_ADVANCE, but not both."
+#endif
+
/**
* Filament Width Sensor
*/
@@ -358,7 +447,6 @@
#error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
#endif
-
/**
* ULTIPANEL encoder
*/
@@ -367,26 +455,14 @@
#endif
#if ENCODER_PULSES_PER_STEP < 0
- #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead"
+ #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
#endif
/**
- * Delta has limited bed leveling options
+ * SAV_3DGLCD display options
*/
-#if ENABLED(DELTA)
-
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
-
- #if DISABLED(AUTO_BED_LEVELING_GRID)
- #error "Only AUTO_BED_LEVELING_GRID is supported with DELTA."
- #endif
-
- #if ENABLED(Z_PROBE_SLED)
- #error "You cannot use Z_PROBE_SLED with DELTA."
- #endif
-
- #endif
-
+#if ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106)
+ #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
#endif
/**
@@ -400,10 +476,11 @@
#endif
/**
- * Allen Key Z probe requires Auto Bed Leveling grid and Delta
+ * Allen Key
+ * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
*/
-#if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA))
- #error "Invalid use of Z_PROBE_ALLEN_KEY."
+#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
+ #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
#endif
/**
@@ -461,54 +538,96 @@
/**
* Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
*/
-#if EXTRUDERS > 3
- #if TEMP_SENSOR_3 == 0
- #error "TEMP_SENSOR_3 is required with 4 EXTRUDERS."
- #elif !HAS_HEATER_3
- #error "HEATER_3_PIN not defined for this board."
- #elif !PIN_EXISTS(TEMP_3)
- #error "TEMP_3_PIN not defined for this board."
- #elif !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
- #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
- #endif
-#elif EXTRUDERS > 2
- #if TEMP_SENSOR_2 == 0
- #error "TEMP_SENSOR_2 is required with 3 or more EXTRUDERS."
- #elif !HAS_HEATER_2
- #error "HEATER_2_PIN not defined for this board."
- #elif !PIN_EXISTS(TEMP_2)
- #error "TEMP_2_PIN not defined for this board."
- #elif !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
- #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
+#if !HAS_HEATER_0
+ #error "HEATER_0_PIN not defined for this board."
+#elif !PIN_EXISTS(TEMP_0)
+ #error "TEMP_0_PIN not defined for this board."
+#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)
+ #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
+#elif TEMP_SENSOR_0 == 0
+ #error "TEMP_SENSOR_0 is required."
+#endif
+
+#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)
+ #if !HAS_HEATER_1
+ #error "HEATER_1_PIN not defined for this board."
#endif
-#elif EXTRUDERS > 1
+#endif
+
+#if HOTENDS > 1
#if TEMP_SENSOR_1 == 0
- #error "TEMP_SENSOR_1 is required with 2 or more EXTRUDERS."
+ #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
#elif !PIN_EXISTS(TEMP_1)
#error "TEMP_1_PIN not defined for this board."
- #elif !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
- #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
#endif
-#endif
-
-#if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL)
- #if !HAS_HEATER_1
- #error "HEATER_1_PIN not defined for this board."
+ #if HOTENDS > 2
+ #if TEMP_SENSOR_2 == 0
+ #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
+ #elif !HAS_HEATER_2
+ #error "HEATER_2_PIN not defined for this board."
+ #elif !PIN_EXISTS(TEMP_2)
+ #error "TEMP_2_PIN not defined for this board."
+ #endif
+ #if HOTENDS > 3
+ #if TEMP_SENSOR_3 == 0
+ #error "TEMP_SENSOR_3 is required with 4 HOTENDS."
+ #elif !HAS_HEATER_3
+ #error "HEATER_3_PIN not defined for this board."
+ #elif !PIN_EXISTS(TEMP_3)
+ #error "TEMP_3_PIN not defined for this board."
+ #endif
+ #elif TEMP_SENSOR_3 != 0
+ #error "TEMP_SENSOR_3 shouldn't be set with only 3 extruders."
+ #endif
+ #elif TEMP_SENSOR_2 != 0
+ #error "TEMP_SENSOR_2 shouldn't be set with only 2 extruders."
+ #elif TEMP_SENSOR_3 != 0
+ #error "TEMP_SENSOR_3 shouldn't be set with only 2 extruders."
#endif
+#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
+ #error "TEMP_SENSOR_1 shouldn't be set with only 1 extruder."
+#elif TEMP_SENSOR_2 != 0
+ #error "TEMP_SENSOR_2 shouldn't be set with only 1 extruder."
+#elif TEMP_SENSOR_3 != 0
+ #error "TEMP_SENSOR_3 shouldn't be set with only 1 extruder."
#endif
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
#endif
-#if !HAS_HEATER_0
- #error "HEATER_0_PIN not defined for this board."
-#elif !PIN_EXISTS(TEMP_0)
- #error "TEMP_0_PIN not defined for this board."
-#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)
- #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
-#elif TEMP_SENSOR_0 == 0
- #error "TEMP_SENSOR_0 is required."
+/**
+ * Basic 2-nozzle duplication mode
+ */
+#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
+ #if HOTENDS != 2
+ #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends."
+ #elif ENABLED(DUAL_X_CARRIAGE)
+ #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE."
+ #elif ENABLED(SINGLENOZZLE)
+ #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE."
+ #elif ENABLED(MIXING_EXTRUDER)
+ #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER."
+ #elif ENABLED(SWITCHING_EXTRUDER)
+ #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER."
+ #endif
+#endif
+
+/**
+ * Test Extruder Pins
+ */
+#if EXTRUDERS > 3
+ #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
+ #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
+ #endif
+#elif EXTRUDERS > 2
+ #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
+ #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
+ #endif
+#elif EXTRUDERS > 1
+ #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
+ #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
+ #endif
#endif
/**
@@ -525,6 +644,13 @@
#endif
/**
+ * emergency-command parser
+ */
+#if ENABLED(EMERGENCY_PARSER) && ENABLED(USBCON)
+ #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
+#endif
+
+ /**
* Warnings for old configurations
*/
#if WATCH_TEMP_PERIOD > 500
@@ -537,8 +663,6 @@
#error "Z_LATE_ENABLE can't be used with COREXZ."
#elif defined(X_HOME_RETRACT_MM)
#error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
-#elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
- #error "PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY."
#elif defined(BEEPER)
#error "BEEPER is now BEEPER_PIN. Please update your pins definitions."
#elif defined(SDCARDDETECT)
@@ -567,6 +691,42 @@
#error "Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2"
#elif defined(LANGUAGE_INCLUDE)
#error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration."
+#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
+ #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
+#elif defined(PID_PARAMS_PER_EXTRUDER)
+ #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
+#elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
+ #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration."
+#elif defined(SERVO_ENDSTOP_ANGLES)
+ #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
+#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
+ #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
+#elif defined(XY_TRAVEL_SPEED)
+ #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead."
+#elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
+ #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
+#elif defined(SERVO_DEACTIVATION_DELAY)
+ #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead."
+#elif ENABLED(FILAMENTCHANGEENABLE)
+ #error "FILAMENTCHANGEENABLE is now FILAMENT_CHANGE_FEATURE. Please update your configuration."
+#elif defined(PLA_PREHEAT_HOTEND_TEMP)
+ #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration."
+#elif defined(PLA_PREHEAT_HPB_TEMP)
+ #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration."
+#elif defined(PLA_PREHEAT_FAN_SPEED)
+ #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration."
+#elif defined(ABS_PREHEAT_HOTEND_TEMP)
+ #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration."
+#elif defined(ABS_PREHEAT_HPB_TEMP)
+ #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration."
+#elif defined(ABS_PREHEAT_FAN_SPEED)
+ #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration."
+#elif defined(ENDSTOPS_ONLY_FOR_HOMING)
+ #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
+#elif defined(HOMING_FEEDRATE)
+ #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
+#elif defined(MANUAL_HOME_POSITIONS)
+ #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
+#elif defined(PID_ADD_EXTRUSION_RATE)
+ #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration."
#endif
-
-#endif //SANITYCHECK_H
diff --git a/Marlin/Sd2Card.cpp b/Marlin/Sd2Card.cpp
index f077e9e77..190e4ad1f 100644
--- a/Marlin/Sd2Card.cpp
+++ b/Marlin/Sd2Card.cpp
@@ -30,6 +30,7 @@
#if ENABLED(SDSUPPORT)
#include "Sd2Card.h"
+
//------------------------------------------------------------------------------
#if DISABLED(SOFTWARE_SPI)
// functions for hardware SPI
@@ -99,10 +100,10 @@
// no interrupts during byte receive - about 8 us
cli();
// output pin high - like sending 0XFF
- fastDigitalWrite(SPI_MOSI_PIN, HIGH);
+ WRITE(SPI_MOSI_PIN, HIGH);
for (uint8_t i = 0; i < 8; i++) {
- fastDigitalWrite(SPI_SCK_PIN, HIGH);
+ WRITE(SPI_SCK_PIN, HIGH);
// adjust so SCK is nice
nop;
@@ -110,9 +111,9 @@
data <<= 1;
- if (fastDigitalRead(SPI_MISO_PIN)) data |= 1;
+ if (READ(SPI_MISO_PIN)) data |= 1;
- fastDigitalWrite(SPI_SCK_PIN, LOW);
+ WRITE(SPI_SCK_PIN, LOW);
}
// enable interrupts
sei();
@@ -130,13 +131,13 @@
// no interrupts during byte send - about 8 us
cli();
for (uint8_t i = 0; i < 8; i++) {
- fastDigitalWrite(SPI_SCK_PIN, LOW);
+ WRITE(SPI_SCK_PIN, LOW);
- fastDigitalWrite(SPI_MOSI_PIN, data & 0X80);
+ WRITE(SPI_MOSI_PIN, data & 0X80);
data <<= 1;
- fastDigitalWrite(SPI_SCK_PIN, HIGH);
+ WRITE(SPI_SCK_PIN, HIGH);
}
// hold SCK high for a few ns
nop;
@@ -144,7 +145,7 @@
nop;
nop;
- fastDigitalWrite(SPI_SCK_PIN, LOW);
+ WRITE(SPI_SCK_PIN, LOW);
// enable interrupts
sei();
}
diff --git a/Marlin/Sd2Card.h b/Marlin/Sd2Card.h
index 45d8f22ea..b1f442c4e 100644
--- a/Marlin/Sd2Card.h
+++ b/Marlin/Sd2Card.h
@@ -37,7 +37,6 @@
* \brief Sd2Card class for V2 SD/SDHC cards
*/
#include "SdFatConfig.h"
-#include "Sd2PinMap.h"
#include "SdInfo.h"
//------------------------------------------------------------------------------
// SPI speed is F_CPU/2^(1 + index), 0 <= index <= 6
@@ -137,25 +136,25 @@ uint8_t const SD_CARD_TYPE_SDHC = 3;
#if DISABLED(SOFTWARE_SPI)
// hardware pin defs
/** The default chip select pin for the SD card is SS. */
- uint8_t const SD_CHIP_SELECT_PIN = SS_PIN;
+ #define SD_CHIP_SELECT_PIN SS_PIN
// The following three pins must not be redefined for hardware SPI.
/** SPI Master Out Slave In pin */
- uint8_t const SPI_MOSI_PIN = MOSI_PIN;
+ #define SPI_MOSI_PIN MOSI_PIN
/** SPI Master In Slave Out pin */
- uint8_t const SPI_MISO_PIN = MISO_PIN;
+ #define SPI_MISO_PIN MISO_PIN
/** SPI Clock pin */
- uint8_t const SPI_SCK_PIN = SCK_PIN;
+ #define SPI_SCK_PIN SCK_PIN
#else // SOFTWARE_SPI
/** SPI chip select pin */
- uint8_t const SD_CHIP_SELECT_PIN = SOFT_SPI_CS_PIN;
+ #define SD_CHIP_SELECT_PIN SOFT_SPI_CS_PIN
/** SPI Master Out Slave In pin */
- uint8_t const SPI_MOSI_PIN = SOFT_SPI_MOSI_PIN;
+ #define SPI_MOSI_PIN SOFT_SPI_MOSI_PIN
/** SPI Master In Slave Out pin */
- uint8_t const SPI_MISO_PIN = SOFT_SPI_MISO_PIN;
+ #define SPI_MISO_PIN SOFT_SPI_MISO_PIN
/** SPI Clock pin */
- uint8_t const SPI_SCK_PIN = SOFT_SPI_SCK_PIN;
+ #define SPI_SCK_PIN SOFT_SPI_SCK_PIN
#endif // SOFTWARE_SPI
//------------------------------------------------------------------------------
/**
diff --git a/Marlin/Sd2PinMap.h b/Marlin/Sd2PinMap.h
deleted file mode 100644
index 3ad6b795a..000000000
--- a/Marlin/Sd2PinMap.h
+++ /dev/null
@@ -1,453 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-
-/**
- * Arduino SdFat Library
- * Copyright (C) 2010 by William Greiman
- *
- * This file is part of the Arduino Sd2Card Library
- */
-// Warning this file was generated by a program.
-#include "Marlin.h"
-#include "macros.h"
-
-#if ENABLED(SDSUPPORT)
-
-#ifndef Sd2PinMap_h
-#define Sd2PinMap_h
-#include
-//------------------------------------------------------------------------------
-/** struct for mapping digital pins */
-struct pin_map_t {
- volatile uint8_t* ddr;
- volatile uint8_t* pin;
- volatile uint8_t* port;
- uint8_t bit;
-};
-//------------------------------------------------------------------------------
-#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // Mega
-
-// Two Wire (aka I2C) ports
-uint8_t const SDA_PIN = 20; // D1
-uint8_t const SCL_PIN = 21; // D0
-
-#undef MOSI_PIN
-#undef MISO_PIN
-#undef SCK_PIN
-// SPI port
-uint8_t const SS_PIN = 53; // B0
-uint8_t const MOSI_PIN = 51; // B2
-uint8_t const MISO_PIN = 50; // B3
-uint8_t const SCK_PIN = 52; // B1
-
-static const pin_map_t digitalPinMap[] = {
- {&DDRE, &PINE, &PORTE, 0}, // E0 0
- {&DDRE, &PINE, &PORTE, 1}, // E1 1
- {&DDRE, &PINE, &PORTE, 4}, // E4 2
- {&DDRE, &PINE, &PORTE, 5}, // E5 3
- {&DDRG, &PING, &PORTG, 5}, // G5 4
- {&DDRE, &PINE, &PORTE, 3}, // E3 5
- {&DDRH, &PINH, &PORTH, 3}, // H3 6
- {&DDRH, &PINH, &PORTH, 4}, // H4 7
- {&DDRH, &PINH, &PORTH, 5}, // H5 8
- {&DDRH, &PINH, &PORTH, 6}, // H6 9
- {&DDRB, &PINB, &PORTB, 4}, // B4 10
- {&DDRB, &PINB, &PORTB, 5}, // B5 11
- {&DDRB, &PINB, &PORTB, 6}, // B6 12
- {&DDRB, &PINB, &PORTB, 7}, // B7 13
- {&DDRJ, &PINJ, &PORTJ, 1}, // J1 14
- {&DDRJ, &PINJ, &PORTJ, 0}, // J0 15
- {&DDRH, &PINH, &PORTH, 1}, // H1 16
- {&DDRH, &PINH, &PORTH, 0}, // H0 17
- {&DDRD, &PIND, &PORTD, 3}, // D3 18
- {&DDRD, &PIND, &PORTD, 2}, // D2 19
- {&DDRD, &PIND, &PORTD, 1}, // D1 20
- {&DDRD, &PIND, &PORTD, 0}, // D0 21
- {&DDRA, &PINA, &PORTA, 0}, // A0 22
- {&DDRA, &PINA, &PORTA, 1}, // A1 23
- {&DDRA, &PINA, &PORTA, 2}, // A2 24
- {&DDRA, &PINA, &PORTA, 3}, // A3 25
- {&DDRA, &PINA, &PORTA, 4}, // A4 26
- {&DDRA, &PINA, &PORTA, 5}, // A5 27
- {&DDRA, &PINA, &PORTA, 6}, // A6 28
- {&DDRA, &PINA, &PORTA, 7}, // A7 29
- {&DDRC, &PINC, &PORTC, 7}, // C7 30
- {&DDRC, &PINC, &PORTC, 6}, // C6 31
- {&DDRC, &PINC, &PORTC, 5}, // C5 32
- {&DDRC, &PINC, &PORTC, 4}, // C4 33
- {&DDRC, &PINC, &PORTC, 3}, // C3 34
- {&DDRC, &PINC, &PORTC, 2}, // C2 35
- {&DDRC, &PINC, &PORTC, 1}, // C1 36
- {&DDRC, &PINC, &PORTC, 0}, // C0 37
- {&DDRD, &PIND, &PORTD, 7}, // D7 38
- {&DDRG, &PING, &PORTG, 2}, // G2 39
- {&DDRG, &PING, &PORTG, 1}, // G1 40
- {&DDRG, &PING, &PORTG, 0}, // G0 41
- {&DDRL, &PINL, &PORTL, 7}, // L7 42
- {&DDRL, &PINL, &PORTL, 6}, // L6 43
- {&DDRL, &PINL, &PORTL, 5}, // L5 44
- {&DDRL, &PINL, &PORTL, 4}, // L4 45
- {&DDRL, &PINL, &PORTL, 3}, // L3 46
- {&DDRL, &PINL, &PORTL, 2}, // L2 47
- {&DDRL, &PINL, &PORTL, 1}, // L1 48
- {&DDRL, &PINL, &PORTL, 0}, // L0 49
- {&DDRB, &PINB, &PORTB, 3}, // B3 50
- {&DDRB, &PINB, &PORTB, 2}, // B2 51
- {&DDRB, &PINB, &PORTB, 1}, // B1 52
- {&DDRB, &PINB, &PORTB, 0}, // B0 53
- {&DDRF, &PINF, &PORTF, 0}, // F0 54
- {&DDRF, &PINF, &PORTF, 1}, // F1 55
- {&DDRF, &PINF, &PORTF, 2}, // F2 56
- {&DDRF, &PINF, &PORTF, 3}, // F3 57
- {&DDRF, &PINF, &PORTF, 4}, // F4 58
- {&DDRF, &PINF, &PORTF, 5}, // F5 59
- {&DDRF, &PINF, &PORTF, 6}, // F6 60
- {&DDRF, &PINF, &PORTF, 7}, // F7 61
- {&DDRK, &PINK, &PORTK, 0}, // K0 62
- {&DDRK, &PINK, &PORTK, 1}, // K1 63
- {&DDRK, &PINK, &PORTK, 2}, // K2 64
- {&DDRK, &PINK, &PORTK, 3}, // K3 65
- {&DDRK, &PINK, &PORTK, 4}, // K4 66
- {&DDRK, &PINK, &PORTK, 5}, // K5 67
- {&DDRK, &PINK, &PORTK, 6}, // K6 68
- {&DDRK, &PINK, &PORTK, 7} // K7 69
-};
-//------------------------------------------------------------------------------
-#elif defined(__AVR_ATmega644P__)\
-|| defined(__AVR_ATmega644__)\
-|| defined(__AVR_ATmega1284P__)
-// Sanguino
-
-// Two Wire (aka I2C) ports
-uint8_t const SDA_PIN = 17; // C1
-uint8_t const SCL_PIN = 18; // C2
-
-// SPI port
-uint8_t const SS_PIN = 4; // B4
-uint8_t const MOSI_PIN = 5; // B5
-uint8_t const MISO_PIN = 6; // B6
-uint8_t const SCK_PIN = 7; // B7
-
-static const pin_map_t digitalPinMap[] = {
- {&DDRB, &PINB, &PORTB, 0}, // B0 0
- {&DDRB, &PINB, &PORTB, 1}, // B1 1
- {&DDRB, &PINB, &PORTB, 2}, // B2 2
- {&DDRB, &PINB, &PORTB, 3}, // B3 3
- {&DDRB, &PINB, &PORTB, 4}, // B4 4
- {&DDRB, &PINB, &PORTB, 5}, // B5 5
- {&DDRB, &PINB, &PORTB, 6}, // B6 6
- {&DDRB, &PINB, &PORTB, 7}, // B7 7
- {&DDRD, &PIND, &PORTD, 0}, // D0 8
- {&DDRD, &PIND, &PORTD, 1}, // D1 9
- {&DDRD, &PIND, &PORTD, 2}, // D2 10
- {&DDRD, &PIND, &PORTD, 3}, // D3 11
- {&DDRD, &PIND, &PORTD, 4}, // D4 12
- {&DDRD, &PIND, &PORTD, 5}, // D5 13
- {&DDRD, &PIND, &PORTD, 6}, // D6 14
- {&DDRD, &PIND, &PORTD, 7}, // D7 15
- {&DDRC, &PINC, &PORTC, 0}, // C0 16
- {&DDRC, &PINC, &PORTC, 1}, // C1 17
- {&DDRC, &PINC, &PORTC, 2}, // C2 18
- {&DDRC, &PINC, &PORTC, 3}, // C3 19
- {&DDRC, &PINC, &PORTC, 4}, // C4 20
- {&DDRC, &PINC, &PORTC, 5}, // C5 21
- {&DDRC, &PINC, &PORTC, 6}, // C6 22
- {&DDRC, &PINC, &PORTC, 7}, // C7 23
- {&DDRA, &PINA, &PORTA, 7}, // A7 24
- {&DDRA, &PINA, &PORTA, 6}, // A6 25
- {&DDRA, &PINA, &PORTA, 5}, // A5 26
- {&DDRA, &PINA, &PORTA, 4}, // A4 27
- {&DDRA, &PINA, &PORTA, 3}, // A3 28
- {&DDRA, &PINA, &PORTA, 2}, // A2 29
- {&DDRA, &PINA, &PORTA, 1}, // A1 30
- {&DDRA, &PINA, &PORTA, 0} // A0 31
-};
-//------------------------------------------------------------------------------
-#elif defined(__AVR_ATmega32U4__)
-// Teensy 2.0
-
-// Two Wire (aka I2C) ports
-uint8_t const SDA_PIN = 6; // D1
-uint8_t const SCL_PIN = 5; // D0
-
-// SPI port
-uint8_t const SS_PIN = 0; // B0
-uint8_t const MOSI_PIN = 2; // B2
-uint8_t const MISO_PIN = 3; // B3
-uint8_t const SCK_PIN = 1; // B1
-
-static const pin_map_t digitalPinMap[] = {
- {&DDRB, &PINB, &PORTB, 0}, // B0 0
- {&DDRB, &PINB, &PORTB, 1}, // B1 1
- {&DDRB, &PINB, &PORTB, 2}, // B2 2
- {&DDRB, &PINB, &PORTB, 3}, // B3 3
- {&DDRB, &PINB, &PORTB, 7}, // B7 4
- {&DDRD, &PIND, &PORTD, 0}, // D0 5
- {&DDRD, &PIND, &PORTD, 1}, // D1 6
- {&DDRD, &PIND, &PORTD, 2}, // D2 7
- {&DDRD, &PIND, &PORTD, 3}, // D3 8
- {&DDRC, &PINC, &PORTC, 6}, // C6 9
- {&DDRC, &PINC, &PORTC, 7}, // C7 10
- {&DDRD, &PIND, &PORTD, 6}, // D6 11
- {&DDRD, &PIND, &PORTD, 7}, // D7 12
- {&DDRB, &PINB, &PORTB, 4}, // B4 13
- {&DDRB, &PINB, &PORTB, 5}, // B5 14
- {&DDRB, &PINB, &PORTB, 6}, // B6 15
- {&DDRF, &PINF, &PORTF, 7}, // F7 16
- {&DDRF, &PINF, &PORTF, 6}, // F6 17
- {&DDRF, &PINF, &PORTF, 5}, // F5 18
- {&DDRF, &PINF, &PORTF, 4}, // F4 19
- {&DDRF, &PINF, &PORTF, 1}, // F1 20
- {&DDRF, &PINF, &PORTF, 0}, // F0 21
- {&DDRD, &PIND, &PORTD, 4}, // D4 22
- {&DDRD, &PIND, &PORTD, 5}, // D5 23
- {&DDRE, &PINE, &PORTE, 6} // E6 24
-};
-//------------------------------------------------------------------------------
-#elif defined(__AVR_AT90USB646__)\
-|| defined(__AVR_AT90USB1286__)
-// Teensy++ 1.0 & 2.0
-
-// Two Wire (aka I2C) ports
-uint8_t const SDA_PIN = 1; // D1
-uint8_t const SCL_PIN = 0; // D0
-
-// SPI port
-uint8_t const SS_PIN = 20; // B0
-uint8_t const MOSI_PIN = 22; // B2
-uint8_t const MISO_PIN = 23; // B3
-uint8_t const SCK_PIN = 21; // B1
-
-static const pin_map_t digitalPinMap[] = {
- {&DDRD, &PIND, &PORTD, 0}, // D0 0
- {&DDRD, &PIND, &PORTD, 1}, // D1 1
- {&DDRD, &PIND, &PORTD, 2}, // D2 2
- {&DDRD, &PIND, &PORTD, 3}, // D3 3
- {&DDRD, &PIND, &PORTD, 4}, // D4 4
- {&DDRD, &PIND, &PORTD, 5}, // D5 5
- {&DDRD, &PIND, &PORTD, 6}, // D6 6
- {&DDRD, &PIND, &PORTD, 7}, // D7 7
- {&DDRE, &PINE, &PORTE, 0}, // E0 8
- {&DDRE, &PINE, &PORTE, 1}, // E1 9
- {&DDRC, &PINC, &PORTC, 0}, // C0 10
- {&DDRC, &PINC, &PORTC, 1}, // C1 11
- {&DDRC, &PINC, &PORTC, 2}, // C2 12
- {&DDRC, &PINC, &PORTC, 3}, // C3 13
- {&DDRC, &PINC, &PORTC, 4}, // C4 14
- {&DDRC, &PINC, &PORTC, 5}, // C5 15
- {&DDRC, &PINC, &PORTC, 6}, // C6 16
- {&DDRC, &PINC, &PORTC, 7}, // C7 17
- {&DDRE, &PINE, &PORTE, 6}, // E6 18
- {&DDRE, &PINE, &PORTE, 7}, // E7 19
- {&DDRB, &PINB, &PORTB, 0}, // B0 20
- {&DDRB, &PINB, &PORTB, 1}, // B1 21
- {&DDRB, &PINB, &PORTB, 2}, // B2 22
- {&DDRB, &PINB, &PORTB, 3}, // B3 23
- {&DDRB, &PINB, &PORTB, 4}, // B4 24
- {&DDRB, &PINB, &PORTB, 5}, // B5 25
- {&DDRB, &PINB, &PORTB, 6}, // B6 26
- {&DDRB, &PINB, &PORTB, 7}, // B7 27
- {&DDRA, &PINA, &PORTA, 0}, // A0 28
- {&DDRA, &PINA, &PORTA, 1}, // A1 29
- {&DDRA, &PINA, &PORTA, 2}, // A2 30
- {&DDRA, &PINA, &PORTA, 3}, // A3 31
- {&DDRA, &PINA, &PORTA, 4}, // A4 32
- {&DDRA, &PINA, &PORTA, 5}, // A5 33
- {&DDRA, &PINA, &PORTA, 6}, // A6 34
- {&DDRA, &PINA, &PORTA, 7}, // A7 35
- {&DDRE, &PINE, &PORTE, 4}, // E4 36
- {&DDRE, &PINE, &PORTE, 5}, // E5 37
- {&DDRF, &PINF, &PORTF, 0}, // F0 38
- {&DDRF, &PINF, &PORTF, 1}, // F1 39
- {&DDRF, &PINF, &PORTF, 2}, // F2 40
- {&DDRF, &PINF, &PORTF, 3}, // F3 41
- {&DDRF, &PINF, &PORTF, 4}, // F4 42
- {&DDRF, &PINF, &PORTF, 5}, // F5 43
- {&DDRF, &PINF, &PORTF, 6}, // F6 44
- {&DDRF, &PINF, &PORTF, 7} // F7 45
-};
-//------------------------------------------------------------------------------
-#elif defined(__AVR_ATmega168__)\
-||defined(__AVR_ATmega168P__)\
-||defined(__AVR_ATmega328P__)
-// 168 and 328 Arduinos
-
-// Two Wire (aka I2C) ports
-uint8_t const SDA_PIN = 18; // C4
-uint8_t const SCL_PIN = 19; // C5
-
-// SPI port
-uint8_t const SS_PIN = 10; // B2
-uint8_t const MOSI_PIN = 11; // B3
-uint8_t const MISO_PIN = 12; // B4
-uint8_t const SCK_PIN = 13; // B5
-
-static const pin_map_t digitalPinMap[] = {
- {&DDRD, &PIND, &PORTD, 0}, // D0 0
- {&DDRD, &PIND, &PORTD, 1}, // D1 1
- {&DDRD, &PIND, &PORTD, 2}, // D2 2
- {&DDRD, &PIND, &PORTD, 3}, // D3 3
- {&DDRD, &PIND, &PORTD, 4}, // D4 4
- {&DDRD, &PIND, &PORTD, 5}, // D5 5
- {&DDRD, &PIND, &PORTD, 6}, // D6 6
- {&DDRD, &PIND, &PORTD, 7}, // D7 7
- {&DDRB, &PINB, &PORTB, 0}, // B0 8
- {&DDRB, &PINB, &PORTB, 1}, // B1 9
- {&DDRB, &PINB, &PORTB, 2}, // B2 10
- {&DDRB, &PINB, &PORTB, 3}, // B3 11
- {&DDRB, &PINB, &PORTB, 4}, // B4 12
- {&DDRB, &PINB, &PORTB, 5}, // B5 13
- {&DDRC, &PINC, &PORTC, 0}, // C0 14
- {&DDRC, &PINC, &PORTC, 1}, // C1 15
- {&DDRC, &PINC, &PORTC, 2}, // C2 16
- {&DDRC, &PINC, &PORTC, 3}, // C3 17
- {&DDRC, &PINC, &PORTC, 4}, // C4 18
- {&DDRC, &PINC, &PORTC, 5} // C5 19
-};
-#elif defined(__AVR_ATmega1281__)
-// Waspmote
-
-// Two Wire (aka I2C) ports
-uint8_t const SDA_PIN = 41;
-uint8_t const SCL_PIN = 40;
-
-
-#undef MOSI_PIN
-#undef MISO_PIN
-// SPI port
-uint8_t const SS_PIN = 16; // B0
-uint8_t const MOSI_PIN = 11; // B2
-uint8_t const MISO_PIN = 12; // B3
-uint8_t const SCK_PIN = 10; // B1
-
-static const pin_map_t digitalPinMap[] = {
- {&DDRE, &PINE, &PORTE, 0}, // E0 0
- {&DDRE, &PINE, &PORTE, 1}, // E1 1
- {&DDRE, &PINE, &PORTE, 3}, // E3 2
- {&DDRE, &PINE, &PORTE, 4}, // E4 3
- {&DDRC, &PINC, &PORTC, 4}, // C4 4
- {&DDRC, &PINC, &PORTC, 5}, // C5 5
- {&DDRC, &PINC, &PORTC, 6}, // C6 6
- {&DDRC, &PINC, &PORTC, 7}, // C7 7
- {&DDRA, &PINA, &PORTA, 2}, // A2 8
- {&DDRA, &PINA, &PORTA, 3}, // A3 9
- {&DDRA, &PINA, &PORTA, 4}, // A4 10
- {&DDRD, &PIND, &PORTD, 5}, // D5 11
- {&DDRD, &PIND, &PORTD, 6}, // D6 12
- {&DDRC, &PINC, &PORTC, 1}, // C1 13
- {&DDRF, &PINF, &PORTF, 1}, // F1 14
- {&DDRF, &PINF, &PORTF, 2}, // F2 15
- {&DDRF, &PINF, &PORTF, 3}, // F3 16
- {&DDRF, &PINF, &PORTF, 4}, // F4 17
- {&DDRF, &PINF, &PORTF, 5}, // F5 18
- {&DDRF, &PINF, &PORTF, 6}, // F6 19
- {&DDRF, &PINF, &PORTF, 7}, // F7 20
- {&DDRF, &PINF, &PORTF, 0}, // F0 21
- {&DDRA, &PINA, &PORTA, 1}, // A1 22
- {&DDRD, &PIND, &PORTD, 7}, // D7 23
- {&DDRE, &PINE, &PORTE, 5}, // E5 24
- {&DDRA, &PINA, &PORTA, 6}, // A6 25
- {&DDRE, &PINE, &PORTE, 2}, // E2 26
- {&DDRA, &PINA, &PORTA, 5}, // A5 27
- {&DDRC, &PINC, &PORTC, 0}, // C0 28
- {&DDRB, &PINB, &PORTB, 0}, // B0 29
- {&DDRB, &PINB, &PORTB, 1}, // B1 30
- {&DDRB, &PINB, &PORTB, 2}, // B2 31
- {&DDRB, &PINB, &PORTB, 3}, // B3 32
- {&DDRB, &PINB, &PORTB, 4}, // B4 33
- {&DDRB, &PINB, &PORTB, 5}, // B5 34
- {&DDRA, &PINA, &PORTA, 0}, // A0 35
- {&DDRB, &PINB, &PORTB, 6}, // B6 36
- {&DDRB, &PINB, &PORTB, 7}, // B7 37
- {&DDRE, &PINE, &PORTE, 6}, // E6 38
- {&DDRE, &PINE, &PORTE, 7}, // E7 39
- {&DDRD, &PIND, &PORTD, 0}, // D0 40
- {&DDRD, &PIND, &PORTD, 1}, // D1 41
- {&DDRC, &PINC, &PORTC, 3}, // C3 42
- {&DDRD, &PIND, &PORTD, 2}, // D2 43
- {&DDRD, &PIND, &PORTD, 3}, // D3 44
- {&DDRA, &PINA, &PORTA, 7}, // A7 45
- {&DDRC, &PINC, &PORTC, 2}, // C2 46
- {&DDRD, &PIND, &PORTD, 4}, // D4 47
- {&DDRG, &PING, &PORTG, 2}, // G2 48
- {&DDRG, &PING, &PORTG, 1}, // G1 49
- {&DDRG, &PING, &PORTG, 0}, // G0 50
-};
-#else // defined(__AVR_ATmega1280__)
-#error "unknown chip"
-#endif // defined(__AVR_ATmega1280__)
-//------------------------------------------------------------------------------
-static const uint8_t digitalPinCount = COUNT(digitalPinMap);
-
-uint8_t badPinNumber(void)
- __attribute__((error("Pin number is too large or not a constant")));
-
-static inline __attribute__((always_inline))
- bool getPinMode(uint8_t pin) {
- if (__builtin_constant_p(pin) && pin < digitalPinCount) {
- return (*digitalPinMap[pin].ddr >> digitalPinMap[pin].bit) & 1;
- }
- else {
- return badPinNumber();
- }
-}
-static inline __attribute__((always_inline))
- void setPinMode(uint8_t pin, uint8_t mode) {
- if (__builtin_constant_p(pin) && pin < digitalPinCount) {
- if (mode) {
- SBI(*digitalPinMap[pin].ddr, digitalPinMap[pin].bit);
- }
- else {
- CBI(*digitalPinMap[pin].ddr, digitalPinMap[pin].bit);
- }
- }
- else {
- badPinNumber();
- }
-}
-static inline __attribute__((always_inline))
- bool fastDigitalRead(uint8_t pin) {
- if (__builtin_constant_p(pin) && pin < digitalPinCount) {
- return (*digitalPinMap[pin].pin >> digitalPinMap[pin].bit) & 1;
- }
- else {
- return badPinNumber();
- }
-}
-static inline __attribute__((always_inline))
- void fastDigitalWrite(uint8_t pin, uint8_t value) {
- if (__builtin_constant_p(pin) && pin < digitalPinCount) {
- if (value) {
- SBI(*digitalPinMap[pin].port, digitalPinMap[pin].bit);
- }
- else {
- CBI(*digitalPinMap[pin].port, digitalPinMap[pin].bit);
- }
- }
- else {
- badPinNumber();
- }
-}
-#endif // Sd2PinMap_h
-
-
-#endif
diff --git a/Marlin/SdFatConfig.h b/Marlin/SdFatConfig.h
index f9cb9fe14..d3406a028 100644
--- a/Marlin/SdFatConfig.h
+++ b/Marlin/SdFatConfig.h
@@ -104,13 +104,13 @@
#define USE_SOFTWARE_SPI 0
// define software SPI pins so Mega can use unmodified 168/328 shields
/** Software SPI chip select pin for the SD */
- uint8_t const SOFT_SPI_CS_PIN = 10;
+ #define SOFT_SPI_CS_PIN 10
/** Software SPI Master Out Slave In pin */
- uint8_t const SOFT_SPI_MOSI_PIN = 11;
+ #define SOFT_SPI_MOSI_PIN 11
/** Software SPI Master In Slave Out pin */
- uint8_t const SOFT_SPI_MISO_PIN = 12;
+ #define SOFT_SPI_MISO_PIN 12
/** Software SPI Clock pin */
- uint8_t const SOFT_SPI_SCK_PIN = 13;
+ #define SOFT_SPI_SCK_PIN 13
//------------------------------------------------------------------------------
/**
* The __cxa_pure_virtual function is an error handler that is invoked when
diff --git a/Marlin/Version.h b/Marlin/Version.h
index 68f3f7604..5aa79221a 100644
--- a/Marlin/Version.h
+++ b/Marlin/Version.h
@@ -26,49 +26,67 @@
* directive USE_AUTOMATIC_VERSIONING.
*/
-/**
- * Marlin release version identifier
- */
-#define SHORT_BUILD_VERSION "1.1.0-RCBugFix"
+#if ENABLED(USE_AUTOMATIC_VERSIONING)
-/**
- * Verbose version identifier which should contain a reference to the location
- * from where the binary was downloaded or the source code was compiled.
- */
-#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)"
+ #include "_Version.h"
-/**
- * The STRING_DISTRIBUTION_DATE represents when the binary file was built,
- * here we define this default string as the date where the latest release
- * version was tagged.
- */
-#define STRING_DISTRIBUTION_DATE "2016-04-27 12:00"
+#else
-/**
- * @todo: Missing documentation block
- */
-#define PROTOCOL_VERSION "1.0"
+ /**
+ * Marlin release version identifier
+ */
+ #define SHORT_BUILD_VERSION "1.1.0-RCBugFix"
-/**
- * Defines a generic printer name to be output to the LCD after booting Marlin.
- */
-#define MACHINE_NAME "3D Printer"
+ /**
+ * Verbose version identifier which should contain a reference to the location
+ * from where the binary was downloaded or the source code was compiled.
+ */
+ #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)"
-/**
- * The SOURCE_CODE_URL is the location where users will find the Marlin Source
- * Code which is installed on the device. In most cases —unless the manufacturer
- * has a distinct Github fork— the Source Code URL should just be the main
- * Marlin repository.
- */
-#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin"
+ /**
+ * The STRING_DISTRIBUTION_DATE represents when the binary file was built,
+ * here we define this default string as the date where the latest release
+ * version was tagged.
+ */
+ #define STRING_DISTRIBUTION_DATE "2016-07-26 12:00"
-/**
- * Default generic printer UUID.
- */
-#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff"
+ /**
+ * Required minimum Configuration.h and Configuration_adv.h file versions.
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on
+ * the configuration files.
+ */
+ #define REQUIRED_CONFIGURATION_H_VERSION 010100
+ #define REQUIRED_CONFIGURATION_ADV_H_VERSION 010100
-/**
- * The WEBSITE_URL is the location where users can get more information such as
- * documentation about a specific Marlin release.
- */
-#define WEBSITE_URL "http://marlinfw.org"
+ /**
+ * @todo: Missing documentation block
+ */
+ #define PROTOCOL_VERSION "1.0"
+
+ /**
+ * Defines a generic printer name to be output to the LCD after booting Marlin.
+ */
+ #define MACHINE_NAME "3D Printer"
+
+ /**
+ * The SOURCE_CODE_URL is the location where users will find the Marlin Source
+ * Code which is installed on the device. In most cases —unless the manufacturer
+ * has a distinct Github fork— the Source Code URL should just be the main
+ * Marlin repository.
+ */
+ #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin"
+
+ /**
+ * Default generic printer UUID.
+ */
+ #define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff"
+
+ /**
+ * The WEBSITE_URL is the location where users can get more information such as
+ * documentation about a specific Marlin release.
+ */
+ #define WEBSITE_URL "http://marlinfw.org"
+
+#endif // USE_AUTOMATIC_VERSIONING
diff --git a/Marlin/boards.h b/Marlin/boards.h
index b06534c98..bf7be0edf 100644
--- a/Marlin/boards.h
+++ b/Marlin/boards.h
@@ -29,20 +29,23 @@
#define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2
#define BOARD_GEN7_13 12 // Gen7 v1.3
#define BOARD_GEN7_14 13 // Gen7 v1.4
+#define BOARD_CNCONTROLS_11 111 // Cartesio CN Controls V11
+#define BOARD_CNCONTROLS_12 112 // Cartesio CN Controls V12
#define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0
#define BOARD_SETHI 20 // Sethi 3D_1
#define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2
-#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 (Power outputs: Extruder, Fan, Bed)
-#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 (Power outputs: Extruder0, Extruder1, Bed)
-#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 (Power outputs: Extruder, Fan, Fan)
-#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 (Power outputs: Extruder0, Extruder1, Fan)
+#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 (Power outputs: Hotend, Fan, Bed)
+#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed)
+#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1)
+#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan)
#define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 (Power outputs: Spindle, Controller Fan)
#define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like)
#define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard
-#define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Extruder, Fan, Bed)
-#define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Extruder0, Extruder1, Bed)
-#define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Extruder, Fan, Fan)
-#define BOARD_RAMPS_14_EEF 46 // RAMPS 1.4 (Power outputs: Extruder0, Extruder1, Fan)
+#define BOARD_RIGIDBOARD_V2 52 // Invent-A-Part RigidBoard V2
+#define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Hotend, Fan, Bed)
+#define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed)
+#define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1)
+#define BOARD_RAMPS_14_EEF 46 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan)
#define BOARD_RAMPS_14_SF 48 // RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
#define BOARD_GEN6 5 // Gen6
#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe
@@ -58,7 +61,8 @@
#define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
#define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
#define BOARD_3DRAG 77 // 3Drag Controller
-#define BOARD_K8200 78 // Vellemann K8200 Controller (derived from 3Drag Controller)
+#define BOARD_K8200 78 // Velleman K8200 Controller (derived from 3Drag Controller)
+#define BOARD_K8400 79 // Velleman K8400 Controller (derived from 3Drag Controller)
#define BOARD_TEENSYLU 8 // Teensylu
#define BOARD_RUMBA 80 // Rumba
#define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286)
diff --git a/Marlin/buzzer.cpp b/Marlin/buzzer.cpp
deleted file mode 100644
index 776ea4dfa..000000000
--- a/Marlin/buzzer.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-
-#include "Marlin.h"
-#if HAS_BUZZER
- #include "buzzer.h"
- #include "ultralcd.h"
-
- void buzz(long duration, uint16_t freq) {
- if (freq > 0) {
- #if ENABLED(LCD_USE_I2C_BUZZER)
- lcd_buzz(duration, freq);
- #elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
- SET_OUTPUT(BEEPER_PIN);
- #if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC
- //tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
- unsigned int delay = 1000000 / freq / 2;
- int i = duration * freq / 1000;
- while (i--) {
- WRITE(BEEPER_PIN, HIGH);
- delayMicroseconds(delay);
- WRITE(BEEPER_PIN, LOW);
- delayMicroseconds(delay);
- }
- #else // buzzer has its own resonator - needs a DC
- WRITE(BEEPER_PIN, HIGH);
- delay(duration);
- WRITE(BEEPER_PIN, LOW);
- #endif
- #else
- delay(duration);
- #endif
- }
- else {
- delay(duration);
- }
- }
-#endif
diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h
index ec568ecd8..199d64e41 100644
--- a/Marlin/buzzer.h
+++ b/Marlin/buzzer.h
@@ -20,11 +20,126 @@
*
*/
-#ifndef BUZZER_H
- #define BUZZER_H
+#ifndef __BUZZER_H__
+#define __BUZZER_H__
- #if HAS_BUZZER
- void buzz(long duration, uint16_t freq);
- #endif
+#include "types.h"
+#include "fastio.h"
+#include "circularqueue.h"
+#include "temperature.h"
-#endif //BUZZER_H
+#include "MarlinConfig.h"
+
+#define TONE_QUEUE_LENGTH 4
+
+/**
+ * @brief Tone structure
+ * @details Simple abstraction of a tone based on a duration and a frequency.
+ */
+struct tone_t {
+ uint16_t duration;
+ uint16_t frequency;
+};
+
+/**
+ * @brief Buzzer class
+ */
+class Buzzer {
+ private:
+ struct state_t {
+ tone_t tone;
+ uint32_t endtime;
+ } state;
+
+ protected:
+ CircularQueue buffer;
+
+ /**
+ * @brief Inverts the sate of a digital PIN
+ * @details This will invert the current state of an digital IO pin.
+ */
+ void invert() {
+ TOGGLE(BEEPER_PIN);
+ }
+
+ /**
+ * @brief Turn off a digital PIN
+ * @details Alias of digitalWrite(PIN, LOW) using FastIO
+ */
+ void off() {
+ WRITE(BEEPER_PIN, LOW);
+ }
+
+ /**
+ * @brief Turn on a digital PIN
+ * @details Alias of digitalWrite(PIN, HIGH) using FastIO
+ */
+ void on() {
+ WRITE(BEEPER_PIN, HIGH);
+ }
+
+ /**
+ * @brief Resets the state of the class
+ * @details Brings the class state to a known one.
+ */
+ void reset() {
+ this->off();
+ this->state.endtime = 0;
+ }
+
+ public:
+ /**
+ * @brief Class constructor
+ */
+ Buzzer() {
+ SET_OUTPUT(BEEPER_PIN);
+ this->reset();
+ }
+
+ /**
+ * @brief Add a tone to the queue
+ * @details Adds a tone_t structure to the ring buffer, will block IO if the
+ * queue is full waiting for one slot to get available.
+ *
+ * @param duration Duration of the tone in milliseconds
+ * @param frequency Frequency of the tone in hertz
+ */
+ void tone(uint16_t const &duration, uint16_t const &frequency = 0) {
+ while (buffer.isFull()) {
+ this->tick();
+ thermalManager.manage_heater();
+ }
+ this->buffer.enqueue((tone_t) { duration, frequency });
+ }
+
+ /**
+ * @brief Loop function
+ * @details This function should be called at loop, it will take care of
+ * playing the tones in the queue.
+ */
+ virtual void tick() {
+ const millis_t now = millis();
+
+ if (!this->state.endtime) {
+ if (this->buffer.isEmpty()) return;
+
+ this->state.tone = this->buffer.dequeue();
+ this->state.endtime = now + this->state.tone.duration;
+
+ if (this->state.tone.frequency > 0) {
+ #if ENABLED(SPEAKER)
+ CRITICAL_SECTION_START;
+ ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration);
+ CRITICAL_SECTION_END;
+ #else
+ this->on();
+ #endif
+ }
+ }
+ else if (ELAPSED(now, this->state.endtime)) this->reset();
+ }
+};
+
+extern Buzzer buzzer;
+
+#endif
diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp
index 2fead5382..65b40933a 100644
--- a/Marlin/cardreader.cpp
+++ b/Marlin/cardreader.cpp
@@ -20,13 +20,15 @@
*
*/
-#include "Marlin.h"
#include "cardreader.h"
+
#include "ultralcd.h"
#include "stepper.h"
#include "temperature.h"
#include "language.h"
+#include "Marlin.h"
+
#if ENABLED(SDSUPPORT)
CardReader::CardReader() {
@@ -102,7 +104,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
if (!dir.open(parent, lfilename, O_READ)) {
if (lsAction == LS_SerialPrint) {
SERIAL_ECHO_START;
- SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR);
+ SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
SERIAL_ECHOLN(lfilename);
}
}
@@ -282,6 +284,13 @@ void CardReader::pauseSDPrint() {
if (sdprinting) sdprinting = false;
}
+void CardReader::stopSDPrint() {
+ if (sdprinting) {
+ sdprinting = false;
+ file.close();
+ }
+}
+
void CardReader::openLogFile(char* name) {
logging = true;
openFile(name, false);
@@ -350,8 +359,8 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
dirname_start = &name[1];
while (dirname_start != NULL) {
dirname_end = strchr(dirname_start, '/');
- //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
- //SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name));
+ //SERIAL_ECHOPGM("start:");SERIAL_ECHOLN((int)(dirname_start - name));
+ //SERIAL_ECHOPGM("end :");SERIAL_ECHOLN((int)(dirname_end - name));
if (dirname_end != NULL && dirname_end > dirname_start) {
char subdirname[FILENAME_LENGTH];
strncpy(subdirname, dirname_start, dirname_end - dirname_start);
@@ -364,7 +373,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
return;
}
else {
- //SERIAL_ECHOLN("dive ok");
+ //SERIAL_ECHOLNPGM("dive ok");
}
curDir = &myDir;
@@ -372,7 +381,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
}
else { // the remainder after all /fsa/fdsa/ is the filename
fname = dirname_start;
- //SERIAL_ECHOLN("remainder");
+ //SERIAL_ECHOLNPGM("remainder");
//SERIAL_ECHOLN(fname);
break;
}
@@ -385,10 +394,9 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
if (read) {
if (file.open(curDir, fname, O_READ)) {
filesize = file.fileSize();
- SERIAL_PROTOCOLPGM(MSG_SD_FILE_OPENED);
- SERIAL_PROTOCOL(fname);
- SERIAL_PROTOCOLPGM(MSG_SD_SIZE);
- SERIAL_PROTOCOLLN(filesize);
+ SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname);
+ SERIAL_PROTOCOLPAIR(MSG_SD_SIZE, filesize);
+ SERIAL_EOL;
sdpos = 0;
SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED);
@@ -396,21 +404,21 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
lcd_setstatus(longFilename[0] ? longFilename : fname);
}
else {
- SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
- SERIAL_PROTOCOL(fname);
- SERIAL_PROTOCOLPGM(".\n");
+ SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
+ SERIAL_PROTOCOLCHAR('.');
+ SERIAL_EOL;
}
}
else { //write
if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
- SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
- SERIAL_PROTOCOL(fname);
- SERIAL_PROTOCOLPGM(".\n");
+ SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
+ SERIAL_PROTOCOLCHAR('.');
+ SERIAL_EOL;
}
else {
saving = true;
- SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE);
- SERIAL_PROTOCOLLN(name);
+ SERIAL_PROTOCOLPAIR(MSG_SD_WRITE_TO_FILE, name);
+ SERIAL_EOL;
lcd_setstatus(fname);
}
}
@@ -431,21 +439,20 @@ void CardReader::removeFile(char* name) {
dirname_start = strchr(name, '/') + 1;
while (dirname_start != NULL) {
dirname_end = strchr(dirname_start, '/');
- //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
- //SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name));
+ //SERIAL_ECHOPGM("start:");SERIAL_ECHOLN((int)(dirname_start - name));
+ //SERIAL_ECHOPGM("end :");SERIAL_ECHOLN((int)(dirname_end - name));
if (dirname_end != NULL && dirname_end > dirname_start) {
char subdirname[FILENAME_LENGTH];
strncpy(subdirname, dirname_start, dirname_end - dirname_start);
subdirname[dirname_end - dirname_start] = 0;
SERIAL_ECHOLN(subdirname);
if (!myDir.open(curDir, subdirname, O_READ)) {
- SERIAL_PROTOCOLPGM("open failed, File: ");
- SERIAL_PROTOCOL(subdirname);
+ SERIAL_PROTOCOLPAIR("open failed, File: ", subdirname);
SERIAL_PROTOCOLCHAR('.');
return;
}
else {
- //SERIAL_ECHOLN("dive ok");
+ //SERIAL_ECHOLNPGM("dive ok");
}
curDir = &myDir;
@@ -453,7 +460,7 @@ void CardReader::removeFile(char* name) {
}
else { // the remainder after all /fsa/fdsa/ is the filename
fname = dirname_start;
- //SERIAL_ECHOLN("remainder");
+ //SERIAL_ECHOLNPGM("remainder");
//SERIAL_ECHOLN(fname);
break;
}
@@ -597,19 +604,20 @@ void CardReader::updir() {
void CardReader::printingHasFinished() {
stepper.synchronize();
+ file.close();
if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure.
- file.close();
file_subcall_ctr--;
openFile(proc_filenames[file_subcall_ctr], true, true);
setIndex(filespos[file_subcall_ctr]);
startFileprint();
}
else {
- file.close();
sdprinting = false;
if (SD_FINISHED_STEPPERRELEASE)
enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
- thermalManager.autotempShutdown();
+ print_job_timer.stop();
+ if (print_job_timer.duration() > 60)
+ enqueue_and_echo_commands_P(PSTR("M31"));
}
}
diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h
index a18b718b5..8c22e581c 100644
--- a/Marlin/cardreader.h
+++ b/Marlin/cardreader.h
@@ -23,12 +23,16 @@
#ifndef CARDREADER_H
#define CARDREADER_H
+#include "MarlinConfig.h"
+
#if ENABLED(SDSUPPORT)
#define MAX_DIR_DEPTH 10 // Maximum folder depth
#include "SdFile.h"
-enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename };
+
+#include "types.h"
+#include "enum.h"
class CardReader {
public:
@@ -48,6 +52,7 @@ public:
void openAndPrintFile(const char *name);
void startFileprint();
void pauseSDPrint();
+ void stopSDPrint();
void getStatus();
void printingHasFinished();
diff --git a/Marlin/circularqueue.h b/Marlin/circularqueue.h
new file mode 100644
index 000000000..9aafb99ac
--- /dev/null
+++ b/Marlin/circularqueue.h
@@ -0,0 +1,145 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __CIRCULARQUEUE_H__
+#define __CIRCULARQUEUE_H__
+
+#include
+
+/**
+ * @brief Circular Queue class
+ * @details Implementation of the classic ring buffer data structure
+ */
+template
+class CircularQueue {
+ private:
+
+ /**
+ * @brief Buffer structure
+ * @details This structure consolidates all the overhead required to handle
+ * a circular queue such as the pointers and the buffer vector.
+ */
+ struct buffer_t {
+ uint8_t head;
+ uint8_t tail;
+ uint8_t count;
+ uint8_t size;
+ T queue[N];
+ } buffer;
+
+ public:
+ /**
+ * @brief Class constructor
+ * @details This class requires two template parameters, T defines the type
+ * of item this queue will handle and N defines the maximum number of
+ * items that can be stored on the queue.
+ */
+ CircularQueue() {
+ this->buffer.size = N;
+ this->buffer.count = this->buffer.head = this->buffer.tail = 0;
+ }
+
+ /**
+ * @brief Removes and returns a item from the queue
+ * @details Removes the oldest item on the queue, pointed to by the
+ * buffer_t head field. The item is returned to the caller.
+ * @return type T item
+ */
+ T dequeue() {
+ if (this->isEmpty()) return T();
+
+ uint8_t index = this->buffer.head;
+
+ --this->buffer.count;
+ if (++this->buffer.head == this->buffer.size)
+ this->buffer.head = 0;
+
+ return this->buffer.queue[index];
+ }
+
+ /**
+ * @brief Adds an item to the queue
+ * @details Adds an item to the queue on the location pointed by the buffer_t
+ * tail variable. Returns false if no queue space is available.
+ * @param item Item to be added to the queue
+ * @return true if the operation was successful
+ */
+ bool enqueue(T const &item) {
+ if (this->isFull()) return false;
+
+ this->buffer.queue[this->buffer.tail] = item;
+
+ ++this->buffer.count;
+ if (++this->buffer.tail == this->buffer.size)
+ this->buffer.tail = 0;
+
+ return true;
+ }
+
+ /**
+ * @brief Checks if the queue has no items
+ * @details Returns true if there are no items on the queue, false otherwise.
+ * @return true if queue is empty
+ */
+ bool isEmpty() {
+ return this->buffer.count == 0;
+ }
+
+ /**
+ * @brief Checks if the queue is full
+ * @details Returns true if the queue is full, false otherwise.
+ * @return true if queue is full
+ */
+ bool isFull() {
+ return this->buffer.count == this->buffer.size;
+ }
+
+ /**
+ * @brief Gets the queue size
+ * @details Returns the maximum number of items a queue can have.
+ * @return the queue size
+ */
+ uint8_t size() {
+ return this->buffer.size;
+ }
+
+ /**
+ * @brief Gets the next item from the queue without removing it
+ * @details Returns the next item in the queue without removing it
+ * or updating the pointers.
+ * @return first item in the queue
+ */
+ T peek() {
+ return this->buffer.queue[this->buffer.head];
+ }
+
+ /**
+ * @brief Gets the number of items on the queue
+ * @details Returns the current number of items stored on the queue.
+ * @return number of items in the queue
+ */
+ uint8_t count() {
+ return this->buffer.count;
+ }
+};
+
+#endif
diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp
index 001955f6e..db10bba15 100644
--- a/Marlin/configuration_store.cpp
+++ b/Marlin/configuration_store.cpp
@@ -36,92 +36,98 @@
*
*/
-#define EEPROM_VERSION "V23"
+#define EEPROM_VERSION "V24"
+
+// Change EEPROM version if these are changed:
+#define EEPROM_OFFSET 100
+#define MAX_EXTRUDERS 4
/**
- * V23 EEPROM Layout:
+ * V24 EEPROM Layout:
*
* 100 Version (char x4)
+ * 104 EEPROM Checksum (uint16_t)
*
- * 104 M92 XYZE planner.axis_steps_per_unit (float x4)
- * 120 M203 XYZE planner.max_feedrate (float x4)
- * 136 M201 XYZE planner.max_acceleration_units_per_sq_second (uint32_t x4)
- * 152 M204 P planner.acceleration (float)
- * 156 M204 R planner.retract_acceleration (float)
- * 160 M204 T planner.travel_acceleration (float)
- * 164 M205 S planner.min_feedrate (float)
- * 168 M205 T planner.min_travel_feedrate (float)
- * 172 M205 B planner.min_segment_time (ulong)
- * 176 M205 X planner.max_xy_jerk (float)
- * 180 M205 Z planner.max_z_jerk (float)
- * 184 M205 E planner.max_e_jerk (float)
- * 188 M206 XYZ home_offset (float x3)
+ * 106 M92 XYZE planner.axis_steps_per_mm (float x4)
+ * 122 M203 XYZE planner.max_feedrate_mm_s (float x4)
+ * 138 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4)
+ * 154 M204 P planner.acceleration (float)
+ * 158 M204 R planner.retract_acceleration (float)
+ * 162 M204 T planner.travel_acceleration (float)
+ * 166 M205 S planner.min_feedrate_mm_s (float)
+ * 170 M205 T planner.min_travel_feedrate_mm_s (float)
+ * 174 M205 B planner.min_segment_time (ulong)
+ * 178 M205 X planner.max_xy_jerk (float)
+ * 182 M205 Z planner.max_z_jerk (float)
+ * 186 M205 E planner.max_e_jerk (float)
+ * 190 M206 XYZ home_offset (float x3)
*
* Mesh bed leveling:
- * 200 M420 S active (bool)
- * 201 z_offset (float) (added in V23)
- * 205 mesh_num_x (uint8 as set in firmware)
- * 206 mesh_num_y (uint8 as set in firmware)
- * 207 G29 S3 XYZ z_values[][] (float x9, by default)
+ * 202 M420 S status (uint8)
+ * 203 z_offset (float)
+ * 207 mesh_num_x (uint8 as set in firmware)
+ * 208 mesh_num_y (uint8 as set in firmware)
+ * 209 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81)
*
* AUTO BED LEVELING
- * 243 M851 zprobe_zoffset (float)
+ * 245 M851 zprobe_zoffset (float)
*
* DELTA:
- * 247 M666 XYZ endstop_adj (float x3)
- * 259 M665 R delta_radius (float)
- * 263 M665 L delta_diagonal_rod (float)
- * 267 M665 S delta_segments_per_second (float)
- * 271 M665 A delta_diagonal_rod_trim_tower_1 (float)
- * 275 M665 B delta_diagonal_rod_trim_tower_2 (float)
- * 279 M665 C delta_diagonal_rod_trim_tower_3 (float)
+ * 249 M666 XYZ endstop_adj (float x3)
+ * 261 M665 R delta_radius (float)
+ * 265 M665 L delta_diagonal_rod (float)
+ * 269 M665 S delta_segments_per_second (float)
+ * 273 M665 A delta_diagonal_rod_trim_tower_1 (float)
+ * 277 M665 B delta_diagonal_rod_trim_tower_2 (float)
+ * 281 M665 C delta_diagonal_rod_trim_tower_3 (float)
*
* Z_DUAL_ENDSTOPS:
- * 283 M666 Z z_endstop_adj (float)
+ * 285 M666 Z z_endstop_adj (float)
*
* ULTIPANEL:
- * 287 M145 S0 H plaPreheatHotendTemp (int)
- * 289 M145 S0 B plaPreheatHPBTemp (int)
- * 291 M145 S0 F plaPreheatFanSpeed (int)
- * 293 M145 S1 H absPreheatHotendTemp (int)
- * 295 M145 S1 B absPreheatHPBTemp (int)
- * 297 M145 S1 F absPreheatFanSpeed (int)
+ * 289 M145 S0 H preheatHotendTemp1 (int)
+ * 291 M145 S0 B preheatBedTemp1 (int)
+ * 293 M145 S0 F preheatFanSpeed1 (int)
+ * 295 M145 S1 H preheatHotendTemp2 (int)
+ * 297 M145 S1 B preheatBedTemp2 (int)
+ * 299 M145 S1 F preheatFanSpeed2 (int)
*
* PIDTEMP:
- * 299 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4)
- * 315 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4)
- * 331 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4)
- * 347 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4)
- * 363 M301 L lpq_len (int)
+ * 301 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4)
+ * 317 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4)
+ * 333 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4)
+ * 349 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4)
+ * 365 M301 L lpq_len (int)
*
* PIDTEMPBED:
- * 365 M304 PID thermalManager.bedKp, thermalManager.bedKi, thermalManager.bedKd (float x3)
+ * 367 M304 PID thermalManager.bedKp, thermalManager.bedKi, thermalManager.bedKd (float x3)
*
* DOGLCD:
- * 377 M250 C lcd_contrast (int)
+ * 379 M250 C lcd_contrast (int)
*
* SCARA:
- * 379 M365 XYZ axis_scaling (float x3)
+ * 381 M365 XYZ axis_scaling (float x3)
*
* FWRETRACT:
- * 391 M209 S autoretract_enabled (bool)
- * 392 M207 S retract_length (float)
- * 396 M207 W retract_length_swap (float)
- * 400 M207 F retract_feedrate (float)
- * 404 M207 Z retract_zlift (float)
- * 408 M208 S retract_recover_length (float)
- * 412 M208 W retract_recover_length_swap (float)
- * 416 M208 F retract_recover_feedrate (float)
+ * 393 M209 S autoretract_enabled (bool)
+ * 394 M207 S retract_length (float)
+ * 398 M207 W retract_length_swap (float)
+ * 402 M207 F retract_feedrate_mm_s (float)
+ * 406 M207 Z retract_zlift (float)
+ * 410 M208 S retract_recover_length (float)
+ * 414 M208 W retract_recover_length_swap (float)
+ * 418 M208 F retract_recover_feedrate_mm_s (float)
*
* Volumetric Extrusion:
- * 420 M200 D volumetric_enabled (bool)
- * 421 M200 T D filament_size (float x4) (T0..3)
+ * 422 M200 D volumetric_enabled (bool)
+ * 423 M200 T D filament_size (float x4) (T0..3)
*
- * 437 This Slot is Available!
+ * 439 This Slot is Available!
*
*/
#include "Marlin.h"
#include "language.h"
+#include "endstops.h"
#include "planner.h"
#include "temperature.h"
#include "ultralcd.h"
@@ -131,6 +137,9 @@
#include "mesh_bed_leveling.h"
#endif
+uint16_t eeprom_checksum;
+const char version[4] = EEPROM_VERSION;
+
void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
uint8_t c;
while (size--) {
@@ -140,375 +149,419 @@ void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
}
+ eeprom_checksum += c;
pos++;
value++;
};
}
void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
do {
- *value = eeprom_read_byte((unsigned char*)pos);
+ uint8_t c = eeprom_read_byte((unsigned char*)pos);
+ *value = c;
+ eeprom_checksum += c;
pos++;
value++;
} while (--size);
}
-#define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value))
-#define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value))
/**
- * Store Configuration Settings - M500
+ * Post-process after Retrieve or Reset
*/
+void Config_Postprocess() {
+ // steps per s2 needs to be updated to agree with units per s2
+ planner.reset_acceleration_rates();
-#define DUMMY_PID_VALUE 3000.0f
+ // Make sure delta kinematics are updated before refreshing the
+ // planner position so the stepper counts will be set correctly.
+ #if ENABLED(DELTA)
+ recalc_delta_settings(delta_radius, delta_diagonal_rod);
+ #endif
-#define EEPROM_OFFSET 100
+ // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm
+ // and init stepper.count[], planner.position[] with current_position
+ planner.refresh_positioning();
+
+ #if ENABLED(PIDTEMP)
+ thermalManager.updatePID();
+ #endif
+
+ calculate_volumetric_multipliers();
+}
#if ENABLED(EEPROM_SETTINGS)
+ #define DUMMY_PID_VALUE 3000.0f
+ #define EEPROM_START() int eeprom_index = EEPROM_OFFSET
+ #define EEPROM_SKIP(VAR) eeprom_index += sizeof(VAR)
+ #define EEPROM_WRITE(VAR) _EEPROM_writeData(eeprom_index, (uint8_t*)&VAR, sizeof(VAR))
+ #define EEPROM_READ(VAR) _EEPROM_readData(eeprom_index, (uint8_t*)&VAR, sizeof(VAR))
+
/**
- * Store Configuration Settings - M500
+ * M500 - Store Configuration
*/
-
void Config_StoreSettings() {
float dummy = 0.0f;
char ver[4] = "000";
- int i = EEPROM_OFFSET;
- EEPROM_WRITE_VAR(i, ver); // invalidate data first
- EEPROM_WRITE_VAR(i, planner.axis_steps_per_unit);
- EEPROM_WRITE_VAR(i, planner.max_feedrate);
- EEPROM_WRITE_VAR(i, planner.max_acceleration_units_per_sq_second);
- EEPROM_WRITE_VAR(i, planner.acceleration);
- EEPROM_WRITE_VAR(i, planner.retract_acceleration);
- EEPROM_WRITE_VAR(i, planner.travel_acceleration);
- EEPROM_WRITE_VAR(i, planner.min_feedrate);
- EEPROM_WRITE_VAR(i, planner.min_travel_feedrate);
- EEPROM_WRITE_VAR(i, planner.min_segment_time);
- EEPROM_WRITE_VAR(i, planner.max_xy_jerk);
- EEPROM_WRITE_VAR(i, planner.max_z_jerk);
- EEPROM_WRITE_VAR(i, planner.max_e_jerk);
- EEPROM_WRITE_VAR(i, home_offset);
-
- uint8_t mesh_num_x = 3;
- uint8_t mesh_num_y = 3;
+
+ EEPROM_START();
+
+ EEPROM_WRITE(ver); // invalidate data first
+ EEPROM_SKIP(eeprom_checksum); // Skip the checksum slot
+
+ eeprom_checksum = 0; // clear before first "real data"
+
+ EEPROM_WRITE(planner.axis_steps_per_mm);
+ EEPROM_WRITE(planner.max_feedrate_mm_s);
+ EEPROM_WRITE(planner.max_acceleration_mm_per_s2);
+ EEPROM_WRITE(planner.acceleration);
+ EEPROM_WRITE(planner.retract_acceleration);
+ EEPROM_WRITE(planner.travel_acceleration);
+ EEPROM_WRITE(planner.min_feedrate_mm_s);
+ EEPROM_WRITE(planner.min_travel_feedrate_mm_s);
+ EEPROM_WRITE(planner.min_segment_time);
+ EEPROM_WRITE(planner.max_xy_jerk);
+ EEPROM_WRITE(planner.max_z_jerk);
+ EEPROM_WRITE(planner.max_e_jerk);
+ EEPROM_WRITE(home_offset);
+
#if ENABLED(MESH_BED_LEVELING)
// Compile time test that sizeof(mbl.z_values) is as expected
typedef char c_assert[(sizeof(mbl.z_values) == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) * sizeof(dummy)) ? 1 : -1];
- mesh_num_x = MESH_NUM_X_POINTS;
- mesh_num_y = MESH_NUM_Y_POINTS;
- EEPROM_WRITE_VAR(i, mbl.active);
- EEPROM_WRITE_VAR(i, mbl.z_offset);
- EEPROM_WRITE_VAR(i, mesh_num_x);
- EEPROM_WRITE_VAR(i, mesh_num_y);
- EEPROM_WRITE_VAR(i, mbl.z_values);
+ uint8_t mesh_num_x = MESH_NUM_X_POINTS,
+ mesh_num_y = MESH_NUM_Y_POINTS,
+ dummy_uint8 = mbl.status & _BV(MBL_STATUS_HAS_MESH_BIT);
+ EEPROM_WRITE(dummy_uint8);
+ EEPROM_WRITE(mbl.z_offset);
+ EEPROM_WRITE(mesh_num_x);
+ EEPROM_WRITE(mesh_num_y);
+ EEPROM_WRITE(mbl.z_values);
#else
- uint8_t dummy_uint8 = 0;
+ // For disabled MBL write a default mesh
+ uint8_t mesh_num_x = 3,
+ mesh_num_y = 3,
+ dummy_uint8 = 0;
dummy = 0.0f;
- EEPROM_WRITE_VAR(i, dummy_uint8);
- EEPROM_WRITE_VAR(i, dummy);
- EEPROM_WRITE_VAR(i, mesh_num_x);
- EEPROM_WRITE_VAR(i, mesh_num_y);
- for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_WRITE_VAR(i, dummy);
+ EEPROM_WRITE(dummy_uint8);
+ EEPROM_WRITE(dummy);
+ EEPROM_WRITE(mesh_num_x);
+ EEPROM_WRITE(mesh_num_y);
+ for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_WRITE(dummy);
#endif // MESH_BED_LEVELING
- #if DISABLED(AUTO_BED_LEVELING_FEATURE)
+ #if !HAS_BED_PROBE
float zprobe_zoffset = 0;
#endif
- EEPROM_WRITE_VAR(i, zprobe_zoffset);
+ EEPROM_WRITE(zprobe_zoffset);
+ // 9 floats for DELTA / Z_DUAL_ENDSTOPS
#if ENABLED(DELTA)
- EEPROM_WRITE_VAR(i, endstop_adj); // 3 floats
- EEPROM_WRITE_VAR(i, delta_radius); // 1 float
- EEPROM_WRITE_VAR(i, delta_diagonal_rod); // 1 float
- EEPROM_WRITE_VAR(i, delta_segments_per_second); // 1 float
- EEPROM_WRITE_VAR(i, delta_diagonal_rod_trim_tower_1); // 1 float
- EEPROM_WRITE_VAR(i, delta_diagonal_rod_trim_tower_2); // 1 float
- EEPROM_WRITE_VAR(i, delta_diagonal_rod_trim_tower_3); // 1 float
+ EEPROM_WRITE(endstop_adj); // 3 floats
+ EEPROM_WRITE(delta_radius); // 1 float
+ EEPROM_WRITE(delta_diagonal_rod); // 1 float
+ EEPROM_WRITE(delta_segments_per_second); // 1 float
+ EEPROM_WRITE(delta_diagonal_rod_trim_tower_1); // 1 float
+ EEPROM_WRITE(delta_diagonal_rod_trim_tower_2); // 1 float
+ EEPROM_WRITE(delta_diagonal_rod_trim_tower_3); // 1 float
#elif ENABLED(Z_DUAL_ENDSTOPS)
- EEPROM_WRITE_VAR(i, z_endstop_adj); // 1 float
+ EEPROM_WRITE(z_endstop_adj); // 1 float
dummy = 0.0f;
- for (uint8_t q = 8; q--;) EEPROM_WRITE_VAR(i, dummy);
+ for (uint8_t q = 8; q--;) EEPROM_WRITE(dummy);
#else
dummy = 0.0f;
- for (uint8_t q = 9; q--;) EEPROM_WRITE_VAR(i, dummy);
+ for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy);
#endif
#if DISABLED(ULTIPANEL)
- int plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP, plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP, plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED,
- absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP, absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP, absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
+ int preheatHotendTemp1 = PREHEAT_1_TEMP_HOTEND, preheatBedTemp1 = PREHEAT_1_TEMP_BED, preheatFanSpeed1 = PREHEAT_1_FAN_SPEED,
+ preheatHotendTemp2 = PREHEAT_2_TEMP_HOTEND, preheatBedTemp2 = PREHEAT_2_TEMP_BED, preheatFanSpeed2 = PREHEAT_2_FAN_SPEED;
#endif // !ULTIPANEL
- EEPROM_WRITE_VAR(i, plaPreheatHotendTemp);
- EEPROM_WRITE_VAR(i, plaPreheatHPBTemp);
- EEPROM_WRITE_VAR(i, plaPreheatFanSpeed);
- EEPROM_WRITE_VAR(i, absPreheatHotendTemp);
- EEPROM_WRITE_VAR(i, absPreheatHPBTemp);
- EEPROM_WRITE_VAR(i, absPreheatFanSpeed);
+ EEPROM_WRITE(preheatHotendTemp1);
+ EEPROM_WRITE(preheatBedTemp1);
+ EEPROM_WRITE(preheatFanSpeed1);
+ EEPROM_WRITE(preheatHotendTemp2);
+ EEPROM_WRITE(preheatBedTemp2);
+ EEPROM_WRITE(preheatFanSpeed2);
- for (uint8_t e = 0; e < 4; e++) {
+ for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) {
#if ENABLED(PIDTEMP)
- if (e < EXTRUDERS) {
- EEPROM_WRITE_VAR(i, PID_PARAM(Kp, e));
- EEPROM_WRITE_VAR(i, PID_PARAM(Ki, e));
- EEPROM_WRITE_VAR(i, PID_PARAM(Kd, e));
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- EEPROM_WRITE_VAR(i, PID_PARAM(Kc, e));
+ if (e < HOTENDS) {
+ EEPROM_WRITE(PID_PARAM(Kp, e));
+ EEPROM_WRITE(PID_PARAM(Ki, e));
+ EEPROM_WRITE(PID_PARAM(Kd, e));
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ EEPROM_WRITE(PID_PARAM(Kc, e));
#else
dummy = 1.0f; // 1.0 = default kc
- EEPROM_WRITE_VAR(i, dummy);
+ EEPROM_WRITE(dummy);
#endif
}
else
#endif // !PIDTEMP
{
dummy = DUMMY_PID_VALUE; // When read, will not change the existing value
- EEPROM_WRITE_VAR(i, dummy); // Kp
+ EEPROM_WRITE(dummy); // Kp
dummy = 0.0f;
- for (uint8_t q = 3; q--;) EEPROM_WRITE_VAR(i, dummy); // Ki, Kd, Kc
+ for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); // Ki, Kd, Kc
}
- } // Extruders Loop
+ } // Hotends Loop
- #if DISABLED(PID_ADD_EXTRUSION_RATE)
+ #if DISABLED(PID_EXTRUSION_SCALING)
int lpq_len = 20;
#endif
- EEPROM_WRITE_VAR(i, lpq_len);
+ EEPROM_WRITE(lpq_len);
#if DISABLED(PIDTEMPBED)
dummy = DUMMY_PID_VALUE;
- for (uint8_t q = 3; q--;) EEPROM_WRITE_VAR(i, dummy);
+ for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy);
#else
- EEPROM_WRITE_VAR(i, thermalManager.bedKp);
- EEPROM_WRITE_VAR(i, thermalManager.bedKi);
- EEPROM_WRITE_VAR(i, thermalManager.bedKd);
+ EEPROM_WRITE(thermalManager.bedKp);
+ EEPROM_WRITE(thermalManager.bedKi);
+ EEPROM_WRITE(thermalManager.bedKd);
#endif
#if !HAS_LCD_CONTRAST
const int lcd_contrast = 32;
#endif
- EEPROM_WRITE_VAR(i, lcd_contrast);
+ EEPROM_WRITE(lcd_contrast);
#if ENABLED(SCARA)
- EEPROM_WRITE_VAR(i, axis_scaling); // 3 floats
+ EEPROM_WRITE(axis_scaling); // 3 floats
#else
dummy = 1.0f;
- EEPROM_WRITE_VAR(i, dummy);
+ EEPROM_WRITE(dummy);
#endif
#if ENABLED(FWRETRACT)
- EEPROM_WRITE_VAR(i, autoretract_enabled);
- EEPROM_WRITE_VAR(i, retract_length);
+ EEPROM_WRITE(autoretract_enabled);
+ EEPROM_WRITE(retract_length);
#if EXTRUDERS > 1
- EEPROM_WRITE_VAR(i, retract_length_swap);
+ EEPROM_WRITE(retract_length_swap);
#else
dummy = 0.0f;
- EEPROM_WRITE_VAR(i, dummy);
+ EEPROM_WRITE(dummy);
#endif
- EEPROM_WRITE_VAR(i, retract_feedrate);
- EEPROM_WRITE_VAR(i, retract_zlift);
- EEPROM_WRITE_VAR(i, retract_recover_length);
+ EEPROM_WRITE(retract_feedrate_mm_s);
+ EEPROM_WRITE(retract_zlift);
+ EEPROM_WRITE(retract_recover_length);
#if EXTRUDERS > 1
- EEPROM_WRITE_VAR(i, retract_recover_length_swap);
+ EEPROM_WRITE(retract_recover_length_swap);
#else
dummy = 0.0f;
- EEPROM_WRITE_VAR(i, dummy);
+ EEPROM_WRITE(dummy);
#endif
- EEPROM_WRITE_VAR(i, retract_recover_feedrate);
+ EEPROM_WRITE(retract_recover_feedrate_mm_s);
#endif // FWRETRACT
- EEPROM_WRITE_VAR(i, volumetric_enabled);
+ EEPROM_WRITE(volumetric_enabled);
// Save filament sizes
- for (uint8_t q = 0; q < 4; q++) {
- if (q < EXTRUDERS) dummy = filament_size[q];
- EEPROM_WRITE_VAR(i, dummy);
+ for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
+ if (q < COUNT(filament_size)) dummy = filament_size[q];
+ EEPROM_WRITE(dummy);
}
- char ver2[4] = EEPROM_VERSION;
- int j = EEPROM_OFFSET;
- EEPROM_WRITE_VAR(j, ver2); // validate data
+ uint16_t final_checksum = eeprom_checksum,
+ eeprom_size = eeprom_index;
+
+ eeprom_index = EEPROM_OFFSET;
+ EEPROM_WRITE(version);
+ EEPROM_WRITE(final_checksum);
// Report storage size
SERIAL_ECHO_START;
- SERIAL_ECHOPAIR("Settings Stored (", i);
+ SERIAL_ECHOPAIR("Settings Stored (", eeprom_size);
SERIAL_ECHOLNPGM(" bytes)");
}
/**
- * Retrieve Configuration Settings - M501
+ * M501 - Retrieve Configuration
*/
-
void Config_RetrieveSettings() {
- int i = EEPROM_OFFSET;
+ EEPROM_START();
+
char stored_ver[4];
- char ver[4] = EEPROM_VERSION;
- EEPROM_READ_VAR(i, stored_ver); //read stored version
- // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
+ EEPROM_READ(stored_ver);
+
+ uint16_t stored_checksum;
+ EEPROM_READ(stored_checksum);
+
+ // SERIAL_ECHOPAIR("Version: [", ver);
+ // SERIAL_ECHOPAIR("] Stored version: [", stored_ver);
+ // SERIAL_ECHOLNPGM("]");
- if (strncmp(ver, stored_ver, 3) != 0) {
+ if (strncmp(version, stored_ver, 3) != 0) {
Config_ResetDefault();
}
else {
float dummy = 0;
+ eeprom_checksum = 0; // clear before reading first "real data"
+
// version number match
- EEPROM_READ_VAR(i, planner.axis_steps_per_unit);
- EEPROM_READ_VAR(i, planner.max_feedrate);
- EEPROM_READ_VAR(i, planner.max_acceleration_units_per_sq_second);
-
- // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
- planner.reset_acceleration_rates();
-
- EEPROM_READ_VAR(i, planner.acceleration);
- EEPROM_READ_VAR(i, planner.retract_acceleration);
- EEPROM_READ_VAR(i, planner.travel_acceleration);
- EEPROM_READ_VAR(i, planner.min_feedrate);
- EEPROM_READ_VAR(i, planner.min_travel_feedrate);
- EEPROM_READ_VAR(i, planner.min_segment_time);
- EEPROM_READ_VAR(i, planner.max_xy_jerk);
- EEPROM_READ_VAR(i, planner.max_z_jerk);
- EEPROM_READ_VAR(i, planner.max_e_jerk);
- EEPROM_READ_VAR(i, home_offset);
+ EEPROM_READ(planner.axis_steps_per_mm);
+ EEPROM_READ(planner.max_feedrate_mm_s);
+ EEPROM_READ(planner.max_acceleration_mm_per_s2);
+
+ EEPROM_READ(planner.acceleration);
+ EEPROM_READ(planner.retract_acceleration);
+ EEPROM_READ(planner.travel_acceleration);
+ EEPROM_READ(planner.min_feedrate_mm_s);
+ EEPROM_READ(planner.min_travel_feedrate_mm_s);
+ EEPROM_READ(planner.min_segment_time);
+ EEPROM_READ(planner.max_xy_jerk);
+ EEPROM_READ(planner.max_z_jerk);
+ EEPROM_READ(planner.max_e_jerk);
+ EEPROM_READ(home_offset);
uint8_t dummy_uint8 = 0, mesh_num_x = 0, mesh_num_y = 0;
- EEPROM_READ_VAR(i, dummy_uint8);
- EEPROM_READ_VAR(i, dummy);
- EEPROM_READ_VAR(i, mesh_num_x);
- EEPROM_READ_VAR(i, mesh_num_y);
+ EEPROM_READ(dummy_uint8);
+ EEPROM_READ(dummy);
+ EEPROM_READ(mesh_num_x);
+ EEPROM_READ(mesh_num_y);
#if ENABLED(MESH_BED_LEVELING)
- mbl.active = dummy_uint8;
+ mbl.status = dummy_uint8;
mbl.z_offset = dummy;
if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) {
- EEPROM_READ_VAR(i, mbl.z_values);
- } else {
+ // EEPROM data fits the current mesh
+ EEPROM_READ(mbl.z_values);
+ }
+ else {
+ // EEPROM data is stale
mbl.reset();
- for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
+ for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ(dummy);
}
#else
- for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
+ // MBL is disabled - skip the stored data
+ for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ(dummy);
#endif // MESH_BED_LEVELING
- #if DISABLED(AUTO_BED_LEVELING_FEATURE)
+ #if !HAS_BED_PROBE
float zprobe_zoffset = 0;
#endif
- EEPROM_READ_VAR(i, zprobe_zoffset);
+ EEPROM_READ(zprobe_zoffset);
#if ENABLED(DELTA)
- EEPROM_READ_VAR(i, endstop_adj); // 3 floats
- EEPROM_READ_VAR(i, delta_radius); // 1 float
- EEPROM_READ_VAR(i, delta_diagonal_rod); // 1 float
- EEPROM_READ_VAR(i, delta_segments_per_second); // 1 float
- EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_1); // 1 float
- EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_2); // 1 float
- EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_3); // 1 float
- recalc_delta_settings(delta_radius, delta_diagonal_rod);
+ EEPROM_READ(endstop_adj); // 3 floats
+ EEPROM_READ(delta_radius); // 1 float
+ EEPROM_READ(delta_diagonal_rod); // 1 float
+ EEPROM_READ(delta_segments_per_second); // 1 float
+ EEPROM_READ(delta_diagonal_rod_trim_tower_1); // 1 float
+ EEPROM_READ(delta_diagonal_rod_trim_tower_2); // 1 float
+ EEPROM_READ(delta_diagonal_rod_trim_tower_3); // 1 float
#elif ENABLED(Z_DUAL_ENDSTOPS)
- EEPROM_READ_VAR(i, z_endstop_adj);
+ EEPROM_READ(z_endstop_adj);
dummy = 0.0f;
- for (uint8_t q=8; q--;) EEPROM_READ_VAR(i, dummy);
+ for (uint8_t q=8; q--;) EEPROM_READ(dummy);
#else
dummy = 0.0f;
- for (uint8_t q=9; q--;) EEPROM_READ_VAR(i, dummy);
+ for (uint8_t q=9; q--;) EEPROM_READ(dummy);
#endif
#if DISABLED(ULTIPANEL)
- int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed,
- absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed;
+ int preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1,
+ preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2;
#endif
- EEPROM_READ_VAR(i, plaPreheatHotendTemp);
- EEPROM_READ_VAR(i, plaPreheatHPBTemp);
- EEPROM_READ_VAR(i, plaPreheatFanSpeed);
- EEPROM_READ_VAR(i, absPreheatHotendTemp);
- EEPROM_READ_VAR(i, absPreheatHPBTemp);
- EEPROM_READ_VAR(i, absPreheatFanSpeed);
+ EEPROM_READ(preheatHotendTemp1);
+ EEPROM_READ(preheatBedTemp1);
+ EEPROM_READ(preheatFanSpeed1);
+ EEPROM_READ(preheatHotendTemp2);
+ EEPROM_READ(preheatBedTemp2);
+ EEPROM_READ(preheatFanSpeed2);
#if ENABLED(PIDTEMP)
- for (uint8_t e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin
- EEPROM_READ_VAR(i, dummy); // Kp
- if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) {
+ for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) {
+ EEPROM_READ(dummy); // Kp
+ if (e < HOTENDS && dummy != DUMMY_PID_VALUE) {
// do not need to scale PID values as the values in EEPROM are already scaled
PID_PARAM(Kp, e) = dummy;
- EEPROM_READ_VAR(i, PID_PARAM(Ki, e));
- EEPROM_READ_VAR(i, PID_PARAM(Kd, e));
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- EEPROM_READ_VAR(i, PID_PARAM(Kc, e));
+ EEPROM_READ(PID_PARAM(Ki, e));
+ EEPROM_READ(PID_PARAM(Kd, e));
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ EEPROM_READ(PID_PARAM(Kc, e));
#else
- EEPROM_READ_VAR(i, dummy);
+ EEPROM_READ(dummy);
#endif
}
else {
- for (uint8_t q=3; q--;) EEPROM_READ_VAR(i, dummy); // Ki, Kd, Kc
+ for (uint8_t q=3; q--;) EEPROM_READ(dummy); // Ki, Kd, Kc
}
}
#else // !PIDTEMP
// 4 x 4 = 16 slots for PID parameters
- for (uint8_t q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc
+ for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ(dummy); // Kp, Ki, Kd, Kc
#endif // !PIDTEMP
- #if DISABLED(PID_ADD_EXTRUSION_RATE)
+ #if DISABLED(PID_EXTRUSION_SCALING)
int lpq_len;
#endif
- EEPROM_READ_VAR(i, lpq_len);
+ EEPROM_READ(lpq_len);
#if ENABLED(PIDTEMPBED)
- EEPROM_READ_VAR(i, dummy); // bedKp
+ EEPROM_READ(dummy); // bedKp
if (dummy != DUMMY_PID_VALUE) {
thermalManager.bedKp = dummy;
- EEPROM_READ_VAR(i, thermalManager.bedKi);
- EEPROM_READ_VAR(i, thermalManager.bedKd);
+ EEPROM_READ(thermalManager.bedKi);
+ EEPROM_READ(thermalManager.bedKd);
}
#else
- for (uint8_t q=3; q--;) EEPROM_READ_VAR(i, dummy); // bedKp, bedKi, bedKd
+ for (uint8_t q=3; q--;) EEPROM_READ(dummy); // bedKp, bedKi, bedKd
#endif
#if !HAS_LCD_CONTRAST
int lcd_contrast;
#endif
- EEPROM_READ_VAR(i, lcd_contrast);
+ EEPROM_READ(lcd_contrast);
#if ENABLED(SCARA)
- EEPROM_READ_VAR(i, axis_scaling); // 3 floats
+ EEPROM_READ(axis_scaling); // 3 floats
#else
- EEPROM_READ_VAR(i, dummy);
+ EEPROM_READ(dummy);
#endif
#if ENABLED(FWRETRACT)
- EEPROM_READ_VAR(i, autoretract_enabled);
- EEPROM_READ_VAR(i, retract_length);
+ EEPROM_READ(autoretract_enabled);
+ EEPROM_READ(retract_length);
#if EXTRUDERS > 1
- EEPROM_READ_VAR(i, retract_length_swap);
+ EEPROM_READ(retract_length_swap);
#else
- EEPROM_READ_VAR(i, dummy);
+ EEPROM_READ(dummy);
#endif
- EEPROM_READ_VAR(i, retract_feedrate);
- EEPROM_READ_VAR(i, retract_zlift);
- EEPROM_READ_VAR(i, retract_recover_length);
+ EEPROM_READ(retract_feedrate_mm_s);
+ EEPROM_READ(retract_zlift);
+ EEPROM_READ(retract_recover_length);
#if EXTRUDERS > 1
- EEPROM_READ_VAR(i, retract_recover_length_swap);
+ EEPROM_READ(retract_recover_length_swap);
#else
- EEPROM_READ_VAR(i, dummy);
+ EEPROM_READ(dummy);
#endif
- EEPROM_READ_VAR(i, retract_recover_feedrate);
+ EEPROM_READ(retract_recover_feedrate_mm_s);
#endif // FWRETRACT
- EEPROM_READ_VAR(i, volumetric_enabled);
+ EEPROM_READ(volumetric_enabled);
- for (uint8_t q = 0; q < 4; q++) {
- EEPROM_READ_VAR(i, dummy);
- if (q < EXTRUDERS) filament_size[q] = dummy;
+ for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
+ EEPROM_READ(dummy);
+ if (q < COUNT(filament_size)) filament_size[q] = dummy;
}
- calculate_volumetric_multipliers();
- // Call thermalManager.updatePID (similar to when we have processed M301)
- thermalManager.updatePID();
-
- // Report settings retrieved and length
- SERIAL_ECHO_START;
- SERIAL_ECHO(ver);
- SERIAL_ECHOPAIR(" stored settings retrieved (", i);
- SERIAL_ECHOLNPGM(" bytes)");
- }
+ if (eeprom_checksum == stored_checksum) {
+ Config_Postprocess();
+ SERIAL_ECHO_START;
+ SERIAL_ECHO(version);
+ SERIAL_ECHOPAIR(" stored settings retrieved (", eeprom_index);
+ SERIAL_ECHOLNPGM(" bytes)");
+ }
+ else {
+ SERIAL_ERROR_START;
+ SERIAL_ERRORLNPGM("EEPROM checksum mismatch");
+ Config_ResetDefault();
+ }
+ }
#if ENABLED(EEPROM_CHITCHAT)
Config_PrintSettings();
@@ -518,42 +571,38 @@ void Config_RetrieveSettings() {
#endif // EEPROM_SETTINGS
/**
- * Reset Configuration Settings - M502
+ * M502 - Reset Configuration
*/
-
void Config_ResetDefault() {
float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT;
float tmp2[] = DEFAULT_MAX_FEEDRATE;
long tmp3[] = DEFAULT_MAX_ACCELERATION;
- for (uint8_t i = 0; i < NUM_AXIS; i++) {
- planner.axis_steps_per_unit[i] = tmp1[i];
- planner.max_feedrate[i] = tmp2[i];
- planner.max_acceleration_units_per_sq_second[i] = tmp3[i];
+ LOOP_XYZE(i) {
+ planner.axis_steps_per_mm[i] = tmp1[i];
+ planner.max_feedrate_mm_s[i] = tmp2[i];
+ planner.max_acceleration_mm_per_s2[i] = tmp3[i];
#if ENABLED(SCARA)
if (i < COUNT(axis_scaling))
axis_scaling[i] = 1;
#endif
}
- // steps per sq second need to be updated to agree with the units per sq second
- planner.reset_acceleration_rates();
-
planner.acceleration = DEFAULT_ACCELERATION;
planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
- planner.min_feedrate = DEFAULT_MINIMUMFEEDRATE;
+ planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE;
planner.min_segment_time = DEFAULT_MINSEGMENTTIME;
- planner.min_travel_feedrate = DEFAULT_MINTRAVELFEEDRATE;
+ planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE;
planner.max_xy_jerk = DEFAULT_XYJERK;
planner.max_z_jerk = DEFAULT_ZJERK;
planner.max_e_jerk = DEFAULT_EJERK;
home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0;
#if ENABLED(MESH_BED_LEVELING)
- mbl.active = false;
+ mbl.reset();
#endif
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ #if HAS_BED_PROBE
zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
#endif
@@ -565,18 +614,17 @@ void Config_ResetDefault() {
delta_diagonal_rod_trim_tower_1 = DELTA_DIAGONAL_ROD_TRIM_TOWER_1;
delta_diagonal_rod_trim_tower_2 = DELTA_DIAGONAL_ROD_TRIM_TOWER_2;
delta_diagonal_rod_trim_tower_3 = DELTA_DIAGONAL_ROD_TRIM_TOWER_3;
- recalc_delta_settings(delta_radius, delta_diagonal_rod);
#elif ENABLED(Z_DUAL_ENDSTOPS)
z_endstop_adj = 0;
#endif
#if ENABLED(ULTIPANEL)
- plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP;
- plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP;
- plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
- absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP;
- absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
- absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
+ preheatHotendTemp1 = PREHEAT_1_TEMP_HOTEND;
+ preheatBedTemp1 = PREHEAT_1_TEMP_BED;
+ preheatFanSpeed1 = PREHEAT_1_FAN_SPEED;
+ preheatHotendTemp2 = PREHEAT_2_TEMP_HOTEND;
+ preheatBedTemp2 = PREHEAT_2_TEMP_BED;
+ preheatFanSpeed2 = PREHEAT_2_FAN_SPEED;
#endif
#if HAS_LCD_CONTRAST
@@ -584,8 +632,8 @@ void Config_ResetDefault() {
#endif
#if ENABLED(PIDTEMP)
- #if ENABLED(PID_PARAMS_PER_EXTRUDER)
- for (uint8_t e = 0; e < EXTRUDERS; e++)
+ #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
+ HOTEND_LOOP()
#else
int e = 0; UNUSED(e); // only need to write once
#endif
@@ -593,15 +641,13 @@ void Config_ResetDefault() {
PID_PARAM(Kp, e) = DEFAULT_Kp;
PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki);
PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd);
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ #if ENABLED(PID_EXTRUSION_SCALING)
PID_PARAM(Kc, e) = DEFAULT_Kc;
#endif
}
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ #if ENABLED(PID_EXTRUSION_SCALING)
lpq_len = 20; // default last-position-queue size
#endif
- // call thermalManager.updatePID (similar to when we have processed M301)
- thermalManager.updatePID();
#endif // PIDTEMP
#if ENABLED(PIDTEMPBED)
@@ -616,19 +662,28 @@ void Config_ResetDefault() {
#if EXTRUDERS > 1
retract_length_swap = RETRACT_LENGTH_SWAP;
#endif
- retract_feedrate = RETRACT_FEEDRATE;
+ retract_feedrate_mm_s = RETRACT_FEEDRATE;
retract_zlift = RETRACT_ZLIFT;
retract_recover_length = RETRACT_RECOVER_LENGTH;
#if EXTRUDERS > 1
retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
#endif
- retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
+ retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE;
#endif
volumetric_enabled = false;
for (uint8_t q = 0; q < COUNT(filament_size); q++)
filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA;
- calculate_volumetric_multipliers();
+
+ endstops.enable_globally(
+ #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
+ (true)
+ #else
+ (false)
+ #endif
+ );
+
+ Config_Postprocess();
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
@@ -636,12 +691,11 @@ void Config_ResetDefault() {
#if DISABLED(DISABLE_M503)
-/**
- * Print Configuration Settings - M503
- */
-
#define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START; }while(0)
+/**
+ * M503 - Print Configuration
+ */
void Config_PrintSettings(bool forReplay) {
// Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
@@ -651,10 +705,10 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOLNPGM("Steps per unit:");
CONFIG_ECHO_START;
}
- SERIAL_ECHOPAIR(" M92 X", planner.axis_steps_per_unit[X_AXIS]);
- SERIAL_ECHOPAIR(" Y", planner.axis_steps_per_unit[Y_AXIS]);
- SERIAL_ECHOPAIR(" Z", planner.axis_steps_per_unit[Z_AXIS]);
- SERIAL_ECHOPAIR(" E", planner.axis_steps_per_unit[E_AXIS]);
+ SERIAL_ECHOPAIR(" M92 X", planner.axis_steps_per_mm[X_AXIS]);
+ SERIAL_ECHOPAIR(" Y", planner.axis_steps_per_mm[Y_AXIS]);
+ SERIAL_ECHOPAIR(" Z", planner.axis_steps_per_mm[Z_AXIS]);
+ SERIAL_ECHOPAIR(" E", planner.axis_steps_per_mm[E_AXIS]);
SERIAL_EOL;
CONFIG_ECHO_START;
@@ -675,10 +729,10 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
CONFIG_ECHO_START;
}
- SERIAL_ECHOPAIR(" M203 X", planner.max_feedrate[X_AXIS]);
- SERIAL_ECHOPAIR(" Y", planner.max_feedrate[Y_AXIS]);
- SERIAL_ECHOPAIR(" Z", planner.max_feedrate[Z_AXIS]);
- SERIAL_ECHOPAIR(" E", planner.max_feedrate[E_AXIS]);
+ SERIAL_ECHOPAIR(" M203 X", planner.max_feedrate_mm_s[X_AXIS]);
+ SERIAL_ECHOPAIR(" Y", planner.max_feedrate_mm_s[Y_AXIS]);
+ SERIAL_ECHOPAIR(" Z", planner.max_feedrate_mm_s[Z_AXIS]);
+ SERIAL_ECHOPAIR(" E", planner.max_feedrate_mm_s[E_AXIS]);
SERIAL_EOL;
CONFIG_ECHO_START;
@@ -686,10 +740,10 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
CONFIG_ECHO_START;
}
- SERIAL_ECHOPAIR(" M201 X", planner.max_acceleration_units_per_sq_second[X_AXIS]);
- SERIAL_ECHOPAIR(" Y", planner.max_acceleration_units_per_sq_second[Y_AXIS]);
- SERIAL_ECHOPAIR(" Z", planner.max_acceleration_units_per_sq_second[Z_AXIS]);
- SERIAL_ECHOPAIR(" E", planner.max_acceleration_units_per_sq_second[E_AXIS]);
+ SERIAL_ECHOPAIR(" M201 X", planner.max_acceleration_mm_per_s2[X_AXIS]);
+ SERIAL_ECHOPAIR(" Y", planner.max_acceleration_mm_per_s2[Y_AXIS]);
+ SERIAL_ECHOPAIR(" Z", planner.max_acceleration_mm_per_s2[Z_AXIS]);
+ SERIAL_ECHOPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS]);
SERIAL_EOL;
CONFIG_ECHO_START;
if (!forReplay) {
@@ -706,8 +760,8 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)");
CONFIG_ECHO_START;
}
- SERIAL_ECHOPAIR(" M205 S", planner.min_feedrate);
- SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate);
+ SERIAL_ECHOPAIR(" M205 S", planner.min_feedrate_mm_s);
+ SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate_mm_s);
SERIAL_ECHOPAIR(" B", planner.min_segment_time);
SERIAL_ECHOPAIR(" X", planner.max_xy_jerk);
SERIAL_ECHOPAIR(" Z", planner.max_z_jerk);
@@ -716,7 +770,7 @@ void Config_PrintSettings(bool forReplay) {
CONFIG_ECHO_START;
if (!forReplay) {
- SERIAL_ECHOLNPGM("Home offset (mm):");
+ SERIAL_ECHOLNPGM("Home offset (mm)");
CONFIG_ECHO_START;
}
SERIAL_ECHOPAIR(" M206 X", home_offset[X_AXIS]);
@@ -729,7 +783,7 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOLNPGM("Mesh bed leveling:");
CONFIG_ECHO_START;
}
- SERIAL_ECHOPAIR(" M420 S", mbl.active);
+ SERIAL_ECHOPAIR(" M420 S", mbl.has_mesh() ? 1 : 0);
SERIAL_ECHOPAIR(" X", MESH_NUM_X_POINTS);
SERIAL_ECHOPAIR(" Y", MESH_NUM_Y_POINTS);
SERIAL_EOL;
@@ -783,14 +837,14 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOLNPGM("Material heatup parameters:");
CONFIG_ECHO_START;
}
- SERIAL_ECHOPAIR(" M145 S0 H", plaPreheatHotendTemp);
- SERIAL_ECHOPAIR(" B", plaPreheatHPBTemp);
- SERIAL_ECHOPAIR(" F", plaPreheatFanSpeed);
+ SERIAL_ECHOPAIR(" M145 S0 H", preheatHotendTemp1);
+ SERIAL_ECHOPAIR(" B", preheatBedTemp1);
+ SERIAL_ECHOPAIR(" F", preheatFanSpeed1);
SERIAL_EOL;
CONFIG_ECHO_START;
- SERIAL_ECHOPAIR(" M145 S1 H", absPreheatHotendTemp);
- SERIAL_ECHOPAIR(" B", absPreheatHPBTemp);
- SERIAL_ECHOPAIR(" F", absPreheatFanSpeed);
+ SERIAL_ECHOPAIR(" M145 S1 H", preheatHotendTemp2);
+ SERIAL_ECHOPAIR(" B", preheatBedTemp2);
+ SERIAL_ECHOPAIR(" F", preheatFanSpeed2);
SERIAL_EOL;
#endif // ULTIPANEL
@@ -801,30 +855,30 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOLNPGM("PID settings:");
}
#if ENABLED(PIDTEMP)
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
if (forReplay) {
- for (uint8_t i = 0; i < EXTRUDERS; i++) {
+ HOTEND_LOOP() {
CONFIG_ECHO_START;
- SERIAL_ECHOPAIR(" M301 E", i);
- SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, i));
- SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, i)));
- SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, i)));
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, i));
- if (i == 0) SERIAL_ECHOPAIR(" L", lpq_len);
+ SERIAL_ECHOPAIR(" M301 E", e);
+ SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, e));
+ SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, e)));
+ SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, e)));
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e));
+ if (e == 0) SERIAL_ECHOPAIR(" L", lpq_len);
#endif
SERIAL_EOL;
}
}
else
- #endif // EXTRUDERS > 1
- // !forReplay || EXTRUDERS == 1
+ #endif // HOTENDS > 1
+ // !forReplay || HOTENDS == 1
{
CONFIG_ECHO_START;
SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0
SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ #if ENABLED(PID_EXTRUSION_SCALING)
SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0));
SERIAL_ECHOPAIR(" L", lpq_len);
#endif
@@ -863,7 +917,7 @@ void Config_PrintSettings(bool forReplay) {
#if EXTRUDERS > 1
SERIAL_ECHOPAIR(" W", retract_length_swap);
#endif
- SERIAL_ECHOPAIR(" F", retract_feedrate * 60);
+ SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_feedrate_mm_s));
SERIAL_ECHOPAIR(" Z", retract_zlift);
SERIAL_EOL;
CONFIG_ECHO_START;
@@ -875,14 +929,14 @@ void Config_PrintSettings(bool forReplay) {
#if EXTRUDERS > 1
SERIAL_ECHOPAIR(" W", retract_recover_length_swap);
#endif
- SERIAL_ECHOPAIR(" F", retract_recover_feedrate * 60);
+ SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_recover_feedrate_mm_s));
SERIAL_EOL;
CONFIG_ECHO_START;
if (!forReplay) {
SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
CONFIG_ECHO_START;
}
- SERIAL_ECHOPAIR(" M209 S", (autoretract_enabled ? 1 : 0));
+ SERIAL_ECHOPAIR(" M209 S", autoretract_enabled ? 1 : 0);
SERIAL_EOL;
#endif // FWRETRACT
@@ -926,20 +980,13 @@ void Config_PrintSettings(bool forReplay) {
/**
* Auto Bed Leveling
*/
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #if ENABLED(CUSTOM_M_CODES)
- if (!forReplay) {
- CONFIG_ECHO_START;
- SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
- }
+ #if HAS_BED_PROBE
+ if (!forReplay) {
CONFIG_ECHO_START;
- SERIAL_ECHOPAIR(" M" STRINGIFY(CUSTOM_M_CODE_SET_Z_PROBE_OFFSET) " Z", zprobe_zoffset);
- #else
- if (!forReplay) {
- CONFIG_ECHO_START;
- SERIAL_ECHOPAIR("Z-Probe Offset (mm):", zprobe_zoffset);
- }
- #endif
+ SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
+ }
+ CONFIG_ECHO_START;
+ SERIAL_ECHOPAIR(" M851 Z", zprobe_zoffset);
SERIAL_EOL;
#endif
}
diff --git a/Marlin/configuration_store.h b/Marlin/configuration_store.h
index 2b2680607..891f19fb9 100644
--- a/Marlin/configuration_store.h
+++ b/Marlin/configuration_store.h
@@ -23,7 +23,7 @@
#ifndef CONFIGURATION_STORE_H
#define CONFIGURATION_STORE_H
-#include "Configuration.h"
+#include "MarlinConfig.h"
void Config_ResetDefault();
diff --git a/Marlin/dac_mcp4728.cpp b/Marlin/dac_mcp4728.cpp
index 3060e6e18..01e38edf8 100644
--- a/Marlin/dac_mcp4728.cpp
+++ b/Marlin/dac_mcp4728.cpp
@@ -43,9 +43,9 @@ void mcp4728_init() {
Wire.begin();
Wire.requestFrom(int(DAC_DEV_ADDRESS), 24);
while(Wire.available()) {
- int deviceID = Wire.receive();
- int hiByte = Wire.receive();
- int loByte = Wire.receive();
+ int deviceID = Wire.read();
+ int hiByte = Wire.read();
+ int loByte = Wire.read();
int isEEPROM = (deviceID & 0B00001000) >> 3;
int channel = (deviceID & 0B00110000) >> 4;
@@ -70,10 +70,10 @@ uint8_t mcp4728_analogWrite(uint8_t channel, uint16_t value) {
*/
uint8_t mcp4728_eepromWrite() {
Wire.beginTransmission(DAC_DEV_ADDRESS);
- Wire.send(SEQWRITE);
+ Wire.write(SEQWRITE);
for (uint8_t channel=0; channel <= 3; channel++) {
- Wire.send(DAC_STEPPER_VREF << 7 | 0 << 5 | DAC_STEPPER_GAIN << 4 | highByte(mcp4728_values[channel]));
- Wire.send(lowByte(mcp4728_values[channel]));
+ Wire.write(DAC_STEPPER_VREF << 7 | 0 << 5 | DAC_STEPPER_GAIN << 4 | highByte(mcp4728_values[channel]));
+ Wire.write(lowByte(mcp4728_values[channel]));
}
return Wire.endTransmission();
}
@@ -83,7 +83,7 @@ uint8_t mcp4728_eepromWrite() {
*/
uint8_t mcp4728_setVref_all(uint8_t value) {
Wire.beginTransmission(DAC_DEV_ADDRESS);
- Wire.send(VREFWRITE | value << 3 | value << 2 | value << 1 | value);
+ Wire.write(VREFWRITE | value << 3 | value << 2 | value << 1 | value);
return Wire.endTransmission();
}
/**
@@ -91,7 +91,7 @@ uint8_t mcp4728_setVref_all(uint8_t value) {
*/
uint8_t mcp4728_setGain_all(uint8_t value) {
Wire.beginTransmission(DAC_DEV_ADDRESS);
- Wire.send(GAINWRITE | value << 3 | value << 2 | value << 1 | value);
+ Wire.write(GAINWRITE | value << 3 | value << 2 | value << 1 | value);
return Wire.endTransmission();
}
@@ -120,8 +120,8 @@ uint16_t mcp4728_getVout(uint8_t channel) {
uint8_t mcp4728_fastWrite() {
Wire.beginTransmission(DAC_DEV_ADDRESS);
for (uint8_t channel=0; channel <= 3; channel++) {
- Wire.send(highByte(mcp4728_values[channel]));
- Wire.send(lowByte(mcp4728_values[channel]));
+ Wire.write(highByte(mcp4728_values[channel]));
+ Wire.write(lowByte(mcp4728_values[channel]));
}
return Wire.endTransmission();
}
@@ -131,7 +131,7 @@ uint8_t mcp4728_fastWrite() {
*/
uint8_t mcp4728_simpleCommand(byte simpleCommand) {
Wire.beginTransmission(GENERALCALL);
- Wire.send(simpleCommand);
+ Wire.write(simpleCommand);
return Wire.endTransmission();
}
diff --git a/Marlin/dac_mcp4728.h b/Marlin/dac_mcp4728.h
index e1739c563..c096c856a 100644
--- a/Marlin/dac_mcp4728.h
+++ b/Marlin/dac_mcp4728.h
@@ -27,30 +27,29 @@
#ifndef mcp4728_h
#define mcp4728_h
-#include "Configuration.h"
-#include "Configuration_adv.h"
+#include "MarlinConfig.h"
#if ENABLED(DAC_STEPPER_CURRENT)
-#include "WProgram.h"
#include "Wire.h"
-//#include
-#define defaultVDD 5000
-#define BASE_ADDR 0x60
-#define RESET 0B00000110
-#define WAKE 0B00001001
-#define UPDATE 0B00001000
-#define MULTIWRITE 0B01000000
-#define SINGLEWRITE 0B01011000
-#define SEQWRITE 0B01010000
-#define VREFWRITE 0B10000000
-#define GAINWRITE 0B11000000
+#define defaultVDD 5000
+#define BASE_ADDR 0x60
+#define RESET 0B00000110
+#define WAKE 0B00001001
+#define UPDATE 0B00001000
+#define MULTIWRITE 0B01000000
+#define SINGLEWRITE 0B01011000
+#define SEQWRITE 0B01010000
+#define VREFWRITE 0B10000000
+#define GAINWRITE 0B11000000
#define POWERDOWNWRITE 0B10100000
-#define GENERALCALL 0B0000000
-#define GAINWRITE 0B11000000
+#define GENERALCALL 0B00000000
+#define GAINWRITE 0B11000000
// This is taken from the original lib, makes it easy to edit if needed
-#define DAC_DEV_ADDRESS (BASE_ADDR | 0x00)
+// DAC_OR_ADDRESS defined in pins_BOARD.h file
+#define DAC_DEV_ADDRESS (BASE_ADDR | DAC_OR_ADDRESS)
+
void mcp4728_init();
uint8_t mcp4728_analogWrite(uint8_t channel, uint16_t value);
diff --git a/Marlin/digipot_mcp4451.cpp b/Marlin/digipot_mcp4451.cpp
index 771581341..c6a01915f 100644
--- a/Marlin/digipot_mcp4451.cpp
+++ b/Marlin/digipot_mcp4451.cpp
@@ -20,7 +20,7 @@
*
*/
-#include "Configuration.h"
+#include "MarlinConfig.h"
#if ENABLED(DIGIPOT_I2C)
diff --git a/Marlin/dogm_bitmaps.h b/Marlin/dogm_bitmaps.h
index 546cfd6f0..e020d2436 100644
--- a/Marlin/dogm_bitmaps.h
+++ b/Marlin/dogm_bitmaps.h
@@ -21,8 +21,14 @@
*/
/**
- * BitMap for splashscreen
- * Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php
+ * Standard Marlin Bitmap for splashscreen
+ *
+ * You may use one of the following tools to generate the C++ bitmap array from
+ * a black and white image:
+ *
+ * - http://www.marlinfw.org/tools/u8glib/converter.html
+ * - http://www.digole.com/tools/PicturetoC_Hex_converter.php
+ *
* Please note that using the high-res version takes 402Bytes of PROGMEM.
*/
@@ -110,7 +116,7 @@
// be displayed.
#if HAS_TEMP_BED
- #if EXTRUDERS == 1
+ #if HOTENDS == 1
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
@@ -160,7 +166,7 @@
0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0,
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
};
- #elif EXTRUDERS == 2
+ #elif HOTENDS == 2
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
@@ -262,7 +268,7 @@
};
#endif // Extruders
#else
- #if EXTRUDERS == 1
+ #if HOTENDS == 1
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
@@ -312,7 +318,7 @@
0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
- #elif EXTRUDERS == 2
+ #elif HOTENDS == 2
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
diff --git a/Marlin/dogm_font_data_ISO10646_Greek.h b/Marlin/dogm_font_data_ISO10646_Greek.h
new file mode 100644
index 000000000..0abb08d9d
--- /dev/null
+++ b/Marlin/dogm_font_data_ISO10646_Greek.h
@@ -0,0 +1,206 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ Fontname: ISO10646_4_Greek
+ Copyright: A. Hardtung, public domain
+ Capital A Height: 7, '1' Height: 7
+ Calculated Max Values w= 5 h=10 x= 2 y= 6 dx= 6 dy= 0 ascent= 8 len=10
+ Font Bounding box w= 6 h= 9 x= 0 y=-2
+ Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
+ Pure Font ascent = 7 descent=-1
+ X Font ascent = 7 descent=-1
+ Max Font ascent = 8 descent=-2
+*/
+#include
+const u8g_fntpgm_uint8_t ISO10646_Greek_5x7[2728] U8G_SECTION(".progmem.ISO10646_Greek_5x7") = {
+ 0,6,9,0,254,7,1,145,3,32,32,255,255,8,254,7,
+ 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
+ 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
+ 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
+ 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
+ 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
+ 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
+ 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
+ 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
+ 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
+ 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
+ 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
+ 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64,
+ 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
+ 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
+ 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
+ 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
+ 48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
+ 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
+ 112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5,
+ 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
+ 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
+ 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
+ 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
+ 8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168,
+ 112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7,
+ 7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0,
+ 0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144,
+ 136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128,
+ 128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5,
+ 7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6,
+ 0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128,
+ 128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16,
+ 16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136,
+ 5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7,
+ 6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0,
+ 136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136,
+ 136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128,
+ 128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7,
+ 7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0,
+ 0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32,
+ 32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136,
+ 136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5,
+ 7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6,
+ 0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136,
+ 136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32,
+ 64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224,
+ 5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,1,
+ 0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,80,
+ 136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,64,
+ 5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,0,
+ 0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,128,
+ 128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,120,
+ 5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,0,
+ 0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,136,
+ 136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,136,
+ 136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,8,
+ 8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,6,
+ 0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,192,
+ 64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,168,
+ 168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,6,
+ 0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,136,
+ 240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,5,
+ 5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,0,
+ 112,128,112,8,240,5,7,7,6,0,0,64,64,224,64,64,
+ 72,48,5,5,5,6,0,0,136,136,136,152,104,5,5,5,
+ 6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,136,
+ 168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,6,
+ 6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,0,
+ 248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,64,
+ 64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,3,
+ 7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,6,
+ 0,3,104,144,0,0,0,6,0,0,0,0,0,6,0,0,
+ 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,
+ 0,0,2,2,2,6,1,6,64,128,3,3,3,6,1,5,
+ 32,64,160,5,8,8,6,0,0,64,160,80,80,136,248,136,
+ 136,2,2,2,6,1,2,192,192,5,8,8,6,0,0,64,
+ 128,248,128,240,128,128,248,5,8,8,6,0,0,64,128,136,
+ 136,248,136,136,136,4,8,8,6,0,0,64,128,112,32,32,
+ 32,32,112,0,0,0,6,0,0,5,8,8,6,0,0,64,
+ 128,112,136,136,136,136,112,0,0,0,6,0,0,5,8,8,
+ 6,0,0,64,128,8,136,112,32,32,32,5,8,8,6,0,
+ 0,64,128,112,136,136,136,80,216,3,8,8,6,1,0,32,
+ 64,160,0,64,64,64,32,5,7,7,6,0,0,32,80,136,
+ 136,248,136,136,5,7,7,6,0,0,240,72,72,112,72,72,
+ 240,5,7,7,6,0,0,248,128,128,128,128,128,128,5,6,
+ 6,6,0,0,32,80,80,136,136,248,5,7,7,6,0,0,
+ 248,128,128,240,128,128,248,5,7,7,6,0,0,248,8,16,
+ 32,64,128,248,5,7,7,6,0,0,136,136,136,248,136,136,
+ 136,5,7,7,6,0,0,112,136,136,168,136,136,112,3,7,
+ 7,6,1,0,224,64,64,64,64,64,224,5,7,7,6,0,
+ 0,136,144,160,192,160,144,136,5,7,7,6,0,0,32,80,
+ 136,136,136,136,136,5,7,7,6,0,0,136,216,168,168,136,
+ 136,136,5,7,7,6,0,0,136,200,200,168,152,152,136,5,
+ 7,7,6,0,0,248,0,0,112,0,0,248,5,7,7,6,
+ 0,0,112,136,136,136,136,136,112,5,7,7,6,0,0,248,
+ 80,80,80,80,80,80,5,7,7,6,0,0,240,136,136,240,
+ 128,128,128,0,0,0,6,0,0,5,7,7,6,0,0,248,
+ 128,64,32,64,128,248,5,7,7,6,0,0,248,32,32,32,
+ 32,32,32,5,7,7,6,0,0,136,136,80,32,32,32,32,
+ 5,7,7,6,0,0,112,32,112,168,112,32,112,5,7,7,
+ 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
+ 168,168,168,168,112,32,32,5,6,6,6,0,0,112,136,136,
+ 80,80,216,3,8,8,6,1,0,160,0,224,64,64,64,64,
+ 224,5,8,8,6,0,0,80,0,136,136,136,80,32,32,5,
+ 8,8,6,0,0,32,64,8,104,152,144,144,104,5,8,8,
+ 6,0,0,32,64,0,112,136,224,136,112,5,10,10,6,0,
+ 254,32,64,0,112,136,136,136,136,8,8,2,8,8,6,1,
+ 0,64,128,0,128,128,128,128,64,5,8,8,6,0,0,16,
+ 32,80,0,136,136,136,112,5,6,6,6,0,0,8,104,152,
+ 144,144,104,4,7,7,6,0,254,96,144,240,144,224,128,128,
+ 5,6,6,6,0,255,136,72,80,32,32,64,5,6,6,6,
+ 0,0,48,64,112,136,136,112,5,5,5,6,0,0,112,136,
+ 224,136,112,5,9,9,6,0,254,128,112,64,128,128,128,112,
+ 8,112,5,7,7,6,0,254,184,200,136,136,136,8,8,5,
+ 5,5,6,0,0,112,136,248,136,112,3,5,5,6,1,0,
+ 128,128,128,128,96,4,5,5,6,0,0,144,160,192,160,144,
+ 5,6,6,6,0,0,64,32,32,80,80,136,5,7,7,6,
+ 0,254,136,136,136,216,168,128,128,5,5,5,6,0,0,136,
+ 136,80,96,32,5,10,10,6,0,254,128,224,128,112,32,64,
+ 128,112,8,112,5,5,5,6,0,0,112,136,136,136,112,5,
+ 5,5,6,0,0,248,80,80,80,80,5,7,7,6,0,254,
+ 112,136,136,200,176,128,128,5,7,7,6,0,254,48,64,128,
+ 64,48,8,112,5,5,5,6,0,0,104,144,144,144,96,4,
+ 5,5,6,0,0,240,64,64,64,48,5,5,5,6,0,0,
+ 136,136,144,144,224,5,8,8,6,0,254,48,168,168,168,168,
+ 112,32,32,5,6,6,6,0,255,136,80,32,32,80,136,5,
+ 7,7,6,0,254,168,168,168,168,112,32,32,5,5,5,6,
+ 0,0,80,136,136,168,112,4,7,7,6,0,0,160,0,64,
+ 64,64,64,48,5,7,7,6,0,0,80,0,136,136,144,144,
+ 224,4,8,8,6,0,0,32,64,0,96,144,144,144,96,5,
+ 8,8,6,0,0,32,64,0,136,136,144,144,96,5,8,8,
+ 6,0,0,32,64,0,80,136,136,168,112,5,7,7,6,0,
+ 255,144,160,192,160,144,136,16,5,8,8,6,0,0,96,144,
+ 160,128,240,136,136,112,5,7,7,6,0,0,112,80,56,144,
+ 144,144,96,5,6,6,6,0,0,152,80,32,32,32,32,5,
+ 8,8,6,0,0,64,128,152,80,32,32,32,32,5,8,8,
+ 6,0,0,80,0,152,80,32,32,32,32,5,7,7,6,0,
+ 255,48,168,168,168,168,112,32,5,5,5,6,0,0,248,80,
+ 80,80,88,5,6,6,6,0,255,136,80,112,80,136,16,5,
+ 7,7,6,0,255,112,136,136,136,112,32,112,5,6,6,6,
+ 0,255,112,136,136,112,32,112,5,6,6,6,0,0,112,136,
+ 128,112,32,112,5,7,7,6,0,254,8,112,128,128,112,16,
+ 96,5,6,6,6,0,0,248,128,128,240,128,128,4,5,5,
+ 6,0,0,240,128,224,128,128,5,6,6,6,0,0,248,0,
+ 0,112,0,248,4,5,5,6,0,0,64,128,240,16,32,5,
+ 7,7,6,0,0,224,80,40,40,8,8,16,5,7,7,6,
+ 0,0,192,32,80,40,8,8,8,5,8,8,6,0,254,168,
+ 168,168,168,168,88,8,112,5,7,7,6,0,254,168,168,168,
+ 168,88,8,112,5,6,6,6,0,0,104,136,136,120,8,8,
+ 5,6,6,6,0,255,104,136,136,120,8,8,4,8,8,6,
+ 0,254,128,224,144,144,144,144,32,192,5,5,5,6,0,0,
+ 104,144,112,16,224,5,6,6,6,0,0,96,144,16,96,136,
+ 112,4,6,6,6,0,0,96,144,16,96,128,112,5,6,6,
+ 6,0,0,136,80,32,80,136,248,5,5,5,6,0,0,136,
+ 80,32,80,112,5,6,6,6,0,0,120,128,240,136,136,112,
+ 4,5,5,6,0,0,240,128,224,144,96,3,6,6,6,1,
+ 0,64,224,64,64,64,64,3,6,6,6,1,255,64,224,64,
+ 64,64,128,5,5,5,6,0,0,136,80,112,80,136,5,7,
+ 7,6,0,254,112,136,136,136,240,128,112,4,5,5,6,0,
+ 0,112,128,128,128,112,2,8,8,6,1,255,64,0,192,64,
+ 64,64,64,128,5,7,7,6,0,0,112,136,136,248,136,136,
+ 112,4,5,5,6,0,0,112,128,224,128,112,4,5,5,6,
+ 0,0,224,16,112,16,224,5,7,7,6,0,0,128,240,136,
+ 136,136,240,128,4,7,7,6,0,255,128,224,144,144,144,224,
+ 128,5,6,6,6,0,0,112,136,128,128,136,112,5,6,6,
+ 6,0,0,136,216,168,136,136,136,5,7,7,6,0,254,136,
+ 216,168,136,136,128,128,5,8,8,6,0,254,112,136,136,136,
+ 112,64,224,64,5,6,6,6,0,0,112,136,8,8,136,112,
+ 5,6,6,6,0,0,112,136,160,128,136,112,5,6,6,6,
+ 0,0,112,136,40,8,136,112};
diff --git a/Marlin/duration_t.h b/Marlin/duration_t.h
new file mode 100644
index 000000000..25ea9bb98
--- /dev/null
+++ b/Marlin/duration_t.h
@@ -0,0 +1,155 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __DURATION_T__
+#define __DURATION_T__
+
+struct duration_t {
+ /**
+ * @brief Duration is stored in seconds
+ */
+ uint32_t value;
+
+ /**
+ * @brief Constructor
+ */
+ duration_t()
+ : duration_t(0) {};
+
+ /**
+ * @brief Constructor
+ *
+ * @param seconds The number of seconds
+ */
+ duration_t(uint32_t const &seconds) {
+ this->value = seconds;
+ }
+
+ /**
+ * @brief Equality comparison
+ * @details Overloads the equality comparison operator
+ *
+ * @param value The number of seconds to compare to
+ * @return True if both durations are equal
+ */
+ bool operator==(const uint32_t &value) const {
+ return (this->value == value);
+ }
+
+ /**
+ * @brief Inequality comparison
+ * @details Overloads the inequality comparison operator
+ *
+ * @param value The number of seconds to compare to
+ * @return False if both durations are equal
+ */
+ bool operator!=(const uint32_t &value) const {
+ return ! this->operator==(value);
+ }
+
+ /**
+ * @brief Formats the duration as years
+ * @return The number of years
+ */
+ inline uint8_t year() const {
+ return this->day() / 365;
+ }
+
+ /**
+ * @brief Formats the duration as days
+ * @return The number of days
+ */
+ inline uint16_t day() const {
+ return this->hour() / 24;
+ }
+
+ /**
+ * @brief Formats the duration as hours
+ * @return The number of hours
+ */
+ inline uint32_t hour() const {
+ return this->minute() / 60;
+ }
+
+ /**
+ * @brief Formats the duration as minutes
+ * @return The number of minutes
+ */
+ inline uint32_t minute() const {
+ return this->second() / 60;
+ }
+
+ /**
+ * @brief Formats the duration as seconds
+ * @return The number of seconds
+ */
+ inline uint32_t second() const {
+ return this->value;
+ }
+
+ /**
+ * @brief Formats the duration as a string
+ * @details String will be formated using a "full" representation of duration
+ *
+ * @param buffer The array pointed to must be able to accommodate 21 bytes
+ *
+ * Output examples:
+ * 123456789012345678901 (strlen)
+ * 135y 364d 23h 59m 59s
+ * 364d 23h 59m 59s
+ * 23h 59m 59s
+ * 59m 59s
+ * 59s
+ */
+ void toString(char *buffer) const {
+ int y = this->year(),
+ d = this->day() % 365,
+ h = this->hour() % 24,
+ m = this->minute() % 60,
+ s = this->second() % 60;
+
+ if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s);
+ else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s);
+ else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s);
+ else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s);
+ else sprintf_P(buffer, PSTR("%is"), s);
+ }
+
+ /**
+ * @brief Formats the duration as a string
+ * @details String will be formated using a "digital" representation of duration
+ *
+ * @param buffer The array pointed to must be able to accommodate 10 bytes
+ *
+ * Output examples:
+ * 1234567890 (strlen)
+ * 1193046:59
+ */
+ void toDigital(char *buffer) const {
+ int h = this->hour() % 24,
+ m = this->minute() % 60;
+
+ sprintf_P(buffer, PSTR("%02i:%02i"), h, m);
+ }
+};
+
+#endif // __DURATION_T__
diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp
index 945b61577..751296d40 100644
--- a/Marlin/endstops.cpp
+++ b/Marlin/endstops.cpp
@@ -40,10 +40,10 @@ Endstops endstops;
bool Endstops::enabled = true,
Endstops::enabled_globally =
- #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
- false
+ #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
+ (true)
#else
- true
+ (false)
#endif
;
volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
@@ -64,20 +64,6 @@ volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_P
* Class and Instance Methods
*/
-Endstops::Endstops() {
- enable_globally(
- #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING)
- false
- #else
- true
- #endif
- );
- enable(true);
- #if HAS_BED_PROBE
- enable_z_probe(false);
- #endif
-} // Endstops::Endstops
-
void Endstops::init() {
#if HAS_X_MIN
@@ -186,10 +172,7 @@ void Endstops::report_state() {
if (stepper.abort_on_endstop_hit) {
card.sdprinting = false;
card.closefile();
- stepper.quick_stop();
- #if DISABLED(DELTA) && DISABLED(SCARA)
- set_current_position_from_planner();
- #endif
+ quickstop_stepper();
thermalManager.disable_all_heaters(); // switch off all heaters.
}
#endif
@@ -197,7 +180,7 @@ void Endstops::report_state() {
} // Endstops::report_state
void Endstops::M119() {
- SERIAL_PROTOCOLLN(MSG_M119_REPORT);
+ SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT);
#if HAS_X_MIN
SERIAL_PROTOCOLPGM(MSG_X_MIN);
SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
diff --git a/Marlin/endstops.h b/Marlin/endstops.h
index 76b34862c..22c2468b8 100644
--- a/Marlin/endstops.h
+++ b/Marlin/endstops.h
@@ -27,7 +27,7 @@
#ifndef ENDSTOPS_H
#define ENDSTOPS_H
-enum EndstopEnum {X_MIN = 0, Y_MIN = 1, Z_MIN = 2, Z_MIN_PROBE = 3, X_MAX = 4, Y_MAX = 5, Z_MAX = 6, Z2_MIN = 7, Z2_MAX = 8};
+#include "enum.h"
class Endstops {
@@ -42,8 +42,8 @@ class Endstops {
static byte
#endif
current_endstop_bits, old_endstop_bits;
-
- Endstops();
+
+ Endstops() {};
/**
* Initialize the endstop pins
diff --git a/Marlin/enum.h b/Marlin/enum.h
new file mode 100644
index 000000000..a51d208ae
--- /dev/null
+++ b/Marlin/enum.h
@@ -0,0 +1,193 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __ENUM_H__
+#define __ENUM_H__
+
+/**
+ * Axis indices as enumerated constants
+ *
+ * Special axis:
+ * - A_AXIS and B_AXIS are used by COREXY printers
+ * - 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
+ */
+enum AxisEnum {
+ NO_AXIS = -1,
+ X_AXIS = 0,
+ A_AXIS = 0,
+ Y_AXIS = 1,
+ B_AXIS = 1,
+ Z_AXIS = 2,
+ C_AXIS = 2,
+ E_AXIS = 3,
+ X_HEAD = 4,
+ Y_HEAD = 5,
+ Z_HEAD = 6
+};
+
+#define LOOP_XYZ(VAR) for (uint8_t VAR=X_AXIS; VAR<=Z_AXIS; VAR++)
+#define LOOP_XYZE(VAR) for (uint8_t VAR=X_AXIS; VAR<=E_AXIS; VAR++)
+
+typedef enum {
+ LINEARUNIT_MM,
+ LINEARUNIT_INCH
+} LinearUnit;
+
+typedef enum {
+ TEMPUNIT_C,
+ TEMPUNIT_K,
+ TEMPUNIT_F
+} TempUnit;
+
+/**
+ * Debug flags
+ * Not yet widely applied
+ */
+enum DebugFlags {
+ DEBUG_NONE = 0,
+ DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed
+ DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output
+ DEBUG_ERRORS = _BV(2), ///< Not implemented
+ DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands
+ DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
+ DEBUG_LEVELING = _BV(5) ///< Print detailed output for homing and leveling
+};
+
+enum EndstopEnum {
+ X_MIN,
+ Y_MIN,
+ Z_MIN,
+ Z_MIN_PROBE,
+ X_MAX,
+ Y_MAX,
+ Z_MAX,
+ Z2_MIN,
+ Z2_MAX
+};
+
+/**
+ * Temperature
+ * Stages in the ISR loop
+ */
+enum TempState {
+ PrepareTemp_0,
+ MeasureTemp_0,
+ PrepareTemp_BED,
+ MeasureTemp_BED,
+ PrepareTemp_1,
+ MeasureTemp_1,
+ PrepareTemp_2,
+ MeasureTemp_2,
+ PrepareTemp_3,
+ MeasureTemp_3,
+ Prepare_FILWIDTH,
+ Measure_FILWIDTH,
+ StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle
+};
+
+#if ENABLED(EMERGENCY_PARSER)
+ enum e_parser_state {
+ state_RESET,
+ state_N,
+ state_M,
+ state_M1,
+ state_M10,
+ state_M108,
+ state_M11,
+ state_M112,
+ state_M4,
+ state_M41,
+ state_M410,
+ state_IGNORE // to '\n'
+ };
+#endif
+
+#if ENABLED(FILAMENT_CHANGE_FEATURE)
+ enum FilamentChangeMenuResponse {
+ FILAMENT_CHANGE_RESPONSE_WAIT_FOR,
+ FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE,
+ FILAMENT_CHANGE_RESPONSE_RESUME_PRINT
+ };
+
+ #if ENABLED(ULTIPANEL)
+ enum FilamentChangeMessage {
+ FILAMENT_CHANGE_MESSAGE_INIT,
+ FILAMENT_CHANGE_MESSAGE_UNLOAD,
+ FILAMENT_CHANGE_MESSAGE_INSERT,
+ FILAMENT_CHANGE_MESSAGE_LOAD,
+ FILAMENT_CHANGE_MESSAGE_EXTRUDE,
+ FILAMENT_CHANGE_MESSAGE_OPTION,
+ FILAMENT_CHANGE_MESSAGE_RESUME,
+ FILAMENT_CHANGE_MESSAGE_STATUS
+ };
+ #endif
+#endif
+
+/**
+ * States for managing Marlin and host communication
+ * Marlin sends messages if blocked or busy
+ */
+#if ENABLED(HOST_KEEPALIVE_FEATURE)
+ enum MarlinBusyState {
+ NOT_BUSY, // Not in a handler
+ IN_HANDLER, // Processing a GCode
+ IN_PROCESS, // Known to be blocking command input (as in G29)
+ PAUSED_FOR_USER, // Blocking pending any input
+ PAUSED_FOR_INPUT // Blocking pending text input (concept)
+ };
+#endif
+
+#if ENABLED(MESH_BED_LEVELING)
+ enum MeshLevelingState {
+ MeshReport,
+ MeshStart,
+ MeshNext,
+ MeshSet,
+ MeshSetZOffset,
+ MeshReset
+ };
+
+ enum MBLStatus {
+ MBL_STATUS_NONE = 0,
+ MBL_STATUS_HAS_MESH_BIT = 0,
+ MBL_STATUS_ACTIVE_BIT = 1
+ };
+#endif
+
+/**
+ * SD Card
+ */
+enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename };
+
+/**
+ * Ultra LCD
+ */
+enum LCDViewAction {
+ LCDVIEW_NONE,
+ LCDVIEW_REDRAW_NOW,
+ LCDVIEW_CALL_REDRAW_NEXT,
+ LCDVIEW_CLEAR_CALL_REDRAW,
+ LCDVIEW_CALL_NO_REDRAW
+};
+
+#endif // __ENUM_H__
diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h
new file mode 100644
index 000000000..54505b66b
--- /dev/null
+++ b/Marlin/example_configurations/Cartesio/Configuration.h
@@ -0,0 +1,1327 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Configuration.h
+ *
+ * Basic settings such as:
+ *
+ * - Type of electronics
+ * - Type of temperature sensor
+ * - Printer geometry
+ * - Endstop configuration
+ * - LCD controller
+ * - Extra features
+ *
+ * Advanced settings can be found in Configuration_adv.h
+ *
+ */
+#ifndef CONFIGURATION_H
+#define CONFIGURATION_H
+
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
+
+//===========================================================================
+//============================= Getting Started =============================
+//===========================================================================
+
+/**
+ * Here are some standard links for getting your machine calibrated:
+ *
+ * http://reprap.org/wiki/Calibration
+ * http://youtu.be/wAL9d7FgInk
+ * http://calculator.josefprusa.cz
+ * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
+ * http://www.thingiverse.com/thing:5573
+ * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
+ * http://www.thingiverse.com/thing:298812
+ */
+
+//===========================================================================
+//============================= DELTA Printer ===============================
+//===========================================================================
+// For a Delta printer replace the configuration files with the files in the
+// example_configurations/delta directory.
+//
+
+//===========================================================================
+//============================= SCARA Printer ===============================
+//===========================================================================
+// For a Scara printer replace the configuration files with the files in the
+// example_configurations/SCARA directory.
+//
+
+// @section info
+
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
+// build by the user have been successfully uploaded into firmware.
+#define STRING_CONFIG_H_AUTHOR "(MaukCC, CartesioE)" // Who made the changes.
+#define SHOW_BOOTSCREEN
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+#define SHOW_CUSTOM_BOOTSCREEN
+// @section machine
+
+// SERIAL_PORT selects which serial port should be used for communication with the host.
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
+// :[0,1,2,3,4,5,6,7]
+#define SERIAL_PORT 0
+
+// This determines the communication speed of the printer
+// :[2400,9600,19200,38400,57600,115200,250000]
+#define BAUDRATE 115200
+
+// Enable the Bluetooth serial interface on AT90USB devices
+//#define BLUETOOTH
+
+// The following define selects which electronics board you have.
+// Please choose the name from boards.h that matches your setup
+#ifndef MOTHERBOARD
+ //#define MOTHERBOARD BOARD_CNCONTROLS_11
+ #define MOTHERBOARD BOARD_CNCONTROLS_12
+#endif
+
+// Optional custom name for your RepStrap or other custom machine
+// Displayed in the LCD "Ready" message
+#define CUSTOM_MACHINE_NAME "CartesioE"
+
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
+//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
+
+// This defines the number of extruders
+// :[1,2,3,4]
+#define EXTRUDERS 3
+
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
+//#define SINGLENOZZLE
+
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
+// For the other hotends it is their distance from the extruder 0 hotend.
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+
+//// The following define selects which power supply you have. Please choose the one that matches your setup
+// 1 = ATX
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
+// :{1:'ATX',2:'X-Box 360'}
+#define POWER_SUPPLY 1
+
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
+//#define PS_DEFAULT_OFF
+
+// @section temperature
+
+//===========================================================================
+//============================= Thermal Settings ============================
+//===========================================================================
+//
+//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
+//
+//// Temperature sensor settings:
+// -3 is thermocouple with MAX31855 (only for sensor 0)
+// -2 is thermocouple with MAX6675 (only for sensor 0)
+// -1 is thermocouple with AD595
+// 0 is not used
+// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
+// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
+// 3 is Mendel-parts thermistor (4.7k pullup)
+// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
+// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
+// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
+// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
+// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
+// 10 is 100k RS thermistor 198-961 (4.7k pullup)
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
+// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
+// 70 is the 100K thermistor found in the bq Hephestos 2
+//
+// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
+// (but gives greater accuracy and more stable PID)
+// 51 is 100k thermistor - EPCOS (1k pullup)
+// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
+//
+// 1047 is Pt1000 with 4k7 pullup
+// 1010 is Pt1000 with 1k pullup (non standard)
+// 147 is Pt100 with 4k7 pullup
+// 110 is Pt100 with 1k pullup (non standard)
+// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below.
+// Use it for Testing or Development purposes. NEVER for production machine.
+//#define DUMMY_THERMISTOR_998_VALUE 25
+//#define DUMMY_THERMISTOR_999_VALUE 100
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
+#define TEMP_SENSOR_0 -1
+#define TEMP_SENSOR_1 -1
+#define TEMP_SENSOR_2 1
+#define TEMP_SENSOR_3 0
+#define TEMP_SENSOR_BED 1
+
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
+//#define TEMP_SENSOR_1_AS_REDUNDANT
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
+
+// Extruder temperature must be close to target for this long before M109 returns success
+#define TEMP_RESIDENCY_TIME 4 // (seconds)
+#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one
+#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
+
+// Bed temperature must be close to target for this long before M190 returns success
+#define TEMP_BED_RESIDENCY_TIME 1 // (seconds)
+#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one
+#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
+
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
+// to check that the wiring to the thermistor is not broken.
+// Otherwise this would lead to the heater being powered on all the time.
+#define HEATER_0_MINTEMP 5
+#define HEATER_1_MINTEMP 5
+#define HEATER_2_MINTEMP 5
+#define HEATER_3_MINTEMP 5
+#define BED_MINTEMP 5
+
+// When temperature exceeds max temp, your heater will be switched off.
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
+// You should use MINTEMP for thermistor short/failure protection.
+#define HEATER_0_MAXTEMP 415
+#define HEATER_1_MAXTEMP 415
+#define HEATER_2_MAXTEMP 415
+#define HEATER_3_MAXTEMP 415
+#define BED_MAXTEMP 165
+
+//===========================================================================
+//============================= PID Settings ================================
+//===========================================================================
+// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
+
+// Comment the following line to disable PID and enable bang-bang.
+#define PIDTEMP
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
+#if ENABLED(PIDTEMP)
+ //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
+ //#define PID_DEBUG // Sends debug data to the serial port.
+ //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
+ //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
+ #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
+ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
+ #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
+ #define K1 0.95 //smoothing factor within the PID
+
+ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
+
+ // Cartesio extruderV6 40W Normal
+ #define DEFAULT_Kp 18
+ #define DEFAULT_Ki 1
+ #define DEFAULT_Kd 100
+
+ // Cartesio extruderV6 40W Volcano
+ //#define DEFAULT_Kp 50
+ //#define DEFAULT_Ki 9
+ //#define DEFAULT_Kd 70
+
+ // Cartesio extruderV6 40W Cyclops
+ //#define DEFAULT_Kp 18
+ //#define DEFAULT_Ki 1
+ //#define DEFAULT_Kd 100
+
+#endif // PIDTEMP
+
+//===========================================================================
+//============================= PID > Bed Temperature Control ===============
+//===========================================================================
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
+//
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
+// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz,
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
+// shouldn't use bed PID until someone else verifies your hardware works.
+// If this is enabled, find your own PID constants below.
+#define PIDTEMPBED
+
+//#define BED_LIMIT_SWITCHING
+
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
+// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
+
+#if ENABLED(PIDTEMPBED)
+
+ //#define PID_BED_DEBUG // Sends debug data to the serial port.
+
+ #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
+
+ //24V 500W silicone heater on to 4mm glass CartesioW
+ #define DEFAULT_bedKp 390
+ #define DEFAULT_bedKi 70
+ #define DEFAULT_bedKd 546
+
+ //24V 250W silicone heater on to 4mm glass CartesioM
+ //#define DEFAULT_bedKp 303
+ //#define DEFAULT_bedKi 42
+ //#define DEFAULT_bedKd 539
+
+ // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
+#endif // PIDTEMPBED
+
+// @section extruder
+
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
+//can be software-disabled for whatever purposes by
+#define PREVENT_DANGEROUS_EXTRUDE
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
+#define PREVENT_LENGTHY_EXTRUDE
+
+#define EXTRUDE_MINTEMP 18
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
+
+//===========================================================================
+//======================== Thermal Runaway Protection =======================
+//===========================================================================
+
+/**
+ * Thermal Protection protects your printer from damage and fire if a
+ * thermistor falls out or temperature sensors fail in any way.
+ *
+ * The issue: If a thermistor falls out or a temperature sensor fails,
+ * Marlin can no longer sense the actual temperature. Since a disconnected
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
+ *
+ * If you get "Thermal Runaway" or "Heating failed" errors the
+ * details can be tuned in Configuration_adv.h
+ */
+
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
+#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
+
+//===========================================================================
+//============================= Mechanical Settings =========================
+//===========================================================================
+
+// @section machine
+
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
+//#define COREXY
+//#define COREXZ
+//#define COREYZ
+
+// Enable this option for Toshiba steppers
+//#define CONFIG_STEPPERS_TOSHIBA
+
+//===========================================================================
+//============================== Endstop Settings ===========================
+//===========================================================================
+
+// @section homing
+
+// Specify here all the endstop connectors that are connected to any endstop or probe.
+// Almost all printers will be using one per axis. Probes will use one or more of the
+// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
+#define USE_XMIN_PLUG
+#define USE_YMIN_PLUG
+#define USE_ZMIN_PLUG
+//#define USE_XMAX_PLUG
+//#define USE_YMAX_PLUG
+//#define USE_ZMAX_PLUG
+
+// coarse Endstop Settings
+#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
+
+#if DISABLED(ENDSTOPPULLUPS)
+ // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
+ //#define ENDSTOPPULLUP_XMAX
+ //#define ENDSTOPPULLUP_YMAX
+ //#define ENDSTOPPULLUP_ZMAX
+ //#define ENDSTOPPULLUP_XMIN
+ //#define ENDSTOPPULLUP_YMIN
+ //#define ENDSTOPPULLUP_ZMIN
+ //#define ENDSTOPPULLUP_ZMIN_PROBE
+#endif
+
+// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+
+//===========================================================================
+//============================= Z Probe Options =============================
+//===========================================================================
+
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
+// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
+// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
+//
+// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! ***
+//
+// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING.
+// Example: To park the head outside the bed area when homing with G28.
+//
+// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
+//
+// For a servo-based Z probe, you must set up servo support below, including
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
+//
+// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
+// - Use 5V for powered (usu. inductive) sensors.
+// - Otherwise connect:
+// - normally-closed switches to GND and D32.
+// - normally-open switches to 5V and D32.
+//
+// Normally-closed switches are advised and are the default.
+//
+// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.)
+// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the
+// default pin for all RAMPS-based boards. Some other boards map differently.
+// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file.
+//
+// WARNING:
+// Setting the wrong pin may have unexpected and potentially disastrous consequences.
+// Use with caution and do your homework.
+//
+//#define Z_MIN_PROBE_ENDSTOP
+
+// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
+// The Z_MIN_PIN will then be used for both Z-homing and probing.
+#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+
+// To use a probe you must enable one of the two options above!
+
+// This option disables the use of the Z_MIN_PROBE_PIN
+// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a
+// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above.
+// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
+//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
+// :{0:'Low',1:'High'}
+#define X_ENABLE_ON 1
+#define Y_ENABLE_ON 1
+#define Z_ENABLE_ON 1
+#define E_ENABLE_ON 0 // For all extruders
+
+// Disables axis stepper immediately when it's not being used.
+// WARNING: When motors turn off there is a chance of losing position accuracy!
+#define DISABLE_X false
+#define DISABLE_Y false
+#define DISABLE_Z false
+// Warn on display about possibly reduced accuracy
+//#define DISABLE_REDUCED_ACCURACY_WARNING
+
+// @section extruder
+
+#define DISABLE_E false // For all extruders
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
+
+// @section machine
+
+// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
+#define INVERT_X_DIR false
+#define INVERT_Y_DIR true
+#define INVERT_Z_DIR false
+
+// @section extruder
+
+// For direct drive extruder v9 set to true, for geared extruder set to false.
+#define INVERT_E0_DIR false
+#define INVERT_E1_DIR false
+#define INVERT_E2_DIR false
+#define INVERT_E3_DIR false
+
+// @section homing
+
+//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
+ // Be sure you have this distance over your Z_MAX_POS in case.
+
+// ENDSTOP SETTINGS:
+// Sets direction of endstops when homing; 1=MAX, -1=MIN
+// :[-1,1]
+#define X_HOME_DIR -1
+#define Y_HOME_DIR -1
+#define Z_HOME_DIR -1
+
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
+#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
+
+// @section machine
+
+// Travel limits after homing (units are in mm)
+#define X_MIN_POS 0
+#define Y_MIN_POS 0
+#define Z_MIN_POS 0
+#define X_MAX_POS 435
+#define Y_MAX_POS 270
+#define Z_MAX_POS 400
+
+//===========================================================================
+//========================= Filament Runout Sensor ==========================
+//===========================================================================
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
+ // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
+ // It is assumed that when logic high = filament available
+ // when logic low = filament ran out
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
+ #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
+ #define FILAMENT_RUNOUT_SCRIPT "M600"
+#endif
+
+//===========================================================================
+//============================ Mesh Bed Leveling ============================
+//===========================================================================
+
+//#define MESH_BED_LEVELING // Enable mesh bed leveling.
+
+#if ENABLED(MESH_BED_LEVELING)
+ #define MESH_INSET 10 // Mesh inset margin on print area
+ #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited.
+ #define MESH_NUM_Y_POINTS 3
+ #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0.
+
+ //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
+
+ //#define MANUAL_BED_LEVELING // Add display menu option for bed leveling.
+
+ #if ENABLED(MANUAL_BED_LEVELING)
+ #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis.
+ #endif // MANUAL_BED_LEVELING
+
+#endif // MESH_BED_LEVELING
+
+//===========================================================================
+//============================ Bed Auto Leveling ============================
+//===========================================================================
+
+// @section bedlevel
+
+//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
+//#define DEBUG_LEVELING_FEATURE
+
+#if ENABLED(AUTO_BED_LEVELING_FEATURE)
+
+ // There are 2 different ways to specify probing locations:
+ //
+ // - "grid" mode
+ // Probe several points in a rectangular grid.
+ // You specify the rectangle and the density of sample points.
+ // This mode is preferred because there are more measurements.
+ //
+ // - "3-point" mode
+ // Probe 3 arbitrary points on the bed (that aren't collinear)
+ // You specify the XY coordinates of all 3 points.
+
+ // Enable this to sample the bed in a grid (least squares solution).
+ // Note: this feature generates 10KB extra code size.
+ #define AUTO_BED_LEVELING_GRID
+
+ #if ENABLED(AUTO_BED_LEVELING_GRID)
+
+ #define LEFT_PROBE_BED_POSITION 15
+ #define RIGHT_PROBE_BED_POSITION 170
+ #define FRONT_PROBE_BED_POSITION 20
+ #define BACK_PROBE_BED_POSITION 170
+
+ #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this.
+
+ // Set the number of grid points per dimension.
+ // You probably don't need more than 3 (squared=9).
+ #define AUTO_BED_LEVELING_GRID_POINTS 2
+
+ #else // !AUTO_BED_LEVELING_GRID
+
+ // Arbitrary points to probe.
+ // A simple cross-product is used to estimate the plane of the bed.
+ #define ABL_PROBE_PT_1_X 15
+ #define ABL_PROBE_PT_1_Y 180
+ #define ABL_PROBE_PT_2_X 15
+ #define ABL_PROBE_PT_2_Y 20
+ #define ABL_PROBE_PT_3_X 170
+ #define ABL_PROBE_PT_3_Y 20
+
+ #endif // !AUTO_BED_LEVELING_GRID
+
+ //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
+ // Useful to retract a deployable Z probe.
+
+ // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
+ // it is highly recommended you also enable Z_SAFE_HOMING below!
+
+#endif // AUTO_BED_LEVELING_FEATURE
+
+
+// @section homing
+
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
+
+// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
+//
+// With this feature enabled:
+//
+// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
+// - If stepper drivers time out, it will need X and Y homing again before Z homing.
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
+// - Prevent Z homing when the Z probe is outside bed area.
+//#define Z_SAFE_HOMING
+
+#if ENABLED(Z_SAFE_HOMING)
+ #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28).
+ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
+#endif
+
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (10*60)
+
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
+
+// default settings
+
+#define DEFAULT_AXIS_STEPS_PER_UNIT {71.128,71.128,640,152}
+#define DEFAULT_MAX_FEEDRATE {200,200,20,20} // (mm/sec)
+#define DEFAULT_MAX_ACCELERATION {1000,1000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 10000 // E acceleration in mm/s^2 for retracts
+#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
+
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
+#define DEFAULT_XYJERK 10.0 // (mm/sec)
+#define DEFAULT_ZJERK 0.4 // (mm/sec)
+#define DEFAULT_EJERK 5.0 // (mm/sec)
+
+
+//=============================================================================
+//============================= Additional Features ===========================
+//=============================================================================
+
+// @section extras
+
+//
+// EEPROM
+//
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
+// M500 - stores parameters in EEPROM
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
+// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
+//define this to enable EEPROM support
+//#define EEPROM_SETTINGS
+
+#if ENABLED(EEPROM_SETTINGS)
+ // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
+ #define EEPROM_CHITCHAT // Please keep turned on if you can.
+#endif
+
+//
+// Host Keepalive
+//
+// When enabled Marlin will send a busy status message to the host
+// every couple of seconds when it can't accept commands.
+//
+#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
+#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
+
+//
+// M100 Free Memory Watcher
+//
+//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
+// @section temperature
+
+// Preheat Constants
+#define PREHEAT_1_TEMP_HOTEND 190
+#define PREHEAT_1_TEMP_BED 50
+#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 110
+#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
+
+//
+// Print job timer
+//
+// Enable this option to automatically start and stop the
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
+//
+// In all cases the timer can be started and stopped using
+// the following commands:
+//
+// - M75 - Start the print job timer
+// - M76 - Pause the print job timer
+// - M77 - Stop the print job timer
+#define PRINTJOB_TIMER_AUTOSTART
+
+//
+// Print Counter
+//
+// When enabled Marlin will keep track of some print statistical data such as:
+// - Total print jobs
+// - Total successful print jobs
+// - Total failed print jobs
+// - Total time printing
+//
+// This information can be viewed by the M78 command.
+//#define PRINTCOUNTER
+
+//=============================================================================
+//============================= LCD and SD support ============================
+//=============================================================================
+
+// @section lcd
+
+//
+// LCD LANGUAGE
+//
+// Here you may choose the language used by Marlin on the LCD menus, the following
+// list of languages are available:
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
+//
+#define LCD_LANGUAGE en
+
+//
+// LCD Character Set
+//
+// Note: This option is NOT applicable to Graphical Displays.
+//
+// All character-based LCD's provide ASCII plus one of these
+// language extensions:
+//
+// - JAPANESE ... the most common
+// - WESTERN ... with more accented characters
+// - CYRILLIC ... for the Russian language
+//
+// To determine the language extension installed on your controller:
+//
+// - Compile and upload with LCD_LANGUAGE set to 'test'
+// - Click the controller to view the LCD menu
+// - The LCD will display Japanese, Western, or Cyrillic text
+//
+// See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
+//
+// :['JAPANESE','WESTERN','CYRILLIC']
+//
+#define DISPLAY_CHARSET_HD44780 JAPANESE
+
+//
+// LCD TYPE
+//
+// You may choose ULTRA_LCD if you have character based LCD with 16x2, 16x4, 20x2,
+// 20x4 char/lines or DOGLCD for the full graphics display with 128x64 pixels
+// (ST7565R family). (This option will be set automatically for certain displays.)
+//
+// IMPORTANT NOTE: The U8glib library is required for Full Graphic Display!
+// https://github.com/olikraus/U8glib_Arduino
+//
+//#define ULTRA_LCD // Character based
+//#define DOGLCD // Full graphics display
+
+//
+// SD CARD
+//
+// SD Card support is disabled by default. If your controller has an SD slot,
+// you must uncomment the following option or it won't work.
+//
+#define SDSUPPORT
+
+//
+// SD CARD: SPI SPEED
+//
+// Uncomment ONE of the following items to use a slower SPI transfer
+// speed. This is usually required if you're getting volume init errors.
+//
+//#define SPI_SPEED SPI_HALF_SPEED
+//#define SPI_SPEED SPI_QUARTER_SPEED
+//#define SPI_SPEED SPI_EIGHTH_SPEED
+
+//
+// SD CARD: ENABLE CRC
+//
+// Use CRC checks and retries on the SD communication.
+//
+//#define SD_CHECK_AND_RETRY
+
+//
+// ENCODER SETTINGS
+//
+// This option overrides the default number of encoder pulses needed to
+// produce one step. Should be increased for high-resolution encoders.
+//
+#define ENCODER_PULSES_PER_STEP 2
+
+//
+// Use this option to override the number of step signals required to
+// move between next/prev menu items.
+//
+#define ENCODER_STEPS_PER_MENU_ITEM 1
+
+/**
+ * Encoder Direction Options
+ *
+ * Test your encoder's behavior first with both options disabled.
+ *
+ * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION.
+ * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION.
+ * Reversed Value Editing only? Enable BOTH options.
+ */
+
+//
+// This option reverses the encoder direction everywhere
+//
+// Set this option if CLOCKWISE causes values to DECREASE
+//
+//#define REVERSE_ENCODER_DIRECTION
+
+//
+// This option reverses the encoder direction for navigating LCD menus.
+//
+// If CLOCKWISE normally moves DOWN this makes it go UP.
+// If CLOCKWISE normally moves UP this makes it go DOWN.
+//
+//#define REVERSE_MENU_DIRECTION
+
+//
+// Individual Axis Homing
+//
+// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
+//
+//#define INDIVIDUAL_AXIS_HOMING_MENU
+
+//
+// SPEAKER/BUZZER
+//
+// If you have a speaker that can produce tones, enable it here.
+// By default Marlin assumes you have a buzzer with a fixed frequency.
+//
+#define SPEAKER
+
+//
+// The duration and frequency for the UI feedback sound.
+// Set these to 0 to disable audio feedback in the LCD menus.
+//
+// Note: Test audio output with the G-Code:
+// M300 S P
+//
+#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
+#define LCD_FEEDBACK_FREQUENCY_HZ 1000
+
+//
+// CONTROLLER TYPE: Standard
+//
+// Marlin supports a wide variety of controllers.
+// Enable one of the following options to specify your controller.
+//
+
+//
+// ULTIMAKER Controller.
+//
+//#define ULTIMAKERCONTROLLER
+
+//
+// ULTIPANEL as seen on Thingiverse.
+//
+//#define ULTIPANEL
+
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+#define CARTESIO_UI
+
+//
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
+// http://reprap.org/wiki/PanelOne
+//
+//#define PANEL_ONE
+
+//
+// MaKr3d Makr-Panel with graphic controller and SD support.
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
+//
+//#define MAKRPANEL
+
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
+//
+// Activate one of these if you have a Panucatt Devices
+// Viki 2.0 or mini Viki with Graphic LCD
+// http://panucatt.com
+//
+//#define VIKI2
+//#define miniVIKI
+
+//
+// Adafruit ST7565 Full Graphic Controller.
+// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/
+//
+//#define ELB_FULL_GRAPHIC_CONTROLLER
+
+//
+// RepRapDiscount Smart Controller.
+// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
+//
+// Note: Usually sold with a white PCB.
+//
+//#define REPRAP_DISCOUNT_SMART_CONTROLLER
+
+//
+// GADGETS3D G3D LCD/SD Controller
+// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
+//
+// Note: Usually sold with a blue PCB.
+//
+//#define G3D_PANEL
+
+//
+// RepRapDiscount FULL GRAPHIC Smart Controller
+// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
+//
+//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+
+//
+// MakerLab Mini Panel with graphic
+// controller and SD support - http://reprap.org/wiki/Mini_panel
+//
+//#define MINIPANEL
+
+//
+// RepRapWorld REPRAPWORLD_KEYPAD v1.1
+// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
+//
+// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key
+// is pressed, a value of 10.0 means 10mm per click.
+//
+#define REPRAPWORLD_KEYPAD
+#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+
+//
+// RigidBot Panel V1.0
+// http://www.inventapart.com/
+//
+//#define RIGIDBOT_PANEL
+
+//
+// BQ LCD Smart Controller shipped by
+// default with the BQ Hephestos 2 and Witbox 2.
+//
+//#define BQ_LCD_SMART_CONTROLLER
+
+//
+// CONTROLLER TYPE: I2C
+//
+// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C
+// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C
+//
+
+//
+// Elefu RA Board Control Panel
+// http://www.elefu.com/index.php?route=product/product&product_id=53
+//
+//#define RA_CONTROL_PANEL
+
+//
+// Sainsmart YW Robot (LCM1602) LCD Display
+//
+//#define LCD_I2C_SAINSMART_YWROBOT
+
+//
+// Generic LCM1602 LCD adapter
+//
+//#define LCM1602
+
+//
+// PANELOLU2 LCD with status LEDs,
+// separate encoder and click inputs.
+//
+// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later.
+// For more info: https://github.com/lincomatic/LiquidTWI2
+//
+// Note: The PANELOLU2 encoder click input can either be directly connected to
+// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
+//
+//#define LCD_I2C_PANELOLU2
+
+//
+// Panucatt VIKI LCD with status LEDs,
+// integrated click & L/R/U/D buttons, separate encoder inputs.
+//
+//#define LCD_I2C_VIKI
+
+//
+// SSD1306 OLED full graphics generic display
+//
+//#define U8GLIB_SSD1306
+
+//
+// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
+//#define SAV_3DGLCD
+#if ENABLED(SAV_3DGLCD)
+ //#define U8GLIB_SSD1306
+ #define U8GLIB_SH1106
+#endif
+
+//
+// CONTROLLER TYPE: Shift register panels
+//
+// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH
+// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD
+//
+//#define SAV_3DLCD
+
+//=============================================================================
+//=============================== Extra Features ==============================
+//=============================================================================
+
+// @section extras
+
+// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
+//#define FAST_PWM_FAN
+
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
+// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
+// is too low, you should also increment SOFT_PWM_SCALE.
+//#define FAN_SOFT_PWM
+
+// Incrementing this by 1 will double the software PWM frequency,
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
+// However, control resolution will be halved for each increment;
+// at zero value, there are 128 effective control positions.
+#define SOFT_PWM_SCALE 0
+
+// Temperature status LEDs that display the hotend and bed temperature.
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
+// Otherwise the RED led is on. There is 1C hysteresis.
+#define TEMP_STAT_LEDS
+
+// M240 Triggers a camera by emulating a Canon RC-1 Remote
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
+//#define PHOTOGRAPH_PIN 23
+
+// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure
+//#define SF_ARC_FIX
+
+// Support for the BariCUDA Paste Extruder.
+//#define BARICUDA
+
+//define BlinkM/CyzRgb Support
+//#define BLINKM
+
+/*********************************************************************\
+* R/C SERVO support
+* Sponsored by TrinityLabs, Reworked by codexmas
+**********************************************************************/
+
+// Number of servos
+//
+// If you select a configuration below, this will receive a default value and does not need to be set manually
+// set it manually if you have more servos than extruders and wish to manually control some
+// leaving it undefined or defining as 0 will disable the servo subsystem
+// If unsure, leave commented / disabled
+//
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
+
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
+
+// Servo deactivation
+//
+// With this option servos are powered only during movement, then turned off to prevent jitter.
+//#define DEACTIVATE_SERVOS_AFTER_MOVE
+
+/**********************************************************************\
+ * Support for a filament diameter sensor
+ * Also allows adjustment of diameter at print time (vs at slicing)
+ * Single extruder only at this point (extruder 0)
+ *
+ * Motherboards
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector
+ * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E)
+ * 301 - Rambo - uses Analog input 3
+ * Note may require analog pins to be defined for different motherboards
+ **********************************************************************/
+// Uncomment below to enable
+//#define FILAMENT_WIDTH_SENSOR
+
+#define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation
+
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
+ #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2)
+ #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel
+
+ #define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm
+ #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm
+ #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM)
+
+ #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially
+
+ //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec.
+ //#define FILAMENT_LCD_DISPLAY
+#endif
+
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h
new file mode 100644
index 000000000..3e10c3f85
--- /dev/null
+++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h
@@ -0,0 +1,799 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Configuration_adv.h
+ *
+ * Advanced settings.
+ * Only change these if you know exactly what you're doing.
+ * Some of these settings can damage your printer if improperly set!
+ *
+ * Basic settings can be found in Configuration.h
+ *
+ */
+#ifndef CONFIGURATION_ADV_H
+#define CONFIGURATION_ADV_H
+
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
+
+// @section temperature
+
+//===========================================================================
+//=============================Thermal Settings ============================
+//===========================================================================
+
+#if DISABLED(PIDTEMPBED)
+ #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control
+ #if ENABLED(BED_LIMIT_SWITCHING)
+ #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
+ #endif
+#endif
+
+/**
+ * Thermal Protection protects your printer from damage and fire if a
+ * thermistor falls out or temperature sensors fail in any way.
+ *
+ * The issue: If a thermistor falls out or a temperature sensor fails,
+ * Marlin can no longer sense the actual temperature. Since a disconnected
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
+ *
+ * The solution: Once the temperature reaches the target, start observing.
+ * If the temperature stays too far below the target (hysteresis) for too long (period),
+ * the firmware will halt the machine as a safety precaution.
+ *
+ * If you get false positives for "Thermal Runaway" increase THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
+ */
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
+ #define THERMAL_PROTECTION_PERIOD 40 // Seconds
+ #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
+
+ /**
+ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
+ * WATCH_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
+ * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
+ * but only if the current temperature is far enough below the target for a reliable test.
+ *
+ * If you get false positives for "Heating failed" increase WATCH_TEMP_PERIOD and/or decrease WATCH_TEMP_INCREASE
+ * WATCH_TEMP_INCREASE should not be below 2.
+ */
+ #define WATCH_TEMP_PERIOD 20 // Seconds
+ #define WATCH_TEMP_INCREASE 2 // Degrees Celsius
+#endif
+
+/**
+ * Thermal Protection parameters for the bed are just as above for hotends.
+ */
+#if ENABLED(THERMAL_PROTECTION_BED)
+ #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
+ #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
+
+ /**
+ * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
+ * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
+ * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
+ * but only if the current temperature is far enough below the target for a reliable test.
+ *
+ * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
+ * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
+ */
+ #define WATCH_BED_TEMP_PERIOD 60 // Seconds
+ #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
+#endif
+
+#if ENABLED(PIDTEMP)
+ // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
+ // if Kc is chosen well, the additional required power due to increased melting should be compensated.
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
+ #define LPQ_MAX_LEN 50
+ #endif
+#endif
+
+/**
+ * Automatic Temperature:
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
+ * The maximum buffered steps/sec of the extruder motor is called "se".
+ * Start autotemp mode with M109 S B F
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
+ * mintemp and maxtemp. Turn this off by executing M109 without F*
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
+ */
+#define AUTOTEMP
+#if ENABLED(AUTOTEMP)
+ #define AUTOTEMP_OLDWEIGHT 0.98
+#endif
+
+//Show Temperature ADC value
+//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
+//#define SHOW_TEMP_ADC_VALUES
+
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
+// @section extruder
+
+// extruder run-out prevention.
+//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
+//#define EXTRUDER_RUNOUT_PREVENT
+#define EXTRUDER_RUNOUT_MINTEMP 190
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
+#define EXTRUDER_RUNOUT_EXTRUDE 100
+
+// @section temperature
+
+//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements.
+//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET"
+#define TEMP_SENSOR_AD595_OFFSET 3.0
+#define TEMP_SENSOR_AD595_GAIN 2.0
+
+//This is for controlling a fan to cool down the stepper drivers
+//it will turn on when any driver is enabled
+//and turn off after the set amount of seconds from last driver being disabled again
+#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
+#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
+#define CONTROLLERFAN_SPEED 255 // == full speed
+
+// When first starting the main fan, run it at full speed for the
+// given number of milliseconds. This gets the fan spinning reliably
+// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
+//#define FAN_KICKSTART_TIME 100
+
+// This defines the minimal speed for the main fan, run in PWM mode
+// to enable uncomment and set minimal PWM speed for reliable running (1-255)
+// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM
+//#define FAN_MIN_PWM 50
+
+// @section extruder
+
+// Extruder cooling fans
+// Configure fan pin outputs to automatically turn on/off when the associated
+// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
+// Multiple extruders can be assigned to the same pin in which case
+// the fan will turn on when any selected extruder is above the threshold.
+#define EXTRUDER_0_AUTO_FAN_PIN 7
+#define EXTRUDER_1_AUTO_FAN_PIN 7
+#define EXTRUDER_2_AUTO_FAN_PIN -1
+#define EXTRUDER_3_AUTO_FAN_PIN -1
+#define EXTRUDER_AUTO_FAN_TEMPERATURE 35
+#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
+
+//===========================================================================
+//============================ Mechanical Settings ==========================
+//===========================================================================
+
+// @section homing
+
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
+
+// @section extras
+
+//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
+// A single Z stepper driver is usually used to drive 2 stepper motors.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
+//#define Z_DUAL_STEPPER_DRIVERS
+
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
+
+ // 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.
+ // That way the machine is capable to align the bed during home, since both Z steppers are homed.
+ // There is also an implementation of M666 (software endstops adjustment) to this feature.
+ // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed.
+ // 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.
+ // 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.
+ // Play a little bit with small adjustments (0.5mm) and check the behaviour.
+ // The M119 (endstops report) will start reporting the Z2 Endstop as well.
+
+ //#define Z_DUAL_ENDSTOPS
+
+ #if ENABLED(Z_DUAL_ENDSTOPS)
+ #define Z2_USE_ENDSTOP _XMAX_
+ #endif
+
+#endif // Z_DUAL_STEPPER_DRIVERS
+
+// Enable this for dual x-carriage printers.
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
+// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug.
+//#define DUAL_X_CARRIAGE
+#if ENABLED(DUAL_X_CARRIAGE)
+ // Configuration for second X-carriage
+ // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
+ // the second x-carriage always homes to the maximum endstop.
+ #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
+ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
+ #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
+ #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
+ // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
+ // without modifying the firmware (through the "M218 T1 X???" command).
+ // Remember: you should set the second extruder x-offset to 0 in your slicer.
+
+ // There are a few selectable movement modes for dual x-carriages using M605 S
+ // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
+ // as long as it supports dual x-carriages. (M605 S0)
+ // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
+ // that additional slicer support is not required. (M605 S1)
+ // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
+ // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
+ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
+
+ // This is the default power-up mode which can be later using M605.
+ #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
+
+ // Default settings in "Auto-park Mode"
+ #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder
+ #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder
+
+ // Default x offset in duplication mode (typically set to half print bed width)
+ #define DEFAULT_DUPLICATION_X_OFFSET 100
+
+#endif //DUAL_X_CARRIAGE
+
+// @section homing
+
+//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
+#define X_HOME_BUMP_MM 5
+#define Y_HOME_BUMP_MM 5
+#define Z_HOME_BUMP_MM 2
+#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate)
+//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
+
+// When G28 is called, this option will make Y home before X
+#define HOME_Y_BEFORE_X
+
+// @section machine
+
+#define AXIS_RELATIVE_MODES {false, false, false, false}
+
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+#define INVERT_X_STEP_PIN false
+#define INVERT_Y_STEP_PIN false
+#define INVERT_Z_STEP_PIN false
+#define INVERT_E_STEP_PIN false
+
+// Default stepper release if idle. Set to 0 to deactivate.
+// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true.
+// Time can be set by M18 and M84.
+#define DEFAULT_STEPPER_DEACTIVE_TIME 120
+#define DISABLE_INACTIVE_X true
+#define DISABLE_INACTIVE_Y true
+#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished.
+#define DISABLE_INACTIVE_E true
+
+#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
+#define DEFAULT_MINTRAVELFEEDRATE 0.0
+
+// @section lcd
+
+#if ENABLED(ULTIPANEL)
+ #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
+ #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder
+#endif
+
+// @section extras
+
+// minimum time in microseconds that a movement needs to take if the buffer is emptied.
+#define DEFAULT_MINSEGMENTTIME 20000
+
+// If defined the movements slow down when the look ahead buffer is only half full
+#define SLOWDOWN
+
+// Frequency limit
+// See nophead's blog for more info
+// Not working O
+//#define XY_FREQUENCY_LIMIT 15
+
+// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
+// of the buffer and all stops. This should not be much greater than zero and should only be changed
+// if unwanted behavior is observed on a user's machine when running at very slow speeds.
+#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
+
+// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
+#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
+
+// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
+#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
+
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
+
+// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
+//#define DIGIPOT_I2C
+// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
+#define DIGIPOT_I2C_NUM_CHANNELS 8
+// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
+#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
+
+//===========================================================================
+//=============================Additional Features===========================
+//===========================================================================
+
+#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
+#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
+#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
+
+//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
+#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
+
+// @section lcd
+
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
+#if ENABLED(SDSUPPORT)
+
+ // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
+ // around this by connecting a push button or single throw switch to the pin defined
+ // as SD_DETECT_PIN in your board's pins definitions.
+ // This setting should be disabled unless you are using a push button, pulling the pin to ground.
+ // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER).
+ #define SD_DETECT_INVERTED
+
+ #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
+ #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
+
+ #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order.
+ // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
+ // using:
+ //#define MENU_ADDAUTOSTART
+
+ // Show a progress bar on HD44780 LCDs for SD printing
+ //#define LCD_PROGRESS_BAR
+
+ #if ENABLED(LCD_PROGRESS_BAR)
+ // Amount of time (ms) to show the bar
+ #define PROGRESS_BAR_BAR_TIME 2000
+ // Amount of time (ms) to show the status message
+ #define PROGRESS_BAR_MSG_TIME 3000
+ // Amount of time (ms) to retain the status message (0=forever)
+ #define PROGRESS_MSG_EXPIRE 0
+ // Enable this to show messages for MSG_TIME then hide them
+ //#define PROGRESS_MSG_ONCE
+ #endif
+
+ // This allows hosts to request long names for files and folders with M33
+ //#define LONG_FILENAME_HOST_SUPPORT
+
+ // This option allows you to abort SD printing when any endstop is triggered.
+ // This feature must be enabled with "M540 S1" or from the LCD menu.
+ // To have any effect, endstops must be enabled during SD printing.
+ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
+
+#endif // SDSUPPORT
+
+// for dogm lcd displays you can choose some additional fonts:
+#if ENABLED(DOGLCD)
+ // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
+ // we don't have a big font for Cyrillic, Kana
+ //#define USE_BIG_EDIT_FONT
+
+ // If you have spare 2300Byte of progmem and want to use a
+ // smaller font on the Info-screen uncomment the next line.
+ //#define USE_SMALL_INFOFONT
+#endif // DOGLCD
+
+// @section safety
+
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
+#define USE_WATCHDOG
+
+#if ENABLED(USE_WATCHDOG)
+ // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
+ // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
+ // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
+ //#define WATCHDOG_RESET_MANUAL
+#endif
+
+// @section lcd
+
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
+// it can e.g. be used to change z-positions in the print startup phase in real-time
+// does not respect endstops!
+//#define BABYSTEPPING
+#if ENABLED(BABYSTEPPING)
+ #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions
+ //not implemented for deltabots!
+ #define BABYSTEP_INVERT_Z false //true for inverse movements in Z
+ #define BABYSTEP_MULTIPLICATOR 1 //faster movements
+#endif
+
+// @section extruder
+
+// extruder advance constant (s2/mm3)
+//
+// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
+//
+// Hooke's law says: force = k * distance
+// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant
+// so: v ^ 2 is proportional to number of steps we advance the extruder
+//#define ADVANCE
+
+#if ENABLED(ADVANCE)
+ #define EXTRUDER_ADVANCE_K .0
+ #define D_FILAMENT 2.85
+#endif
+
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
+// @section leveling
+
+// Default mesh area is an area with an inset margin on the print area.
+// Below are the macros that are used to define the borders for the mesh area,
+// made available here for specialized needs, ie dual extruder setup.
+#if ENABLED(MESH_BED_LEVELING)
+ #define MESH_MIN_X (X_MIN_POS + MESH_INSET)
+ #define MESH_MAX_X (X_MAX_POS - (MESH_INSET))
+ #define MESH_MIN_Y (Y_MIN_POS + MESH_INSET)
+ #define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET))
+#endif
+
+// @section extras
+
+// Arc interpretation settings:
+#define ARC_SUPPORT // Disabling this saves ~2738 bytes
+#define MM_PER_ARC_SEGMENT 1
+#define N_ARC_CORRECTION 25
+
+// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
+//#define BEZIER_CURVE_SUPPORT
+
+const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement
+
+// @section temperature
+
+// Control heater 0 and heater 1 in parallel.
+//#define HEATERS_PARALLEL
+
+//===========================================================================
+//================================= Buffers =================================
+//===========================================================================
+
+// @section hidden
+
+// The number of linear motions that can be in the plan at any give time.
+// 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.
+#if ENABLED(SDSUPPORT)
+ #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
+#else
+ #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
+#endif
+
+// @section serial
+
+// The ASCII buffer for serial input
+#define MAX_CMD_SIZE 96
+#define BUFSIZE 4
+
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
+// Bad Serial-connections can miss a received command by sending an 'ok'
+// Therefore some clients abort after 30 seconds in a timeout.
+// Some other clients start sending commands while receiving a 'wait'.
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
+//#define NO_TIMEOUTS 1000 // Milliseconds
+
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
+//#define ADVANCED_OK
+
+// @section fwretract
+
+// Firmware based and LCD controlled retract
+// M207 and M208 can be used to define parameters for the retraction.
+// The retraction can be called by the slicer using G10 and G11
+// until then, intended retractions can be detected by moves that only extrude and the direction.
+// the moves are than replaced by the firmware controlled ones.
+
+//#define FWRETRACT //ONLY PARTIALLY TESTED
+#if ENABLED(FWRETRACT)
+ #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
+ #define RETRACT_LENGTH 3 //default retract length (positive mm)
+ #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change
+ #define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s)
+ #define RETRACT_ZLIFT 0 //default retract Z-lift
+ #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
+ #define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change)
+ #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s)
+#endif
+
+// Add support for experimental filament exchange support M600; requires display
+#if ENABLED(ULTIPANEL)
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 30 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 10 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 1 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ //#define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
+ #endif
+#endif
+
+/******************************************************************************\
+ * enable this section if you have TMC26X motor drivers.
+ * you need to import the TMC26XStepper library into the Arduino IDE for this
+ ******************************************************************************/
+
+// @section tmc
+
+//#define HAVE_TMCDRIVER
+#if ENABLED(HAVE_TMCDRIVER)
+
+ //#define X_IS_TMC
+ #define X_MAX_CURRENT 1000 //in mA
+ #define X_SENSE_RESISTOR 91 //in mOhms
+ #define X_MICROSTEPS 16 //number of microsteps
+
+ //#define X2_IS_TMC
+ #define X2_MAX_CURRENT 1000 //in mA
+ #define X2_SENSE_RESISTOR 91 //in mOhms
+ #define X2_MICROSTEPS 16 //number of microsteps
+
+ //#define Y_IS_TMC
+ #define Y_MAX_CURRENT 1000 //in mA
+ #define Y_SENSE_RESISTOR 91 //in mOhms
+ #define Y_MICROSTEPS 16 //number of microsteps
+
+ //#define Y2_IS_TMC
+ #define Y2_MAX_CURRENT 1000 //in mA
+ #define Y2_SENSE_RESISTOR 91 //in mOhms
+ #define Y2_MICROSTEPS 16 //number of microsteps
+
+ //#define Z_IS_TMC
+ #define Z_MAX_CURRENT 1000 //in mA
+ #define Z_SENSE_RESISTOR 91 //in mOhms
+ #define Z_MICROSTEPS 16 //number of microsteps
+
+ //#define Z2_IS_TMC
+ #define Z2_MAX_CURRENT 1000 //in mA
+ #define Z2_SENSE_RESISTOR 91 //in mOhms
+ #define Z2_MICROSTEPS 16 //number of microsteps
+
+ //#define E0_IS_TMC
+ #define E0_MAX_CURRENT 1000 //in mA
+ #define E0_SENSE_RESISTOR 91 //in mOhms
+ #define E0_MICROSTEPS 16 //number of microsteps
+
+ //#define E1_IS_TMC
+ #define E1_MAX_CURRENT 1000 //in mA
+ #define E1_SENSE_RESISTOR 91 //in mOhms
+ #define E1_MICROSTEPS 16 //number of microsteps
+
+ //#define E2_IS_TMC
+ #define E2_MAX_CURRENT 1000 //in mA
+ #define E2_SENSE_RESISTOR 91 //in mOhms
+ #define E2_MICROSTEPS 16 //number of microsteps
+
+ //#define E3_IS_TMC
+ #define E3_MAX_CURRENT 1000 //in mA
+ #define E3_SENSE_RESISTOR 91 //in mOhms
+ #define E3_MICROSTEPS 16 //number of microsteps
+
+#endif
+
+/******************************************************************************\
+ * enable this section if you have L6470 motor drivers.
+ * you need to import the L6470 library into the Arduino IDE for this
+ ******************************************************************************/
+
+// @section l6470
+
+//#define HAVE_L6470DRIVER
+#if ENABLED(HAVE_L6470DRIVER)
+
+ //#define X_IS_L6470
+ #define X_MICROSTEPS 16 //number of microsteps
+ #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define X2_IS_L6470
+ #define X2_MICROSTEPS 16 //number of microsteps
+ #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define Y_IS_L6470
+ #define Y_MICROSTEPS 16 //number of microsteps
+ #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define Y2_IS_L6470
+ #define Y2_MICROSTEPS 16 //number of microsteps
+ #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define Z_IS_L6470
+ #define Z_MICROSTEPS 16 //number of microsteps
+ #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define Z2_IS_L6470
+ #define Z2_MICROSTEPS 16 //number of microsteps
+ #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define E0_IS_L6470
+ #define E0_MICROSTEPS 16 //number of microsteps
+ #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define E1_IS_L6470
+ #define E1_MICROSTEPS 16 //number of microsteps
+ #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define E2_IS_L6470
+ #define E2_MICROSTEPS 16 //number of microsteps
+ #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define E3_IS_L6470
+ #define E3_MICROSTEPS 16 //number of microsteps
+ #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+#endif
+
+/**
+ * TWI/I2C BUS
+ *
+ * This feature is an EXPERIMENTAL feature so it shall not be used on production
+ * machines. Enabling this will allow you to send and receive I2C data from slave
+ * devices on the bus.
+ *
+ * ; Example #1
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
+ * ; It uses multiple M155 commands with one B arg
+ * M155 A99 ; Target slave address
+ * M155 B77 ; M
+ * M155 B97 ; a
+ * M155 B114 ; r
+ * M155 B108 ; l
+ * M155 B105 ; i
+ * M155 B110 ; n
+ * M155 S1 ; Send the current buffer
+ *
+ * ; Example #2
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
+ *
+ * ; Example #3
+ * ; Example serial output of a M156 request
+ * echo:i2c-reply: from:99 bytes:5 data:hello
+ */
+
+// @section i2cbus
+
+//#define EXPERIMENTAL_I2CBUS
+
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/Cartesio/_Bootscreen.h b/Marlin/example_configurations/Cartesio/_Bootscreen.h
new file mode 100644
index 000000000..a365caee7
--- /dev/null
+++ b/Marlin/example_configurations/Cartesio/_Bootscreen.h
@@ -0,0 +1,103 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Custom Bitmap for splashscreen
+ *
+ * You may use one of the following tools to generate the C++ bitmap array from
+ * a black and white image:
+ *
+ * - http://www.marlinfw.org/tools/u8glib/converter.html
+ * - http://www.digole.com/tools/PicturetoC_Hex_converter.php
+ */
+#include
+
+#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
+#define CUSTOM_BOOTSCREEN_BMPWIDTH 63
+#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
+
+const unsigned char custom_start_bmp[512] PROGMEM = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00,
+ 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+ 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
+ 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
+ 0x00, 0x0f, 0x07, 0x87, 0xff, 0xff, 0xe0, 0x00,
+ 0x00, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x00,
+ 0x01, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80,
+ 0x03, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80,
+ 0x07, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xc0,
+ 0x07, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0,
+ 0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0,
+ 0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0,
+ 0x1f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0,
+ 0x1f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf0,
+ 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8,
+ 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8,
+ 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8,
+ 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf8,
+ 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc,
+ 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc,
+ 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc,
+ 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc,
+ 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
+ 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
+ 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
+ 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
+ 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
+ 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc,
+ 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc,
+ 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc,
+ 0x3f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8,
+ 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8,
+ 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8,
+ 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8,
+ 0x1f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0,
+ 0x1f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0,
+ 0x1f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0,
+ 0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0,
+ 0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xc0,
+ 0x07, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xc0,
+ 0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x80,
+ 0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x00,
+ 0x01, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00,
+ 0x00, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00,
+ 0x00, 0x0f, 0xff, 0xff, 0xc3, 0xc1, 0xe0, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
+ 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
+ 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00,
+ 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00,
+ 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h
index 39e5ce4e3..95a414580 100644
--- a/Marlin/example_configurations/Felix/Configuration.h
+++ b/Marlin/example_configurations/Felix/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -366,18 +402,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -389,7 +486,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -422,6 +519,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -458,6 +570,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -489,7 +602,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -523,8 +636,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -567,58 +683,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -627,18 +696,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -646,7 +711,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -655,14 +720,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (4*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -685,18 +750,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -728,22 +781,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -776,8 +914,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
//#define LCD_LANGUAGE en
@@ -924,6 +1064,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -936,6 +1082,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -986,7 +1138,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1046,7 +1198,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1081,7 +1235,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1113,28 +1267,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1165,7 +1307,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h
index 36c6fcd71..570073579 100644
--- a/Marlin/example_configurations/Felix/Configuration_adv.h
+++ b/Marlin/example_configurations/Felix/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -351,6 +402,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h
index 107f8386c..49ce86a76 100644
--- a/Marlin/example_configurations/Felix/DUAL/Configuration.h
+++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 1
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -364,18 +400,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -387,7 +484,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -420,6 +517,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -456,6 +568,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -487,7 +600,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -521,8 +634,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -565,58 +681,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -625,18 +694,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -644,7 +709,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -653,14 +718,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (4*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -683,18 +748,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -726,22 +779,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -774,8 +912,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
//#define LCD_LANGUAGE en
@@ -922,6 +1062,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -934,6 +1080,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -984,7 +1136,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1044,7 +1196,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1079,7 +1233,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1111,28 +1265,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1163,7 +1305,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h
index 5b41fb397..478d5c755 100644
--- a/Marlin/example_configurations/Hephestos/Configuration.h
+++ b/Marlin/example_configurations/Hephestos/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -126,17 +142,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -171,6 +210,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -187,7 +227,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -226,10 +266,6 @@
#define HEATER_3_MAXTEMP 260
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -244,8 +280,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -376,18 +412,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -399,7 +496,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -432,6 +529,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -468,6 +580,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -499,7 +612,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -533,8 +646,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -577,58 +693,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -637,18 +706,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -656,7 +721,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -665,14 +730,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY 2000
+#define HOMING_FEEDRATE_Z 150
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {2000, 2000, 150, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -694,18 +759,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -737,22 +790,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 200
-#define PLA_PREHEAT_HPB_TEMP 0
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 200
+#define PREHEAT_1_TEMP_BED 0
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 220
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 220
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -785,8 +923,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
//#define LCD_LANGUAGE en
@@ -933,6 +1073,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -945,6 +1091,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -995,7 +1147,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1055,7 +1207,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1090,7 +1244,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1122,28 +1276,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1174,7 +1316,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h
index 50e8ba28f..b719e6072 100644
--- a/Marlin/example_configurations/Hephestos/Configuration_adv.h
+++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-//#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -351,6 +402,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 1.75
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h
index 3f6f4b644..bb4b483be 100644
--- a/Marlin/example_configurations/Hephestos_2/Configuration.h
+++ b/Marlin/example_configurations/Hephestos_2/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "@jbrazio" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 70
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -208,24 +248,20 @@
// The minimal temperature defines the temperature below which the heater will not be enabled It is used
// to check that the wiring to the thermistor is not broken.
// Otherwise this would lead to the heater being powered on all the time.
-#define HEATER_0_MINTEMP 5
-#define HEATER_1_MINTEMP 5
-#define HEATER_2_MINTEMP 5
-#define HEATER_3_MINTEMP 5
-#define BED_MINTEMP 5
+#define HEATER_0_MINTEMP 15
+//#define HEATER_1_MINTEMP 5
+//#define HEATER_2_MINTEMP 5
+//#define HEATER_3_MINTEMP 5
+//#define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off.
// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
// You should use MINTEMP for thermistor short/failure protection.
#define HEATER_0_MAXTEMP 250
-#define HEATER_1_MAXTEMP 275
-#define HEATER_2_MAXTEMP 275
-#define HEATER_3_MAXTEMP 275
-#define BED_MAXTEMP 150
-
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
+//#define HEATER_1_MAXTEMP 275
+//#define HEATER_2_MAXTEMP 275
+//#define HEATER_3_MAXTEMP 275
+//#define BED_MAXTEMP 150
//===========================================================================
//============================= PID Settings ================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 250 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -280,7 +316,7 @@
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
-#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
+//#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
#if ENABLED(PIDTEMPBED)
@@ -331,7 +367,7 @@
*/
#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
-#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
+//#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
//===========================================================================
//============================= Mechanical Settings =========================
@@ -378,18 +414,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -401,7 +498,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -434,6 +531,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 5 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 2 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -2
+#define Z_PROBE_OFFSET_RANGE_MAX 0
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -470,6 +582,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
#define MIN_Z_HEIGHT_FOR_HOMING 5 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -480,8 +593,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1
-#define min_software_endstops false // If true, axis won't move to coordinates less than HOME_POS.
-#define max_software_endstops false // If true, axis won't move to coordinates greater than the defined lengths below.
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
+#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
// @section machine
@@ -501,7 +614,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -535,8 +648,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -579,58 +695,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X ((X_MIN_POS + X_MAX_POS) / 2)
#define ABL_PROBE_PT_3_Y Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 5 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 2 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 5 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- #define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -639,18 +708,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -658,7 +723,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
#define Z_SAFE_HOMING
@@ -667,47 +732,35 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (150*60)
+#define HOMING_FEEDRATE_Z 200
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {150*60, 150*60, 3.3*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
-#define DEFAULT_AXIS_STEPS_PER_UNIT {160, 160, 8000, 204.146} // default steps per unit for Ultimaker
-#define DEFAULT_MAX_FEEDRATE {200, 200, 3.3, 200} // (mm/sec)
-#define DEFAULT_MAX_ACCELERATION {1000, 1000, 100, 3000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+#define DEFAULT_AXIS_STEPS_PER_UNIT {160, 160, 8000, 210.02} // Steps per unit
+#define DEFAULT_MAX_FEEDRATE {250, 250, 2, 200} // mm/sec
+#define DEFAULT_MAX_ACCELERATION {1000, 1000, 20, 1000} // X, Y, Z, E max start speed for accelerated moves
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts
#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
-#define DEFAULT_XYJERK 15.0 // (mm/sec)
-#define DEFAULT_ZJERK 0.4 // (mm/sec)
-#define DEFAULT_EJERK 2.0 // (mm/sec)
+#define DEFAULT_XYJERK 20.0 // (mm/sec)
+#define DEFAULT_ZJERK 0.4 // (mm/sec)
+#define DEFAULT_EJERK 2.0 // (mm/sec)
//=============================================================================
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -5
- #define Z_PROBE_OFFSET_RANGE_MAX 0
- #endif
-#endif
-
// @section extras
//
@@ -739,22 +792,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 210
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 210
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 110
+#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 110
-#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -774,7 +912,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// - Total time printing
//
// This information can be viewed by the M78 command.
-//#define PRINTCOUNTER
+#define PRINTCOUNTER
//=============================================================================
//============================= LCD and SD support ============================
@@ -787,8 +925,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -852,7 +992,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Use CRC checks and retries on the SD communication.
//
-//#define SD_CHECK_AND_RETRY
+#define SD_CHECK_AND_RETRY
//
// ENCODER SETTINGS
@@ -935,6 +1075,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -947,6 +1093,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -997,7 +1149,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1057,7 +1209,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1092,7 +1246,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1124,28 +1278,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1176,7 +1318,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h
index 2fe4d660c..eeb11da2d 100644
--- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h
+++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -273,13 +321,16 @@
//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
// When G28 is called, this option will make Y home before X
-//#define HOME_Y_BEFORE_X
+#define HOME_Y_BEFORE_X
// @section machine
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -288,7 +339,7 @@
// Default stepper release if idle. Set to 0 to deactivate.
// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true.
// Time can be set by M18 and M84.
-#define DEFAULT_STEPPER_DEACTIVE_TIME 60
+#define DEFAULT_STEPPER_DEACTIVE_TIME 120
#define DISABLE_INACTIVE_X true
#define DISABLE_INACTIVE_Y true
#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished.
@@ -320,7 +371,7 @@
// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
// of the buffer and all stops. This should not be much greater than zero and should only be changed
// if unwanted behavior is observed on a user's machine when running at very slow speeds.
-#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
+#define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec)
// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
@@ -342,15 +393,18 @@
//=============================Additional Features===========================
//===========================================================================
-#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
-#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
-#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
+//#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
+//#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
+//#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
-#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
+//#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -361,7 +415,7 @@
#define SD_DETECT_INVERTED
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
- #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
+ #define SD_FINISHED_RELEASECOMMAND "M104 S0\nM84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order.
// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/Hephestos_2/readme.md b/Marlin/example_configurations/Hephestos_2/README.md
similarity index 55%
rename from Marlin/example_configurations/Hephestos_2/readme.md
rename to Marlin/example_configurations/Hephestos_2/README.md
index 19521705f..8fcb53c3d 100644
--- a/Marlin/example_configurations/Hephestos_2/readme.md
+++ b/Marlin/example_configurations/Hephestos_2/README.md
@@ -5,4 +5,10 @@ NOTE: The look and feel of the Hephestos 2 while navigating the LCD menu will ch
## Changelog
* 2016/03/01 - Initial release
- * 2016/03/21 - Activated four point auto leveling by default; updated miscellaneous z-probe values
+ * 2016/03/21 - Activated 4-point auto leveling by default
+ Updated miscellaneous z-probe values
+ * 2016/06/21 - Disabled hot bed related options
+ Activated software endstops
+ SD printing now disables the heater when finished
+ * 2016/07/13 - Update the `DEFAULT_AXIS_STEPS_PER_UNIT` for the Z axis
+ Increased the `DEFAULT_XYJERK`
diff --git a/Marlin/example_configurations/Hephestos_2/_Bootscreen.h b/Marlin/example_configurations/Hephestos_2/_Bootscreen.h
new file mode 100644
index 000000000..981926422
--- /dev/null
+++ b/Marlin/example_configurations/Hephestos_2/_Bootscreen.h
@@ -0,0 +1,103 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Custom Bitmap for splashscreen
+ *
+ * You may use one of the following tools to generate the C++ bitmap array from
+ * a black and white image:
+ *
+ * - http://www.marlinfw.org/tools/u8glib/converter.html
+ * - http://www.digole.com/tools/PicturetoC_Hex_converter.php
+ */
+#include
+
+#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
+#define CUSTOM_BOOTSCREEN_BMPWIDTH 62
+#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
+
+const unsigned char custom_start_bmp[512] PROGMEM = {
+ 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0xc0, 0x0f, 0xf0, 0x07, 0x80, 0x00,
+ 0x00, 0x07, 0xe0, 0x07, 0xe0, 0x0f, 0xc0, 0x00,
+ 0x00, 0x0f, 0xf0, 0x03, 0xc0, 0x1f, 0xe0, 0x00,
+ 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
+ 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
+ 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
+ 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
+ 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
+ 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x1f, 0xe0, 0x00,
+ 0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x00,
+ 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0x80, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x1e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+ 0x3f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+ 0x7f, 0x80, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+ 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+ 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+ 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+ 0xff, 0xc0, 0x00, 0x00, 0xf7, 0xc0, 0x1f, 0x80,
+ 0xff, 0xc0, 0x00, 0x00, 0xff, 0xf0, 0x7f, 0xc0,
+ 0x7f, 0x80, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xe0,
+ 0x3f, 0x00, 0x00, 0x00, 0xfc, 0xf8, 0xf0, 0xf8,
+ 0x1e, 0x00, 0x00, 0x00, 0xf8, 0x7d, 0xe0, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0xf8, 0x79, 0xf0, 0xf8,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xf8,
+ 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x7f, 0xf8,
+ 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x3f, 0xf8,
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x0e, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
+};
diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h
index 4b74fe505..1a740067c 100644
--- a/Marlin/example_configurations/K8200/Configuration.h
+++ b/Marlin/example_configurations/K8200/Configuration.h
@@ -45,8 +45,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -80,20 +90,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(K8200, @CONSULitAS)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -130,17 +146,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -175,6 +214,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -191,7 +231,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 5
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -230,10 +270,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -248,8 +284,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -401,18 +437,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -424,7 +521,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -457,6 +554,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -493,6 +605,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR true
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -524,7 +637,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -558,8 +671,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -602,58 +718,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -662,18 +731,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -681,7 +746,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -690,14 +755,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (4*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -719,18 +784,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -762,22 +815,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 190
-#define PLA_PREHEAT_HPB_TEMP 50 // K8200: set back to 70 if you have an upgraded heatbed power supply
-#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 190
+#define PREHEAT_1_TEMP_BED 50 // K8200: set back to 70 if you have an upgraded heatbed power supply
+#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 60 // K8200: set back to 110 if you have an upgraded heatbed power supply
+#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 60 // K8200: set back to 110 if you have an upgraded heatbed power supply
-#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -810,8 +948,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -958,6 +1098,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -970,6 +1116,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1020,7 +1172,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1080,7 +1232,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1115,7 +1269,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1147,28 +1301,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1199,7 +1341,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h
index 296ecd2d6..dc26fd603 100644
--- a/Marlin/example_configurations/K8200/Configuration_adv.h
+++ b/Marlin/example_configurations/K8200/Configuration_adv.h
@@ -39,7 +39,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -108,8 +119,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -134,15 +145,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -183,24 +221,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -222,14 +278,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -243,7 +291,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -285,7 +333,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -357,6 +408,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -394,7 +448,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -410,9 +463,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -451,6 +505,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -494,12 +557,27 @@ const unsigned int dropsegments = 2; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 32 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -531,16 +609,30 @@ const unsigned int dropsegments = 2; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -686,9 +778,9 @@ const unsigned int dropsegments = 2; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -698,19 +790,16 @@ const unsigned int dropsegments = 2; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/K8200/readme.md b/Marlin/example_configurations/K8200/README.md
similarity index 100%
rename from Marlin/example_configurations/K8200/readme.md
rename to Marlin/example_configurations/K8200/README.md
diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h
new file mode 100644
index 000000000..c525b2203
--- /dev/null
+++ b/Marlin/example_configurations/K8400/Configuration.h
@@ -0,0 +1,1327 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Configuration.h
+ *
+ * Basic settings such as:
+ *
+ * - Type of electronics
+ * - Type of temperature sensor
+ * - Printer geometry
+ * - Endstop configuration
+ * - LCD controller
+ * - Extra features
+ *
+ * Advanced settings can be found in Configuration_adv.h
+ *
+ */
+#ifndef CONFIGURATION_H
+#define CONFIGURATION_H
+
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
+
+//===========================================================================
+//============================= Getting Started =============================
+//===========================================================================
+
+/**
+ * Here are some standard links for getting your machine calibrated:
+ *
+ * http://reprap.org/wiki/Calibration
+ * http://youtu.be/wAL9d7FgInk
+ * http://calculator.josefprusa.cz
+ * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
+ * http://www.thingiverse.com/thing:5573
+ * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
+ * http://www.thingiverse.com/thing:298812
+ */
+
+//===========================================================================
+//============================= DELTA Printer ===============================
+//===========================================================================
+// For a Delta printer replace the configuration files with the files in the
+// example_configurations/delta directory.
+//
+
+//===========================================================================
+//============================= SCARA Printer ===============================
+//===========================================================================
+// For a Scara printer replace the configuration files with the files in the
+// example_configurations/SCARA directory.
+//
+
+// @section info
+
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
+// build by the user have been successfully uploaded into firmware.
+#define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes.
+#define SHOW_BOOTSCREEN
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
+// @section machine
+
+// SERIAL_PORT selects which serial port should be used for communication with the host.
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
+// :[0,1,2,3,4,5,6,7]
+#define SERIAL_PORT 0
+
+// This determines the communication speed of the printer
+// :[2400,9600,19200,38400,57600,115200,250000]
+#define BAUDRATE 250000
+
+// Enable the Bluetooth serial interface on AT90USB devices
+//#define BLUETOOTH
+
+// The following define selects which electronics board you have.
+// Please choose the name from boards.h that matches your setup
+#ifndef MOTHERBOARD
+ #define MOTHERBOARD BOARD_K8400
+#endif
+
+// Optional custom name for your RepStrap or other custom machine
+// Displayed in the LCD "Ready" message
+//#define CUSTOM_MACHINE_NAME "3D Printer"
+
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
+//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
+
+// This defines the number of extruders
+// :[1,2,3,4]
+#define EXTRUDERS 1
+
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
+//#define SINGLENOZZLE
+
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
+// For the other hotends it is their distance from the extruder 0 hotend.
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+
+//// The following define selects which power supply you have. Please choose the one that matches your setup
+// 1 = ATX
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
+// :{1:'ATX',2:'X-Box 360'}
+#define POWER_SUPPLY 1
+
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
+//#define PS_DEFAULT_OFF
+
+// @section temperature
+
+//===========================================================================
+//============================= Thermal Settings ============================
+//===========================================================================
+//
+//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
+//
+//// Temperature sensor settings:
+// -3 is thermocouple with MAX31855 (only for sensor 0)
+// -2 is thermocouple with MAX6675 (only for sensor 0)
+// -1 is thermocouple with AD595
+// 0 is not used
+// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
+// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
+// 3 is Mendel-parts thermistor (4.7k pullup)
+// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
+// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
+// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
+// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
+// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
+// 10 is 100k RS thermistor 198-961 (4.7k pullup)
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
+// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
+// 70 is the 100K thermistor found in the bq Hephestos 2
+//
+// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
+// (but gives greater accuracy and more stable PID)
+// 51 is 100k thermistor - EPCOS (1k pullup)
+// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
+//
+// 1047 is Pt1000 with 4k7 pullup
+// 1010 is Pt1000 with 1k pullup (non standard)
+// 147 is Pt100 with 4k7 pullup
+// 110 is Pt100 with 1k pullup (non standard)
+// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below.
+// Use it for Testing or Development purposes. NEVER for production machine.
+//#define DUMMY_THERMISTOR_998_VALUE 25
+//#define DUMMY_THERMISTOR_999_VALUE 100
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
+#define TEMP_SENSOR_0 5
+#define TEMP_SENSOR_1 0
+#define TEMP_SENSOR_2 0
+#define TEMP_SENSOR_3 0
+#define TEMP_SENSOR_BED 0
+
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
+//#define TEMP_SENSOR_1_AS_REDUNDANT
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
+
+// Extruder temperature must be close to target for this long before M109 returns success
+#define TEMP_RESIDENCY_TIME 2 // (seconds)
+#define TEMP_HYSTERESIS 5 // (degC) range of +/- temperatures considered "close" to the target one
+#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
+
+// Bed temperature must be close to target for this long before M190 returns success
+#define TEMP_BED_RESIDENCY_TIME 10 // (seconds)
+#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one
+#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
+
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
+// to check that the wiring to the thermistor is not broken.
+// Otherwise this would lead to the heater being powered on all the time.
+#define HEATER_0_MINTEMP 5
+#define HEATER_1_MINTEMP 5
+#define HEATER_2_MINTEMP 5
+#define HEATER_3_MINTEMP 5
+#define BED_MINTEMP 5
+
+// When temperature exceeds max temp, your heater will be switched off.
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
+// You should use MINTEMP for thermistor short/failure protection.
+#define HEATER_0_MAXTEMP 275
+#define HEATER_1_MAXTEMP 275
+#define HEATER_2_MAXTEMP 275
+#define HEATER_3_MAXTEMP 275
+#define BED_MAXTEMP 150
+
+//===========================================================================
+//============================= PID Settings ================================
+//===========================================================================
+// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
+
+// Comment the following line to disable PID and enable bang-bang.
+#define PIDTEMP
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
+#if ENABLED(PIDTEMP)
+ //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
+ //#define PID_DEBUG // Sends debug data to the serial port.
+ //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
+ //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
+ #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
+ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
+ #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
+ #define K1 0.95 //smoothing factor within the PID
+
+ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
+ // Ultimaker
+ //#define DEFAULT_Kp 22.2
+ //#define DEFAULT_Ki 1.08
+ //#define DEFAULT_Kd 114
+
+ // MakerGear
+ //#define DEFAULT_Kp 7.0
+ //#define DEFAULT_Ki 0.1
+ //#define DEFAULT_Kd 12
+
+ // Mendel Parts V9 on 12V
+ #define DEFAULT_Kp 63.0
+ #define DEFAULT_Ki 2.25
+ #define DEFAULT_Kd 440
+
+#endif // PIDTEMP
+
+//===========================================================================
+//============================= PID > Bed Temperature Control ===============
+//===========================================================================
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
+//
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
+// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz,
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
+// shouldn't use bed PID until someone else verifies your hardware works.
+// If this is enabled, find your own PID constants below.
+//#define PIDTEMPBED
+
+//#define BED_LIMIT_SWITCHING
+
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
+// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
+
+#if ENABLED(PIDTEMPBED)
+
+ //#define PID_BED_DEBUG // Sends debug data to the serial port.
+
+ #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
+
+ //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
+ //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
+ #define DEFAULT_bedKp 10.00
+ #define DEFAULT_bedKi .023
+ #define DEFAULT_bedKd 305.4
+
+ //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
+ //from pidautotune
+ //#define DEFAULT_bedKp 97.1
+ //#define DEFAULT_bedKi 1.41
+ //#define DEFAULT_bedKd 1675.16
+
+ // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
+#endif // PIDTEMPBED
+
+// @section extruder
+
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
+//can be software-disabled for whatever purposes by
+#define PREVENT_DANGEROUS_EXTRUDE
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
+#define PREVENT_LENGTHY_EXTRUDE
+
+#define EXTRUDE_MINTEMP 160
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
+
+//===========================================================================
+//======================== Thermal Runaway Protection =======================
+//===========================================================================
+
+/**
+ * Thermal Protection protects your printer from damage and fire if a
+ * thermistor falls out or temperature sensors fail in any way.
+ *
+ * The issue: If a thermistor falls out or a temperature sensor fails,
+ * Marlin can no longer sense the actual temperature. Since a disconnected
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
+ *
+ * If you get "Thermal Runaway" or "Heating failed" errors the
+ * details can be tuned in Configuration_adv.h
+ */
+
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
+#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
+
+//===========================================================================
+//============================= Mechanical Settings =========================
+//===========================================================================
+
+// @section machine
+
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
+//#define COREXY
+//#define COREXZ
+//#define COREYZ
+
+// Enable this option for Toshiba steppers
+//#define CONFIG_STEPPERS_TOSHIBA
+
+//===========================================================================
+//============================== Endstop Settings ===========================
+//===========================================================================
+
+// @section homing
+
+// Specify here all the endstop connectors that are connected to any endstop or probe.
+// Almost all printers will be using one per axis. Probes will use one or more of the
+// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
+#define USE_XMIN_PLUG
+#define USE_YMIN_PLUG
+#define USE_ZMIN_PLUG
+//#define USE_XMAX_PLUG
+//#define USE_YMAX_PLUG
+//#define USE_ZMAX_PLUG
+
+// coarse Endstop Settings
+#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
+
+#if DISABLED(ENDSTOPPULLUPS)
+ // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
+ //#define ENDSTOPPULLUP_XMAX
+ //#define ENDSTOPPULLUP_YMAX
+ //#define ENDSTOPPULLUP_ZMAX
+ //#define ENDSTOPPULLUP_XMIN
+ //#define ENDSTOPPULLUP_YMIN
+ //#define ENDSTOPPULLUP_ZMIN
+ //#define ENDSTOPPULLUP_ZMIN_PROBE
+#endif
+
+// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+
+//===========================================================================
+//============================= Z Probe Options =============================
+//===========================================================================
+
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
+// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
+// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
+//
+// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! ***
+//
+// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING.
+// Example: To park the head outside the bed area when homing with G28.
+//
+// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
+//
+// For a servo-based Z probe, you must set up servo support below, including
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
+//
+// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
+// - Use 5V for powered (usu. inductive) sensors.
+// - Otherwise connect:
+// - normally-closed switches to GND and D32.
+// - normally-open switches to 5V and D32.
+//
+// Normally-closed switches are advised and are the default.
+//
+// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.)
+// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the
+// default pin for all RAMPS-based boards. Some other boards map differently.
+// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file.
+//
+// WARNING:
+// Setting the wrong pin may have unexpected and potentially disastrous consequences.
+// Use with caution and do your homework.
+//
+//#define Z_MIN_PROBE_ENDSTOP
+
+// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
+// The Z_MIN_PIN will then be used for both Z-homing and probing.
+#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+
+// To use a probe you must enable one of the two options above!
+
+// This option disables the use of the Z_MIN_PROBE_PIN
+// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a
+// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above.
+// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
+//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
+// :{0:'Low',1:'High'}
+#define X_ENABLE_ON 0
+#define Y_ENABLE_ON 0
+#define Z_ENABLE_ON 0
+#define E_ENABLE_ON 0 // For all extruders
+
+// Disables axis stepper immediately when it's not being used.
+// WARNING: When motors turn off there is a chance of losing position accuracy!
+#define DISABLE_X false
+#define DISABLE_Y false
+#define DISABLE_Z false
+// Warn on display about possibly reduced accuracy
+//#define DISABLE_REDUCED_ACCURACY_WARNING
+
+// @section extruder
+
+#define DISABLE_E false // For all extruders
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
+
+// @section machine
+
+// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
+#define INVERT_X_DIR false
+#define INVERT_Y_DIR true
+#define INVERT_Z_DIR true
+
+// @section extruder
+
+// For direct drive extruder v9 set to true, for geared extruder set to false.
+#define INVERT_E0_DIR false
+#define INVERT_E1_DIR true
+#define INVERT_E2_DIR false
+#define INVERT_E3_DIR false
+
+// @section homing
+
+//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
+ // Be sure you have this distance over your Z_MAX_POS in case.
+
+// ENDSTOP SETTINGS:
+// Sets direction of endstops when homing; 1=MAX, -1=MIN
+// :[-1,1]
+#define X_HOME_DIR -1
+#define Y_HOME_DIR -1
+#define Z_HOME_DIR -1
+
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
+#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
+
+// @section machine
+
+// Travel limits after homing (units are in mm)
+#define X_MIN_POS 0
+#define Y_MIN_POS 20
+#define Z_MIN_POS 0
+#define X_MAX_POS 200
+#define Y_MAX_POS 200
+#define Z_MAX_POS 190
+
+//===========================================================================
+//========================= Filament Runout Sensor ==========================
+//===========================================================================
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
+ // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
+ // It is assumed that when logic high = filament available
+ // when logic low = filament ran out
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
+ #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
+ #define FILAMENT_RUNOUT_SCRIPT "M600"
+#endif
+
+//===========================================================================
+//============================ Mesh Bed Leveling ============================
+//===========================================================================
+
+//#define MESH_BED_LEVELING // Enable mesh bed leveling.
+
+#if ENABLED(MESH_BED_LEVELING)
+ #define MESH_INSET 10 // Mesh inset margin on print area
+ #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited.
+ #define MESH_NUM_Y_POINTS 3
+ #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0.
+
+ //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
+
+ //#define MANUAL_BED_LEVELING // Add display menu option for bed leveling.
+
+ #if ENABLED(MANUAL_BED_LEVELING)
+ #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis.
+ #endif // MANUAL_BED_LEVELING
+
+#endif // MESH_BED_LEVELING
+
+//===========================================================================
+//============================ Bed Auto Leveling ============================
+//===========================================================================
+
+// @section bedlevel
+
+//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
+//#define DEBUG_LEVELING_FEATURE
+
+#if ENABLED(AUTO_BED_LEVELING_FEATURE)
+
+ // There are 2 different ways to specify probing locations:
+ //
+ // - "grid" mode
+ // Probe several points in a rectangular grid.
+ // You specify the rectangle and the density of sample points.
+ // This mode is preferred because there are more measurements.
+ //
+ // - "3-point" mode
+ // Probe 3 arbitrary points on the bed (that aren't collinear)
+ // You specify the XY coordinates of all 3 points.
+
+ // Enable this to sample the bed in a grid (least squares solution).
+ // Note: this feature generates 10KB extra code size.
+ #define AUTO_BED_LEVELING_GRID
+
+ #if ENABLED(AUTO_BED_LEVELING_GRID)
+
+ #define LEFT_PROBE_BED_POSITION 15
+ #define RIGHT_PROBE_BED_POSITION 170
+ #define FRONT_PROBE_BED_POSITION 20
+ #define BACK_PROBE_BED_POSITION 170
+
+ #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this.
+
+ // Set the number of grid points per dimension.
+ // You probably don't need more than 3 (squared=9).
+ #define AUTO_BED_LEVELING_GRID_POINTS 2
+
+ #else // !AUTO_BED_LEVELING_GRID
+
+ // Arbitrary points to probe.
+ // A simple cross-product is used to estimate the plane of the bed.
+ #define ABL_PROBE_PT_1_X 15
+ #define ABL_PROBE_PT_1_Y 180
+ #define ABL_PROBE_PT_2_X 15
+ #define ABL_PROBE_PT_2_Y 20
+ #define ABL_PROBE_PT_3_X 170
+ #define ABL_PROBE_PT_3_Y 20
+
+ #endif // !AUTO_BED_LEVELING_GRID
+
+ //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
+ // Useful to retract a deployable Z probe.
+
+ // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
+ // it is highly recommended you also enable Z_SAFE_HOMING below!
+
+#endif // AUTO_BED_LEVELING_FEATURE
+
+
+// @section homing
+
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
+
+// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
+//
+// With this feature enabled:
+//
+// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
+// - If stepper drivers time out, it will need X and Y homing again before Z homing.
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
+// - Prevent Z homing when the Z probe is outside bed area.
+//#define Z_SAFE_HOMING
+
+#if ENABLED(Z_SAFE_HOMING)
+ #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28).
+ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
+#endif
+
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (8*60)
+
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
+
+// default settings
+
+#define DEFAULT_AXIS_STEPS_PER_UNIT {134.74,134.74,4266.66,148.7} // default steps per unit for Ultimaker
+#define DEFAULT_MAX_FEEDRATE {160, 160, 10, 10000} // (mm/sec)
+#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 6000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 6000 // E acceleration in mm/s^2 for retracts
+#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
+
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
+#define DEFAULT_XYJERK 10.0 // (mm/sec)
+#define DEFAULT_ZJERK 0.5 // (mm/sec)
+#define DEFAULT_EJERK 20.0 // (mm/sec)
+
+
+//=============================================================================
+//============================= Additional Features ===========================
+//=============================================================================
+
+// @section extras
+
+//
+// EEPROM
+//
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
+// M500 - stores parameters in EEPROM
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
+// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
+//define this to enable EEPROM support
+#define EEPROM_SETTINGS
+
+#if ENABLED(EEPROM_SETTINGS)
+ // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
+ #define EEPROM_CHITCHAT // Please keep turned on if you can.
+#endif
+
+//
+// Host Keepalive
+//
+// When enabled Marlin will send a busy status message to the host
+// every couple of seconds when it can't accept commands.
+//
+#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
+#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
+
+//
+// M100 Free Memory Watcher
+//
+//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
+// @section temperature
+
+// Preheat Constants
+#define PREHEAT_1_TEMP_HOTEND 210
+#define PREHEAT_1_TEMP_BED 0
+#define PREHEAT_1_FAN_SPEED 165 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 245
+#define PREHEAT_2_TEMP_BED 0
+#define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
+
+//
+// Print job timer
+//
+// Enable this option to automatically start and stop the
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
+//
+// In all cases the timer can be started and stopped using
+// the following commands:
+//
+// - M75 - Start the print job timer
+// - M76 - Pause the print job timer
+// - M77 - Stop the print job timer
+#define PRINTJOB_TIMER_AUTOSTART
+
+//
+// Print Counter
+//
+// When enabled Marlin will keep track of some print statistical data such as:
+// - Total print jobs
+// - Total successful print jobs
+// - Total failed print jobs
+// - Total time printing
+//
+// This information can be viewed by the M78 command.
+//#define PRINTCOUNTER
+
+//=============================================================================
+//============================= LCD and SD support ============================
+//=============================================================================
+
+// @section lcd
+
+//
+// LCD LANGUAGE
+//
+// Here you may choose the language used by Marlin on the LCD menus, the following
+// list of languages are available:
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
+//
+#define LCD_LANGUAGE en
+
+//
+// LCD Character Set
+//
+// Note: This option is NOT applicable to Graphical Displays.
+//
+// All character-based LCD's provide ASCII plus one of these
+// language extensions:
+//
+// - JAPANESE ... the most common
+// - WESTERN ... with more accented characters
+// - CYRILLIC ... for the Russian language
+//
+// To determine the language extension installed on your controller:
+//
+// - Compile and upload with LCD_LANGUAGE set to 'test'
+// - Click the controller to view the LCD menu
+// - The LCD will display Japanese, Western, or Cyrillic text
+//
+// See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
+//
+// :['JAPANESE','WESTERN','CYRILLIC']
+//
+#define DISPLAY_CHARSET_HD44780 JAPANESE
+
+//
+// LCD TYPE
+//
+// You may choose ULTRA_LCD if you have character based LCD with 16x2, 16x4, 20x2,
+// 20x4 char/lines or DOGLCD for the full graphics display with 128x64 pixels
+// (ST7565R family). (This option will be set automatically for certain displays.)
+//
+// IMPORTANT NOTE: The U8glib library is required for Full Graphic Display!
+// https://github.com/olikraus/U8glib_Arduino
+//
+#define ULTRA_LCD // Character based
+//#define DOGLCD // Full graphics display
+
+//
+// SD CARD
+//
+// SD Card support is disabled by default. If your controller has an SD slot,
+// you must uncomment the following option or it won't work.
+//
+#define SDSUPPORT
+
+//
+// SD CARD: SPI SPEED
+//
+// Uncomment ONE of the following items to use a slower SPI transfer
+// speed. This is usually required if you're getting volume init errors.
+//
+//#define SPI_SPEED SPI_HALF_SPEED
+//#define SPI_SPEED SPI_QUARTER_SPEED
+//#define SPI_SPEED SPI_EIGHTH_SPEED
+
+//
+// SD CARD: ENABLE CRC
+//
+// Use CRC checks and retries on the SD communication.
+//
+//#define SD_CHECK_AND_RETRY
+
+//
+// ENCODER SETTINGS
+//
+// This option overrides the default number of encoder pulses needed to
+// produce one step. Should be increased for high-resolution encoders.
+//
+#define ENCODER_PULSES_PER_STEP 4
+
+//
+// Use this option to override the number of step signals required to
+// move between next/prev menu items.
+//
+#define ENCODER_STEPS_PER_MENU_ITEM 1
+
+/**
+ * Encoder Direction Options
+ *
+ * Test your encoder's behavior first with both options disabled.
+ *
+ * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION.
+ * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION.
+ * Reversed Value Editing only? Enable BOTH options.
+ */
+
+//
+// This option reverses the encoder direction everywhere
+//
+// Set this option if CLOCKWISE causes values to DECREASE
+//
+//#define REVERSE_ENCODER_DIRECTION
+
+//
+// This option reverses the encoder direction for navigating LCD menus.
+//
+// If CLOCKWISE normally moves DOWN this makes it go UP.
+// If CLOCKWISE normally moves UP this makes it go DOWN.
+//
+#define REVERSE_MENU_DIRECTION
+
+//
+// Individual Axis Homing
+//
+// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
+//
+//#define INDIVIDUAL_AXIS_HOMING_MENU
+
+//
+// SPEAKER/BUZZER
+//
+// If you have a speaker that can produce tones, enable it here.
+// By default Marlin assumes you have a buzzer with a fixed frequency.
+//
+//#define SPEAKER
+
+//
+// The duration and frequency for the UI feedback sound.
+// Set these to 0 to disable audio feedback in the LCD menus.
+//
+// Note: Test audio output with the G-Code:
+// M300 S P
+//
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000
+
+//
+// CONTROLLER TYPE: Standard
+//
+// Marlin supports a wide variety of controllers.
+// Enable one of the following options to specify your controller.
+//
+
+//
+// ULTIMAKER Controller.
+//
+#define ULTIMAKERCONTROLLER
+
+//
+// ULTIPANEL as seen on Thingiverse.
+//
+//#define ULTIPANEL
+
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
+//
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
+// http://reprap.org/wiki/PanelOne
+//
+//#define PANEL_ONE
+
+//
+// MaKr3d Makr-Panel with graphic controller and SD support.
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
+//
+//#define MAKRPANEL
+
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
+//
+// Activate one of these if you have a Panucatt Devices
+// Viki 2.0 or mini Viki with Graphic LCD
+// http://panucatt.com
+//
+//#define VIKI2
+//#define miniVIKI
+
+//
+// Adafruit ST7565 Full Graphic Controller.
+// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/
+//
+//#define ELB_FULL_GRAPHIC_CONTROLLER
+
+//
+// RepRapDiscount Smart Controller.
+// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
+//
+// Note: Usually sold with a white PCB.
+//
+//#define REPRAP_DISCOUNT_SMART_CONTROLLER
+
+//
+// GADGETS3D G3D LCD/SD Controller
+// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
+//
+// Note: Usually sold with a blue PCB.
+//
+//#define G3D_PANEL
+
+//
+// RepRapDiscount FULL GRAPHIC Smart Controller
+// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
+//
+//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+
+//
+// MakerLab Mini Panel with graphic
+// controller and SD support - http://reprap.org/wiki/Mini_panel
+//
+//#define MINIPANEL
+
+//
+// RepRapWorld REPRAPWORLD_KEYPAD v1.1
+// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
+//
+// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key
+// is pressed, a value of 10.0 means 10mm per click.
+//
+//#define REPRAPWORLD_KEYPAD
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+
+//
+// RigidBot Panel V1.0
+// http://www.inventapart.com/
+//
+//#define RIGIDBOT_PANEL
+
+//
+// BQ LCD Smart Controller shipped by
+// default with the BQ Hephestos 2 and Witbox 2.
+//
+//#define BQ_LCD_SMART_CONTROLLER
+
+//
+// CONTROLLER TYPE: I2C
+//
+// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C
+// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C
+//
+
+//
+// Elefu RA Board Control Panel
+// http://www.elefu.com/index.php?route=product/product&product_id=53
+//
+//#define RA_CONTROL_PANEL
+
+//
+// Sainsmart YW Robot (LCM1602) LCD Display
+//
+//#define LCD_I2C_SAINSMART_YWROBOT
+
+//
+// Generic LCM1602 LCD adapter
+//
+//#define LCM1602
+
+//
+// PANELOLU2 LCD with status LEDs,
+// separate encoder and click inputs.
+//
+// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later.
+// For more info: https://github.com/lincomatic/LiquidTWI2
+//
+// Note: The PANELOLU2 encoder click input can either be directly connected to
+// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
+//
+//#define LCD_I2C_PANELOLU2
+
+//
+// Panucatt VIKI LCD with status LEDs,
+// integrated click & L/R/U/D buttons, separate encoder inputs.
+//
+//#define LCD_I2C_VIKI
+
+//
+// SSD1306 OLED full graphics generic display
+//
+//#define U8GLIB_SSD1306
+
+//
+// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
+//#define SAV_3DGLCD
+#if ENABLED(SAV_3DGLCD)
+ //#define U8GLIB_SSD1306
+ #define U8GLIB_SH1106
+#endif
+
+//
+// CONTROLLER TYPE: Shift register panels
+//
+// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH
+// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD
+//
+//#define SAV_3DLCD
+
+//=============================================================================
+//=============================== Extra Features ==============================
+//=============================================================================
+
+// @section extras
+
+// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
+//#define FAST_PWM_FAN
+
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
+// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
+// is too low, you should also increment SOFT_PWM_SCALE.
+//#define FAN_SOFT_PWM
+
+// Incrementing this by 1 will double the software PWM frequency,
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
+// However, control resolution will be halved for each increment;
+// at zero value, there are 128 effective control positions.
+#define SOFT_PWM_SCALE 0
+
+// Temperature status LEDs that display the hotend and bed temperature.
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
+// Otherwise the RED led is on. There is 1C hysteresis.
+//#define TEMP_STAT_LEDS
+
+// M240 Triggers a camera by emulating a Canon RC-1 Remote
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
+//#define PHOTOGRAPH_PIN 23
+
+// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure
+//#define SF_ARC_FIX
+
+// Support for the BariCUDA Paste Extruder.
+//#define BARICUDA
+
+//define BlinkM/CyzRgb Support
+//#define BLINKM
+
+/*********************************************************************\
+* R/C SERVO support
+* Sponsored by TrinityLabs, Reworked by codexmas
+**********************************************************************/
+
+// Number of servos
+//
+// If you select a configuration below, this will receive a default value and does not need to be set manually
+// set it manually if you have more servos than extruders and wish to manually control some
+// leaving it undefined or defining as 0 will disable the servo subsystem
+// If unsure, leave commented / disabled
+//
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
+
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
+
+// Servo deactivation
+//
+// With this option servos are powered only during movement, then turned off to prevent jitter.
+//#define DEACTIVATE_SERVOS_AFTER_MOVE
+
+/**********************************************************************\
+ * Support for a filament diameter sensor
+ * Also allows adjustment of diameter at print time (vs at slicing)
+ * Single extruder only at this point (extruder 0)
+ *
+ * Motherboards
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector
+ * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E)
+ * 301 - Rambo - uses Analog input 3
+ * Note may require analog pins to be defined for different motherboards
+ **********************************************************************/
+// Uncomment below to enable
+//#define FILAMENT_WIDTH_SENSOR
+
+#define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation
+
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
+ #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2)
+ #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel
+
+ #define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm
+ #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm
+ #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM)
+
+ #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially
+
+ //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec.
+ //#define FILAMENT_LCD_DISPLAY
+#endif
+
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h
new file mode 100644
index 000000000..64efac984
--- /dev/null
+++ b/Marlin/example_configurations/K8400/Configuration_adv.h
@@ -0,0 +1,799 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Configuration_adv.h
+ *
+ * Advanced settings.
+ * Only change these if you know exactly what you're doing.
+ * Some of these settings can damage your printer if improperly set!
+ *
+ * Basic settings can be found in Configuration.h
+ *
+ */
+#ifndef CONFIGURATION_ADV_H
+#define CONFIGURATION_ADV_H
+
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
+
+// @section temperature
+
+//===========================================================================
+//=============================Thermal Settings ============================
+//===========================================================================
+
+#if DISABLED(PIDTEMPBED)
+ #define BED_CHECK_INTERVAL 1000 // ms between checks in bang-bang control
+ #if ENABLED(BED_LIMIT_SWITCHING)
+ #define BED_HYSTERESIS 1 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
+ #endif
+#endif
+
+/**
+ * Thermal Protection protects your printer from damage and fire if a
+ * thermistor falls out or temperature sensors fail in any way.
+ *
+ * The issue: If a thermistor falls out or a temperature sensor fails,
+ * Marlin can no longer sense the actual temperature. Since a disconnected
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
+ *
+ * The solution: Once the temperature reaches the target, start observing.
+ * If the temperature stays too far below the target (hysteresis) for too long (period),
+ * the firmware will halt the machine as a safety precaution.
+ *
+ * If you get false positives for "Thermal Runaway" increase THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
+ */
+#if ENABLED(THERMAL_PROTECTION_HOTENDS)
+ #define THERMAL_PROTECTION_PERIOD 40 // Seconds
+ #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
+
+ /**
+ * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
+ * WATCH_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
+ * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
+ * but only if the current temperature is far enough below the target for a reliable test.
+ *
+ * If you get false positives for "Heating failed" increase WATCH_TEMP_PERIOD and/or decrease WATCH_TEMP_INCREASE
+ * WATCH_TEMP_INCREASE should not be below 2.
+ */
+ #define WATCH_TEMP_PERIOD 20 // Seconds
+ #define WATCH_TEMP_INCREASE 2 // Degrees Celsius
+#endif
+
+/**
+ * Thermal Protection parameters for the bed are just as above for hotends.
+ */
+#if ENABLED(THERMAL_PROTECTION_BED)
+ #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
+ #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
+
+ /**
+ * Whenever an M140 or M190 increases the target temperature the firmware will wait for the
+ * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
+ * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
+ * but only if the current temperature is far enough below the target for a reliable test.
+ *
+ * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
+ * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
+ */
+ #define WATCH_BED_TEMP_PERIOD 60 // Seconds
+ #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
+#endif
+
+#if ENABLED(PIDTEMP)
+ // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
+ // if Kc is chosen well, the additional required power due to increased melting should be compensated.
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
+ #define LPQ_MAX_LEN 50
+ #endif
+#endif
+
+/**
+ * Automatic Temperature:
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
+ * The maximum buffered steps/sec of the extruder motor is called "se".
+ * Start autotemp mode with M109 S B F
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
+ * mintemp and maxtemp. Turn this off by executing M109 without F*
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
+ */
+#define AUTOTEMP
+#if ENABLED(AUTOTEMP)
+ #define AUTOTEMP_OLDWEIGHT 0.98
+#endif
+
+//Show Temperature ADC value
+//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
+//#define SHOW_TEMP_ADC_VALUES
+
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
+// @section extruder
+
+// extruder run-out prevention.
+//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
+//#define EXTRUDER_RUNOUT_PREVENT
+#define EXTRUDER_RUNOUT_MINTEMP 190
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
+#define EXTRUDER_RUNOUT_EXTRUDE 100
+
+// @section temperature
+
+//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements.
+//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET"
+#define TEMP_SENSOR_AD595_OFFSET 0.0
+#define TEMP_SENSOR_AD595_GAIN 1.0
+
+//This is for controlling a fan to cool down the stepper drivers
+//it will turn on when any driver is enabled
+//and turn off after the set amount of seconds from last driver being disabled again
+#define CONTROLLERFAN_PIN 2 //Pin used for the fan to cool controller (-1 to disable)
+#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
+#define CONTROLLERFAN_SPEED 255 // == full speed
+
+// When first starting the main fan, run it at full speed for the
+// given number of milliseconds. This gets the fan spinning reliably
+// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
+//#define FAN_KICKSTART_TIME 100
+
+// This defines the minimal speed for the main fan, run in PWM mode
+// to enable uncomment and set minimal PWM speed for reliable running (1-255)
+// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM
+//#define FAN_MIN_PWM 50
+
+// @section extruder
+
+// Extruder cooling fans
+// Configure fan pin outputs to automatically turn on/off when the associated
+// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
+// Multiple extruders can be assigned to the same pin in which case
+// the fan will turn on when any selected extruder is above the threshold.
+#define EXTRUDER_0_AUTO_FAN_PIN -1
+#define EXTRUDER_1_AUTO_FAN_PIN -1
+#define EXTRUDER_2_AUTO_FAN_PIN -1
+#define EXTRUDER_3_AUTO_FAN_PIN -1
+#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
+#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
+
+//===========================================================================
+//============================ Mechanical Settings ==========================
+//===========================================================================
+
+// @section homing
+
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
+
+// @section extras
+
+//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
+// A single Z stepper driver is usually used to drive 2 stepper motors.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
+//#define Z_DUAL_STEPPER_DRIVERS
+
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
+
+ // 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.
+ // That way the machine is capable to align the bed during home, since both Z steppers are homed.
+ // There is also an implementation of M666 (software endstops adjustment) to this feature.
+ // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed.
+ // 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.
+ // 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.
+ // Play a little bit with small adjustments (0.5mm) and check the behaviour.
+ // The M119 (endstops report) will start reporting the Z2 Endstop as well.
+
+ //#define Z_DUAL_ENDSTOPS
+
+ #if ENABLED(Z_DUAL_ENDSTOPS)
+ #define Z2_USE_ENDSTOP _XMAX_
+ #endif
+
+#endif // Z_DUAL_STEPPER_DRIVERS
+
+// Enable this for dual x-carriage printers.
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
+// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug.
+//#define DUAL_X_CARRIAGE
+#if ENABLED(DUAL_X_CARRIAGE)
+ // Configuration for second X-carriage
+ // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
+ // the second x-carriage always homes to the maximum endstop.
+ #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
+ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
+ #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
+ #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
+ // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
+ // without modifying the firmware (through the "M218 T1 X???" command).
+ // Remember: you should set the second extruder x-offset to 0 in your slicer.
+
+ // There are a few selectable movement modes for dual x-carriages using M605 S
+ // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
+ // as long as it supports dual x-carriages. (M605 S0)
+ // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
+ // that additional slicer support is not required. (M605 S1)
+ // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
+ // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
+ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
+
+ // This is the default power-up mode which can be later using M605.
+ #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
+
+ // Default settings in "Auto-park Mode"
+ #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder
+ #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder
+
+ // Default x offset in duplication mode (typically set to half print bed width)
+ #define DEFAULT_DUPLICATION_X_OFFSET 100
+
+#endif //DUAL_X_CARRIAGE
+
+// @section homing
+
+//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
+#define X_HOME_BUMP_MM 10
+#define Y_HOME_BUMP_MM 10
+#define Z_HOME_BUMP_MM 3
+#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate)
+#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
+
+// When G28 is called, this option will make Y home before X
+//#define HOME_Y_BEFORE_X
+
+// @section machine
+
+#define AXIS_RELATIVE_MODES {false, false, false, false}
+
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+#define INVERT_X_STEP_PIN false
+#define INVERT_Y_STEP_PIN false
+#define INVERT_Z_STEP_PIN false
+#define INVERT_E_STEP_PIN false
+
+// Default stepper release if idle. Set to 0 to deactivate.
+// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true.
+// Time can be set by M18 and M84.
+#define DEFAULT_STEPPER_DEACTIVE_TIME 120
+#define DISABLE_INACTIVE_X true
+#define DISABLE_INACTIVE_Y true
+#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished.
+#define DISABLE_INACTIVE_E true
+
+#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
+#define DEFAULT_MINTRAVELFEEDRATE 0.0
+
+// @section lcd
+
+#if ENABLED(ULTIPANEL)
+ #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
+ #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder
+#endif
+
+// @section extras
+
+// minimum time in microseconds that a movement needs to take if the buffer is emptied.
+#define DEFAULT_MINSEGMENTTIME 20000
+
+// If defined the movements slow down when the look ahead buffer is only half full
+#define SLOWDOWN
+
+// Frequency limit
+// See nophead's blog for more info
+// Not working O
+//#define XY_FREQUENCY_LIMIT 15
+
+// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
+// of the buffer and all stops. This should not be much greater than zero and should only be changed
+// if unwanted behavior is observed on a user's machine when running at very slow speeds.
+#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
+
+// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
+#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
+
+// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
+#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
+
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
+
+// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
+//#define DIGIPOT_I2C
+// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
+#define DIGIPOT_I2C_NUM_CHANNELS 8
+// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
+#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
+
+//===========================================================================
+//=============================Additional Features===========================
+//===========================================================================
+
+#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
+#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
+#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
+
+//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
+#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
+
+// @section lcd
+
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
+#if ENABLED(SDSUPPORT)
+
+ // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
+ // around this by connecting a push button or single throw switch to the pin defined
+ // as SD_DETECT_PIN in your board's pins definitions.
+ // This setting should be disabled unless you are using a push button, pulling the pin to ground.
+ // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER).
+ #define SD_DETECT_INVERTED
+
+ #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
+ #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
+
+ #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order.
+ // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
+ // using:
+ //#define MENU_ADDAUTOSTART
+
+ // Show a progress bar on HD44780 LCDs for SD printing
+ //#define LCD_PROGRESS_BAR
+
+ #if ENABLED(LCD_PROGRESS_BAR)
+ // Amount of time (ms) to show the bar
+ #define PROGRESS_BAR_BAR_TIME 2000
+ // Amount of time (ms) to show the status message
+ #define PROGRESS_BAR_MSG_TIME 3000
+ // Amount of time (ms) to retain the status message (0=forever)
+ #define PROGRESS_MSG_EXPIRE 0
+ // Enable this to show messages for MSG_TIME then hide them
+ //#define PROGRESS_MSG_ONCE
+ #endif
+
+ // This allows hosts to request long names for files and folders with M33
+ //#define LONG_FILENAME_HOST_SUPPORT
+
+ // This option allows you to abort SD printing when any endstop is triggered.
+ // This feature must be enabled with "M540 S1" or from the LCD menu.
+ // To have any effect, endstops must be enabled during SD printing.
+ //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
+
+#endif // SDSUPPORT
+
+// for dogm lcd displays you can choose some additional fonts:
+#if ENABLED(DOGLCD)
+ // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
+ // we don't have a big font for Cyrillic, Kana
+ //#define USE_BIG_EDIT_FONT
+
+ // If you have spare 2300Byte of progmem and want to use a
+ // smaller font on the Info-screen uncomment the next line.
+ //#define USE_SMALL_INFOFONT
+#endif // DOGLCD
+
+// @section safety
+
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
+#define USE_WATCHDOG
+
+#if ENABLED(USE_WATCHDOG)
+ // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
+ // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
+ // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
+ //#define WATCHDOG_RESET_MANUAL
+#endif
+
+// @section lcd
+
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
+// it can e.g. be used to change z-positions in the print startup phase in real-time
+// does not respect endstops!
+//#define BABYSTEPPING
+#if ENABLED(BABYSTEPPING)
+ #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions
+ //not implemented for deltabots!
+ #define BABYSTEP_INVERT_Z false //true for inverse movements in Z
+ #define BABYSTEP_MULTIPLICATOR 1 //faster movements
+#endif
+
+// @section extruder
+
+// extruder advance constant (s2/mm3)
+//
+// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
+//
+// Hooke's law says: force = k * distance
+// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant
+// so: v ^ 2 is proportional to number of steps we advance the extruder
+//#define ADVANCE
+
+#if ENABLED(ADVANCE)
+ #define EXTRUDER_ADVANCE_K .0
+ #define D_FILAMENT 2.85
+#endif
+
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
+// @section leveling
+
+// Default mesh area is an area with an inset margin on the print area.
+// Below are the macros that are used to define the borders for the mesh area,
+// made available here for specialized needs, ie dual extruder setup.
+#if ENABLED(MESH_BED_LEVELING)
+ #define MESH_MIN_X (X_MIN_POS + MESH_INSET)
+ #define MESH_MAX_X (X_MAX_POS - (MESH_INSET))
+ #define MESH_MIN_Y (Y_MIN_POS + MESH_INSET)
+ #define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET))
+#endif
+
+// @section extras
+
+// Arc interpretation settings:
+#define ARC_SUPPORT // Disabling this saves ~2738 bytes
+#define MM_PER_ARC_SEGMENT 1
+#define N_ARC_CORRECTION 25
+
+// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
+//#define BEZIER_CURVE_SUPPORT
+
+const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement
+
+// @section temperature
+
+// Control heater 0 and heater 1 in parallel.
+//#define HEATERS_PARALLEL
+
+//===========================================================================
+//================================= Buffers =================================
+//===========================================================================
+
+// @section hidden
+
+// The number of linear motions that can be in the plan at any give time.
+// 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.
+#if ENABLED(SDSUPPORT)
+ #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
+#else
+ #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
+#endif
+
+// @section serial
+
+// The ASCII buffer for serial input
+#define MAX_CMD_SIZE 96
+#define BUFSIZE 26
+
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
+// Bad Serial-connections can miss a received command by sending an 'ok'
+// Therefore some clients abort after 30 seconds in a timeout.
+// Some other clients start sending commands while receiving a 'wait'.
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
+//#define NO_TIMEOUTS 1000 // Milliseconds
+
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
+//#define ADVANCED_OK
+
+// @section fwretract
+
+// Firmware based and LCD controlled retract
+// M207 and M208 can be used to define parameters for the retraction.
+// The retraction can be called by the slicer using G10 and G11
+// until then, intended retractions can be detected by moves that only extrude and the direction.
+// the moves are than replaced by the firmware controlled ones.
+
+//#define FWRETRACT //ONLY PARTIALLY TESTED
+#if ENABLED(FWRETRACT)
+ #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
+ #define RETRACT_LENGTH 3 //default retract length (positive mm)
+ #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change
+ #define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s)
+ #define RETRACT_ZLIFT 0 //default retract Z-lift
+ #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
+ #define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change)
+ #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s)
+#endif
+
+// Add support for experimental filament exchange support M600; requires display
+#if ENABLED(ULTIPANEL)
+ #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 100 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 100 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 20 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 5 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 600 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 600 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 100 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
+ #endif
+#endif
+
+/******************************************************************************\
+ * enable this section if you have TMC26X motor drivers.
+ * you need to import the TMC26XStepper library into the Arduino IDE for this
+ ******************************************************************************/
+
+// @section tmc
+
+//#define HAVE_TMCDRIVER
+#if ENABLED(HAVE_TMCDRIVER)
+
+ //#define X_IS_TMC
+ #define X_MAX_CURRENT 1000 //in mA
+ #define X_SENSE_RESISTOR 91 //in mOhms
+ #define X_MICROSTEPS 16 //number of microsteps
+
+ //#define X2_IS_TMC
+ #define X2_MAX_CURRENT 1000 //in mA
+ #define X2_SENSE_RESISTOR 91 //in mOhms
+ #define X2_MICROSTEPS 16 //number of microsteps
+
+ //#define Y_IS_TMC
+ #define Y_MAX_CURRENT 1000 //in mA
+ #define Y_SENSE_RESISTOR 91 //in mOhms
+ #define Y_MICROSTEPS 16 //number of microsteps
+
+ //#define Y2_IS_TMC
+ #define Y2_MAX_CURRENT 1000 //in mA
+ #define Y2_SENSE_RESISTOR 91 //in mOhms
+ #define Y2_MICROSTEPS 16 //number of microsteps
+
+ //#define Z_IS_TMC
+ #define Z_MAX_CURRENT 1000 //in mA
+ #define Z_SENSE_RESISTOR 91 //in mOhms
+ #define Z_MICROSTEPS 16 //number of microsteps
+
+ //#define Z2_IS_TMC
+ #define Z2_MAX_CURRENT 1000 //in mA
+ #define Z2_SENSE_RESISTOR 91 //in mOhms
+ #define Z2_MICROSTEPS 16 //number of microsteps
+
+ //#define E0_IS_TMC
+ #define E0_MAX_CURRENT 1000 //in mA
+ #define E0_SENSE_RESISTOR 91 //in mOhms
+ #define E0_MICROSTEPS 16 //number of microsteps
+
+ //#define E1_IS_TMC
+ #define E1_MAX_CURRENT 1000 //in mA
+ #define E1_SENSE_RESISTOR 91 //in mOhms
+ #define E1_MICROSTEPS 16 //number of microsteps
+
+ //#define E2_IS_TMC
+ #define E2_MAX_CURRENT 1000 //in mA
+ #define E2_SENSE_RESISTOR 91 //in mOhms
+ #define E2_MICROSTEPS 16 //number of microsteps
+
+ //#define E3_IS_TMC
+ #define E3_MAX_CURRENT 1000 //in mA
+ #define E3_SENSE_RESISTOR 91 //in mOhms
+ #define E3_MICROSTEPS 16 //number of microsteps
+
+#endif
+
+/******************************************************************************\
+ * enable this section if you have L6470 motor drivers.
+ * you need to import the L6470 library into the Arduino IDE for this
+ ******************************************************************************/
+
+// @section l6470
+
+//#define HAVE_L6470DRIVER
+#if ENABLED(HAVE_L6470DRIVER)
+
+ //#define X_IS_L6470
+ #define X_MICROSTEPS 16 //number of microsteps
+ #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define X2_IS_L6470
+ #define X2_MICROSTEPS 16 //number of microsteps
+ #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define Y_IS_L6470
+ #define Y_MICROSTEPS 16 //number of microsteps
+ #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define Y2_IS_L6470
+ #define Y2_MICROSTEPS 16 //number of microsteps
+ #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define Z_IS_L6470
+ #define Z_MICROSTEPS 16 //number of microsteps
+ #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define Z2_IS_L6470
+ #define Z2_MICROSTEPS 16 //number of microsteps
+ #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define E0_IS_L6470
+ #define E0_MICROSTEPS 16 //number of microsteps
+ #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define E1_IS_L6470
+ #define E1_MICROSTEPS 16 //number of microsteps
+ #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define E2_IS_L6470
+ #define E2_MICROSTEPS 16 //number of microsteps
+ #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+ //#define E3_IS_L6470
+ #define E3_MICROSTEPS 16 //number of microsteps
+ #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
+ #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
+ #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
+
+#endif
+
+/**
+ * TWI/I2C BUS
+ *
+ * This feature is an EXPERIMENTAL feature so it shall not be used on production
+ * machines. Enabling this will allow you to send and receive I2C data from slave
+ * devices on the bus.
+ *
+ * ; Example #1
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
+ * ; It uses multiple M155 commands with one B arg
+ * M155 A99 ; Target slave address
+ * M155 B77 ; M
+ * M155 B97 ; a
+ * M155 B114 ; r
+ * M155 B108 ; l
+ * M155 B105 ; i
+ * M155 B110 ; n
+ * M155 S1 ; Send the current buffer
+ *
+ * ; Example #2
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
+ *
+ * ; Example #3
+ * ; Example serial output of a M156 request
+ * echo:i2c-reply: from:99 bytes:5 data:hello
+ */
+
+// @section i2cbus
+
+//#define EXPERIMENTAL_I2CBUS
+
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h
new file mode 100644
index 000000000..7713ed90b
--- /dev/null
+++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h
@@ -0,0 +1,1327 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Configuration.h
+ *
+ * Basic settings such as:
+ *
+ * - Type of electronics
+ * - Type of temperature sensor
+ * - Printer geometry
+ * - Endstop configuration
+ * - LCD controller
+ * - Extra features
+ *
+ * Advanced settings can be found in Configuration_adv.h
+ *
+ */
+#ifndef CONFIGURATION_H
+#define CONFIGURATION_H
+
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
+
+//===========================================================================
+//============================= Getting Started =============================
+//===========================================================================
+
+/**
+ * Here are some standard links for getting your machine calibrated:
+ *
+ * http://reprap.org/wiki/Calibration
+ * http://youtu.be/wAL9d7FgInk
+ * http://calculator.josefprusa.cz
+ * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
+ * http://www.thingiverse.com/thing:5573
+ * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
+ * http://www.thingiverse.com/thing:298812
+ */
+
+//===========================================================================
+//============================= DELTA Printer ===============================
+//===========================================================================
+// For a Delta printer replace the configuration files with the files in the
+// example_configurations/delta directory.
+//
+
+//===========================================================================
+//============================= SCARA Printer ===============================
+//===========================================================================
+// For a Scara printer replace the configuration files with the files in the
+// example_configurations/SCARA directory.
+//
+
+// @section info
+
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
+// build by the user have been successfully uploaded into firmware.
+#define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes.
+#define SHOW_BOOTSCREEN
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
+// @section machine
+
+// SERIAL_PORT selects which serial port should be used for communication with the host.
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
+// :[0,1,2,3,4,5,6,7]
+#define SERIAL_PORT 0
+
+// This determines the communication speed of the printer
+// :[2400,9600,19200,38400,57600,115200,250000]
+#define BAUDRATE 250000
+
+// Enable the Bluetooth serial interface on AT90USB devices
+//#define BLUETOOTH
+
+// The following define selects which electronics board you have.
+// Please choose the name from boards.h that matches your setup
+#ifndef MOTHERBOARD
+ #define MOTHERBOARD BOARD_K8400
+#endif
+
+// Optional custom name for your RepStrap or other custom machine
+// Displayed in the LCD "Ready" message
+//#define CUSTOM_MACHINE_NAME "3D Printer"
+
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
+//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
+
+// This defines the number of extruders
+// :[1,2,3,4]
+#define EXTRUDERS 2
+
+// For Cyclops or any "multi-extruder" that shares a single nozzle.
+//#define SINGLENOZZLE
+
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
+// For the other hotends it is their distance from the extruder 0 hotend.
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+
+//// The following define selects which power supply you have. Please choose the one that matches your setup
+// 1 = ATX
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
+// :{1:'ATX',2:'X-Box 360'}
+#define POWER_SUPPLY 1
+
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
+//#define PS_DEFAULT_OFF
+
+// @section temperature
+
+//===========================================================================
+//============================= Thermal Settings ============================
+//===========================================================================
+//
+//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
+//
+//// Temperature sensor settings:
+// -3 is thermocouple with MAX31855 (only for sensor 0)
+// -2 is thermocouple with MAX6675 (only for sensor 0)
+// -1 is thermocouple with AD595
+// 0 is not used
+// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
+// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
+// 3 is Mendel-parts thermistor (4.7k pullup)
+// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
+// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
+// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
+// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
+// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
+// 10 is 100k RS thermistor 198-961 (4.7k pullup)
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
+// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
+// 70 is the 100K thermistor found in the bq Hephestos 2
+//
+// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
+// (but gives greater accuracy and more stable PID)
+// 51 is 100k thermistor - EPCOS (1k pullup)
+// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
+//
+// 1047 is Pt1000 with 4k7 pullup
+// 1010 is Pt1000 with 1k pullup (non standard)
+// 147 is Pt100 with 4k7 pullup
+// 110 is Pt100 with 1k pullup (non standard)
+// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below.
+// Use it for Testing or Development purposes. NEVER for production machine.
+//#define DUMMY_THERMISTOR_998_VALUE 25
+//#define DUMMY_THERMISTOR_999_VALUE 100
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
+#define TEMP_SENSOR_0 5
+#define TEMP_SENSOR_1 5
+#define TEMP_SENSOR_2 0
+#define TEMP_SENSOR_3 0
+#define TEMP_SENSOR_BED 0
+
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
+//#define TEMP_SENSOR_1_AS_REDUNDANT
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
+
+// Extruder temperature must be close to target for this long before M109 returns success
+#define TEMP_RESIDENCY_TIME 2 // (seconds)
+#define TEMP_HYSTERESIS 5 // (degC) range of +/- temperatures considered "close" to the target one
+#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
+
+// Bed temperature must be close to target for this long before M190 returns success
+#define TEMP_BED_RESIDENCY_TIME 10 // (seconds)
+#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one
+#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
+
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
+// to check that the wiring to the thermistor is not broken.
+// Otherwise this would lead to the heater being powered on all the time.
+#define HEATER_0_MINTEMP 5
+#define HEATER_1_MINTEMP 5
+#define HEATER_2_MINTEMP 5
+#define HEATER_3_MINTEMP 5
+#define BED_MINTEMP 5
+
+// When temperature exceeds max temp, your heater will be switched off.
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
+// You should use MINTEMP for thermistor short/failure protection.
+#define HEATER_0_MAXTEMP 275
+#define HEATER_1_MAXTEMP 275
+#define HEATER_2_MAXTEMP 275
+#define HEATER_3_MAXTEMP 275
+#define BED_MAXTEMP 150
+
+//===========================================================================
+//============================= PID Settings ================================
+//===========================================================================
+// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
+
+// Comment the following line to disable PID and enable bang-bang.
+#define PIDTEMP
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
+#if ENABLED(PIDTEMP)
+ //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
+ //#define PID_DEBUG // Sends debug data to the serial port.
+ //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
+ //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
+ #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
+ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
+ #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
+ #define K1 0.95 //smoothing factor within the PID
+
+ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
+ // Ultimaker
+ //#define DEFAULT_Kp 22.2
+ //#define DEFAULT_Ki 1.08
+ //#define DEFAULT_Kd 114
+
+ // MakerGear
+ //#define DEFAULT_Kp 7.0
+ //#define DEFAULT_Ki 0.1
+ //#define DEFAULT_Kd 12
+
+ // Mendel Parts V9 on 12V
+ #define DEFAULT_Kp 63.0
+ #define DEFAULT_Ki 2.25
+ #define DEFAULT_Kd 440
+
+#endif // PIDTEMP
+
+//===========================================================================
+//============================= PID > Bed Temperature Control ===============
+//===========================================================================
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
+//
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
+// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz,
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
+// shouldn't use bed PID until someone else verifies your hardware works.
+// If this is enabled, find your own PID constants below.
+//#define PIDTEMPBED
+
+//#define BED_LIMIT_SWITCHING
+
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
+// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
+
+#if ENABLED(PIDTEMPBED)
+
+ //#define PID_BED_DEBUG // Sends debug data to the serial port.
+
+ #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term
+
+ //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
+ //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
+ #define DEFAULT_bedKp 10.00
+ #define DEFAULT_bedKi .023
+ #define DEFAULT_bedKd 305.4
+
+ //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
+ //from pidautotune
+ //#define DEFAULT_bedKp 97.1
+ //#define DEFAULT_bedKi 1.41
+ //#define DEFAULT_bedKd 1675.16
+
+ // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
+#endif // PIDTEMPBED
+
+// @section extruder
+
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
+//can be software-disabled for whatever purposes by
+#define PREVENT_DANGEROUS_EXTRUDE
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
+#define PREVENT_LENGTHY_EXTRUDE
+
+#define EXTRUDE_MINTEMP 160
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
+
+//===========================================================================
+//======================== Thermal Runaway Protection =======================
+//===========================================================================
+
+/**
+ * Thermal Protection protects your printer from damage and fire if a
+ * thermistor falls out or temperature sensors fail in any way.
+ *
+ * The issue: If a thermistor falls out or a temperature sensor fails,
+ * Marlin can no longer sense the actual temperature. Since a disconnected
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
+ *
+ * If you get "Thermal Runaway" or "Heating failed" errors the
+ * details can be tuned in Configuration_adv.h
+ */
+
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
+#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
+
+//===========================================================================
+//============================= Mechanical Settings =========================
+//===========================================================================
+
+// @section machine
+
+// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics
+//#define COREXY
+//#define COREXZ
+//#define COREYZ
+
+// Enable this option for Toshiba steppers
+//#define CONFIG_STEPPERS_TOSHIBA
+
+//===========================================================================
+//============================== Endstop Settings ===========================
+//===========================================================================
+
+// @section homing
+
+// Specify here all the endstop connectors that are connected to any endstop or probe.
+// Almost all printers will be using one per axis. Probes will use one or more of the
+// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
+#define USE_XMIN_PLUG
+#define USE_YMIN_PLUG
+#define USE_ZMIN_PLUG
+//#define USE_XMAX_PLUG
+//#define USE_YMAX_PLUG
+//#define USE_ZMAX_PLUG
+
+// coarse Endstop Settings
+#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
+
+#if DISABLED(ENDSTOPPULLUPS)
+ // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
+ //#define ENDSTOPPULLUP_XMAX
+ //#define ENDSTOPPULLUP_YMAX
+ //#define ENDSTOPPULLUP_ZMAX
+ //#define ENDSTOPPULLUP_XMIN
+ //#define ENDSTOPPULLUP_YMIN
+ //#define ENDSTOPPULLUP_ZMIN
+ //#define ENDSTOPPULLUP_ZMIN_PROBE
+#endif
+
+// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+
+//===========================================================================
+//============================= Z Probe Options =============================
+//===========================================================================
+
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
+// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
+// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
+//
+// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! ***
+//
+// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING.
+// Example: To park the head outside the bed area when homing with G28.
+//
+// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
+//
+// For a servo-based Z probe, you must set up servo support below, including
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
+//
+// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
+// - Use 5V for powered (usu. inductive) sensors.
+// - Otherwise connect:
+// - normally-closed switches to GND and D32.
+// - normally-open switches to 5V and D32.
+//
+// Normally-closed switches are advised and are the default.
+//
+// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.)
+// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the
+// default pin for all RAMPS-based boards. Some other boards map differently.
+// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file.
+//
+// WARNING:
+// Setting the wrong pin may have unexpected and potentially disastrous consequences.
+// Use with caution and do your homework.
+//
+//#define Z_MIN_PROBE_ENDSTOP
+
+// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
+// The Z_MIN_PIN will then be used for both Z-homing and probing.
+#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+
+// To use a probe you must enable one of the two options above!
+
+// This option disables the use of the Z_MIN_PROBE_PIN
+// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a
+// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above.
+// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
+//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
+// :{0:'Low',1:'High'}
+#define X_ENABLE_ON 0
+#define Y_ENABLE_ON 0
+#define Z_ENABLE_ON 0
+#define E_ENABLE_ON 0 // For all extruders
+
+// Disables axis stepper immediately when it's not being used.
+// WARNING: When motors turn off there is a chance of losing position accuracy!
+#define DISABLE_X false
+#define DISABLE_Y false
+#define DISABLE_Z false
+// Warn on display about possibly reduced accuracy
+//#define DISABLE_REDUCED_ACCURACY_WARNING
+
+// @section extruder
+
+#define DISABLE_E false // For all extruders
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
+
+// @section machine
+
+// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
+#define INVERT_X_DIR false
+#define INVERT_Y_DIR true
+#define INVERT_Z_DIR true
+
+// @section extruder
+
+// For direct drive extruder v9 set to true, for geared extruder set to false.
+#define INVERT_E0_DIR false
+#define INVERT_E1_DIR true
+#define INVERT_E2_DIR false
+#define INVERT_E3_DIR false
+
+// @section homing
+
+//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
+ // Be sure you have this distance over your Z_MAX_POS in case.
+
+// ENDSTOP SETTINGS:
+// Sets direction of endstops when homing; 1=MAX, -1=MIN
+// :[-1,1]
+#define X_HOME_DIR -1
+#define Y_HOME_DIR -1
+#define Z_HOME_DIR -1
+
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
+#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
+
+// @section machine
+
+// Travel limits after homing (units are in mm)
+#define X_MIN_POS 0
+#define Y_MIN_POS 20
+#define Z_MIN_POS 0
+#define X_MAX_POS 200
+#define Y_MAX_POS 200
+#define Z_MAX_POS 190
+
+//===========================================================================
+//========================= Filament Runout Sensor ==========================
+//===========================================================================
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
+ // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
+ // It is assumed that when logic high = filament available
+ // when logic low = filament ran out
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
+ #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
+ #define FILAMENT_RUNOUT_SCRIPT "M600"
+#endif
+
+//===========================================================================
+//============================ Mesh Bed Leveling ============================
+//===========================================================================
+
+//#define MESH_BED_LEVELING // Enable mesh bed leveling.
+
+#if ENABLED(MESH_BED_LEVELING)
+ #define MESH_INSET 10 // Mesh inset margin on print area
+ #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited.
+ #define MESH_NUM_Y_POINTS 3
+ #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0.
+
+ //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0]
+
+ //#define MANUAL_BED_LEVELING // Add display menu option for bed leveling.
+
+ #if ENABLED(MANUAL_BED_LEVELING)
+ #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis.
+ #endif // MANUAL_BED_LEVELING
+
+#endif // MESH_BED_LEVELING
+
+//===========================================================================
+//============================ Bed Auto Leveling ============================
+//===========================================================================
+
+// @section bedlevel
+
+//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
+//#define DEBUG_LEVELING_FEATURE
+
+#if ENABLED(AUTO_BED_LEVELING_FEATURE)
+
+ // There are 2 different ways to specify probing locations:
+ //
+ // - "grid" mode
+ // Probe several points in a rectangular grid.
+ // You specify the rectangle and the density of sample points.
+ // This mode is preferred because there are more measurements.
+ //
+ // - "3-point" mode
+ // Probe 3 arbitrary points on the bed (that aren't collinear)
+ // You specify the XY coordinates of all 3 points.
+
+ // Enable this to sample the bed in a grid (least squares solution).
+ // Note: this feature generates 10KB extra code size.
+ #define AUTO_BED_LEVELING_GRID
+
+ #if ENABLED(AUTO_BED_LEVELING_GRID)
+
+ #define LEFT_PROBE_BED_POSITION 15
+ #define RIGHT_PROBE_BED_POSITION 170
+ #define FRONT_PROBE_BED_POSITION 20
+ #define BACK_PROBE_BED_POSITION 170
+
+ #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this.
+
+ // Set the number of grid points per dimension.
+ // You probably don't need more than 3 (squared=9).
+ #define AUTO_BED_LEVELING_GRID_POINTS 2
+
+ #else // !AUTO_BED_LEVELING_GRID
+
+ // Arbitrary points to probe.
+ // A simple cross-product is used to estimate the plane of the bed.
+ #define ABL_PROBE_PT_1_X 15
+ #define ABL_PROBE_PT_1_Y 180
+ #define ABL_PROBE_PT_2_X 15
+ #define ABL_PROBE_PT_2_Y 20
+ #define ABL_PROBE_PT_3_X 170
+ #define ABL_PROBE_PT_3_Y 20
+
+ #endif // !AUTO_BED_LEVELING_GRID
+
+ //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
+ // Useful to retract a deployable Z probe.
+
+ // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
+ // it is highly recommended you also enable Z_SAFE_HOMING below!
+
+#endif // AUTO_BED_LEVELING_FEATURE
+
+
+// @section homing
+
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
+
+// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
+//
+// With this feature enabled:
+//
+// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
+// - If stepper drivers time out, it will need X and Y homing again before Z homing.
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
+// - Prevent Z homing when the Z probe is outside bed area.
+//#define Z_SAFE_HOMING
+
+#if ENABLED(Z_SAFE_HOMING)
+ #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28).
+ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
+#endif
+
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (8*60)
+
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
+
+// default settings
+
+#define DEFAULT_AXIS_STEPS_PER_UNIT {134.74,134.74,4266.66,148.7} // default steps per unit for Ultimaker
+#define DEFAULT_MAX_FEEDRATE {160, 160, 10, 10000} // (mm/sec)
+#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 6000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 6000 // E acceleration in mm/s^2 for retracts
+#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
+
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
+#define DEFAULT_XYJERK 10.0 // (mm/sec)
+#define DEFAULT_ZJERK 0.5 // (mm/sec)
+#define DEFAULT_EJERK 20.0 // (mm/sec)
+
+
+//=============================================================================
+//============================= Additional Features ===========================
+//=============================================================================
+
+// @section extras
+
+//
+// EEPROM
+//
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
+// M500 - stores parameters in EEPROM
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
+// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
+//define this to enable EEPROM support
+#define EEPROM_SETTINGS
+
+#if ENABLED(EEPROM_SETTINGS)
+ // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
+ #define EEPROM_CHITCHAT // Please keep turned on if you can.
+#endif
+
+//
+// Host Keepalive
+//
+// When enabled Marlin will send a busy status message to the host
+// every couple of seconds when it can't accept commands.
+//
+#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
+#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
+
+//
+// M100 Free Memory Watcher
+//
+//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
+// @section temperature
+
+// Preheat Constants
+#define PREHEAT_1_TEMP_HOTEND 210
+#define PREHEAT_1_TEMP_BED 0
+#define PREHEAT_1_FAN_SPEED 165 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 245
+#define PREHEAT_2_TEMP_BED 0
+#define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
+
+//
+// Print job timer
+//
+// Enable this option to automatically start and stop the
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
+//
+// In all cases the timer can be started and stopped using
+// the following commands:
+//
+// - M75 - Start the print job timer
+// - M76 - Pause the print job timer
+// - M77 - Stop the print job timer
+#define PRINTJOB_TIMER_AUTOSTART
+
+//
+// Print Counter
+//
+// When enabled Marlin will keep track of some print statistical data such as:
+// - Total print jobs
+// - Total successful print jobs
+// - Total failed print jobs
+// - Total time printing
+//
+// This information can be viewed by the M78 command.
+//#define PRINTCOUNTER
+
+//=============================================================================
+//============================= LCD and SD support ============================
+//=============================================================================
+
+// @section lcd
+
+//
+// LCD LANGUAGE
+//
+// Here you may choose the language used by Marlin on the LCD menus, the following
+// list of languages are available:
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
+//
+#define LCD_LANGUAGE en
+
+//
+// LCD Character Set
+//
+// Note: This option is NOT applicable to Graphical Displays.
+//
+// All character-based LCD's provide ASCII plus one of these
+// language extensions:
+//
+// - JAPANESE ... the most common
+// - WESTERN ... with more accented characters
+// - CYRILLIC ... for the Russian language
+//
+// To determine the language extension installed on your controller:
+//
+// - Compile and upload with LCD_LANGUAGE set to 'test'
+// - Click the controller to view the LCD menu
+// - The LCD will display Japanese, Western, or Cyrillic text
+//
+// See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
+//
+// :['JAPANESE','WESTERN','CYRILLIC']
+//
+#define DISPLAY_CHARSET_HD44780 JAPANESE
+
+//
+// LCD TYPE
+//
+// You may choose ULTRA_LCD if you have character based LCD with 16x2, 16x4, 20x2,
+// 20x4 char/lines or DOGLCD for the full graphics display with 128x64 pixels
+// (ST7565R family). (This option will be set automatically for certain displays.)
+//
+// IMPORTANT NOTE: The U8glib library is required for Full Graphic Display!
+// https://github.com/olikraus/U8glib_Arduino
+//
+#define ULTRA_LCD // Character based
+//#define DOGLCD // Full graphics display
+
+//
+// SD CARD
+//
+// SD Card support is disabled by default. If your controller has an SD slot,
+// you must uncomment the following option or it won't work.
+//
+#define SDSUPPORT
+
+//
+// SD CARD: SPI SPEED
+//
+// Uncomment ONE of the following items to use a slower SPI transfer
+// speed. This is usually required if you're getting volume init errors.
+//
+//#define SPI_SPEED SPI_HALF_SPEED
+//#define SPI_SPEED SPI_QUARTER_SPEED
+//#define SPI_SPEED SPI_EIGHTH_SPEED
+
+//
+// SD CARD: ENABLE CRC
+//
+// Use CRC checks and retries on the SD communication.
+//
+//#define SD_CHECK_AND_RETRY
+
+//
+// ENCODER SETTINGS
+//
+// This option overrides the default number of encoder pulses needed to
+// produce one step. Should be increased for high-resolution encoders.
+//
+#define ENCODER_PULSES_PER_STEP 4
+
+//
+// Use this option to override the number of step signals required to
+// move between next/prev menu items.
+//
+#define ENCODER_STEPS_PER_MENU_ITEM 1
+
+/**
+ * Encoder Direction Options
+ *
+ * Test your encoder's behavior first with both options disabled.
+ *
+ * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION.
+ * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION.
+ * Reversed Value Editing only? Enable BOTH options.
+ */
+
+//
+// This option reverses the encoder direction everywhere
+//
+// Set this option if CLOCKWISE causes values to DECREASE
+//
+//#define REVERSE_ENCODER_DIRECTION
+
+//
+// This option reverses the encoder direction for navigating LCD menus.
+//
+// If CLOCKWISE normally moves DOWN this makes it go UP.
+// If CLOCKWISE normally moves UP this makes it go DOWN.
+//
+#define REVERSE_MENU_DIRECTION
+
+//
+// Individual Axis Homing
+//
+// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
+//
+//#define INDIVIDUAL_AXIS_HOMING_MENU
+
+//
+// SPEAKER/BUZZER
+//
+// If you have a speaker that can produce tones, enable it here.
+// By default Marlin assumes you have a buzzer with a fixed frequency.
+//
+//#define SPEAKER
+
+//
+// The duration and frequency for the UI feedback sound.
+// Set these to 0 to disable audio feedback in the LCD menus.
+//
+// Note: Test audio output with the G-Code:
+// M300 S P
+//
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000
+
+//
+// CONTROLLER TYPE: Standard
+//
+// Marlin supports a wide variety of controllers.
+// Enable one of the following options to specify your controller.
+//
+
+//
+// ULTIMAKER Controller.
+//
+#define ULTIMAKERCONTROLLER
+
+//
+// ULTIPANEL as seen on Thingiverse.
+//
+//#define ULTIPANEL
+
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
+//
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
+// http://reprap.org/wiki/PanelOne
+//
+//#define PANEL_ONE
+
+//
+// MaKr3d Makr-Panel with graphic controller and SD support.
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
+//
+//#define MAKRPANEL
+
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
+//
+// Activate one of these if you have a Panucatt Devices
+// Viki 2.0 or mini Viki with Graphic LCD
+// http://panucatt.com
+//
+//#define VIKI2
+//#define miniVIKI
+
+//
+// Adafruit ST7565 Full Graphic Controller.
+// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/
+//
+//#define ELB_FULL_GRAPHIC_CONTROLLER
+
+//
+// RepRapDiscount Smart Controller.
+// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
+//
+// Note: Usually sold with a white PCB.
+//
+//#define REPRAP_DISCOUNT_SMART_CONTROLLER
+
+//
+// GADGETS3D G3D LCD/SD Controller
+// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
+//
+// Note: Usually sold with a blue PCB.
+//
+//#define G3D_PANEL
+
+//
+// RepRapDiscount FULL GRAPHIC Smart Controller
+// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
+//
+//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+
+//
+// MakerLab Mini Panel with graphic
+// controller and SD support - http://reprap.org/wiki/Mini_panel
+//
+//#define MINIPANEL
+
+//
+// RepRapWorld REPRAPWORLD_KEYPAD v1.1
+// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
+//
+// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key
+// is pressed, a value of 10.0 means 10mm per click.
+//
+//#define REPRAPWORLD_KEYPAD
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+
+//
+// RigidBot Panel V1.0
+// http://www.inventapart.com/
+//
+//#define RIGIDBOT_PANEL
+
+//
+// BQ LCD Smart Controller shipped by
+// default with the BQ Hephestos 2 and Witbox 2.
+//
+//#define BQ_LCD_SMART_CONTROLLER
+
+//
+// CONTROLLER TYPE: I2C
+//
+// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C
+// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C
+//
+
+//
+// Elefu RA Board Control Panel
+// http://www.elefu.com/index.php?route=product/product&product_id=53
+//
+//#define RA_CONTROL_PANEL
+
+//
+// Sainsmart YW Robot (LCM1602) LCD Display
+//
+//#define LCD_I2C_SAINSMART_YWROBOT
+
+//
+// Generic LCM1602 LCD adapter
+//
+//#define LCM1602
+
+//
+// PANELOLU2 LCD with status LEDs,
+// separate encoder and click inputs.
+//
+// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later.
+// For more info: https://github.com/lincomatic/LiquidTWI2
+//
+// Note: The PANELOLU2 encoder click input can either be directly connected to
+// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
+//
+//#define LCD_I2C_PANELOLU2
+
+//
+// Panucatt VIKI LCD with status LEDs,
+// integrated click & L/R/U/D buttons, separate encoder inputs.
+//
+//#define LCD_I2C_VIKI
+
+//
+// SSD1306 OLED full graphics generic display
+//
+//#define U8GLIB_SSD1306
+
+//
+// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
+//#define SAV_3DGLCD
+#if ENABLED(SAV_3DGLCD)
+ //#define U8GLIB_SSD1306
+ #define U8GLIB_SH1106
+#endif
+
+//
+// CONTROLLER TYPE: Shift register panels
+//
+// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH
+// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD
+//
+//#define SAV_3DLCD
+
+//=============================================================================
+//=============================== Extra Features ==============================
+//=============================================================================
+
+// @section extras
+
+// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
+//#define FAST_PWM_FAN
+
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
+// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
+// is too low, you should also increment SOFT_PWM_SCALE.
+//#define FAN_SOFT_PWM
+
+// Incrementing this by 1 will double the software PWM frequency,
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
+// However, control resolution will be halved for each increment;
+// at zero value, there are 128 effective control positions.
+#define SOFT_PWM_SCALE 0
+
+// Temperature status LEDs that display the hotend and bed temperature.
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
+// Otherwise the RED led is on. There is 1C hysteresis.
+//#define TEMP_STAT_LEDS
+
+// M240 Triggers a camera by emulating a Canon RC-1 Remote
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
+//#define PHOTOGRAPH_PIN 23
+
+// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure
+//#define SF_ARC_FIX
+
+// Support for the BariCUDA Paste Extruder.
+//#define BARICUDA
+
+//define BlinkM/CyzRgb Support
+//#define BLINKM
+
+/*********************************************************************\
+* R/C SERVO support
+* Sponsored by TrinityLabs, Reworked by codexmas
+**********************************************************************/
+
+// Number of servos
+//
+// If you select a configuration below, this will receive a default value and does not need to be set manually
+// set it manually if you have more servos than extruders and wish to manually control some
+// leaving it undefined or defining as 0 will disable the servo subsystem
+// If unsure, leave commented / disabled
+//
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
+
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
+
+// Servo deactivation
+//
+// With this option servos are powered only during movement, then turned off to prevent jitter.
+//#define DEACTIVATE_SERVOS_AFTER_MOVE
+
+/**********************************************************************\
+ * Support for a filament diameter sensor
+ * Also allows adjustment of diameter at print time (vs at slicing)
+ * Single extruder only at this point (extruder 0)
+ *
+ * Motherboards
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector
+ * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E)
+ * 301 - Rambo - uses Analog input 3
+ * Note may require analog pins to be defined for different motherboards
+ **********************************************************************/
+// Uncomment below to enable
+//#define FILAMENT_WIDTH_SENSOR
+
+#define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation
+
+#if ENABLED(FILAMENT_WIDTH_SENSOR)
+ #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2)
+ #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel
+
+ #define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm
+ #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm
+ #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM)
+
+ #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially
+
+ //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec.
+ //#define FILAMENT_LCD_DISPLAY
+#endif
+
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/K8400/README.md b/Marlin/example_configurations/K8400/README.md
new file mode 100644
index 000000000..c9089b587
--- /dev/null
+++ b/Marlin/example_configurations/K8400/README.md
@@ -0,0 +1,15 @@
+# Configuration for Velleman K8400 Vertex
+http://www.k8400.eu/
+
+Configuration files for the K8400, ported upstream from the official Velleman firmware.
+Like it's predecessor, (K8200), the K8400 is a 3Drag clone. There are some minor differences, documented in pins_K8400.h.
+
+Single and dual head configurations provided. Copy the correct Configuration.h and Configuration_adv.h to the /Marlin/ directory.
+
+**NOTE: This configuration includes the community sourced feed rate fix. Use 100% feed rate in Repetier!**
+
+For implementation and updated K8400 firmware, see https://github.com/birkett/Velleman-K8400-Firmware
+
+### Original Sources
+Credit to Velleman for the original 1.0.x based code:
+http://www.vertex3dprinter.eu/downloads/files/vertex/firmware/vertex-m1-v1.4-h2.zip
diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
index d9c8b9be4..67d6ddeb6 100644
--- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
+++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "RepRapWorld.com" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -384,18 +420,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -407,7 +504,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -440,6 +537,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -476,6 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -507,7 +620,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -541,8 +654,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -585,58 +701,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -645,18 +714,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -664,7 +729,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -673,14 +738,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (4*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -702,18 +767,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -745,22 +798,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 110
+#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 110
-#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -793,8 +931,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -941,6 +1081,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -953,6 +1099,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1003,7 +1155,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
#define REPRAPWORLD_KEYPAD
-#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1063,7 +1215,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1098,7 +1252,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1130,28 +1284,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1182,7 +1324,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h
index 967927d86..1ea13b9a4 100644
--- a/Marlin/example_configurations/RigidBot/Configuration.h
+++ b/Marlin/example_configurations/RigidBot/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -104,8 +120,11 @@
// The following define selects which electronics board you have.
// Please choose the name from boards.h that matches your setup
+// for Rigidbot version 1 : #define MOTHERBOARD BOARD_RIGIDBOARD
+// for Rigidbot Version 2 : #define MOTHERBOARD BOARD_RIGIDBOARD_V2
+
#ifndef MOTHERBOARD
- #define MOTHERBOARD BOARD_RIGIDBOARD
+ #define MOTHERBOARD BOARD_RIGIDBOARD_V2
#endif
// Optional custom name for your RepStrap or other custom machine
@@ -123,17 +142,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-#define EXTRUDER_OFFSET_X {0.0, 36.00} // (in mm) for each extruder, offset of the hotend on the X axis
-#define EXTRUDER_OFFSET_Y {0.0, 0.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+#define HOTEND_OFFSET_X {0.0, 36.00} // (in mm) for each extruder, offset of the hotend on the X axis
+#define HOTEND_OFFSET_Y {0.0, 0.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +210,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +227,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1 // DGlass3D = 5; RigidBot = 1; 3DSv6 = 5
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -223,10 +266,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +280,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -378,18 +417,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -401,7 +501,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -434,6 +534,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -470,6 +585,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -501,7 +617,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -535,8 +651,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -579,58 +698,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -639,18 +711,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -658,7 +726,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -667,14 +735,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (15*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 15*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -697,18 +765,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -740,22 +796,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 110
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 110
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -788,8 +929,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -936,6 +1079,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -948,6 +1097,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1000,7 +1155,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1060,7 +1215,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1095,7 +1252,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1127,28 +1284,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
#define NUM_SERVOS 0 // DGlass3D - Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1179,7 +1324,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h
index c8a56e4bd..2118f83d5 100644
--- a/Marlin/example_configurations/RigidBot/Configuration_adv.h
+++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -351,6 +402,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 1.75
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 8
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h
index a801823ee..389c6de23 100644
--- a/Marlin/example_configurations/SCARA/Configuration.h
+++ b/Marlin/example_configurations/SCARA/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -98,20 +108,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -148,17 +164,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -193,6 +232,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -209,7 +249,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -248,10 +288,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-#define EXTRUDER_WATTS (2*2/5.9) // P=U^2/R
-#define BED_WATTS (5.45*5.45/2.2) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -266,8 +302,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 20 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -392,18 +428,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -415,7 +512,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -448,6 +545,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -484,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -515,7 +628,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -549,8 +662,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -593,58 +709,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -653,18 +722,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- // For SCARA: Offset between HomingPosition and Bed X=0 / Y=0
- #define MANUAL_X_HOME_POS -22.
- #define MANUAL_Y_HOME_POS -52.
- #define MANUAL_Z_HOME_POS 0.1 // Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+#define MANUAL_X_HOME_POS -22
+#define MANUAL_Y_HOME_POS -52
+#define MANUAL_Z_HOME_POS 0.1 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -672,7 +737,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -681,14 +746,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (40*60)
+#define HOMING_FEEDRATE_Z (10*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -710,18 +775,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-//#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -753,22 +806,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -801,8 +939,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
//#define LCD_LANGUAGE en
@@ -949,6 +1089,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -961,6 +1107,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1011,7 +1163,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1071,7 +1223,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1106,7 +1260,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1138,28 +1292,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1190,7 +1332,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h
index 257142419..07f1e5654 100644
--- a/Marlin/example_configurations/SCARA/Configuration_adv.h
+++ b/Marlin/example_configurations/SCARA/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 180
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 180. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 180 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -351,6 +402,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 1.75
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h
index b2bd2ce8a..113a4f922 100644
--- a/Marlin/example_configurations/TAZ4/Configuration.h
+++ b/Marlin/example_configurations/TAZ4/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(Aleph Objects, Inc, TAZ config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 7
#define TEMP_SENSOR_1 7
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 250
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 16 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -405,18 +441,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -428,7 +525,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -461,6 +558,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -497,6 +609,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR true
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -528,7 +641,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -562,8 +675,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -606,58 +722,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -666,18 +735,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -685,7 +750,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -694,14 +759,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (8*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 8*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -723,18 +788,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -766,22 +819,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 230
+#define PREHEAT_2_TEMP_BED 110
+#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 230
-#define ABS_PREHEAT_HPB_TEMP 110
-#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -814,8 +952,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -962,6 +1102,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -974,6 +1120,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1024,7 +1176,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1084,7 +1236,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1119,7 +1273,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1151,28 +1305,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1203,7 +1345,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h
index 7dfb96e44..d0d98fb9f 100644
--- a/Marlin/example_configurations/TAZ4/Configuration_adv.h
+++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -185,24 +223,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -224,14 +280,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -245,7 +293,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -287,7 +335,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -359,6 +410,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -396,7 +450,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -412,9 +465,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -453,6 +507,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -496,12 +559,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -533,16 +611,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- #define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- //#define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- //#define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- //#define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -688,9 +780,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -700,19 +792,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h
index f32e071d1..e422e7c4f 100644
--- a/Marlin/example_configurations/WITBOX/Configuration.h
+++ b/Marlin/example_configurations/WITBOX/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(bq Witbox)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -126,17 +142,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -171,6 +210,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -187,7 +227,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -226,10 +266,6 @@
#define HEATER_3_MAXTEMP 260
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -244,8 +280,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -376,18 +412,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -399,7 +496,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -432,6 +529,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -468,6 +580,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -499,7 +612,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -533,8 +646,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -577,58 +693,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -637,18 +706,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -656,7 +721,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -665,14 +730,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (120*60)
+#define HOMING_FEEDRATE_Z 432
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {120*60, 120*60, 7.2*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -694,18 +759,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -737,22 +790,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 200
-#define PLA_PREHEAT_HPB_TEMP 0
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 200
+#define PREHEAT_1_TEMP_BED 0
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 220
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 220
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -785,8 +923,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
//#define LCD_LANGUAGE en
@@ -933,6 +1073,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -945,6 +1091,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -995,7 +1147,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1055,7 +1207,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1090,7 +1244,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1122,28 +1276,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1174,7 +1316,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h
index 50e8ba28f..b719e6072 100644
--- a/Marlin/example_configurations/WITBOX/Configuration_adv.h
+++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-//#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -351,6 +402,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 1.75
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h
index 151e16bc8..633d13090 100644
--- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h
+++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -384,18 +420,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -407,7 +504,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -440,6 +537,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -476,6 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -507,7 +620,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -541,8 +654,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -585,58 +701,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -645,18 +714,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -664,7 +729,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -673,14 +738,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (4*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -702,18 +767,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -745,22 +798,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 110
+#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 110
-#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -793,8 +931,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -941,6 +1081,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -953,6 +1099,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1003,7 +1155,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1063,7 +1215,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1098,7 +1252,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1130,28 +1284,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1182,7 +1324,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h
index 026a72733..0f1ef7e44 100644
--- a/Marlin/example_configurations/delta/biv2.5/Configuration.h
+++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 5
#define TEMP_SENSOR_1 5
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -426,18 +462,126 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 4000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
+// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
+//#define Z_PROBE_ALLEN_KEY
+
+#if ENABLED(Z_PROBE_ALLEN_KEY)
+ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
+ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
+
+ // Just like Kossel Pro
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_PROBE_SPEED)/2
+
+ #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Y -122.00
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0
+ #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_STOW_2_X 36.00 // move down to retract probe
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Y -122.00
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Z 25.0
+ #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/2
+
+ #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
+
+#endif // Z_PROBE_ALLEN_KEY
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -449,7 +593,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -482,6 +626,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 50 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -518,6 +677,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -549,7 +709,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -583,8 +743,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -631,99 +794,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 50 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
- // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
- // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
- //#define Z_PROBE_ALLEN_KEY
-
- #if ENABLED(Z_PROBE_ALLEN_KEY)
- // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
- // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
-
- // Just like Kossel Pro
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z 100.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (HOMING_FEEDRATE_XYZ)/2
-
- #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip
- #define Z_PROBE_ALLEN_KEY_STOW_1_Y -122.00
- #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0
- #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #define Z_PROBE_ALLEN_KEY_STOW_2_X 36.00 // move down to retract probe
- #define Z_PROBE_ALLEN_KEY_STOW_2_Y -122.00
- #define Z_PROBE_ALLEN_KEY_STOW_2_Z 25.0
- #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/2
-
- #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100
- #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0
- #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0
- #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #endif // Z_PROBE_ALLEN_KEY
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -732,17 +807,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section homing
-// The position of the homing switches
-#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
+// The center of the bed is at (X=0, Y=0)
+#define BED_CENTER_AT_0_0
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 405 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+#define MANUAL_Z_HOME_POS 405 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -750,7 +822,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -760,16 +832,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#endif
-// @section movement
+// Delta only homes to Z
+#define HOMING_FEEDRATE_Z (200*30)
-/**
- * MOVEMENT SETTINGS
- */
-
-// delta homing speeds must be the same on xyz
-#define HOMING_FEEDRATE_XYZ (200*30)
-#define HOMING_FEEDRATE_E 0
-#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E }
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
// delta speeds must be the same on xyz
@@ -791,18 +860,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -834,22 +891,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -882,8 +1024,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -1030,6 +1174,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -1042,6 +1192,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1092,7 +1248,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1152,7 +1308,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1187,7 +1345,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1219,28 +1377,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1271,7 +1417,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
index ecfe11c39..9183be44b 100644
--- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -353,6 +404,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -390,7 +444,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -406,9 +459,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -447,6 +501,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -490,12 +553,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -527,16 +605,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -682,9 +774,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -694,19 +786,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h
index dea1dfe83..d6cb1a1d0 100644
--- a/Marlin/example_configurations/delta/generic/Configuration.h
+++ b/Marlin/example_configurations/delta/generic/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,9 +224,9 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 -1
-#define TEMP_SENSOR_1 -1
+#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -426,18 +462,120 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 4000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
+// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
+//#define Z_PROBE_ALLEN_KEY
+
+#if ENABLED(Z_PROBE_ALLEN_KEY)
+ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
+ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
+ #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0
+ #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10
+
+ #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0
+ #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
+
+#endif // Z_PROBE_ALLEN_KEY
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -449,7 +587,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -482,6 +620,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -518,6 +671,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -549,7 +703,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -583,8 +737,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -631,93 +788,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points
- #define Z_RAISE_AFTER_PROBING 50 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
- // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
- // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
- //#define Z_PROBE_ALLEN_KEY
-
- #if ENABLED(Z_PROBE_ALLEN_KEY)
- // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
- // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
-
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/10
-
- #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position
- #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
- #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
- #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down
- #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0
- #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0
- #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/10
-
- #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear
- #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0
- #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0
- #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #endif // Z_PROBE_ALLEN_KEY
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -726,17 +801,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section homing
-// The position of the homing switches
-#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
+// The center of the bed is at (X=0, Y=0)
+#define BED_CENTER_AT_0_0
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+#define MANUAL_Z_HOME_POS 250 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -744,7 +816,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -754,16 +826,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#endif
-// @section movement
+// Delta only homes to Z
+#define HOMING_FEEDRATE_Z (200*60)
-/**
- * MOVEMENT SETTINGS
- */
-
-// delta homing speeds must be the same on xyz
-#define HOMING_FEEDRATE_XYZ (200*60)
-#define HOMING_FEEDRATE_E 0
-#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E }
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
// delta speeds must be the same on xyz
@@ -785,18 +854,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -828,22 +885,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -876,8 +1018,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -1024,6 +1168,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -1036,6 +1186,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1086,7 +1242,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1146,7 +1302,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1181,7 +1339,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1213,28 +1371,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1265,7 +1411,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h
index 145c3cdee..eb79a3041 100644
--- a/Marlin/example_configurations/delta/generic/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -353,6 +404,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -390,7 +444,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -406,9 +459,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -447,6 +501,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -490,12 +553,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -527,16 +605,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -682,9 +774,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -694,19 +786,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h
index b26298913..bdd3afc44 100644
--- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h
+++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 7
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -406,7 +442,7 @@
// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
//#define USE_XMIN_PLUG
//#define USE_YMIN_PLUG
-//#define USE_ZMIN_PLUG
+#define USE_ZMIN_PLUG
#define USE_XMAX_PLUG
#define USE_YMAX_PLUG
#define USE_ZMAX_PLUG
@@ -426,18 +462,123 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 4000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
+// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
+#define Z_PROBE_ALLEN_KEY
+
+#if ENABLED(Z_PROBE_ALLEN_KEY)
+ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
+ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
+
+ // Kossel Mini
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10)
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
+ // Move the probe into position
+ #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
+ #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED
+ // Move the nozzle down further to push the probe into retracted position.
+ #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH)
+ #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10)
+ // Raise things back up slightly so we don't bump into anything
+ #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH)
+ #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2)
+
+ #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
+
+#endif // Z_PROBE_ALLEN_KEY
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -449,7 +590,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -482,6 +623,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 50 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -518,6 +674,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 15// (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -549,7 +706,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -583,8 +740,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -631,96 +791,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points
- #define Z_RAISE_AFTER_PROBING 50 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
- // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
- // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
- #define Z_PROBE_ALLEN_KEY
-
- #if ENABLED(Z_PROBE_ALLEN_KEY)
- // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
- // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
-
- // Kossel Mini
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED
-
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED/10)
-
- #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
- // Move the probe into position
- #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0
- #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
- #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
- #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED
- // Move the nozzle down further to push the probe into retracted position.
- #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X
- #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y
- #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH)
- #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED/10)
- // Raise things back up slightly so we don't bump into anything
- #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X
- #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y
- #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH)
- #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_TRAVEL_SPEED/2)
-
- #endif // Z_PROBE_ALLEN_KEY
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -729,17 +804,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
+// The center of the bed is at (X=0, Y=0)
+#define BED_CENTER_AT_0_0
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+#define MANUAL_Z_HOME_POS 250 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -747,7 +819,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -757,16 +829,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#endif
-// @section movement
+// Delta only homes to Z
+#define HOMING_FEEDRATE_Z (200*60)
-/**
- * MOVEMENT SETTINGS
- */
-
-// delta homing speeds must be the same on xyz
-#define HOMING_FEEDRATE_XYZ (200*60)
-#define HOMING_FEEDRATE_E 0
-#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E }
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
// delta speeds must be the same on xyz
@@ -788,18 +857,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -831,22 +888,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -879,8 +1021,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -1027,6 +1171,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -1039,6 +1189,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1089,7 +1245,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1149,7 +1305,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1184,7 +1342,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1216,28 +1374,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1268,7 +1414,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
index 4e629b43e..7ec5948d0 100644
--- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -352,6 +403,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -389,7 +443,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -405,9 +458,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -446,6 +500,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -489,12 +552,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -526,16 +604,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -681,9 +773,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -693,19 +785,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h
index d87239d1a..3764b52d9 100644
--- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h
+++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h
@@ -44,8 +44,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -79,20 +89,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -129,17 +145,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -174,6 +213,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -190,7 +230,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 5
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -229,10 +269,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -247,8 +283,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 50 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -415,18 +451,128 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -23 // KosselPro actual: -22.919
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // KosselPro actual: -6.304
+// Kossel Pro note: The correct value is likely -17.45 but I'd rather err on the side of
+// not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed.
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -17.25 // Increase this if the first layer is too thin (remember: it's a negative number so increase means closer to zero).
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
+// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
+#define Z_PROBE_ALLEN_KEY
+
+#if ENABLED(Z_PROBE_ALLEN_KEY)
+ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
+ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
+
+ // Kossel Pro
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_PROBE_SPEED)/2
+
+ #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Y -125.00
+ #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0
+ #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X // move down to retract probe
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y
+ #define Z_PROBE_ALLEN_KEY_STOW_2_Z 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/2
+
+ #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0
+ #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED
+
+ #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
+ #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
+
+#endif // Z_PROBE_ALLEN_KEY
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -438,7 +584,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -471,6 +617,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 100 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -15
+#define Z_PROBE_OFFSET_RANGE_MAX 5
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -507,6 +668,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -538,7 +700,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -572,8 +734,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -620,101 +785,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -23 // KosselPro actual: -22.919
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // KosselPro actual: -6.304
- // Kossel Pro note: The correct value is likely -17.45 but I'd rather err on the side of
- // not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed.
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -17.25 // Increase this if the first layer is too thin (remember: it's a negative number so increase means closer to zero).
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 100 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
- // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
- // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
- #define Z_PROBE_ALLEN_KEY
-
- #if ENABLED(Z_PROBE_ALLEN_KEY)
- // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
- // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
-
- // Kossel Pro
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (HOMING_FEEDRATE_XYZ)/2
-
- #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip
- #define Z_PROBE_ALLEN_KEY_STOW_1_Y -125.00
- #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0
- #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X // move down to retract probe
- #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y
- #define Z_PROBE_ALLEN_KEY_STOW_2_Z 0.0
- #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/2
-
- #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100
- #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0
- #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0
- #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #endif // Z_PROBE_ALLEN_KEY
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -723,17 +798,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
+// The center of the bed is at (X=0, Y=0)
+#define BED_CENTER_AT_0_0
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 277 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+#define MANUAL_Z_HOME_POS 277 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -741,7 +813,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
#define Z_SAFE_HOMING
@@ -751,16 +823,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#endif
-// @section movement
+// Delta only homes to Z
+#define HOMING_FEEDRATE_Z (200*60)
-/**
- * MOVEMENT SETTINGS
- */
-
-// delta homing speeds must be the same on xyz
-#define HOMING_FEEDRATE_XYZ (200*60)
-#define HOMING_FEEDRATE_E 0
-#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E }
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
#define XYZ_FULL_STEPS_PER_ROTATION 200
#define XYZ_MICROSTEPS 32
@@ -788,18 +857,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -15
- #define Z_PROBE_OFFSET_RANGE_MAX -5
- #endif
-#endif
-
// @section extras
//
@@ -831,22 +888,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -879,8 +1021,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -1027,6 +1171,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -1039,6 +1189,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1089,7 +1245,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1149,7 +1305,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1184,7 +1342,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1216,28 +1374,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1268,7 +1414,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
index cc7d88b72..811477921 100644
--- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
@@ -38,7 +38,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -107,8 +118,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -133,15 +144,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -182,24 +220,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -221,14 +277,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -242,7 +290,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -284,7 +332,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -357,6 +408,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -394,7 +448,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -410,9 +463,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -451,6 +505,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -494,12 +557,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -531,16 +609,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -686,9 +778,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -698,19 +790,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/delta/kossel_pro/readme.md b/Marlin/example_configurations/delta/kossel_pro/README.md
similarity index 100%
rename from Marlin/example_configurations/delta/kossel_pro/readme.md
rename to Marlin/example_configurations/delta/kossel_pro/README.md
diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h
index fa4e96d58..8c6195bb3 100644
--- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h
+++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -66,20 +76,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(oxivanisher)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -116,17 +132,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 2
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -161,6 +200,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -177,7 +217,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 5
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -216,10 +256,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -234,8 +270,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -424,18 +460,120 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle X offset: -left +right
+#define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle Y offset: -front +behind
+#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.3 // Z probe to nozzle Z offset: -below (always!)
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
+// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
+//#define Z_PROBE_ALLEN_KEY
+
+#if ENABLED(Z_PROBE_ALLEN_KEY)
+ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
+ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
+
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED
+
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10
+
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
+ //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
+
+ //#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position
+ //#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
+ //#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
+ //#define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED
+
+ //#define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down
+ //#define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0
+ //#define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0
+ //#define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10
+
+ //#define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear
+ //#define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0
+ //#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0
+ //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED
+
+ //#define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
+ //#define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
+ //#define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
+ //#define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
+
+#endif // Z_PROBE_ALLEN_KEY
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -447,7 +585,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -480,6 +618,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 20 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 10 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -516,6 +669,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -547,7 +701,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -581,8 +735,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -629,93 +786,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle X offset: -left +right
- #define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle Y offset: -front +behind
- #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.3 // Z probe to nozzle Z offset: -below (always!)
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 20 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 10 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 20 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- #define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
- // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
- // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
- //#define Z_PROBE_ALLEN_KEY
-
- #if ENABLED(Z_PROBE_ALLEN_KEY)
- // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
- // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
-
- //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0
- //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS
- //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
- //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE HOMING_FEEDRATE_XYZ
-
- //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0
- //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS
- //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
- //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/10
-
- //#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position
- //#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
- //#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
- //#define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE HOMING_FEEDRATE_XYZ
-
- //#define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down
- //#define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0
- //#define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0
- //#define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/10
-
- //#define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear
- //#define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0
- //#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0
- //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_XYZ
-
- #endif // Z_PROBE_ALLEN_KEY
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -724,17 +799,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
+// The center of the bed is at (X=0, Y=0)
+#define BED_CENTER_AT_0_0
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 381.4 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+#define MANUAL_Z_HOME_POS 381.4 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -742,7 +814,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -751,17 +823,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Delta only homes to Z
+#define HOMING_FEEDRATE_Z (60*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-// delta homing speeds must be the same on xyz
-#define HOMING_FEEDRATE_XYZ (60*60)
-#define HOMING_FEEDRATE_E 0
-#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E }
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// variables to calculate steps
#define XYZ_FULL_STEPS_PER_ROTATION 200
@@ -772,6 +840,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// delta speeds must be the same on xyz
#define XYZ_STEPS (XYZ_FULL_STEPS_PER_ROTATION * XYZ_MICROSTEPS / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH))
+// default settings
+
#define DEFAULT_AXIS_STEPS_PER_UNIT {XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 158} // default steps per unit for PowerWasp
#define DEFAULT_MAX_FEEDRATE {200, 200, 200, 25} // (mm/sec)
#define DEFAULT_MAX_ACCELERATION {9000,9000,9000,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
@@ -790,18 +860,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -833,22 +891,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
+
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -881,8 +1024,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
#define LCD_LANGUAGE en
@@ -1029,6 +1174,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -1041,6 +1192,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1091,7 +1248,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1151,7 +1308,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1186,7 +1345,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1218,28 +1377,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1270,7 +1417,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
index 3d90e5a65..2a7399bb0 100644
--- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
+++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -353,6 +404,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -390,7 +444,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -406,9 +459,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -447,6 +501,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -490,12 +553,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -527,16 +605,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -682,9 +774,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -694,19 +786,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h
index 1991ee620..49196a128 100644
--- a/Marlin/example_configurations/makibox/Configuration.h
+++ b/Marlin/example_configurations/makibox/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -387,18 +423,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -410,7 +507,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -443,6 +540,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
@@ -479,6 +591,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -510,7 +623,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -544,8 +657,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -588,58 +704,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -648,18 +717,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -667,7 +732,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -676,14 +741,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY 1500
+#define HOMING_FEEDRATE_Z (2*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {1500, 1500, 120, 0} // set the homing speeds (mm/min) ***** MakiBox A6 *****
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -705,18 +770,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -748,22 +801,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -796,8 +934,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
//#define LCD_LANGUAGE en
@@ -944,6 +1084,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -956,6 +1102,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -1006,7 +1158,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1066,7 +1218,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1101,7 +1255,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1133,28 +1287,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1185,7 +1327,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h
index 1621cbd31..22cefd538 100644
--- a/Marlin/example_configurations/makibox/Configuration_adv.h
+++ b/Marlin/example_configurations/makibox/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -351,6 +402,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h
index c380ee2a0..60ba4d6ca 100644
--- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h
+++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h
@@ -38,8 +38,18 @@
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include "boards.h"
-#include "macros.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_H_VERSION 010100
//===========================================================================
//============================= Getting Started =============================
@@ -73,20 +83,26 @@
// @section info
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
-
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
-#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
-//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
+#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
+#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2
+//
+// *** VENDORS PLEASE READ *****************************************************
+//
+// Marlin now allow you to have a vendor boot image to be displayed on machine
+// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
+// custom boot image and them the default Marlin boot image is shown.
+//
+// We suggest for you to take advantage of this new feature and keep the Marlin
+// boot image unmodified. For an example have a look at the bq Hephestos 2
+// example configuration folder.
+//
+//#define SHOW_CUSTOM_BOOTSCREEN
// @section machine
// SERIAL_PORT selects which serial port should be used for communication with the host.
@@ -123,17 +139,40 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// A dual extruder that uses a single stepper motor
+// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z
+//#define SWITCHING_EXTRUDER
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define SWITCHING_EXTRUDER_SERVO_NR 0
+ #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1
+ //#define HOTEND_OFFSET_Z {0.0, 0.0}
+#endif
+
+/**
+ * "Mixing Extruder"
+ * - Adds a new code, M165, to set the current mix factors.
+ * - Extends the stepping routines to move multiple steppers in proportion to the mix.
+ * - Optional support for Repetier Host M163, M164, and virtual extruder.
+ * - This implementation supports only a single extruder.
+ * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
+ */
+//#define MIXING_EXTRUDER
+#if ENABLED(MIXING_EXTRUDER)
+ #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
+ #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
+ //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
+#endif
+
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend.
-//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
-//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
//// The following define selects which power supply you have. Please choose the one that matches your setup
// 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
// :{1:'ATX',2:'X-Box 360'}
-
#define POWER_SUPPLY 1
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
@@ -168,6 +207,7 @@
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
+// 66 is 4.7M High Temperature thermistor from Dyze Design
// 70 is the 100K thermistor found in the bq Hephestos 2
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
@@ -184,7 +224,7 @@
// Use it for Testing or Development purposes. NEVER for production machine.
//#define DUMMY_THERMISTOR_998_VALUE 25
//#define DUMMY_THERMISTOR_999_VALUE 100
-// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
+// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" }
#define TEMP_SENSOR_0 5
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
@@ -223,10 +263,6 @@
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R
-//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R
-
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
@@ -241,8 +277,8 @@
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
- //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
- // Set/get with gcode: M301 E[extruder number, 0-2]
+ //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
+ // Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
@@ -374,18 +410,79 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
-const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
+//
+// Probe Type
+// Probes are sensors/switches that are activated / deactivated before/after use.
+//
+// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
+// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below.
+//
+// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500.
+//
+
+// A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
+// For example an inductive probe, or a setup that uses the nozzle to probe.
+// An inductive probe must be deactivated to go below
+// its trigger-point if hardware endstops are active.
+//#define FIX_MOUNTED_PROBE
+
+// The BLTouch probe emulates a servo probe.
+//#define BLTOUCH
+
+// Z Servo Probe, such as an endstop switch on a rotating arm.
+//#define Z_ENDSTOP_SERVO_NR 0
+//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles
+
+// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
+//#define Z_PROBE_SLED
+//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
+
+// Z Probe to nozzle (X,Y) offset, relative to (0, 0).
+// X and Y offsets must be integers.
+//
+// In the following example the X and Y offsets are both positive:
+// #define X_PROBE_OFFSET_FROM_EXTRUDER 10
+// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
+//
+// +-- BACK ---+
+// | |
+// L | (+) P | R <-- probe (20,20)
+// E | | I
+// F | (-) N (+) | G <-- nozzle (10,10)
+// T | | H
+// | (-) | T
+// | |
+// O-- FRONT --+
+// (0,0)
+#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
+#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
+
+// X and Y axis travel speed (mm/m) between probes
+#define XY_PROBE_SPEED 8000
+// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
+#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
+// Speed for the "accurate" probe of each point
+#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
+// Use double touch for probing
+//#define PROBE_DOUBLE_TOUCH
+
+//
+// Allen Key Probe is defined in the Delta example configurations.
+//
+
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
@@ -397,7 +494,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN.
//
// For a servo-based Z probe, you must set up servo support below, including
-// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES.
+// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES.
//
// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin.
// - Use 5V for powered (usu. inductive) sensors.
@@ -430,6 +527,21 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP
+// Enable Z Probe Repeatability test to see how accurate your probe is
+//#define Z_MIN_PROBE_REPEATABILITY_TEST
+
+//
+// Probe Raise options provide clearance for the probe to deploy, stow, and travel.
+//
+#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow
+#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points.
+
+//
+// For M851 give a range for adjusting the Z probe offset
+//
+#define Z_PROBE_OFFSET_RANGE_MIN -20
+#define Z_PROBE_OFFSET_RANGE_MAX 20
+
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 1
@@ -466,6 +578,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define INVERT_E3_DIR false
// @section homing
+
//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
@@ -497,7 +610,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// It is assumed that when logic high = filament available
// when logic low = filament ran out
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
+ const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor.
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif
@@ -531,8 +644,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section bedlevel
//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line)
+
+// Enable this feature to get detailed logging of G28, G29, M48, etc.
+// Logging is off by default. Enable this logging feature with 'M111 S32'.
+// NOTE: Requires a huge amount of PROGMEM.
//#define DEBUG_LEVELING_FEATURE
-#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -575,58 +691,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
- #endif // AUTO_BED_LEVELING_GRID
-
- // Z Probe to nozzle (X,Y) offset, relative to (0, 0).
- // X and Y offsets must be integers.
- //
- // In the following example the X and Y offsets are both positive:
- // #define X_PROBE_OFFSET_FROM_EXTRUDER 10
- // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
- //
- // +-- BACK ---+
- // | |
- // L | (+) P | R <-- probe (20,20)
- // E | | I
- // F | (-) N (+) | G <-- nozzle (10,10)
- // T | | H
- // | (-) | T
- // | |
- // O-- FRONT --+
- // (0,0)
- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle]
- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle]
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle]
-
- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min.
-
- #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points.
- #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point.
+ #endif // !AUTO_BED_LEVELING_GRID
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.
- // Probes are sensors/switches that need to be activated before they can be used
- // and deactivated after their use.
- // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE
-
- // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
- // when the hardware endstops are active.
- //#define FIX_MOUNTED_PROBE
-
- // A Servo Probe can be defined in the servo section below.
-
- // An Allen Key Probe is currently predefined only in the delta example configurations.
-
- // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell.
- //#define Z_PROBE_SLED
- //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
-
- // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment
- // For example any setup that uses the nozzle itself as a probe.
- //#define MECHANICAL_PROBE
-
// If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing,
// it is highly recommended you also enable Z_SAFE_HOMING below!
@@ -635,18 +704,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// @section homing
-// The position of the homing switches
-//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
-//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
-
-// Manual homing switch locations:
-// For deltabots this means top and center of the Cartesian print volume.
-#if ENABLED(MANUAL_HOME_POSITIONS)
- #define MANUAL_X_HOME_POS 0
- #define MANUAL_Y_HOME_POS 0
- #define MANUAL_Z_HOME_POS 0
- //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
-#endif
+// The center of the bed is at (X=0, Y=0)
+//#define BED_CENTER_AT_0_0
+
+// Manually set the home position. Leave these undefined for automatic settings.
+// For DELTA this is the top-center of the Cartesian print volume.
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
@@ -654,7 +719,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING
@@ -663,14 +728,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
#endif
+// Homing speeds (mm/m)
+#define HOMING_FEEDRATE_XY (50*60)
+#define HOMING_FEEDRATE_Z (4*60)
-// @section movement
-
-/**
- * MOVEMENT SETTINGS
- */
-
-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
+//
+// MOVEMENT SETTINGS
+// @section motion
+//
// default settings
@@ -696,18 +761,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//============================= Additional Features ===========================
//=============================================================================
-// @section more
-
-// Custom M code points
-#define CUSTOM_M_CODES
-#if ENABLED(CUSTOM_M_CODES)
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
- #define Z_PROBE_OFFSET_RANGE_MIN -20
- #define Z_PROBE_OFFSET_RANGE_MAX 20
- #endif
-#endif
-
// @section extras
//
@@ -739,22 +792,107 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
+//
+// G20/G21 Inch mode support
+//
+//#define INCH_MODE_SUPPORT
+
+//
+// M149 Set temperature units support
+//
+//#define TEMPERATURE_UNITS_SUPPORT
+
// @section temperature
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
-#define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#define PREHEAT_1_TEMP_HOTEND 180
+#define PREHEAT_1_TEMP_BED 70
+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+
+#define PREHEAT_2_TEMP_HOTEND 240
+#define PREHEAT_2_TEMP_BED 100
+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+
+//
+// Nozzle Park -- EXPERIMENTAL
+//
+// When enabled allows the user to define a special XYZ position, inside the
+// machine's topology, to park the nozzle when idle or when receiving the G27
+// command.
+//
+// The "P" paramenter controls what is the action applied to the Z axis:
+// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
+// be raised to reach Z-park height.
+//
+// P1: No matter the current Z-pos, the nozzle will be raised/lowered to
+// reach Z-park height.
+//
+// P2: The nozzle height will be raised by Z-park amount but never going over
+// the machine's limit of Z_MAX_POS.
+//
+//#define NOZZLE_PARK_FEATURE
+
+#if ENABLED(NOZZLE_PARK_FEATURE)
+ // Specify a park position as { X, Y, Z }
+ #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+#endif
+
+//
+// Clean Nozzle Feature -- EXPERIMENTAL
+//
+// When enabled allows the user to send G12 to start the nozzle cleaning
+// process, the G-Code accepts two parameters:
+// "P" for pattern selection
+// "S" for defining the number of strokes/repetitions
+//
+// Available list of patterns:
+// P0: This is the default pattern, this process requires a sponge type
+// material at a fixed bed location, the cleaning process is based on
+// "strokes" i.e. back-and-forth movements between the starting and end
+// points.
+//
+// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
+// defines the number of zig-zag triangles to be done. "S" defines the
+// number of strokes aka one back-and-forth movement. As an example
+// sending "G12 P1 S1 T3" will execute:
+//
+// --
+// | (X0, Y1) | /\ /\ /\ | (X1, Y1)
+// | | / \ / \ / \ |
+// A | | / \ / \ / \ |
+// | | / \ / \ / \ |
+// | (X0, Y0) | / \/ \/ \ | (X1, Y0)
+// -- +--------------------------------+
+// |________|_________|_________|
+// T1 T2 T3
+//
+// Caveats: End point Z should use the same value as Start point Z.
+//
+// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
+// may change to add new functionality like different wipe patterns.
+//
+//#define NOZZLE_CLEAN_FEATURE
-#define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
-#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
+ // Number of pattern repetitions
+ #define NOZZLE_CLEAN_STROKES 12
+
+ // Specify positions as { X, Y, Z }
+ #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
+ #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)}
+
+ // Moves the nozzle to the initial position
+ #define NOZZLE_CLEAN_GOBACK
+#endif
//
// Print job timer
//
// Enable this option to automatically start and stop the
-// print job timer when M104 and M109 commands are received.
+// print job timer when M104/M109/M190 commands are received.
+// M104 (extruder without wait) - high temp = none, low temp = stop timer
+// M109 (extruder with wait) - high temp = start timer, low temp = stop timer
+// M190 (bed with wait) - high temp = start timer, low temp = none
//
// In all cases the timer can be started and stopped using
// the following commands:
@@ -787,8 +925,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
// Here you may choose the language used by Marlin on the LCD menus, the following
// list of languages are available:
-// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8,
-// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test
+// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
+// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test
+//
+// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'}
//
//#define LCD_LANGUAGE en
@@ -935,6 +1075,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define ULTIPANEL
+//
+// Cartesio UI
+// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
+//
+//#define CARTESIO_UI
+
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
@@ -947,6 +1093,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define MAKRPANEL
+//
+// ReprapWorld Graphical LCD
+// https://reprapworld.com/?products_details&products_id/1218
+//
+//#define REPRAPWORLD_GRAPHICAL_LCD
+
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
@@ -997,7 +1149,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
//
// RigidBot Panel V1.0
@@ -1057,7 +1209,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306
+//
// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
+//
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
@@ -1092,7 +1246,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
-// Temperature status LEDs that display the hotend and bet temperature.
+// Temperature status LEDs that display the hotend and bed temperature.
// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
// Otherwise the RED led is on. There is 1C hysteresis.
//#define TEMP_STAT_LEDS
@@ -1124,28 +1278,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
-// Servo Endstops
-//
-// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
-// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
-//
-//#define X_ENDSTOP_SERVO_NR 1
-//#define Y_ENDSTOP_SERVO_NR 2
-//#define Z_ENDSTOP_SERVO_NR 0
-//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles
+// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle.
+// 300ms is a good value but you can try less delay.
+// If the servo can't reach the requested position, increase it.
+#define SERVO_DELAY 300
// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- // Delay (in microseconds) before turning the servo off. This depends on the servo speed.
- // 300ms is a good value but you can try less delay.
- // If the servo can't reach the requested position, increase it.
- #define SERVO_DEACTIVATION_DELAY 300
-#endif
-
/**********************************************************************\
* Support for a filament diameter sensor
* Also allows adjustment of diameter at print time (vs at slicing)
@@ -1176,7 +1318,4 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//#define FILAMENT_LCD_DISPLAY
#endif
-#include "Configuration_adv.h"
-#include "thermistortables.h"
-
-#endif //CONFIGURATION_H
+#endif // CONFIGURATION_H
diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
index 81db41194..2ececd4c3 100644
--- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
+++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
@@ -33,7 +33,18 @@
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
-#include "Conditionals.h"
+/**
+ *
+ * ***********************************
+ * ** ATTENTION TO ALL DEVELOPERS **
+ * ***********************************
+ *
+ * You must increment this version number for every significant change such as,
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
+ *
+ * Note: Update also Version.h !
+ */
+#define CONFIGURATION_ADV_H_VERSION 010100
// @section temperature
@@ -102,8 +113,8 @@
#if ENABLED(PIDTEMP)
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
- #define PID_ADD_EXTRUSION_RATE
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ //#define PID_EXTRUSION_SCALING
+ #if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50
#endif
@@ -128,15 +139,42 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
+/**
+ * High Temperature Thermistor Support
+ *
+ * Thermistors able to support high temperature tend to have a hard time getting
+ * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
+ * will probably be caught when the heating element first turns on during the
+ * preheating process, which will trigger a min_temp_error as a safety measure
+ * and force stop everything.
+ * To circumvent this limitation, we allow for a preheat time (during which,
+ * min_temp_error won't be triggered) and add a min_temp buffer to handle
+ * aberrant readings.
+ *
+ * If you want to enable this feature for your hotend thermistor(s)
+ * uncomment and set values > 0 in the constants below
+ */
+
+// The number of consecutive low temperature errors that can occur
+// before a min_temp_error is triggered. (Shouldn't be more than 10.)
+//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
+
+// The number of milliseconds a hotend will preheat before starting to check
+// the temperature. This value should NOT be set to the time it takes the
+// hot end to reach the target temperature, but the time it takes to reach
+// the minimum temperature your thermistor can read. The lower the better/safer.
+// This shouldn't need to be more than 30 seconds (30000)
+//#define MILLISECONDS_PREHEAT_TIME 0
+
// @section extruder
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
#define EXTRUDER_RUNOUT_MINTEMP 190
-#define EXTRUDER_RUNOUT_SECONDS 30.
-#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
-#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed
+#define EXTRUDER_RUNOUT_SECONDS 30
+#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
+#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
#define EXTRUDER_RUNOUT_EXTRUDE 100
// @section temperature
@@ -177,24 +215,42 @@
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
-
//===========================================================================
-//=============================Mechanical Settings===========================
+//============================ Mechanical Settings ==========================
//===========================================================================
// @section homing
-#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
+// If you want endstops to stay on (by default) even when not homing
+// enable this option. Override at any time with M120, M121.
+//#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
+// Dual X Steppers
+// Uncomment this option to drive two X axis motors.
+// The next unused E driver will be assigned to the second X stepper.
+//#define X_DUAL_STEPPER_DRIVERS
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ // Set true if the two X motors need to rotate in opposite directions
+ #define INVERT_X2_VS_X_DIR true
+#endif
+
+
+// Dual Y Steppers
+// Uncomment this option to drive two Y axis motors.
+// The next unused E driver will be assigned to the second Y stepper.
+//#define Y_DUAL_STEPPER_DRIVERS
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ // Set true if the two Y motors need to rotate in opposite directions
+ #define INVERT_Y2_VS_Y_DIR true
+#endif
+
// A single Z stepper driver is usually used to drive 2 stepper motors.
-// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
-// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
-// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
-// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
+// Uncomment this option to use a separate stepper driver for each Z axis motor.
+// The next unused E driver will be assigned to the second Z stepper.
//#define Z_DUAL_STEPPER_DRIVERS
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
@@ -216,14 +272,6 @@
#endif // Z_DUAL_STEPPER_DRIVERS
-// Same again but for Y Axis.
-//#define Y_DUAL_STEPPER_DRIVERS
-
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- // Define if the two Y drives need to rotate in opposite directions
- #define INVERT_Y2_VS_Y_DIR true
-#endif
-
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -237,7 +285,7 @@
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
- // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
+ // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
@@ -279,7 +327,10 @@
#define AXIS_RELATIVE_MODES {false, false, false, false}
-//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
+// Allow duplication mode with a basic dual-nozzle extruder
+//#define DUAL_NOZZLE_DUPLICATION_MODE
+
+// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
@@ -351,6 +402,9 @@
// @section lcd
+// Include a page of printer information in the LCD Main Menu
+//#define LCD_INFO_MENU
+
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -388,7 +442,6 @@
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
- // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
#endif // SDSUPPORT
@@ -404,9 +457,10 @@
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
-// @section more
+// @section safety
-// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+// The hardware watchdog should reset the microcontroller disabling all outputs,
+// in case the firmware gets stuck and doesn't do temperature regulation.
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
@@ -445,6 +499,15 @@
#define D_FILAMENT 2.85
#endif
+// Implementation of a linear pressure control
+// Assumption: advance = k * (delta velocity)
+// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
+//#define LIN_ADVANCE
+
+#if ENABLED(LIN_ADVANCE)
+ #define LIN_ADVANCE_K 75
+#endif
+
// @section leveling
// Default mesh area is an area with an inset margin on the print area.
@@ -488,12 +551,27 @@ const unsigned int dropsegments = 5; //everything with less than this number of
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif
-// @section more
+// @section serial
-//The ASCII buffer for receiving from the serial:
+// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
+// Transfer Buffer Size
+// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
+// To buffer a simple "ok" you need 4 bytes.
+// For ADVANCED_OK (M105) you need 32 bytes.
+// For debug-echo: 128 bytes for the optimal speed.
+// Other output doesn't need to be that speedy.
+// :[0,2,4,8,16,32,64,128,256]
+#define TX_BUFFER_SIZE 0
+
+// Enable an emergency-command parser to intercept certain commands as they
+// enter the serial receive buffer, so they cannot be blocked.
+// Currently handles M108, M112, M410
+// Does not work on boards using AT90USB (USBCON) processors!
+//#define EMERGENCY_PARSER
+
// Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
@@ -525,16 +603,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of
// Add support for experimental filament exchange support M600; requires display
#if ENABLED(ULTIPANEL)
- //#define FILAMENTCHANGEENABLE
- #if ENABLED(FILAMENTCHANGEENABLE)
- #define FILAMENTCHANGE_XPOS 3
- #define FILAMENTCHANGE_YPOS 3
- #define FILAMENTCHANGE_ZADD 10
- #define FILAMENTCHANGE_FIRSTRETRACT -2
- #define FILAMENTCHANGE_FINALRETRACT -100
- #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
- #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
- #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
+ // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
+ #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
+ #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
+ #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
+ #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
+ #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm
+ // It is a short retract used immediately after print interrupt before move to filament exchange position
+ #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
+ #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
+ // Longer length for bowden printers to unload filament from whole bowden tube,
+ // shorter lenght for printers without bowden to unload filament from extruder only,
+ // 0 to disable unloading for manual unloading
+ #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
+ #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
+ // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
+ // Short or zero length for printers without bowden where loading is not used
+ #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
+ #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
+ // 0 to disable for manual extrusion
+ // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
+ // or until outcoming filament color is not clear for filament color change
+ #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
#endif
#endif
@@ -680,9 +772,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* devices on the bus.
*
* ; Example #1
- * ; This macro send the string "Marlin" to the slave device with address 0x63
+ * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
* ; It uses multiple M155 commands with one B arg
- * M155 A63 ; Target slave address
+ * M155 A99 ; Target slave address
* M155 B77 ; M
* M155 B97 ; a
* M155 B114 ; r
@@ -692,19 +784,16 @@ const unsigned int dropsegments = 5; //everything with less than this number of
* M155 S1 ; Send the current buffer
*
* ; Example #2
- * ; Request 6 bytes from slave device with address 0x63
- * M156 A63 B5
+ * ; Request 6 bytes from slave device with address 0x63 (99)
+ * M156 A99 B5
*
* ; Example #3
* ; Example serial output of a M156 request
- * echo:i2c-reply: from:63 bytes:5 data:hello
+ * echo:i2c-reply: from:99 bytes:5 data:hello
*/
// @section i2cbus
//#define EXPERIMENTAL_I2CBUS
-#include "Conditionals.h"
-#include "SanityCheck.h"
-
-#endif //CONFIGURATION_ADV_H
+#endif // CONFIGURATION_ADV_H
diff --git a/Marlin/fastio.h b/Marlin/fastio.h
index 10464bf50..3a608e005 100644
--- a/Marlin/fastio.h
+++ b/Marlin/fastio.h
@@ -2047,11 +2047,6 @@
#endif
#if defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
- // SPI
- #define SCK DIO9
- #define MISO DIO11
- #define MOSI DIO10
- #define SS DIO8
// change for your board
#define DEBUG_LED DIO31 /* led D5 red */
@@ -2063,6 +2058,12 @@
//#define AT90USBxx_TEENSYPP_ASSIGNMENTS // Use Teensy++ 2.0 assignments
#ifndef AT90USBxx_TEENSYPP_ASSIGNMENTS // Use traditional Marlin pin assignments
+ // SPI
+ #define SCK DIO9 // 21
+ #define MISO DIO11 // 23
+ #define MOSI DIO10 // 22
+ #define SS DIO8 // 20
+
#define DIO0_PIN PINA0
#define DIO0_RPORT PINA
#define DIO0_WPORT PORTA
@@ -2707,6 +2708,12 @@
The pins 46 and 47 are not supported by Teensyduino, but are supported below.
*/
+ // SPI
+ #define SCK DIO21 // 9
+ #define MISO DIO23 // 11
+ #define MOSI DIO22 // 10
+ #define SS DIO20 // 8
+
#define DIO0_PIN PIND0
#define DIO0_RPORT PIND
#define DIO0_WPORT PORTD
diff --git a/Marlin/fonts/README.md b/Marlin/fonts/README.md
deleted file mode 100644
index 86e54929b..000000000
--- a/Marlin/fonts/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience).
-
-In Fony export the fonts to bdf-format. (Maybe another one can edit them with Fontforge.) Then run `make_fonts.bat` which calls `bdf2u8g.exe` with the parameters needed to produce the `.h` files. The `.h` files must be edited and moved:
-- Replace `#include "u8g.h"` with `#include `,
-- Replace `U8G_FONT_SECTION` with `U8G_SECTION`,
-- Insert `.progmem.` right after the first quote `"`,
-- Move the file to the main directory.
-
-How to integrate a new font:
-Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixels per line. So to have any space between the lines we can use no more than 10 pixel height for the symbols. For up to 11 pixels set TALL_FONT_CORRECTION 1 when loading the font.
-To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols.
-For the second half of the font we now support up to 11x11 pixel.
-
-- Get `Fony.exe` from [hukka.ncn.fi](http://hukka.ncn.fi/?fony)
-- Copy one of the existing `*.fon` files and use the copy for your work.
-- Only change the pixels. Don't change width or height.
-- Export as a `*.bdf` file
-- Use `bdf2u8g.exe` to produce the `.h` file. Examples for the existing fonts are in `make_fonts.bat`.
-- Edit the produced `.h` file to match our needs. Find hints in the `dogm_font_data_.h` files.
-- Make a new entry in the font list in `dogm_lcd_implementation.h` before the `#else // fall-back` line:
-```cpp
- #elif ENABLED(DISPLAY_CHARSET_NEWNAME)
- #include "dogm_font_data_yourfont.h"
- #define FONT_MENU_NAME YOURFONTNAME
- #else // fall-back
-```
-- Add your font to the list of permitted fonts in 'language_en.h'
-```cpp
- ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... )
-```
\ No newline at end of file
diff --git a/Marlin/fonts/bdf2u8g.exe b/Marlin/fonts/bdf2u8g.exe
deleted file mode 100644
index 1e51b2656..000000000
Binary files a/Marlin/fonts/bdf2u8g.exe and /dev/null differ
diff --git a/Marlin/language.h b/Marlin/language.h
index edef06be1..496fed5c9 100644
--- a/Marlin/language.h
+++ b/Marlin/language.h
@@ -23,7 +23,7 @@
#ifndef LANGUAGE_H
#define LANGUAGE_H
-#include "Configuration.h"
+#include "MarlinConfig.h"
// Fallback if no language is set. DON'T CHANGE
#ifndef LCD_LANGUAGE
@@ -42,34 +42,31 @@
// See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
// Languages
-// en English
-// pl Polish
-// fr French
+// an Aragonese
+// bg Bulgarian
+// ca Catalan
+// cn Chinese
+// cz Czech
// de German
+// el Greek
+// el-gr Greek (Greece)
+// en English
// es Spanish
-// ru Russian
-// bg Bulgarian
-// it Italian
-// pt Portuguese
-// pt_utf8 Portuguese (UTF8)
-// pt-br Portuguese (Brazilian)
-// pt-br_utf8 Portuguese (Brazilian UTF8)
+// eu Basque-Euskera
// fi Finnish
-// an Aragonese
-// nl Dutch
+// fr French
// gl Galician
-// ca Catalan
-// eu Basque-Euskera
+// hr Croatian
+// it Italian
// kana Japanese
// kana_utf8 Japanese (UTF8)
-// cn Chinese
-// cz Czech
-
-#if ENABLED(USE_AUTOMATIC_VERSIONING)
- #include "_Version.h"
-#else
- #include "Version.h"
-#endif
+// nl Dutch
+// pl Polish
+// pt Portuguese
+// pt-br Portuguese (Brazilian)
+// pt-br_utf8 Portuguese (Brazilian UTF8)
+// pt_utf8 Portuguese (UTF8)
+// ru Russian
#ifdef DEFAULT_SOURCE_CODE_URL
#undef SOURCE_CODE_URL
@@ -116,6 +113,7 @@
#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: "
#define MSG_OK "ok"
#define MSG_WAIT "wait"
+#define MSG_STATS "Stats: "
#define MSG_FILE_SAVED "Done saving file."
#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: "
#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: "
@@ -127,7 +125,7 @@
#define MSG_INVALID_EXTRUDER "Invalid extruder"
#define MSG_INVALID_SOLENOID "Invalid solenoid"
#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature"
-#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
+#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID EMERGENCY_PARSER_CAPABILITIES "\n"
#define MSG_COUNT_X " Count X: "
#define MSG_COUNT_A " Count A: "
#define MSG_ERR_KILLED "Printer halted. kill() called!"
@@ -155,8 +153,9 @@
#define MSG_ENDSTOP_HIT "TRIGGERED"
#define MSG_ENDSTOP_OPEN "open"
#define MSG_HOTEND_OFFSET "Hotend offsets:"
+#define MSG_DUPLICATION_MODE "Duplication mode: "
-#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
+#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir "
#define MSG_SD_INIT_FAIL "SD init fail"
#define MSG_SD_VOL_INIT_FAIL "volume.init failed"
#define MSG_SD_OPENROOT_FAIL "openRoot failed"
@@ -170,6 +169,7 @@
#define MSG_SD_PRINTING_BYTE "SD printing byte "
#define MSG_SD_NOT_PRINTING "Not SD printing"
#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
+#define MSG_SD_ERR_READ "SD read error"
#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: "
#define MSG_STEPPER_TOO_HIGH "Steprate too high: "
diff --git a/Marlin/language_an.h b/Marlin/language_an.h
index c2d49fb25..bfabc0a57 100644
--- a/Marlin/language_an.h
+++ b/Marlin/language_an.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_AN_H
#define LANGUAGE_AN_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -49,16 +48,16 @@
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Establir zero"
-#define MSG_PREHEAT_PLA "Precalentar PLA"
-#define MSG_PREHEAT_PLA_N "Precalentar PLA "
-#define MSG_PREHEAT_PLA_ALL "Precalentar PLA a"
-#define MSG_PREHEAT_PLA_BEDONLY "Prec. PLA Base"
-#define MSG_PREHEAT_PLA_SETTINGS "Achustar tem. PLA"
-#define MSG_PREHEAT_ABS "Precalentar ABS"
-#define MSG_PREHEAT_ABS_N "Precalentar ABS "
-#define MSG_PREHEAT_ABS_ALL "Precalentar ABS a"
-#define MSG_PREHEAT_ABS_BEDONLY "Prec. ABS Base"
-#define MSG_PREHEAT_ABS_SETTINGS "Achustar tem. ABS"
+#define MSG_PREHEAT_1 "Precalentar PLA"
+#define MSG_PREHEAT_1_N "Precalentar PLA "
+#define MSG_PREHEAT_1_ALL "Precalentar PLA a"
+#define MSG_PREHEAT_1_BEDONLY "Prec. PLA Base"
+#define MSG_PREHEAT_1_SETTINGS "Achustar tem. PLA"
+#define MSG_PREHEAT_2 "Precalentar ABS"
+#define MSG_PREHEAT_2_N "Precalentar ABS "
+#define MSG_PREHEAT_2_ALL "Precalentar ABS a"
+#define MSG_PREHEAT_2_BEDONLY "Prec. ABS Base"
+#define MSG_PREHEAT_2_SETTINGS "Achustar tem. ABS"
#define MSG_COOLDOWN "Enfriar"
#define MSG_SWITCH_PS_ON "Enchegar Fuent"
#define MSG_SWITCH_PS_OFF "Desenchegar Fuent"
@@ -142,15 +141,13 @@
#define MSG_INIT_SDCARD "Encetan. tarcheta"
#define MSG_CNG_SDCARD "Cambiar tarcheta"
#define MSG_ZPROBE_OUT "Z probe out. bed"
-#define MSG_YX_UNHOMED "Home X/Y before Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop abort"
-#define MSG_END_HOUR "hours"
-#define MSG_END_MINUTE "minutes"
-
#define MSG_DELTA_CALIBRATE "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Calibrate X"
#define MSG_DELTA_CALIBRATE_Y "Calibrate Y"
diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h
index 1071642a9..51606947c 100644
--- a/Marlin/language_bg.h
+++ b/Marlin/language_bg.h
@@ -49,16 +49,16 @@
#define MSG_SET_HOME_OFFSETS "Задай Начало"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Изходна точка"
-#define MSG_PREHEAT_PLA "Подгряване PLA"
-#define MSG_PREHEAT_PLA_N "Подгряване PLA"
-#define MSG_PREHEAT_PLA_ALL "Подгр. PLA Всички"
-#define MSG_PREHEAT_PLA_BEDONLY "Подгр. PLA Легло"
-#define MSG_PREHEAT_PLA_SETTINGS "Настройки PLA"
-#define MSG_PREHEAT_ABS "Подгряване ABS"
-#define MSG_PREHEAT_ABS_N "Подгряване ABS"
-#define MSG_PREHEAT_ABS_ALL "Подгр. ABS Всички"
-#define MSG_PREHEAT_ABS_BEDONLY "Подгр. ABS Легло"
-#define MSG_PREHEAT_ABS_SETTINGS "Настройки ABS"
+#define MSG_PREHEAT_1 "Подгряване PLA"
+#define MSG_PREHEAT_1_N "Подгряване PLA"
+#define MSG_PREHEAT_1_ALL "Подгр. PLA Всички"
+#define MSG_PREHEAT_1_BEDONLY "Подгр. PLA Легло"
+#define MSG_PREHEAT_1_SETTINGS "Настройки PLA"
+#define MSG_PREHEAT_2 "Подгряване ABS"
+#define MSG_PREHEAT_2_N "Подгряване ABS"
+#define MSG_PREHEAT_2_ALL "Подгр. ABS Всички"
+#define MSG_PREHEAT_2_BEDONLY "Подгр. ABS Легло"
+#define MSG_PREHEAT_2_SETTINGS "Настройки ABS"
#define MSG_COOLDOWN "Охлаждане"
#define MSG_SWITCH_PS_ON "Вкл. захранване"
#define MSG_SWITCH_PS_OFF "Изкл. захранване"
@@ -143,15 +143,13 @@
#define MSG_INIT_SDCARD "Иниц. SD-Карта"
#define MSG_CNG_SDCARD "Смяна SD-Карта"
#define MSG_ZPROBE_OUT "Z-сондата е извадена"
-#define MSG_YX_UNHOMED "Задайте X/Y преди Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z Отстояние"
#define MSG_BABYSTEP_X "Министъпка X"
#define MSG_BABYSTEP_Y "Министъпка Y"
#define MSG_BABYSTEP_Z "Министъпка Z"
#define MSG_ENDSTOP_ABORT "Стоп Кр.Изключватели"
-#define MSG_END_HOUR "часа"
-#define MSG_END_MINUTE "минути"
-
#define MSG_DELTA_CALIBRATE "Делта Калибровка"
#define MSG_DELTA_CALIBRATE_X "Калибровка X"
#define MSG_DELTA_CALIBRATE_Y "Калибровка Y"
diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h
index 95ded7488..b90f1c395 100644
--- a/Marlin/language_ca.h
+++ b/Marlin/language_ca.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_CA_H
#define LANGUAGE_CA_H
-//#define MAPPER_NON
#define MAPPER_C2C3 // because of "ó"
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
@@ -50,16 +49,16 @@
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Establir origen"
-#define MSG_PREHEAT_PLA "Preescalfar PLA"
-#define MSG_PREHEAT_PLA_N "Preescalfar PLA "
-#define MSG_PREHEAT_PLA_ALL "Preesc. tot PLA"
-#define MSG_PREHEAT_PLA_BEDONLY "Preesc. llit PLA"
-#define MSG_PREHEAT_PLA_SETTINGS "Configuració PLA"
-#define MSG_PREHEAT_ABS "Preescalfar ABS"
-#define MSG_PREHEAT_ABS_N "Preescalfar ABS "
-#define MSG_PREHEAT_ABS_ALL "Preesc. tot ABS"
-#define MSG_PREHEAT_ABS_BEDONLY "Preesc. llit ABS"
-#define MSG_PREHEAT_ABS_SETTINGS "Configuració ABS"
+#define MSG_PREHEAT_1 "Preescalfar PLA"
+#define MSG_PREHEAT_1_N "Preescalfar PLA "
+#define MSG_PREHEAT_1_ALL "Preesc. tot PLA"
+#define MSG_PREHEAT_1_BEDONLY "Preesc. llit PLA"
+#define MSG_PREHEAT_1_SETTINGS "Configuració PLA"
+#define MSG_PREHEAT_2 "Preescalfar ABS"
+#define MSG_PREHEAT_2_N "Preescalfar ABS "
+#define MSG_PREHEAT_2_ALL "Preesc. tot ABS"
+#define MSG_PREHEAT_2_BEDONLY "Preesc. llit ABS"
+#define MSG_PREHEAT_2_SETTINGS "Configuració ABS"
#define MSG_COOLDOWN "Refredar"
#define MSG_SWITCH_PS_ON "Switch power on"
#define MSG_SWITCH_PS_OFF "Switch power off"
@@ -143,15 +142,13 @@
#define MSG_INIT_SDCARD "Iniciant SD"
#define MSG_CNG_SDCARD "Canviar SD"
#define MSG_ZPROBE_OUT "Z probe out. bed"
-#define MSG_YX_UNHOMED "Home X/Y abans Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop abort"
-#define MSG_END_HOUR "hours"
-#define MSG_END_MINUTE "minutes"
-
#define MSG_DELTA_CALIBRATE "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Calibrate X"
#define MSG_DELTA_CALIBRATE_Y "Calibrate Y"
diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h
index 487f72356..86c639dfa 100644
--- a/Marlin/language_cn.h
+++ b/Marlin/language_cn.h
@@ -29,8 +29,6 @@
*/
#ifndef LANGUAGE_CN_H
#define LANGUAGE_CN_H
-
-#define MAPPER_NON // For direct ascii codes
#define DISPLAY_CHARSET_ISO10646_CN
#define WELCOME_MSG "\xa4\xa5\xa6\xa7"
@@ -47,16 +45,16 @@
#define MSG_SET_HOME_OFFSETS "\xbe\xbf\xbb\xbc\xbd\xc0\xc1"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "\xbe\xbf\xbc\xbd"
-#define MSG_PREHEAT_PLA "\xc3\xc4 PLA"
-#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
-#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " \xc5\xc6"
-#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " \xc4\xc7"
-#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " \xbe\xbf"
-#define MSG_PREHEAT_ABS "\xc3\xc4 ABS"
-#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
-#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " \xc5\xc6"
-#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " \xbe\xc6"
-#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " \xbe\xbf"
+#define MSG_PREHEAT_1 "\xc3\xc4 PLA"
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " \xc5\xc6"
+#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " \xc4\xc7"
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " \xbe\xbf"
+#define MSG_PREHEAT_2 "\xc3\xc4 ABS"
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " \xc5\xc6"
+#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " \xbe\xc6"
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " \xbe\xbf"
#define MSG_COOLDOWN "\xc8\xc9"
#define MSG_SWITCH_PS_ON "\xb9\xcb\xca\xb3"
#define MSG_SWITCH_PS_OFF "\xb9\xcb\xb5\xb6"
@@ -142,7 +140,8 @@
#define MSG_INIT_SDCARD "Init. SD card"
#define MSG_CNG_SDCARD "Change SD card"
#define MSG_ZPROBE_OUT "Z probe out. bed"
-#define MSG_YX_UNHOMED "Home X/Y before Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
@@ -154,9 +153,6 @@
#define MSG_ERR_MAXTEMP "Err: MAXTEMP"
#define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
-#define MSG_END_HOUR "hours"
-#define MSG_END_MINUTE "minutes"
-
#define MSG_DELTA_CALIBRATE "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Calibrate X"
#define MSG_DELTA_CALIBRATE_Y "Calibrate Y"
diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h
index da277a2a2..742cd8c1b 100644
--- a/Marlin/language_cz.h
+++ b/Marlin/language_cz.h
@@ -34,7 +34,6 @@
#ifndef LANGUAGE_CZ_H
#define LANGUAGE_CZ_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -58,16 +57,20 @@
#define MSG_SET_HOME_OFFSETS "Nastavit ofsety"
#define MSG_HOME_OFFSETS_APPLIED "Ofsety nastaveny"
#define MSG_SET_ORIGIN "Nastavit pocatek"
-#define MSG_PREHEAT_PLA "Zahrat PLA"
-#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
-#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " Vse"
-#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Podloz"
-#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " Nast"
-#define MSG_PREHEAT_ABS "Zahrat ABS"
-#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
-#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " Vse"
-#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Podloz"
-#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " Nast"
+#define MSG_PREHEAT_1 "Zahrat PLA"
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " Vse"
+#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " Podloz"
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " Nast"
+#define MSG_PREHEAT_2 "Zahrat ABS"
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " Vse"
+#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Podloz"
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " Nast"
+#define MSG_H1 "1"
+#define MSG_H2 "2"
+#define MSG_H3 "3"
+#define MSG_H4 "4"
#define MSG_COOLDOWN "Zchladit"
#define MSG_SWITCH_PS_ON "Zapnout napajeni"
#define MSG_SWITCH_PS_OFF "Vypnout napajeni"
@@ -79,12 +82,20 @@
#define MSG_MOVE_Y "Posunout Y"
#define MSG_MOVE_Z "Posunout Z"
#define MSG_MOVE_E "Extruder"
+#define MSG_MOVE_E1 "1"
+#define MSG_MOVE_E2 "2"
+#define MSG_MOVE_E3 "3"
+#define MSG_MOVE_E4 "4"
#define MSG_MOVE_01MM "Posunout o 0,1mm"
#define MSG_MOVE_1MM "Posunout o 1mm"
#define MSG_MOVE_10MM "Posunout o 10mm"
#define MSG_SPEED "Rychlost"
#define MSG_BED_Z "Vyska podl."
#define MSG_NOZZLE "Tryska"
+#define MSG_N1 " 1"
+#define MSG_N2 " 2"
+#define MSG_N3 " 3"
+#define MSG_N4 " 4"
#define MSG_BED "Podlozka"
#define MSG_FAN_SPEED "Rychlost vent."
#define MSG_FLOW "Prutok"
@@ -99,6 +110,11 @@
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
+#define MSG_SELECT "Vybrat"
+#define MSG_E1 " E1"
+#define MSG_E2 " E2"
+#define MSG_E3 " E3"
+#define MSG_E4 " E4"
#define MSG_ACC "Zrychl"
#define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk"
@@ -122,6 +138,10 @@
#define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E na mm3"
#define MSG_FILAMENT_DIAM "Fil. Prum."
+#define MSG_DIAM_E1 " 1"
+#define MSG_DIAM_E2 " 2"
+#define MSG_DIAM_E3 " 3"
+#define MSG_DIAM_E4 " 4"
#define MSG_CONTRAST "Kontrast LCD"
#define MSG_STORE_EPROM "Ulozit nastaveni"
#define MSG_LOAD_EPROM "Nacist nastaveni"
@@ -154,30 +174,89 @@
#define MSG_INIT_SDCARD "Nacist SD kartu"
#define MSG_CNG_SDCARD "Vymenit SD kartu"
#define MSG_ZPROBE_OUT "Sonda Z mimo podl"
-#define MSG_YX_UNHOMED "Domu X/Y pred Z"
+#define MSG_HOME "Domu" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "prvni"
#define MSG_ZPROBE_ZOFFSET "Z ofset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop abort"
#define MSG_HEATING_FAILED_LCD "Chyba zahrivani"
-#define MSG_ERR_REDUNDANT_TEMP "Chyba: REDUNDANTNI TEPLOTA"
+#define MSG_ERR_REDUNDANT_TEMP "REDUND. TEPLOTA"
#define MSG_THERMAL_RUNAWAY "TEPLOTNI SKOK"
-#define MSG_ERR_MAXTEMP "Chyba: VYSOKA TEPLOTA"
-#define MSG_ERR_MINTEMP "Chyba: NIZKA TEPLOTA"
-#define MSG_ERR_MAXTEMP_BED "Chyba: VYSOKA TEPLOTA PODL."
-#define MSG_ERR_MINTEMP_BED "Chyba: NIZKA TEPLOTA PODL."
-#define MSG_END_HOUR "hod"
-#define MSG_END_MINUTE "min"
+#define MSG_ERR_MAXTEMP "VYSOKA TEPLOTA"
+#define MSG_ERR_MINTEMP "NIZKA TEPLOTA"
+#define MSG_ERR_MAXTEMP_BED "VYS. TEPL. PODL."
+#define MSG_ERR_MINTEMP_BED "NIZ. TEPL. PODL."
+#define MSG_HALTED "TISK. ZASTAVENA"
+#define MSG_PLEASE_RESET "Provedte reset"
+#define MSG_SHORT_DAY "d"
+#define MSG_SHORT_HOUR "h"
+#define MSG_SHORT_MINUTE "m"
#define MSG_HEATING "Zahrivani..."
#define MSG_HEATING_COMPLETE "Zahrati hotovo."
#define MSG_BED_HEATING "Zahrivani podl."
#define MSG_BED_DONE "Podlozka hotova."
-
#define MSG_DELTA_CALIBRATE "Delta Kalibrace"
#define MSG_DELTA_CALIBRATE_X "Kalibrovat X"
#define MSG_DELTA_CALIBRATE_Y "Kalibrovat Y"
#define MSG_DELTA_CALIBRATE_Z "Kalibrovat Z"
#define MSG_DELTA_CALIBRATE_CENTER "Kalibrovat Stred"
+#define MSG_INFO_MENU "O tiskarne"
+#define MSG_INFO_PRINTER_MENU "Info o tiskarne"
+#define MSG_INFO_STATS_MENU "Statistika"
+#define MSG_INFO_BOARD_MENU "Info o desce"
+#define MSG_INFO_THERMISTOR_MENU "Termistory"
+#define MSG_INFO_EXTRUDERS "Extrudery"
+#define MSG_INFO_BAUDRATE "Rychlost"
+#define MSG_INFO_PROTOCOL "Protokol"
+#if LCD_WIDTH > 19
+ #define MSG_INFO_PRINT_COUNT "Pocet tisku"
+ #define MSG_INFO_COMPLETED_PRINTS "Dokonceno"
+ #define MSG_INFO_PRINT_TIME "Celkovy cas"
+ #define MSG_INFO_PRINT_LONGEST "Nejdelsi tisk"
+ #define MSG_INFO_PRINT_FILAMENT "Celkem vytlaceno"
+#else
+ #define MSG_INFO_PRINT_COUNT "Tisky"
+ #define MSG_INFO_COMPLETED_PRINTS "Hotovo"
+ #define MSG_INFO_PRINT_TIME "Cas"
+ #define MSG_INFO_PRINT_LONGEST "Nejdelsi"
+ #define MSG_INFO_PRINT_FILAMENT "Vytlaceno"
+#endif
+#define MSG_INFO_MIN_TEMP "Teplota min"
+#define MSG_INFO_MAX_TEMP "Teplota max"
+#define MSG_INFO_PSU "Nap. zdroj"
+
+#define MSG_FILAMENT_CHANGE_HEADER "VYMENA FILAMENTU"
+#define MSG_FILAMENT_CHANGE_OPTION_HEADER "CO DAL?"
+#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Jeste vytlacit"
+#define MSG_FILAMENT_CHANGE_OPTION_RESUME "Obnovit tisk"
+#if LCD_HEIGHT >= 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Cekejte prosim"
+ #define MSG_FILAMENT_CHANGE_INIT_2 "na zahajeni"
+ #define MSG_FILAMENT_CHANGE_INIT_3 "vymeny filamentu"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Cekejte prosim"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_2 "na vysunuti"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_3 "filamentu"
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Vlozte filament"
+ #define MSG_FILAMENT_CHANGE_INSERT_2 "a stisknete"
+ #define MSG_FILAMENT_CHANGE_INSERT_3 "tlacitko..."
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Cekejte prosim"
+ #define MSG_FILAMENT_CHANGE_LOAD_2 "na zavedeni"
+ #define MSG_FILAMENT_CHANGE_LOAD_3 "filamentu"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Cekejte prosim"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "na vytlaceni"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "filamentu"
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Cekejte prosim"
+ #define MSG_FILAMENT_CHANGE_RESUME_2 "na pokracovani"
+ #define MSG_FILAMENT_CHANGE_RESUME_3 "tisku"
+#else // LCD_HEIGHT < 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Cekejte..."
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Vysouvani..."
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Vlozte, kliknete"
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Zavadeni..."
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Vytlacovani..."
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Pokracovani..."
+#endif // LCD_HEIGHT < 4
#endif // LANGUAGE_CZ_H
diff --git a/Marlin/language_da.h b/Marlin/language_da.h
index a66ceb50b..b107ca05d 100644
--- a/Marlin/language_da.h
+++ b/Marlin/language_da.h
@@ -54,16 +54,16 @@
#define MSG_SET_HOME_OFFSETS "Sæt forskyding af home"
#define MSG_HOME_OFFSETS_APPLIED "Forskydninger af home pos. er tilføjet"
#define MSG_SET_ORIGIN "Sæt origin"
-#define MSG_PREHEAT_PLA "Forvarm PLA"
-#define MSG_PREHEAT_PLA_N "Forvarm PLA "
-#define MSG_PREHEAT_PLA_ALL "Forvarm PLA Alle"
-#define MSG_PREHEAT_PLA_BEDONLY "Forvarm PLA Bed"
-#define MSG_PREHEAT_PLA_SETTINGS "Forvarm PLA conf"
-#define MSG_PREHEAT_ABS "Forvarm ABS"
-#define MSG_PREHEAT_ABS_N "Forvarm ABS "
-#define MSG_PREHEAT_ABS_ALL "Forvarm ABS Alle"
-#define MSG_PREHEAT_ABS_BEDONLY "Forvarm ABS Bed"
-#define MSG_PREHEAT_ABS_SETTINGS "Forvarm ABS conf"
+#define MSG_PREHEAT_1 "Forvarm PLA"
+#define MSG_PREHEAT_1_N "Forvarm PLA "
+#define MSG_PREHEAT_1_ALL "Forvarm PLA Alle"
+#define MSG_PREHEAT_1_BEDONLY "Forvarm PLA Bed"
+#define MSG_PREHEAT_1_SETTINGS "Forvarm PLA conf"
+#define MSG_PREHEAT_2 "Forvarm ABS"
+#define MSG_PREHEAT_2_N "Forvarm ABS "
+#define MSG_PREHEAT_2_ALL "Forvarm ABS Alle"
+#define MSG_PREHEAT_2_BEDONLY "Forvarm ABS Bed"
+#define MSG_PREHEAT_2_SETTINGS "Forvarm ABS conf"
#define MSG_H1 "1"
#define MSG_H2 "2"
#define MSG_H3 "3"
@@ -83,7 +83,6 @@
#define MSG_MOVE_E2 "2"
#define MSG_MOVE_E3 "3"
#define MSG_MOVE_E4 "4"
-
#define MSG_MOVE_01MM "Flyt 0.1mm"
#define MSG_MOVE_1MM "Flyt 1mm"
#define MSG_MOVE_10MM "Flyt 10mm"
@@ -171,7 +170,8 @@
#define MSG_INIT_SDCARD "Init. SD card"
#define MSG_CNG_SDCARD "Skift SD kort"
#define MSG_ZPROBE_OUT "Probe udenfor plade"
-#define MSG_YX_UNHOMED "Home X/Y før Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
@@ -182,19 +182,16 @@
#define MSG_THERMAL_RUNAWAY "Temp løber løbsk"
#define MSG_ERR_MAXTEMP "Fejl: Maks temp"
#define MSG_ERR_MINTEMP "Fejl: Min temp"
-#define MSG_ERR_MAXTEMP_BED "Fejl: Maks P temp"
-#define MSG_ERR_MINTEMP_BED "Fejl: Min P temp"
-#define MSG_END_HOUR "Timer"
-#define MSG_END_MINUTE "Minutter"
+#define MSG_ERR_MAXTEMP_BED "Fejl: Maks Plsde temp"
+#define MSG_ERR_MINTEMP_BED "Fejl: Min Plade temp"
#define MSG_HEATING "Opvarmer..."
#define MSG_HEATING_COMPLETE "Opvarmet"
#define MSG_BED_HEATING "Opvarmer plade"
#define MSG_BED_DONE "Plade opvarmet"
-
-#define MSG_DELTA_CALIBRATE "Delta Kalibrering"
-#define MSG_DELTA_CALIBRATE_X "Kalibrer X"
-#define MSG_DELTA_CALIBRATE_Y "Kalibrer Y"
-#define MSG_DELTA_CALIBRATE_Z "Kalibrer Z"
-#define MSG_DELTA_CALIBRATE_CENTER "Kalibrerings Center"
+#define MSG_DELTA_CALIBRATE "Delta Kalibrering"
+#define MSG_DELTA_CALIBRATE_X "Kalibrer X"
+#define MSG_DELTA_CALIBRATE_Y "Kalibrer Y"
+#define MSG_DELTA_CALIBRATE_Z "Kalibrer Z"
+#define MSG_DELTA_CALIBRATE_CENTER "Kalibrerings Center"
#endif // LANGUAGE_DA_H
diff --git a/Marlin/language_de.h b/Marlin/language_de.h
index 9f94ef321..9744378fc 100644
--- a/Marlin/language_de.h
+++ b/Marlin/language_de.h
@@ -49,16 +49,16 @@
#define MSG_SET_HOME_OFFSETS "Setze Homeoffsets"
#define MSG_HOME_OFFSETS_APPLIED "Offsets aktiv"
#define MSG_SET_ORIGIN "Setze Nullpunkt" //"G92 X0 Y0 Z0" commented out in ultralcd.cpp
-#define MSG_PREHEAT_PLA "Vorwärmen PLA"
-#define MSG_PREHEAT_PLA_N "Vorwärmen PLA "
-#define MSG_PREHEAT_PLA_ALL "Vorw. PLA Alle"
-#define MSG_PREHEAT_PLA_BEDONLY "Vorw. PLA Bett"
-#define MSG_PREHEAT_PLA_SETTINGS "Vorw. PLA Einst."
-#define MSG_PREHEAT_ABS "Vorwärmen ABS"
-#define MSG_PREHEAT_ABS_N "Vorwärmen ABS "
-#define MSG_PREHEAT_ABS_ALL "Vorw. ABS Alle"
-#define MSG_PREHEAT_ABS_BEDONLY "Vorw. ABS Bett"
-#define MSG_PREHEAT_ABS_SETTINGS "Vorw. ABS Einst."
+#define MSG_PREHEAT_1 "Vorwärmen PLA"
+#define MSG_PREHEAT_1_N "Vorwärmen PLA "
+#define MSG_PREHEAT_1_ALL "Vorw. PLA Alle"
+#define MSG_PREHEAT_1_BEDONLY "Vorw. PLA Bett"
+#define MSG_PREHEAT_1_SETTINGS "Vorw. PLA Einst."
+#define MSG_PREHEAT_2 "Vorwärmen ABS"
+#define MSG_PREHEAT_2_N "Vorwärmen ABS "
+#define MSG_PREHEAT_2_ALL "Vorw. ABS Alle"
+#define MSG_PREHEAT_2_BEDONLY "Vorw. ABS Bett"
+#define MSG_PREHEAT_2_SETTINGS "Vorw. ABS Einst."
#define MSG_COOLDOWN "Abkühlen"
#define MSG_SWITCH_PS_ON "Netzteil ein"
#define MSG_SWITCH_PS_OFF "Netzteil aus"
@@ -145,7 +145,8 @@
#define MSG_INIT_SDCARD "SD-Karte erkennen" // Manually initialize the SD-card via user interface
#define MSG_CNG_SDCARD "SD-Karte getauscht" // SD-card changed by user. For machines with no autocarddetect. Both send "M21"
#define MSG_ZPROBE_OUT "Sensor ausserhalb"
-#define MSG_YX_UNHOMED "X/Y vor Z homen!"
+#define MSG_HOME "Vorher" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "homen"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
@@ -158,17 +159,69 @@
#define MSG_ERR_MINTEMP LCD_STR_THERMOMETER " UNTERSCHRITTEN"
#define MSG_ERR_MAXTEMP_BED "BETT " LCD_STR_THERMOMETER " ÜBERSCHRITTEN"
#define MSG_ERR_MINTEMP_BED "BETT " LCD_STR_THERMOMETER " UNTERSCHRITTEN"
-#define MSG_END_HOUR "Stunden"
-#define MSG_END_MINUTE "Minuten"
#define MSG_HEATING "Aufheizen..."
#define MSG_HEATING_COMPLETE "Aufgeheizt"
#define MSG_BED_HEATING "Bett aufheizen"
#define MSG_BED_DONE "Bett aufgeheizt"
-
#define MSG_DELTA_CALIBRATE "Delta kalibrieren"
#define MSG_DELTA_CALIBRATE_X "Kalibriere X"
#define MSG_DELTA_CALIBRATE_Y "Kalibriere Y"
#define MSG_DELTA_CALIBRATE_Z "Kalibriere Z"
#define MSG_DELTA_CALIBRATE_CENTER "Kalibriere Mitte"
+#define MSG_INFO_MENU "Über den Drucker"
+#define MSG_INFO_PRINTER_MENU "Drucker Info"
+#define MSG_INFO_STATS_MENU "Drucker Stats"
+#define MSG_INFO_BOARD_MENU "Board Info"
+#define MSG_INFO_THERMISTOR_MENU "Thermistors"
+#define MSG_INFO_EXTRUDERS "Extruders"
+#define MSG_INFO_BAUDRATE "Baud"
+#define MSG_INFO_PROTOCOL "Protokol"
+
+#if LCD_WIDTH > 19
+ #define MSG_INFO_PRINT_COUNT "Gesamte Drucke "
+ #define MSG_INFO_COMPLETED_PRINTS "Beendete Drucke "
+ #define MSG_INFO_PRINT_TIME "Gesamte Druckzeit"
+#else
+ #define MSG_INFO_PRINT_COUNT "Prints "
+ #define MSG_INFO_COMPLETED_PRINTS "Completed"
+ #define MSG_INFO_PRINT_TIME "Duration "
+#endif
+#define MSG_INFO_MIN_TEMP "Min Temp"
+#define MSG_INFO_MAX_TEMP "Max Temp"
+#define MSG_INFO_PSU "Stromversorgung"
+
+#define MSG_FILAMENT_CHANGE_HEADER "ÄNDERE FILAMENT"
+#define MSG_FILAMENT_CHANGE_OPTION_HEADER "ÄNDERE OPTIONEN:"
+#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Extrude mehr"
+#define MSG_FILAMENT_CHANGE_OPTION_RESUME "Drucke weiter"
+
+#if LCD_HEIGHT >= 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Warte auf den"
+ #define MSG_FILAMENT_CHANGE_INIT_2 "Start zum "
+ #define MSG_FILAMENT_CHANGE_INIT_3 "Filament wechsel"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Warte auf das"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_2 "herrausnehmen"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_3 "des Filaments"
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Fädel Filament"
+ #define MSG_FILAMENT_CHANGE_INSERT_2 "ein und drücke"
+ #define MSG_FILAMENT_CHANGE_INSERT_3 "den Knopf..."
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Warte auf das"
+ #define MSG_FILAMENT_CHANGE_LOAD_2 "laden des"
+ #define MSG_FILAMENT_CHANGE_LOAD_3 "Filaments"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Warte auf das"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "Extruden des"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "Filaments"
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Warte auf das"
+ #define MSG_FILAMENT_CHANGE_RESUME_2 "fortfahren des"
+ #define MSG_FILAMENT_CHANGE_RESUME_3 "Druckes"
+#else // LCD_HEIGHT < 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Bitte warten..."
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Auswerfen..."
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Laden und Klick"
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Laden..."
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Extruden..."
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Weitermachen..."
+#endif // LCD_HEIGHT < 4
+
#endif // LANGUAGE_DE_H
diff --git a/Marlin/language_el-gr.h b/Marlin/language_el-gr.h
new file mode 100644
index 000000000..510e8aae3
--- /dev/null
+++ b/Marlin/language_el-gr.h
@@ -0,0 +1,198 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Greek (Greece)
+ *
+ * LCD Menu Messages
+ * See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
+ *
+ */
+#ifndef LANGUAGE_EL_GR_H
+#define LANGUAGE_EL_GR_H
+
+// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
+//#define SIMULATE_ROMFONT
+
+//#define MAPPER_CECF
+//#define DISPLAY_CHARSET_ISO10646_GREEK
+
+#define WELCOME_MSG MACHINE_NAME " έτοιμο."
+#define MSG_SD_INSERTED "Εισαγωγή κάρτας"
+#define MSG_SD_REMOVED "Αφαίρεση κάρτας"
+#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters
+#define MSG_MAIN "Βασική Οθόνη"
+#define MSG_AUTOSTART "Αυτόματη εκκίνηση"
+#define MSG_DISABLE_STEPPERS "Απενεργοποίηση βηματιστή"
+#define MSG_AUTO_HOME "Αυτομ. επαναφορά στο αρχικό σημείο"
+#define MSG_AUTO_HOME_X "Αρχικό σημείο X"
+#define MSG_AUTO_HOME_Y "Αρχικό σημείο Y"
+#define MSG_AUTO_HOME_Z "Αρχικό σημείο Z"
+#define MSG_LEVEL_BED_HOMING "Επαναφορά στο αρχικό σημείο ΧΥΖ"
+#define MSG_LEVEL_BED_WAITING "Κάντε κλικ για να ξεκινήσετε"
+#define MSG_LEVEL_BED_NEXT_POINT "Επόμενο σημείο"
+#define MSG_LEVEL_BED_DONE "Ολοκλήρωση επιπεδοποίησης!"
+#define MSG_LEVEL_BED_CANCEL "Ακύρωση"
+#define MSG_SET_HOME_OFFSETS "Ορισμός βασικών μετατοπίσεων"
+#define MSG_HOME_OFFSETS_APPLIED "Εφαρμόστηκαν οι μετατοπίσεις"
+#define MSG_SET_ORIGIN "Ορισμός προέλευσης"
+#define MSG_PREHEAT_1 "Προθέρμανση PLA"
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " όλα"
+#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " κλίνη"
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " επιβεβαίωση"
+#define MSG_PREHEAT_2 "Προθέρμανση ABS"
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " όλα"
+#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Bed"
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " επιβεβαίωση"
+#define MSG_H1 "1"
+#define MSG_H2 "2"
+#define MSG_H3 "3"
+#define MSG_H4 "4"
+#define MSG_COOLDOWN "Μειωση θερμοκρασιας"
+#define MSG_SWITCH_PS_ON "Ενεργοποίηση"
+#define MSG_SWITCH_PS_OFF "Απενεργοποίηση"
+#define MSG_EXTRUDE "Εξώθηση"
+#define MSG_RETRACT "Ανάσυρση"
+#define MSG_MOVE_AXIS "Μετακίνηση άξονα"
+#define MSG_LEVEL_BED "Επιπεδοποίηση κλίνης"
+#define MSG_MOVE_X "Μετακίνηση X"
+#define MSG_MOVE_Y "Μετακίνηση Y"
+#define MSG_MOVE_Z "Μετακίνηση Z"
+#define MSG_MOVE_E "Εξωθητήρας"
+#define MSG_MOVE_E1 "1"
+#define MSG_MOVE_E2 "2"
+#define MSG_MOVE_E3 "3"
+#define MSG_MOVE_E4 "4"
+#define MSG_MOVE_01MM "Μετακίνηση 0,1 μμ"
+#define MSG_MOVE_1MM "Μετακίνηση 1 μμ"
+#define MSG_MOVE_10MM "Μετακίνηση 10 μμ"
+#define MSG_SPEED "Ταχύτητα"
+#define MSG_BED_Z "Κλίνη Z"
+#define MSG_NOZZLE "Ακροφύσιο"
+#define MSG_N1 " 1"
+#define MSG_N2 " 2"
+#define MSG_N3 " 3"
+#define MSG_N4 " 4"
+#define MSG_BED "Κλίνη"
+#define MSG_FAN_SPEED "Ταχύτητα ανεμιστήρα"
+#define MSG_FLOW "Ροή"
+#define MSG_CONTROL "Έλεγχος"
+#define MSG_MIN " " LCD_STR_THERMOMETER " Min"
+#define MSG_MAX " " LCD_STR_THERMOMETER " Max"
+#define MSG_FACTOR " " LCD_STR_THERMOMETER " Fact"
+#define MSG_AUTOTEMP "Αυτομ. ρύθμιση θερμοκρασίας"
+#define MSG_ON "Ενεργοποιημένο"
+#define MSG_OFF "Απενεργοποιημένο"
+#define MSG_PID_P "PID-P"
+#define MSG_PID_I "PID-I"
+#define MSG_PID_D "PID-D"
+#define MSG_PID_C "PID-C"
+#define MSG_E1 " E1"
+#define MSG_E2 " E2"
+#define MSG_E3 " E3"
+#define MSG_E4 " E4"
+#define MSG_ACC "Επιτάχυνση"
+#define MSG_VXY_JERK "Vαντίδραση xy"
+#define MSG_VZ_JERK "Vαντίδραση z"
+#define MSG_VE_JERK "Vαντίδραση e"
+#define MSG_VMAX "Vμεγ "
+#define MSG_X "X"
+#define MSG_Y "Y"
+#define MSG_Z "Z"
+#define MSG_E "E"
+#define MSG_VMIN "Vελαχ"
+#define MSG_VTRAV_MIN "Vελάχ. μετατόπιση"
+#define MSG_AMAX "Aμεγ "
+#define MSG_A_RETRACT "Α-ανάσυρση"
+#define MSG_A_TRAVEL "Α-μετατόπιση"
+#define MSG_XSTEPS "Bήματα X ανά μμ"
+#define MSG_YSTEPS "Bήματα Υ ανά μμ"
+#define MSG_ZSTEPS "Bήματα Ζ ανά μμ"
+#define MSG_ESTEPS "Bήματα Ε ανά μμ"
+#define MSG_TEMPERATURE "Θερμοκρασία"
+#define MSG_MOTION "Κίνηση"
+#define MSG_VOLUMETRIC "Νήμα"
+#define MSG_VOLUMETRIC_ENABLED "Ε σε μμ3"
+#define MSG_FILAMENT_DIAM "Διάμετρος νήματος"
+#define MSG_DIAM_E1 " 1"
+#define MSG_DIAM_E2 " 2"
+#define MSG_DIAM_E3 " 3"
+#define MSG_DIAM_E4 " 4"
+#define MSG_CONTRAST "Κοντράστ LCD"
+#define MSG_STORE_EPROM "Αποθήκευση"
+#define MSG_LOAD_EPROM "Φόρτωση"
+#define MSG_RESTORE_FAILSAFE "Επαναφορά ασφαλούς αντιγράφου"
+#define MSG_REFRESH "Ανανέωση"
+#define MSG_WATCH "Οθόνη πληροφόρησης"
+#define MSG_PREPARE "Προετοιμασία"
+#define MSG_TUNE "Συντονισμός"
+#define MSG_PAUSE_PRINT "Παύση εκτύπωσης"
+#define MSG_RESUME_PRINT "Συνέχιση εκτύπωσης"
+#define MSG_STOP_PRINT "Διακοπή εκτύπωσης"
+#define MSG_CARD_MENU "Εκτύπωση από SD"
+#define MSG_NO_CARD "Δεν βρέθηκε SD"
+#define MSG_DWELL "Αναστολή λειτουργίας..."
+#define MSG_USERWAIT "Αναμονή για χρήστη…"
+#define MSG_RESUMING "Συνεχίζεται η εκτύπωση"
+#define MSG_PRINT_ABORTED "Διακόπτεται η εκτύπωση"
+#define MSG_NO_MOVE "Καμία κίνηση."
+#define MSG_KILLED "ΤΕΡΜΑΤΙΣΜΟΣ. "
+#define MSG_STOPPED "ΔΙΑΚΟΠΗ. "
+#define MSG_CONTROL_RETRACT "Ανάσυρση μμ"
+#define MSG_CONTROL_RETRACT_SWAP "Εναλλαγή ανάσυρσης μμ"
+#define MSG_CONTROL_RETRACTF "Ανάσυρση V"
+#define MSG_CONTROL_RETRACT_ZLIFT "Μεταπήδηση μμ"
+#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
+#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm"
+#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
+#define MSG_AUTORETRACT "Αυτόματη ανάσυρση"
+#define MSG_FILAMENTCHANGE "Αλλαγή νήματος"
+#define MSG_INIT_SDCARD "Προετοιμασία κάρτας SD"
+#define MSG_CNG_SDCARD "Αλλαγή κάρτας SD"
+#define MSG_ZPROBE_OUT "Διερεύνηση Z εκτός κλίνης"
+#define MSG_YX_UNHOMED "Επαναφορά Χ/Υ πριν από Ζ"
+#define MSG_XYZ_UNHOMED "Επαναφορά ΧΥΖ πρώτα"
+#define MSG_ZPROBE_ZOFFSET "Μετατόπιση Ζ"
+#define MSG_BABYSTEP_X "Μικρό βήμα Χ"
+#define MSG_BABYSTEP_Y "Μικρό βήμα Υ"
+#define MSG_BABYSTEP_Z "Μικρό βήμα Ζ"
+#define MSG_ENDSTOP_ABORT "Ματαίωση endstop "
+#define MSG_HEATING_FAILED_LCD "Ανεπιτυχής θέρμανση"
+#define MSG_ERR_REDUNDANT_TEMP "Λάθος: ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"
+#define MSG_THERMAL_RUNAWAY "ΔΙΑΦΥΓΗ ΘΕΡΜΟΤΗΤΑΣ"
+#define MSG_ERR_MAXTEMP "Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ"
+#define MSG_ERR_MINTEMP "Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ"
+#define MSG_ERR_MAXTEMP_BED "Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ"
+#define MSG_ERR_MINTEMP_BED "Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ"
+#define MSG_HEATING "Θερμαίνεται…"
+#define MSG_HEATING_COMPLETE "Η θέρμανση ολοκληρώθηκε."
+#define MSG_BED_HEATING "Θέρμανση κλίνης."
+#define MSG_BED_DONE "Η κλίνη ολοκληρώθηκε."
+#define MSG_DELTA_CALIBRATE "Βαθμονόμηση Delta"
+#define MSG_DELTA_CALIBRATE_X "Βαθμονόμηση X"
+#define MSG_DELTA_CALIBRATE_Y "Βαθμονόμηση Y"
+#define MSG_DELTA_CALIBRATE_Z "Βαθμονόμηση Z"
+#define MSG_DELTA_CALIBRATE_CENTER "Βαθμονόμηση κέντρου"
+
+#endif // LANGUAGE_EL_GR_H
diff --git a/Marlin/language_el.h b/Marlin/language_el.h
new file mode 100644
index 000000000..9d1c8555a
--- /dev/null
+++ b/Marlin/language_el.h
@@ -0,0 +1,254 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Greek
+ *
+ * LCD Menu Messages
+ * See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
+ *
+ */
+#ifndef LANGUAGE_EL_H
+#define LANGUAGE_EL_H
+
+// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
+//#define SIMULATE_ROMFONT
+
+#define MAPPER_CECF
+#define DISPLAY_CHARSET_ISO10646_GREEK
+
+#define WELCOME_MSG MACHINE_NAME " έτοιμο."
+#define MSG_SD_INSERTED "Εισαγωγή κάρτας"
+#define MSG_SD_REMOVED "Αφαίρεση κάρτας"
+#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters
+#define MSG_MAIN "Βασική Οθόνη"
+#define MSG_AUTOSTART "Αυτόματη εκκίνηση"
+#define MSG_DISABLE_STEPPERS "Απενεργοποίηση Μοτέρ"
+#define MSG_AUTO_HOME "Αυτομ. επαναφορά στο αρχικό σημείο" //SHORTEN
+#define MSG_AUTO_HOME_X "Αρχικό σημείο X"
+#define MSG_AUTO_HOME_Y "Αρχικό σημείο Y"
+#define MSG_AUTO_HOME_Z "Αρχικό σημείο Z"
+#define MSG_LEVEL_BED_HOMING "Επαναφορά Επ. Εκτύπωσης" //SHORTEN
+#define MSG_LEVEL_BED_WAITING "Επιπεδοποίηση επ. Εκτύπωσης περιμενει" //SHORTEN
+#define MSG_LEVEL_BED_NEXT_POINT "Επόμενο σημείο"
+#define MSG_LEVEL_BED_DONE "Ολοκλήρωση επιπεδοποίησης!" //SHORTEN
+#define MSG_LEVEL_BED_CANCEL "Ακύρωση"
+#define MSG_SET_HOME_OFFSETS "Ορισμός βασικών μετατοπίσεων" //SHORTEN
+#define MSG_HOME_OFFSETS_APPLIED "Εφαρμόστηκαν οι μετατοπίσεις" //SHORTEN
+#define MSG_SET_ORIGIN "Ορισμός προέλευσης"
+#define MSG_PREHEAT_1 "Προθέρμανση PLA"
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " όλα"
+#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " bed" //SHORTEN
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " επιβεβαίωση" //SHORTEN
+#define MSG_PREHEAT_2 "Προθέρμανση ABS"
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " όλα"
+#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " bed" //SHORTEN
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " επιβεβαίωση" //SHORTEN
+#define MSG_H1 "1"
+#define MSG_H2 "2"
+#define MSG_H3 "3"
+#define MSG_H4 "4"
+#define MSG_COOLDOWN "Μειωση θερμοκρασιας"
+#define MSG_SWITCH_PS_ON "Ενεργοποίηση"
+#define MSG_SWITCH_PS_OFF "Απενεργοποίηση"
+#define MSG_EXTRUDE "Εξώθηση"
+#define MSG_RETRACT "Ανάσυρση"
+#define MSG_MOVE_AXIS "Μετακίνηση άξονα"
+#define MSG_LEVEL_BED "Επιπεδοποίηση Επ. Εκτύπωσης" //SHORTEN
+#define MSG_MOVE_X "Μετακίνηση X"
+#define MSG_MOVE_Y "Μετακίνηση Y"
+#define MSG_MOVE_Z "Μετακίνηση Z"
+#define MSG_MOVE_E "Εξωθητήρας"
+#define MSG_MOVE_E1 "1"
+#define MSG_MOVE_E2 "2"
+#define MSG_MOVE_E3 "3"
+#define MSG_MOVE_E4 "4"
+#define MSG_MOVE_01MM "Μετακίνηση 0,1μμ"
+#define MSG_MOVE_1MM "Μετακίνηση 1μμ"
+#define MSG_MOVE_10MM "Μετακίνηση 10μμ"
+#define MSG_SPEED "Ταχύτητα"
+#define MSG_BED_Z "Επ. Εκτύπωσης Z"
+#define MSG_NOZZLE "Ακροφύσιο"
+#define MSG_N1 " 1"
+#define MSG_N2 " 2"
+#define MSG_N3 " 3"
+#define MSG_N4 " 4"
+#define MSG_BED "Κλίνη"
+#define MSG_FAN_SPEED "Ταχύτητα ανεμιστήρα"
+#define MSG_FLOW "Ροή"
+#define MSG_CONTROL "Έλεγχος"
+#define MSG_MIN " " LCD_STR_THERMOMETER " Min"
+#define MSG_MAX " " LCD_STR_THERMOMETER " Max"
+#define MSG_FACTOR " " LCD_STR_THERMOMETER " Fact"
+#define MSG_AUTOTEMP "Αυτομ ρύθμιση θερ/σίας" //SHORTEN
+#define MSG_ON "Ενεργοποιημένο"
+#define MSG_OFF "Απενεργοποιημένο"
+#define MSG_PID_P "PID-P"
+#define MSG_PID_I "PID-I"
+#define MSG_PID_D "PID-D"
+#define MSG_PID_C "PID-C"
+#define MSG_E1 " E1"
+#define MSG_E2 " E2"
+#define MSG_E3 " E3"
+#define MSG_E4 " E4"
+#define MSG_ACC "Επιτάχυνση"
+#define MSG_VXY_JERK "Vαντίδραση xy"
+#define MSG_VZ_JERK "Vαντίδραση z"
+#define MSG_VE_JERK "Vαντίδραση e"
+#define MSG_VMAX "V Μέγιστο"
+#define MSG_X "X"
+#define MSG_Y "Y"
+#define MSG_Z "Z"
+#define MSG_E "E"
+#define MSG_VMIN "V Ελάχιστο"
+#define MSG_VTRAV_MIN "Vελάχ. μετατόπιση"
+#define MSG_AMAX "Aμεγ "
+#define MSG_A_RETRACT "Α-ανάσυρση"
+#define MSG_A_TRAVEL "Α-μετατόπιση"
+#define MSG_XSTEPS "Bήματα X ανά μμ"
+#define MSG_YSTEPS "Bήματα Υ ανά μμ"
+#define MSG_ZSTEPS "Bήματα Ζ ανά μμ"
+#define MSG_ESTEPS "Bήματα Ε ανά μμ"
+#define MSG_TEMPERATURE "Θερμοκρασία"
+#define MSG_MOTION "Κίνηση"
+#define MSG_VOLUMETRIC "Νήμα"
+#define MSG_VOLUMETRIC_ENABLED "Ε σε μμ3"
+#define MSG_FILAMENT_DIAM "Διάμετρος νήματος"
+#define MSG_DIAM_E1 " 1"
+#define MSG_DIAM_E2 " 2"
+#define MSG_DIAM_E3 " 3"
+#define MSG_DIAM_E4 " 4"
+#define MSG_CONTRAST "Κοντράστ LCD"
+#define MSG_STORE_EPROM "Αποθήκευση"
+#define MSG_LOAD_EPROM "Φόρτωση"
+#define MSG_RESTORE_FAILSAFE "Επαναφορά ασφαλούς αντιγράφου" //SHORTEN
+#define MSG_REFRESH "Ανανέωση"
+#define MSG_WATCH "Οθόνη πληροφόρησης"
+#define MSG_PREPARE "Προετοιμασία"
+#define MSG_TUNE "Συντονισμός"
+#define MSG_PAUSE_PRINT "Παύση εκτύπωσης"
+#define MSG_RESUME_PRINT "Συνέχιση εκτύπωσης"
+#define MSG_STOP_PRINT "Διακοπή εκτύπωσης"
+#define MSG_CARD_MENU "Εκτύπωση από SD"
+#define MSG_NO_CARD "Δεν βρέθηκε SD"
+#define MSG_DWELL "Αναστολή λειτουργίας"
+#define MSG_USERWAIT "Αναμονή για χρήστη"
+#define MSG_RESUMING "Συνεχίζεται η εκτύπωση" //SHORTEN
+#define MSG_PRINT_ABORTED "Διακόπτεται η εκτύπωση" //SHORTEN
+#define MSG_NO_MOVE "Καμία κίνηση."
+#define MSG_KILLED "ΤΕΡΜΑΤΙΣΜΟΣ. "
+#define MSG_STOPPED "ΔΙΑΚΟΠΗ. "
+#define MSG_CONTROL_RETRACT "Ανάσυρση μμ"
+#define MSG_CONTROL_RETRACT_SWAP "Εναλλαγή ανάσυρσης μμ" //SHORTEN
+#define MSG_CONTROL_RETRACTF "Ανάσυρση V"
+#define MSG_CONTROL_RETRACT_ZLIFT "Μεταπήδηση μμ"
+#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
+#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm"
+#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
+#define MSG_AUTORETRACT "Αυτόματη ανάσυρση"
+#define MSG_FILAMENTCHANGE "Αλλαγή νήματος"
+#define MSG_INIT_SDCARD "Προετοιμασία κάρτας SD" //SHORTEN
+#define MSG_CNG_SDCARD "Αλλαγή κάρτας SD"
+#define MSG_ZPROBE_OUT "Διερεύνηση Z εκτός Επ.Εκτύπωσης" //SHORTEN
+#define MSG_YX_UNHOMED "Επαναφορά Χ/Υ πριν από Ζ" //SHORTEN
+#define MSG_XYZ_UNHOMED "Επαναφορά ΧΥΖ πρώτα"
+#define MSG_ZPROBE_ZOFFSET "Μετατόπιση Ζ"
+#define MSG_BABYSTEP_X "Μικρό βήμα Χ"
+#define MSG_BABYSTEP_Y "Μικρό βήμα Υ"
+#define MSG_BABYSTEP_Z "Μικρό βήμα Ζ"
+#define MSG_ENDSTOP_ABORT "Ακύρωση endstop "
+#define MSG_HEATING_FAILED_LCD "Ανεπιτυχής θέρμανση"
+#define MSG_ERR_REDUNDANT_TEMP "ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"
+#define MSG_THERMAL_RUNAWAY "ΔΙΑΦΥΓΗ ΘΕΡΜΟΚΡΑΣΙΑΣ"
+#define MSG_ERR_MAXTEMP "ΠΕΡΙΤΗ ΘΕΡΜΟΚΡΑΣΙΑ"
+#define MSG_ERR_MINTEMP "ΜΗ ΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑΣ" //SHORTEN
+#define MSG_ERR_MAXTEMP_BED "ΜΕΓΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ" //SHORTEN
+#define MSG_ERR_MINTEMP_BED "ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ" //SHORTEN
+#define MSG_HALTED "H εκτύπωση διακόπηκε"
+#define MSG_PLEASE_RESET "PLEASE RESET" //TRANSLATE
+#define MSG_HEATING "Θερμαίνεται…"
+#define MSG_HEATING_COMPLETE "Η θέρμανση ολοκληρώθηκε." //SHORTEN
+#define MSG_BED_HEATING "Θέρμανση ΕΠ. Εκτύπωσης" //SHORTEN
+#define MSG_BED_DONE "Η Επ. Εκτύπωσης ολοκληρώθηκε" //SHORTEN
+#define MSG_DELTA_CALIBRATE "Βαθμονόμηση Delta"
+#define MSG_DELTA_CALIBRATE_X "Βαθμονόμηση X"
+#define MSG_DELTA_CALIBRATE_Y "Βαθμονόμηση Y"
+#define MSG_DELTA_CALIBRATE_Z "Βαθμονόμηση Z"
+#define MSG_DELTA_CALIBRATE_CENTER "Βαθμονόμηση κέντρου"
+
+#define MSG_INFO_MENU "About Printer"
+#define MSG_INFO_PRINTER_MENU "Printer Info"
+#define MSG_INFO_STATS_MENU "Printer Stats"
+#define MSG_INFO_BOARD_MENU "Board Info"
+#define MSG_INFO_THERMISTOR_MENU "Thermistors"
+#define MSG_INFO_EXTRUDERS "Extruders"
+#define MSG_INFO_BAUDRATE "Baud"
+#define MSG_INFO_PROTOCOL "Protocol"
+
+#if LCD_WIDTH > 19
+ #define MSG_INFO_PRINT_COUNT "Print Count"
+ #define MSG_INFO_COMPLETED_PRINTS "Completed "
+ #define MSG_INFO_PRINT_TIME "Total Time "
+#else
+ #define MSG_INFO_PRINT_COUNT "Prints "
+ #define MSG_INFO_COMPLETED_PRINTS "Completed"
+ #define MSG_INFO_PRINT_TIME "Duration "
+#endif
+#define MSG_INFO_MIN_TEMP "Min Temp"
+#define MSG_INFO_MAX_TEMP "Max Temp"
+#define MSG_INFO_PSU "Power Supply"
+
+#define MSG_FILAMENT_CHANGE_HEADER "CHANGE FILAMENT"
+#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Extrude more"
+#define MSG_FILAMENT_CHANGE_OPTION_RESUME "Resume print"
+
+#if LCD_HEIGHT >= 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Wait for start"
+ #define MSG_FILAMENT_CHANGE_INIT_2 "of the filament"
+ #define MSG_FILAMENT_CHANGE_INIT_3 "change"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Wait for"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_2 "filament unload"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_3 ""
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert filament"
+ #define MSG_FILAMENT_CHANGE_INSERT_2 "and press button"
+ #define MSG_FILAMENT_CHANGE_INSERT_3 "to continue..."
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Wait for"
+ #define MSG_FILAMENT_CHANGE_LOAD_2 "filament load"
+ #define MSG_FILAMENT_CHANGE_LOAD_3 ""
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Wait for"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "filament extrude"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_3 ""
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Wait for print"
+ #define MSG_FILAMENT_CHANGE_RESUME_2 "to resume"
+ #define MSG_FILAMENT_CHANGE_RESUME_3 ""
+#else // LCD_HEIGHT < 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Please wait..."
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Ejecting..."
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert and Click"
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Loading..."
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Extruding..."
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Resuming..."
+#endif
+
+#endif // LANGUAGE_EL_H
diff --git a/Marlin/language_en.h b/Marlin/language_en.h
index e85d342d0..6cf7d52c5 100644
--- a/Marlin/language_en.h
+++ b/Marlin/language_en.h
@@ -30,16 +30,11 @@
#ifndef LANGUAGE_EN_H
#define LANGUAGE_EN_H
-#if DISABLED(MAPPER_NON) && DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_D0D1) && DISABLED(MAPPER_D0D1_MOD) && DISABLED(MAPPER_E382E383)
- #define MAPPER_NON // For direct ascii codes
-#endif
-
//#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays
-#if DISABLED(SIMULATE_ROMFONT) && DISABLED(DISPLAY_CHARSET_ISO10646_1) && DISABLED(DISPLAY_CHARSET_ISO10646_5) && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) && DISABLED(DISPLAY_CHARSET_ISO10646_CN)
+#if DISABLED(SIMULATE_ROMFONT) && DISABLED(DISPLAY_CHARSET_ISO10646_1) && DISABLED(DISPLAY_CHARSET_ISO10646_5) && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) && DISABLED(DISPLAY_CHARSET_ISO10646_GREEK) && DISABLED(DISPLAY_CHARSET_ISO10646_CN)
#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays.
#endif
-
#ifndef WELCOME_MSG
#define WELCOME_MSG MACHINE_NAME " ready."
#endif
@@ -97,35 +92,35 @@
#ifndef MSG_SET_ORIGIN
#define MSG_SET_ORIGIN "Set origin"
#endif
-#ifndef MSG_PREHEAT_PLA
- #define MSG_PREHEAT_PLA "Preheat PLA"
+#ifndef MSG_PREHEAT_1
+ #define MSG_PREHEAT_1 "Preheat PLA"
#endif
-#ifndef MSG_PREHEAT_PLA_N
- #define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
+#ifndef MSG_PREHEAT_1_N
+ #define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
#endif
-#ifndef MSG_PREHEAT_PLA_ALL
- #define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " All"
+#ifndef MSG_PREHEAT_1_ALL
+ #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " All"
#endif
-#ifndef MSG_PREHEAT_PLA_BEDONLY
- #define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Bed"
+#ifndef MSG_PREHEAT_1_BEDONLY
+ #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " Bed"
#endif
-#ifndef MSG_PREHEAT_PLA_SETTINGS
- #define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " conf"
+#ifndef MSG_PREHEAT_1_SETTINGS
+ #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " conf"
#endif
-#ifndef MSG_PREHEAT_ABS
- #define MSG_PREHEAT_ABS "Preheat ABS"
+#ifndef MSG_PREHEAT_2
+ #define MSG_PREHEAT_2 "Preheat ABS"
#endif
-#ifndef MSG_PREHEAT_ABS_N
- #define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
+#ifndef MSG_PREHEAT_2_N
+ #define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
#endif
-#ifndef MSG_PREHEAT_ABS_ALL
- #define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " All"
+#ifndef MSG_PREHEAT_2_ALL
+ #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " All"
#endif
-#ifndef MSG_PREHEAT_ABS_BEDONLY
- #define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Bed"
+#ifndef MSG_PREHEAT_2_BEDONLY
+ #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Bed"
#endif
-#ifndef MSG_PREHEAT_ABS_SETTINGS
- #define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " conf"
+#ifndef MSG_PREHEAT_2_SETTINGS
+ #define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " conf"
#endif
#ifndef MSG_H1
#define MSG_H1 "1"
@@ -256,6 +251,9 @@
#ifndef MSG_PID_C
#define MSG_PID_C "PID-C"
#endif
+#ifndef MSG_SELECT
+ #define MSG_SELECT "Select"
+#endif
#ifndef MSG_E1
#define MSG_E1 " E1"
#endif
@@ -445,11 +443,11 @@
#ifndef MSG_ZPROBE_OUT
#define MSG_ZPROBE_OUT "Z probe out. bed"
#endif
-#ifndef MSG_YX_UNHOMED
- #define MSG_YX_UNHOMED "Home X/Y before Z"
+#ifndef MSG_HOME
+ #define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
#endif
-#ifndef MSG_XYZ_UNHOMED
- #define MSG_XYZ_UNHOMED "Home XYZ first"
+#ifndef MSG_FIRST
+ #define MSG_FIRST "first"
#endif
#ifndef MSG_ZPROBE_ZOFFSET
#define MSG_ZPROBE_ZOFFSET "Z Offset"
@@ -487,11 +485,20 @@
#ifndef MSG_ERR_MINTEMP_BED
#define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED"
#endif
-#ifndef MSG_END_HOUR
- #define MSG_END_HOUR "hours"
+#ifndef MSG_HALTED
+ #define MSG_HALTED "PRINTER HALTED"
+#endif
+#ifndef MSG_PLEASE_RESET
+ #define MSG_PLEASE_RESET "Please reset"
+#endif
+#ifndef MSG_SHORT_DAY
+ #define MSG_SHORT_DAY "d" // One character only
#endif
-#ifndef MSG_END_MINUTE
- #define MSG_END_MINUTE "minutes"
+#ifndef MSG_SHORT_HOUR
+ #define MSG_SHORT_HOUR "h" // One character only
+#endif
+#ifndef MSG_SHORT_MINUTE
+ #define MSG_SHORT_MINUTE "m" // One character only
#endif
#ifndef MSG_HEATING
#define MSG_HEATING "Heating..."
@@ -521,4 +528,161 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif
+#ifndef MSG_INFO_MENU
+ #define MSG_INFO_MENU "About Printer"
+#endif
+#ifndef MSG_INFO_PRINTER_MENU
+ #define MSG_INFO_PRINTER_MENU "Printer Info"
+#endif
+#ifndef MSG_INFO_STATS_MENU
+ #define MSG_INFO_STATS_MENU "Printer Stats"
+#endif
+#ifndef MSG_INFO_BOARD_MENU
+ #define MSG_INFO_BOARD_MENU "Board Info"
+#endif
+#ifndef MSG_INFO_THERMISTOR_MENU
+ #define MSG_INFO_THERMISTOR_MENU "Thermistors"
+#endif
+#ifndef MSG_INFO_EXTRUDERS
+ #define MSG_INFO_EXTRUDERS "Extruders"
+#endif
+#ifndef MSG_INFO_BAUDRATE
+ #define MSG_INFO_BAUDRATE "Baud"
+#endif
+#ifndef MSG_INFO_PROTOCOL
+ #define MSG_INFO_PROTOCOL "Protocol"
+#endif
+
+#if LCD_WIDTH > 19
+ #ifndef MSG_INFO_PRINT_COUNT
+ #define MSG_INFO_PRINT_COUNT "Print Count"
+ #endif
+ #ifndef MSG_INFO_COMPLETED_PRINTS
+ #define MSG_INFO_COMPLETED_PRINTS "Completed"
+ #endif
+ #ifndef MSG_INFO_PRINT_TIME
+ #define MSG_INFO_PRINT_TIME "Total print time"
+ #endif
+ #ifndef MSG_INFO_PRINT_LONGEST
+ #define MSG_INFO_PRINT_LONGEST "Longest job time"
+ #endif
+ #ifndef MSG_INFO_PRINT_FILAMENT
+ #define MSG_INFO_PRINT_FILAMENT "Extruded total"
+ #endif
+#else
+ #ifndef MSG_INFO_PRINT_COUNT
+ #define MSG_INFO_PRINT_COUNT "Prints"
+ #endif
+ #ifndef MSG_INFO_COMPLETED_PRINTS
+ #define MSG_INFO_COMPLETED_PRINTS "Completed"
+ #endif
+ #ifndef MSG_INFO_PRINT_TIME
+ #define MSG_INFO_PRINT_TIME "Total"
+ #endif
+ #ifndef MSG_INFO_PRINT_LONGEST
+ #define MSG_INFO_PRINT_LONGEST "Longest"
+ #endif
+ #ifndef MSG_INFO_PRINT_FILAMENT
+ #define MSG_INFO_PRINT_FILAMENT "Extruded"
+ #endif
+#endif
+
+#ifndef MSG_INFO_MIN_TEMP
+ #define MSG_INFO_MIN_TEMP "Min Temp"
+#endif
+#ifndef MSG_INFO_MAX_TEMP
+ #define MSG_INFO_MAX_TEMP "Max Temp"
+#endif
+#ifndef MSG_INFO_PSU
+ #define MSG_INFO_PSU "Power Supply"
+#endif
+
+#ifndef MSG_FILAMENT_CHANGE_HEADER
+ #define MSG_FILAMENT_CHANGE_HEADER "CHANGE FILAMENT"
+#endif
+#ifndef MSG_FILAMENT_CHANGE_OPTION_HEADER
+ #define MSG_FILAMENT_CHANGE_OPTION_HEADER "CHANGE OPTIONS:"
+#endif
+#ifndef MSG_FILAMENT_CHANGE_OPTION_EXTRUDE
+ #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Extrude more"
+#endif
+#ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME
+ #define MSG_FILAMENT_CHANGE_OPTION_RESUME "Resume print"
+#endif
+#if LCD_HEIGHT >= 4
+ #ifndef MSG_FILAMENT_CHANGE_INIT_1
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Wait for start"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_INIT_2
+ #define MSG_FILAMENT_CHANGE_INIT_2 "of the filament"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_INIT_3
+ #define MSG_FILAMENT_CHANGE_INIT_3 "change"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Wait for"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_UNLOAD_2
+ #define MSG_FILAMENT_CHANGE_UNLOAD_2 "filament unload"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_UNLOAD_3
+ #define MSG_FILAMENT_CHANGE_UNLOAD_3 ""
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_INSERT_1
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert filament"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_INSERT_2
+ #define MSG_FILAMENT_CHANGE_INSERT_2 "and press button"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_INSERT_3
+ #define MSG_FILAMENT_CHANGE_INSERT_3 "to continue..."
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_LOAD_1
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Wait for"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_LOAD_2
+ #define MSG_FILAMENT_CHANGE_LOAD_2 "filament load"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_LOAD_3
+ #define MSG_FILAMENT_CHANGE_LOAD_3 ""
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_1
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Wait for"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_2
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "filament extrude"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_3
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_3 ""
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_RESUME_1
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Wait for print"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_RESUME_2
+ #define MSG_FILAMENT_CHANGE_RESUME_2 "to resume"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_RESUME_3
+ #define MSG_FILAMENT_CHANGE_RESUME_3 ""
+ #endif
+#else // LCD_HEIGHT < 4
+ #ifndef MSG_FILAMENT_CHANGE_INIT_1
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Please wait..."
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Ejecting..."
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_INSERT_1
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert and Click"
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_LOAD_1
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Loading..."
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_1
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Extruding..."
+ #endif
+ #ifndef MSG_FILAMENT_CHANGE_RESUME_1
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Resuming..."
+ #endif
+#endif // LCD_HEIGHT < 4
+
#endif // LANGUAGE_EN_H
diff --git a/Marlin/language_es.h b/Marlin/language_es.h
index 947294579..2943fcf96 100644
--- a/Marlin/language_es.h
+++ b/Marlin/language_es.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_ES_H
#define LANGUAGE_ES_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -38,27 +37,35 @@
#define WELCOME_MSG MACHINE_NAME " lista."
#define MSG_SD_INSERTED "Tarjeta colocada"
#define MSG_SD_REMOVED "Tarjeta retirada"
+#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters
#define MSG_MAIN "Menu principal"
#define MSG_AUTOSTART "Inicio automatico"
#define MSG_DISABLE_STEPPERS "Apagar motores"
#define MSG_AUTO_HOME "Llevar al origen"
+#define MSG_AUTO_HOME_X "Origen X"
+#define MSG_AUTO_HOME_Y "Origen Y"
+#define MSG_AUTO_HOME_Z "Origen Z"
#define MSG_LEVEL_BED_HOMING "Origen XYZ"
-#define MSG_LEVEL_BED_WAITING "Click to Begin"
-#define MSG_LEVEL_BED_DONE "Leveling Done!"
-#define MSG_LEVEL_BED_CANCEL "Cancel"
+#define MSG_LEVEL_BED_WAITING "Presione para iniciar"
+#define MSG_LEVEL_BED_DONE "Nivelacion lista!"
+#define MSG_LEVEL_BED_CANCEL "Cancelar"
#define MSG_SET_HOME_OFFSETS "Ajustar desfases"
-#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
+#define MSG_HOME_OFFSETS_APPLIED "Desfase aplicado"
#define MSG_SET_ORIGIN "Establecer origen"
-#define MSG_PREHEAT_PLA "Precalentar PLA"
-#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
-#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA "Todo"
-#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA"Plataforma"
-#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA "Config"
-#define MSG_PREHEAT_ABS "Precalentar ABS"
-#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
-#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS "Todo"
-#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS "Plataforma"
-#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS "Config"
+#define MSG_PREHEAT_1 "Precalentar PLA"
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 "Todo"
+#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1"Plataforma"
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 "Config"
+#define MSG_PREHEAT_2 "Precalentar ABS"
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 "Todo"
+#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 "Plataforma"
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 "Config"
+#define MSG_H1 "1"
+#define MSG_H2 "2"
+#define MSG_H3 "3"
+#define MSG_H4 "4"
#define MSG_COOLDOWN "Enfriar"
#define MSG_SWITCH_PS_ON "Encender"
#define MSG_SWITCH_PS_OFF "Apagar"
@@ -70,12 +77,20 @@
#define MSG_MOVE_Y "Mover Y"
#define MSG_MOVE_Z "Mover Z"
#define MSG_MOVE_E "Extrusor"
+#define MSG_MOVE_E1 "1"
+#define MSG_MOVE_E2 "2"
+#define MSG_MOVE_E3 "3"
+#define MSG_MOVE_E4 "4"
#define MSG_MOVE_01MM "Mover 0.1mm"
#define MSG_MOVE_1MM "Mover 1mm"
#define MSG_MOVE_10MM "Mover 10mm"
#define MSG_SPEED "Velocidad"
#define MSG_BED_Z "Plataforma Z"
#define MSG_NOZZLE "Boquilla"
+#define MSG_N1 " 1"
+#define MSG_N2 " 2"
+#define MSG_N3 " 3"
+#define MSG_N4 " 4"
#define MSG_BED "Plataforma"
#define MSG_FAN_SPEED "Ventilador"
#define MSG_FLOW "Flujo"
@@ -90,6 +105,10 @@
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
+#define MSG_E1 " E1"
+#define MSG_E2 " E2"
+#define MSG_E3 " E3"
+#define MSG_E4 " E4"
#define MSG_ACC "Aceleracion"
#define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk"
@@ -113,12 +132,16 @@
#define MSG_VOLUMETRIC "Filamento"
#define MSG_VOLUMETRIC_ENABLED "E in mm3"
#define MSG_FILAMENT_DIAM "Fil. Dia."
+#define MSG_DIAM_E1 " 1"
+#define MSG_DIAM_E2 " 2"
+#define MSG_DIAM_E3 " 3"
+#define MSG_DIAM_E4 " 4"
#define MSG_CONTRAST "Contraste"
#define MSG_STORE_EPROM "Guardar memoria"
#define MSG_LOAD_EPROM "Cargar memoria"
#define MSG_RESTORE_FAILSAFE "Restaurar memoria."
#define MSG_REFRESH "Volver a cargar"
-#define MSG_WATCH "Monitorizar"
+#define MSG_WATCH "Informacion"
#define MSG_PREPARE "Preparar"
#define MSG_TUNE "Ajustar"
#define MSG_PAUSE_PRINT "Pausar impresion"
@@ -145,12 +168,13 @@
#define MSG_INIT_SDCARD "Iniciando tarjeta"
#define MSG_CNG_SDCARD "Cambiar tarjeta"
#define MSG_ZPROBE_OUT "Sonda Z fuera"
-#define MSG_YX_UNHOMED "Reiniciar X/Y y Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Desfase Z"
#define MSG_BABYSTEP_X "Micropaso X"
#define MSG_BABYSTEP_Y "Micropaso Y"
#define MSG_BABYSTEP_Z "Micropaso Z"
-#define MSG_ENDSTOP_ABORT "Endstop abort"
+#define MSG_ENDSTOP_ABORT "Cancelado - Endstop"
#define MSG_HEATING_FAILED_LCD "Error: al calentar"
#define MSG_ERR_REDUNDANT_TEMP "Error: temperatura redundante"
#define MSG_THERMAL_RUNAWAY "Error de temperatura"
@@ -158,13 +182,10 @@
#define MSG_ERR_MINTEMP "Error: Temp Minima"
#define MSG_ERR_MAXTEMP_BED "Error: Temp Max Plataforma"
#define MSG_ERR_MINTEMP_BED "Error: Temp Min Plataforma"
-#define MSG_END_HOUR "horas"
-#define MSG_END_MINUTE "minutos"
#define MSG_HEATING "Calentando..."
#define MSG_HEATING_COMPLETE "Calentamiento Completo"
#define MSG_BED_HEATING "Calentando plataforma ..."
#define MSG_BED_DONE "Plataforma Caliente"
-
#define MSG_DELTA_CALIBRATE "Calibracion Delta"
#define MSG_DELTA_CALIBRATE_X "Calibrar X"
#define MSG_DELTA_CALIBRATE_Y "Calibrar Y"
diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h
index 51600f8b4..909d6c85d 100644
--- a/Marlin/language_eu.h
+++ b/Marlin/language_eu.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_EU_H
#define LANGUAGE_EU_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -49,16 +48,16 @@
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Hasiera ipini"
-#define MSG_PREHEAT_PLA "Aurreberotu PLA"
-#define MSG_PREHEAT_PLA_N "Aurreberotu PLA "
-#define MSG_PREHEAT_PLA_ALL "Berotu PLA Guztia"
-#define MSG_PREHEAT_PLA_BEDONLY "Berotu PLA Ohea"
-#define MSG_PREHEAT_PLA_SETTINGS "Berotu PLA Konfig"
-#define MSG_PREHEAT_ABS "Aurreberotu ABS"
-#define MSG_PREHEAT_ABS_N "Aurreberotu ABS "
-#define MSG_PREHEAT_ABS_ALL "Berotu ABS Guztia"
-#define MSG_PREHEAT_ABS_BEDONLY "Berotu ABS Ohea"
-#define MSG_PREHEAT_ABS_SETTINGS "Berotu ABS Konfig"
+#define MSG_PREHEAT_1 "Aurreberotu PLA"
+#define MSG_PREHEAT_1_N "Aurreberotu PLA "
+#define MSG_PREHEAT_1_ALL "Berotu PLA Guztia"
+#define MSG_PREHEAT_1_BEDONLY "Berotu PLA Ohea"
+#define MSG_PREHEAT_1_SETTINGS "Berotu PLA Konfig"
+#define MSG_PREHEAT_2 "Aurreberotu ABS"
+#define MSG_PREHEAT_2_N "Aurreberotu ABS "
+#define MSG_PREHEAT_2_ALL "Berotu ABS Guztia"
+#define MSG_PREHEAT_2_BEDONLY "Berotu ABS Ohea"
+#define MSG_PREHEAT_2_SETTINGS "Berotu ABS Konfig"
#define MSG_COOLDOWN "Hoztu"
#define MSG_SWITCH_PS_ON "Energia piztu"
#define MSG_SWITCH_PS_OFF "Energia itzali"
@@ -142,15 +141,13 @@
#define MSG_INIT_SDCARD "Hasieratu txartela"
#define MSG_CNG_SDCARD "Aldatu txartela"
#define MSG_ZPROBE_OUT "Z ohe hasiera"
-#define MSG_YX_UNHOMED "Posizio ezezaguna"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z konpentsatu"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop deuseztat"
-#define MSG_END_HOUR "hours"
-#define MSG_END_MINUTE "minutes"
-
#define MSG_DELTA_CALIBRATE "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Calibrate X"
#define MSG_DELTA_CALIBRATE_Y "Calibrate Y"
diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h
index a1915fd3b..b73a207e2 100644
--- a/Marlin/language_fi.h
+++ b/Marlin/language_fi.h
@@ -49,16 +49,16 @@
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Aseta origo"
-#define MSG_PREHEAT_PLA "Esilämmitä PLA"
-#define MSG_PREHEAT_PLA_N "Esilämmitä PLA "
-#define MSG_PREHEAT_PLA_ALL "Esilä. PLA Kaikki"
-#define MSG_PREHEAT_PLA_BEDONLY "Esilä. PLA Alusta"
-#define MSG_PREHEAT_PLA_SETTINGS "Esilämm. PLA konf"
-#define MSG_PREHEAT_ABS "Esilämmitä ABS"
-#define MSG_PREHEAT_ABS_N "Esilämmitä ABS "
-#define MSG_PREHEAT_ABS_ALL "Esilä. ABS Kaikki"
-#define MSG_PREHEAT_ABS_BEDONLY "Esilä. ABS Alusta"
-#define MSG_PREHEAT_ABS_SETTINGS "Esilämm. ABS konf"
+#define MSG_PREHEAT_1 "Esilämmitä PLA"
+#define MSG_PREHEAT_1_N "Esilämmitä PLA "
+#define MSG_PREHEAT_1_ALL "Esilä. PLA Kaikki"
+#define MSG_PREHEAT_1_BEDONLY "Esilä. PLA Alusta"
+#define MSG_PREHEAT_1_SETTINGS "Esilämm. PLA konf"
+#define MSG_PREHEAT_2 "Esilämmitä ABS"
+#define MSG_PREHEAT_2_N "Esilämmitä ABS "
+#define MSG_PREHEAT_2_ALL "Esilä. ABS Kaikki"
+#define MSG_PREHEAT_2_BEDONLY "Esilä. ABS Alusta"
+#define MSG_PREHEAT_2_SETTINGS "Esilämm. ABS konf"
#define MSG_COOLDOWN "Jäähdytä"
#define MSG_SWITCH_PS_ON "Virta päälle"
#define MSG_SWITCH_PS_OFF "Virta pois"
@@ -142,15 +142,13 @@
#define MSG_INIT_SDCARD "Init. SD-Card"
#define MSG_CNG_SDCARD "Change SD-Card"
#define MSG_ZPROBE_OUT "Z probe out. bed"
-#define MSG_YX_UNHOMED "Home X/Y before Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop abort"
-#define MSG_END_HOUR "hours"
-#define MSG_END_MINUTE "minutes"
-
#define MSG_DELTA_CALIBRATE "Delta Kalibrointi"
#define MSG_DELTA_CALIBRATE_X "Kalibroi X"
#define MSG_DELTA_CALIBRATE_Y "Kalibroi Y"
diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h
index 79b3d35c2..52adbcba0 100644
--- a/Marlin/language_fr.h
+++ b/Marlin/language_fr.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_FR_H
#define LANGUAGE_FR_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -49,16 +48,16 @@
#define MSG_SET_HOME_OFFSETS "Regler decal. origine"
#define MSG_HOME_OFFSETS_APPLIED "Decalages appliques"
#define MSG_SET_ORIGIN "Regler origine"
-#define MSG_PREHEAT_PLA "Prechauffage PLA"
-#define MSG_PREHEAT_PLA_N "Prechauff. PLA "
-#define MSG_PREHEAT_PLA_ALL "Prech. PLA Tout"
-#define MSG_PREHEAT_PLA_BEDONLY "Prech. PLA Plateau"
-#define MSG_PREHEAT_PLA_SETTINGS "Regl. prech. PLA"
-#define MSG_PREHEAT_ABS "Prechauffage ABS"
-#define MSG_PREHEAT_ABS_N "Prechauff. ABS "
-#define MSG_PREHEAT_ABS_ALL "Prech. ABS Tout"
-#define MSG_PREHEAT_ABS_BEDONLY "Prech. ABS Plateau"
-#define MSG_PREHEAT_ABS_SETTINGS "Regl. prech. ABS"
+#define MSG_PREHEAT_1 "Prechauffage PLA"
+#define MSG_PREHEAT_1_N "Prechauff. PLA "
+#define MSG_PREHEAT_1_ALL "Prech. PLA Tout"
+#define MSG_PREHEAT_1_BEDONLY "Prech. PLA Plateau"
+#define MSG_PREHEAT_1_SETTINGS "Regl. prech. PLA"
+#define MSG_PREHEAT_2 "Prechauffage ABS"
+#define MSG_PREHEAT_2_N "Prechauff. ABS "
+#define MSG_PREHEAT_2_ALL "Prech. ABS Tout"
+#define MSG_PREHEAT_2_BEDONLY "Prech. ABS Plateau"
+#define MSG_PREHEAT_2_SETTINGS "Regl. prech. ABS"
#define MSG_COOLDOWN "Refroidir"
#define MSG_SWITCH_PS_ON "Allumer alim."
#define MSG_SWITCH_PS_OFF "Eteindre alim."
@@ -145,7 +144,8 @@
#define MSG_INIT_SDCARD "Init. la carte SD"
#define MSG_CNG_SDCARD "Changer de carte"
#define MSG_ZPROBE_OUT "Z sonde exte. lit"
-#define MSG_YX_UNHOMED "Rev. dans XY av.Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Decalage Z"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
@@ -158,13 +158,10 @@
#define MSG_ERR_MINTEMP "Err: TEMP. MIN"
#define MSG_ERR_MAXTEMP_BED "Err: TEMP. MAX PLATEAU"
#define MSG_ERR_MINTEMP_BED "Err: TEMP. MIN PLATEAU"
-#define MSG_END_HOUR "heures"
-#define MSG_END_MINUTE "minutes"
#define MSG_HEATING "En chauffe..."
#define MSG_HEATING_COMPLETE "Chauffe terminee"
#define MSG_BED_HEATING "Plateau en chauffe..."
#define MSG_BED_DONE "Chauffe plateau terminee"
-
#define MSG_DELTA_CALIBRATE "Calibration Delta"
#define MSG_DELTA_CALIBRATE_X "Calibrer X"
#define MSG_DELTA_CALIBRATE_Y "Calibrer Y"
diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h
index 5365f3c70..c899c63fd 100644
--- a/Marlin/language_gl.h
+++ b/Marlin/language_gl.h
@@ -54,16 +54,16 @@
#define MSG_SET_HOME_OFFSETS "Offsets na orixe"
#define MSG_HOME_OFFSETS_APPLIED "Offsets fixados"
#define MSG_SET_ORIGIN "Fixar orixe"
-#define MSG_PREHEAT_PLA "Prequentar PLA"
-#define MSG_PREHEAT_PLA_N "Prequentar PLA "
-#define MSG_PREHEAT_PLA_ALL "Preque. PLA Todo"
-#define MSG_PREHEAT_PLA_BEDONLY "Preque. PLA Cama"
-#define MSG_PREHEAT_PLA_SETTINGS "Preque. PLA conf"
-#define MSG_PREHEAT_ABS "Prequentar ABS"
-#define MSG_PREHEAT_ABS_N "Prequentar ABS "
-#define MSG_PREHEAT_ABS_ALL "Preque. ABS Todo"
-#define MSG_PREHEAT_ABS_BEDONLY "Preque. ABS Cama"
-#define MSG_PREHEAT_ABS_SETTINGS "Preque. ABS conf"
+#define MSG_PREHEAT_1 "Prequentar PLA"
+#define MSG_PREHEAT_1_N "Prequentar PLA "
+#define MSG_PREHEAT_1_ALL "Preque. PLA Todo"
+#define MSG_PREHEAT_1_BEDONLY "Preque. PLA Cama"
+#define MSG_PREHEAT_1_SETTINGS "Preque. PLA conf"
+#define MSG_PREHEAT_2 "Prequentar ABS"
+#define MSG_PREHEAT_2_N "Prequentar ABS "
+#define MSG_PREHEAT_2_ALL "Preque. ABS Todo"
+#define MSG_PREHEAT_2_BEDONLY "Preque. ABS Cama"
+#define MSG_PREHEAT_2_SETTINGS "Preque. ABS conf"
#define MSG_H1 "1"
#define MSG_H2 "2"
#define MSG_H3 "3"
@@ -170,8 +170,8 @@
#define MSG_INIT_SDCARD "Iniciando SD"
#define MSG_CNG_SDCARD "Cambiar SD"
#define MSG_ZPROBE_OUT "Sonda-Z sen cama"
-#define MSG_YX_UNHOMED "X/Y antes que Z"
-#define MSG_XYZ_UNHOMED "Orixe XYZ antes"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Offset Z"
#define MSG_BABYSTEP_X "Micropaso X"
#define MSG_BABYSTEP_Y "Micropaso Y"
@@ -184,17 +184,14 @@
#define MSG_ERR_MINTEMP "Err: temp. min."
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED"
-#define MSG_END_HOUR "horas"
-#define MSG_END_MINUTE "minutos"
#define MSG_HEATING "Quentando..."
#define MSG_HEATING_COMPLETE "Xa esta quente"
#define MSG_BED_HEATING "Quentando cama"
#define MSG_BED_DONE "Cama esta quente"
-
-#define MSG_DELTA_CALIBRATE "Calibracion Delta"
-#define MSG_DELTA_CALIBRATE_X "Calibrar X"
-#define MSG_DELTA_CALIBRATE_Y "Calibrar Y"
-#define MSG_DELTA_CALIBRATE_Z "Calibrar Z"
-#define MSG_DELTA_CALIBRATE_CENTER "Calibrar Centro"
+#define MSG_DELTA_CALIBRATE "Calibracion Delta"
+#define MSG_DELTA_CALIBRATE_X "Calibrar X"
+#define MSG_DELTA_CALIBRATE_Y "Calibrar Y"
+#define MSG_DELTA_CALIBRATE_Z "Calibrar Z"
+#define MSG_DELTA_CALIBRATE_CENTER "Calibrar Centro"
#endif // LANGUAGE_GL_H
diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h
new file mode 100644
index 000000000..603521506
--- /dev/null
+++ b/Marlin/language_hr.h
@@ -0,0 +1,197 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Croatian (Hrvatski)
+ *
+ * LCD Menu Messages
+ * See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
+ *
+ */
+#ifndef LANGUAGE_HR_H
+#define LANGUAGE_HR_H
+
+
+// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
+//#define SIMULATE_ROMFONT
+#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays.
+
+#define WELCOME_MSG MACHINE_NAME " spreman."
+#define MSG_SD_INSERTED "SD kartica umetnuta"
+#define MSG_SD_REMOVED "SD kartica uklonjena"
+#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters
+#define MSG_MAIN "Main"
+#define MSG_AUTOSTART "Automatsko pokretanje"
+#define MSG_DISABLE_STEPPERS "Ugasi steppere"
+#define MSG_AUTO_HOME "Automatski homing"
+#define MSG_AUTO_HOME_X "Home-aj X"
+#define MSG_AUTO_HOME_Y "Home-aj Y"
+#define MSG_AUTO_HOME_Z "Home-aj Z"
+#define MSG_LEVEL_BED_HOMING "Home-aj XYZ"
+#define MSG_LEVEL_BED_WAITING "Click to Begin"
+#define MSG_LEVEL_BED_NEXT_POINT "Sljedeća točka"
+#define MSG_LEVEL_BED_DONE "Niveliranje gotovo!"
+#define MSG_LEVEL_BED_CANCEL "Otkaži"
+#define MSG_SET_HOME_OFFSETS "Postavi home offsete"
+#define MSG_HOME_OFFSETS_APPLIED "Offsets postavljeni"
+#define MSG_SET_ORIGIN "Postavi ishodište"
+#define MSG_PREHEAT_1 "Predgrij PLA"
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " Sve"
+#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " Bed"
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " conf"
+#define MSG_PREHEAT_2 "Predgrij ABS"
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " Sve"
+#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Bed"
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " conf"
+#define MSG_H1 "1"
+#define MSG_H2 "2"
+#define MSG_H3 "3"
+#define MSG_H4 "4"
+#define MSG_COOLDOWN "Hlađenje"
+#define MSG_SWITCH_PS_ON "Uključi napajanje"
+#define MSG_SWITCH_PS_OFF "Isključi napajanje"
+#define MSG_EXTRUDE "Extrude"
+#define MSG_RETRACT "Retract"
+#define MSG_MOVE_AXIS "Miči os"
+#define MSG_LEVEL_BED "Niveliraj bed"
+#define MSG_MOVE_X "Miči X"
+#define MSG_MOVE_Y "Miči Y"
+#define MSG_MOVE_Z "Miči Z"
+#define MSG_MOVE_E "Extruder"
+#define MSG_MOVE_E1 "1"
+#define MSG_MOVE_E2 "2"
+#define MSG_MOVE_E3 "3"
+#define MSG_MOVE_E4 "4"
+#define MSG_MOVE_01MM "Miči 0.1mm"
+#define MSG_MOVE_1MM "Miči 1mm"
+#define MSG_MOVE_10MM "Miči 10mm"
+#define MSG_SPEED "Brzina"
+#define MSG_BED_Z "Bed Z"
+#define MSG_NOZZLE "Nozzle"
+#define MSG_N1 " 1"
+#define MSG_N2 " 2"
+#define MSG_N3 " 3"
+#define MSG_N4 " 4"
+#define MSG_BED "Bed"
+#define MSG_FAN_SPEED "Brzina ventilatora"
+#define MSG_FLOW "Flow"
+#define MSG_CONTROL "Control"
+#define MSG_MIN " " LCD_STR_THERMOMETER " Min"
+#define MSG_MAX " " LCD_STR_THERMOMETER " Max"
+#define MSG_FACTOR " " LCD_STR_THERMOMETER " Fact"
+#define MSG_AUTOTEMP "Autotemp"
+#define MSG_ON "On "
+#define MSG_OFF "Off"
+#define MSG_PID_P "PID-P"
+#define MSG_PID_I "PID-I"
+#define MSG_PID_D "PID-D"
+#define MSG_PID_C "PID-C"
+#define MSG_E1 " E1"
+#define MSG_E2 " E2"
+#define MSG_E3 " E3"
+#define MSG_E4 " E4"
+#define MSG_ACC "Accel"
+#define MSG_VXY_JERK "Vxy-jerk"
+#define MSG_VZ_JERK "Vz-jerk"
+#define MSG_VE_JERK "Ve-jerk"
+#define MSG_VMAX "Vmax "
+#define MSG_X "X"
+#define MSG_Y "Y"
+#define MSG_Z "Z"
+#define MSG_E "E"
+#define MSG_VMIN "Vmin"
+#define MSG_VTRAV_MIN "VTrav min"
+#define MSG_AMAX "Amax "
+#define MSG_A_RETRACT "A-retract"
+#define MSG_A_TRAVEL "A-travel"
+#define MSG_XSTEPS "Xsteps/mm"
+#define MSG_YSTEPS "Ysteps/mm"
+#define MSG_ZSTEPS "Zsteps/mm"
+#define MSG_ESTEPS "Esteps/mm"
+#define MSG_TEMPERATURE "Temperature"
+#define MSG_MOTION "Motion"
+#define MSG_VOLUMETRIC "Filament"
+#define MSG_VOLUMETRIC_ENABLED "E in mm3"
+#define MSG_FILAMENT_DIAM "Fil. Dia."
+#define MSG_DIAM_E1 " 1"
+#define MSG_DIAM_E2 " 2"
+#define MSG_DIAM_E3 " 3"
+#define MSG_DIAM_E4 " 4"
+#define MSG_CONTRAST "Kontrast LCD-a"
+#define MSG_STORE_EPROM "Pohrani u memoriju"
+#define MSG_LOAD_EPROM "Učitaj memoriju"
+#define MSG_RESTORE_FAILSAFE "Učitaj failsafe"
+#define MSG_REFRESH "Osvježi"
+#define MSG_WATCH "Info screen"
+#define MSG_PREPARE "Pripremi"
+#define MSG_TUNE "Tune"
+#define MSG_PAUSE_PRINT "Pauziraj print"
+#define MSG_RESUME_PRINT "Nastavi print"
+#define MSG_STOP_PRINT "Zaustavi print"
+#define MSG_CARD_MENU "Printaj s SD kartice"
+#define MSG_NO_CARD "Nema SD kartice"
+#define MSG_DWELL "Sleep..."
+#define MSG_USERWAIT "Čekaj korisnika..."
+#define MSG_RESUMING "Nastavljam print"
+#define MSG_PRINT_ABORTED "Print otkazan"
+#define MSG_NO_MOVE "No move."
+#define MSG_KILLED "KILLED. "
+#define MSG_STOPPED "ZAUSTAVLJEN. "
+#define MSG_CONTROL_RETRACT "Retract mm"
+#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm"
+#define MSG_CONTROL_RETRACTF "Retract V"
+#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
+#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
+#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm"
+#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
+#define MSG_AUTORETRACT "AutoRetr."
+#define MSG_FILAMENTCHANGE "Promijeni filament"
+#define MSG_INIT_SDCARD "Init. SD karticu"
+#define MSG_CNG_SDCARD "Promijeni SD karticu"
+#define MSG_ZPROBE_OUT "Z probe out. bed"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
+#define MSG_ZPROBE_ZOFFSET "Z Offset"
+#define MSG_BABYSTEP_X "Babystep X"
+#define MSG_BABYSTEP_Y "Babystep Y"
+#define MSG_BABYSTEP_Z "Babystep Z"
+#define MSG_ENDSTOP_ABORT "Endstop abort"
+#define MSG_HEATING_FAILED_LCD "Heating failed"
+#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP"
+#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
+#define MSG_ERR_MAXTEMP "Err: MAXTEMP"
+#define MSG_ERR_MINTEMP "Err: MINTEMP"
+#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
+#define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED"
+#define MSG_HEATING "Grijanje..."
+#define MSG_HEATING_COMPLETE "Grijanje gotovo."
+#define MSG_BED_HEATING "Grijanje Bed-a."
+#define MSG_BED_DONE "Bed gotov."
+#define MSG_DELTA_CALIBRATE "Delta Kalibracija"
+#define MSG_DELTA_CALIBRATE_X "Kalibriraj X"
+#define MSG_DELTA_CALIBRATE_Y "Kalibriraj Y"
+#define MSG_DELTA_CALIBRATE_Z "Kalibriraj Z"
+#define MSG_DELTA_CALIBRATE_CENTER "Kalibriraj Središte"
+
+#endif // LANGUAGE_HR_H
diff --git a/Marlin/language_it.h b/Marlin/language_it.h
index 7fb0bdcf5..047272bc6 100644
--- a/Marlin/language_it.h
+++ b/Marlin/language_it.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_IT_H
#define LANGUAGE_IT_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -38,27 +37,32 @@
#define WELCOME_MSG MACHINE_NAME " pronto."
#define MSG_SD_INSERTED "SD Card inserita"
#define MSG_SD_REMOVED "SD Card rimossa"
+#define MSG_LCD_ENDSTOPS "Endstop"
#define MSG_MAIN "Menu principale"
#define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS "Disabilita Motori"
#define MSG_AUTO_HOME "Auto Home"
+#define MSG_AUTO_HOME_X "Home asse X"
+#define MSG_AUTO_HOME_Y "Home asse Y"
+#define MSG_AUTO_HOME_Z "Home asse Z"
#define MSG_LEVEL_BED_HOMING "Home assi XYZ"
#define MSG_LEVEL_BED_WAITING "Premi per Iniziare"
+#define MSG_LEVEL_BED_NEXT_POINT "Punto successivo"
#define MSG_LEVEL_BED_DONE "Livel. terminato!"
#define MSG_LEVEL_BED_CANCEL "Annulla"
#define MSG_SET_HOME_OFFSETS "Imp. offset home"
#define MSG_HOME_OFFSETS_APPLIED "Offset applicato"
#define MSG_SET_ORIGIN "Imposta Origine"
-#define MSG_PREHEAT_PLA "Preriscalda PLA"
-#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
-#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " Tutto"
-#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Piatto"
-#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " conf"
-#define MSG_PREHEAT_ABS "Preriscalda ABS"
-#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
-#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " Tutto"
-#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Piatto"
-#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " conf"
+#define MSG_PREHEAT_1 "Preriscalda PLA"
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " Tutto"
+#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " Piatto"
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " conf"
+#define MSG_PREHEAT_2 "Preriscalda ABS"
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " Tutto"
+#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Piatto"
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " conf"
#define MSG_COOLDOWN "Raffredda"
#define MSG_SWITCH_PS_ON "Accendi aliment."
#define MSG_SWITCH_PS_OFF "Spegni aliment."
@@ -90,6 +94,7 @@
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
+#define MSG_SELECT "Seleziona"
#define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk"
@@ -145,7 +150,8 @@
#define MSG_INIT_SDCARD "Iniz. SD-Card"
#define MSG_CNG_SDCARD "Cambia SD-Card"
#define MSG_ZPROBE_OUT "Z probe out. bed"
-#define MSG_YX_UNHOMED "Home X/Y prima di Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
@@ -158,17 +164,75 @@
#define MSG_ERR_MINTEMP "Err: TEMP MINIMA"
#define MSG_ERR_MAXTEMP_BED "Err: TEMP MASSIMA PIATTO"
#define MSG_ERR_MINTEMP_BED "Err: TEMP MINIMA PIATTO"
-#define MSG_END_HOUR "ore"
-#define MSG_END_MINUTE "minuti"
+#define MSG_HALTED "STAMPANTE FERMATA"
+#define MSG_PLEASE_RESET "Riavviare prego"
+#define MSG_SHORT_DAY "g" // One character only
+#define MSG_SHORT_HOUR "h" // One character only
+#define MSG_SHORT_MINUTE "m" // One character only
#define MSG_HEATING "Riscaldamento.."
#define MSG_HEATING_COMPLETE "Risc. completato"
#define MSG_BED_HEATING "Risc. Piatto.."
#define MSG_BED_DONE "Piatto Pronto"
-
#define MSG_DELTA_CALIBRATE "Calibraz. Delta"
#define MSG_DELTA_CALIBRATE_X "Calibra X"
#define MSG_DELTA_CALIBRATE_Y "Calibra Y"
#define MSG_DELTA_CALIBRATE_Z "Calibra Z"
#define MSG_DELTA_CALIBRATE_CENTER "Calibra Center"
+#define MSG_INFO_MENU "Riguardo stampante"
+#define MSG_INFO_PRINTER_MENU "Info. stampante"
+#define MSG_INFO_STATS_MENU "Statistiche"
+#define MSG_INFO_BOARD_MENU "Info. scheda"
+#define MSG_INFO_THERMISTOR_MENU "Termistori"
+#define MSG_INFO_EXTRUDERS "Estrusori"
+#define MSG_INFO_BAUDRATE "Baud"
+#define MSG_INFO_PROTOCOL "Protocollo"
+#if LCD_WIDTH > 19
+ #define MSG_INFO_PRINT_COUNT "Contat. stampa"
+ #define MSG_INFO_COMPLETED_PRINTS "Completati"
+ #define MSG_INFO_PRINT_TIME "Tempo totale"
+ #define MSG_INFO_PRINT_LONGEST "Lavoro piu lungo"
+ #define MSG_INFO_PRINT_FILAMENT "Totale estruso"
+#else
+ #define MSG_INFO_PRINT_COUNT "Stampe"
+ #define MSG_INFO_COMPLETED_PRINTS "Completati"
+ #define MSG_INFO_PRINT_TIME "Durata"
+ #define MSG_INFO_PRINT_LONGEST "Piu lungo"
+ #define MSG_INFO_PRINT_FILAMENT "Estruso"
+#endif
+#define MSG_INFO_MIN_TEMP "Temp min"
+#define MSG_INFO_MAX_TEMP "Temp max"
+#define MSG_INFO_PSU "Alimentatore"
+
+#define MSG_FILAMENT_CHANGE_HEADER "CAMBIA FILAMENTO"
+#define MSG_FILAMENT_CHANGE_OPTION_HEADER "CAMBIA OPZIONI:"
+#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Estrusione"
+#define MSG_FILAMENT_CHANGE_OPTION_RESUME "Riprendi stampa"
+#if LCD_HEIGHT >= 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Attendere avvio"
+ #define MSG_FILAMENT_CHANGE_INIT_2 "del cambio"
+ #define MSG_FILAMENT_CHANGE_INIT_3 "di filamento"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Attendere"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_2 "l'espulsione"
+ #define MSG_FILAMENT_CHANGE_UNLOAD_3 "del filamento"
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Inserisci il"
+ #define MSG_FILAMENT_CHANGE_INSERT_2 "filamento e"
+ #define MSG_FILAMENT_CHANGE_INSERT_3 "premi per cont"
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Attendere"
+ #define MSG_FILAMENT_CHANGE_LOAD_2 "il caricamento"
+ #define MSG_FILAMENT_CHANGE_LOAD_3 "del filamento"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Attendere"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "l'estrusione"
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "del filamento"
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Attendere"
+ #define MSG_FILAMENT_CHANGE_RESUME_2 "la ripresa"
+ #define MSG_FILAMENT_CHANGE_RESUME_3 "della stampa"
+#else // LCD_HEIGHT < 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "Attendere..."
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Espulsione..."
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "Inserisci e premi"
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "Caricamento..."
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Estrusione..."
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "Ripresa..."
+#endif // LCD_HEIGHT < 4
#endif // LANGUAGE_IT_H
diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h
index e3f41a733..67136e298 100644
--- a/Marlin/language_kana.h
+++ b/Marlin/language_kana.h
@@ -31,7 +31,6 @@
#ifndef LANGUAGE_KANA_H
#define LANGUAGE_KANA_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_KANA
@@ -56,16 +55,16 @@
#define MSG_SET_HOME_OFFSETS "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2" // "キジュンオフセットセッテイ" ("Set home offsets")
#define MSG_HOME_OFFSETS_APPLIED "\xb5\xcc\xbe\xaf\xc4\xb6\xde\xc3\xb7\xd6\xb3\xbb\xda\xcf\xbc\xc0" // "オフセットガテキヨウサレマシタ" ("Offsets applied")
#define MSG_SET_ORIGIN "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4" // "キジュンセット" ("Set origin")
-#define MSG_PREHEAT_PLA "PLA \xd6\xc8\xc2" // "PLA ヨネツ" ("Preheat PLA")
-#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
-#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " \xbd\xcd\xde\xc3" // " スベテ" (" All")
-#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " \xcd\xde\xaf\xc4\xde" // " ベッド" (" Bed")
-#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " \xbe\xaf\xc3\xb2" // " セッテイ" (" conf")
-#define MSG_PREHEAT_ABS "ABS \xd6\xc8\xc2" // "ABS ヨネツ" ("Preheat ABS")
-#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
-#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " \xbd\xcd\xde\xc3" // " スベテ" (" All")
-#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " \xcd\xde\xaf\xc4\xde" // " ベッド" (" Bed")
-#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " \xbe\xaf\xc3\xb2" // " セッテイ" (" conf")
+#define MSG_PREHEAT_1 "PLA \xd6\xc8\xc2" // "PLA ヨネツ" ("Preheat PLA")
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL "PLA \xbd\xcd\xde\xc3\xd6\xc8\xc2" // "PLA スベテヨネツ" (" All")
+#define MSG_PREHEAT_1_BEDONLY "PLA \xcd\xde\xaf\xc4\xde\xd6\xc8\xc2" // "PLA ベッドヨネツ" (" Bed")
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 "\xbe\xaf\xc3\xb2" // "セッテイ" (" conf")
+#define MSG_PREHEAT_2 "ABS \xd6\xc8\xc2" // "ABS ヨネツ" ("Preheat ABS")
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL "ABS \xbd\xcd\xde\xc3\xd6\xc8\xc2" // "ABS スベテヨネツ" (" All")
+#define MSG_PREHEAT_2_BEDONLY "ABS \xcd\xde\xaf\xc4\xde\xd6\xc8\xc2" // "ABS ベッドヨネツ" (" Bed")
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 "\xbe\xaf\xc3\xb2" // "セッテイ" (" conf")
#define MSG_COOLDOWN "\xb6\xc8\xc2\xc3\xb2\xbc" // "カネツテイシ" ("Cooldown")
#define MSG_SWITCH_PS_ON "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xdd" // "デンゲン オン" ("Switch power on")
#define MSG_SWITCH_PS_OFF "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc" // "デンゲン オフ" ("Switch power off")
@@ -90,10 +89,10 @@
#define MSG_MIN LCD_STR_THERMOMETER " \xbb\xb2\xc3\xb2" // " サイテイ" (" Min")
#define MSG_MAX LCD_STR_THERMOMETER " \xbb\xb2\xba\xb3" // " サイコウ" (" Max")
#define MSG_FACTOR LCD_STR_THERMOMETER " \xcc\xa7\xb8\xc0\xb0" // " ファクター" (" Fact")
-#if LCD_WIDTH < 20
- #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde" // "ジドウオンド" ("Autotemp")
-#else
+#if LCD_WIDTH > 19
#define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde\xbe\xb2\xb7\xde\xae" // "ジドウオンドセイギョ" ("Autotemp")
+#else
+ #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde" // "ジドウオンド" ("Autotemp")
#endif
#define MSG_ON "\xb5\xdd " // "オン " ("On ")
#define MSG_OFF "\xb5\xcc " // "オフ " ("Off")
@@ -101,31 +100,32 @@
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
-#if LCD_WIDTH < 20
- #define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "カソクド" ("Accel")
- #define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vxy-jerk")
- #define MSG_VZ_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "Zジク ヤクド" ("Vz-jerk")
- #define MSG_VE_JERK "E\x20\xd4\xb8\xc4\xde" // "E ヤクド" ("Ve-jerk")
- #define MSG_VMAX "max\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "maxオクリソクド" ("Vmax ")
-#else
+#define MSG_SELECT "\xbe\xdd\xc0\xb8" // "センタク" ("Select")
+#if LCD_WIDTH > 19
#define MSG_ACC "\xb6\xbf\xb8\xc4\xde mm/s2" // "カソクド mm/s2" ("Accel")
#define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "XYジク ヤクド mm/s" ("Vxy-jerk")
#define MSG_VZ_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Zジク ヤクド mm/s" ("Vz-jerk")
#define MSG_VE_JERK "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\x20\xd4\xb8\xc4\xde" // "エクストルーダー ヤクド" ("Ve-jerk")
#define MSG_VMAX "\xbb\xb2\xc0\xde\xb2\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "サイダイオクリソクド " ("Vmax ")
+#else
+ #define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "カソクド" ("Accel")
+ #define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vxy-jerk")
+ #define MSG_VZ_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "Zジク ヤクド" ("Vz-jerk")
+ #define MSG_VE_JERK "E\x20\xd4\xb8\xc4\xde" // "E ヤクド" ("Ve-jerk")
+ #define MSG_VMAX "max\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "maxオクリソクド" ("Vmax ")
#endif
#define MSG_X "X"
#define MSG_Y "Y"
#define MSG_Z "Z"
#define MSG_E "E"
-#if LCD_WIDTH < 20
- #define MSG_VMIN "min\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "minオクリソクド" ("Vmin")
- #define MSG_VTRAV_MIN "min\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "minイドウソクド" ("VTrav min")
- #define MSG_AMAX "max\xb6\xbf\xb8 " // "maxカソク " ("Amax ")
-#else
+#if LCD_WIDTH > 19
#define MSG_VMIN "\xbb\xb2\xbc\xae\xb3\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "サイショウオクリソクド" ("Vmin")
#define MSG_VTRAV_MIN "\xbb\xb2\xbc\xae\xb3\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "サイショウイドウソクド" ("VTrav min")
#define MSG_AMAX "\xbb\xb2\xc0\xde\xb2\xb6\xbf\xb8\xc4\xde " // "サイダイカソクド " ("Amax ")
+#else
+ #define MSG_VMIN "min\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "minオクリソクド" ("Vmin")
+ #define MSG_VTRAV_MIN "min\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "minイドウソクド" ("VTrav min")
+ #define MSG_AMAX "max\xb6\xbf\xb8 " // "maxカソク " ("Amax ")
#endif
#define MSG_A_RETRACT "\xcb\xb7\xba\xd0\xb6\xbf\xb8\xc4\xde" // "ヒキコミカソクド" ("A-retract")
#define MSG_A_TRAVEL "\xb2\xc4\xde\xb3\xb6\xbf\xb8\xc4\xde" // "イドウカソクド" ("A-travel")
@@ -137,10 +137,10 @@
#define MSG_MOTION "\xb3\xba\xde\xb7\xbe\xaf\xc3\xb2" // "ウゴキセッテイ" ("Motion")
#define MSG_VOLUMETRIC "\xcc\xa8\xd7\xd2\xdd\xc4" // "フィラメント" ("Filament")
#define MSG_VOLUMETRIC_ENABLED "E in mm3"
-#if LCD_WIDTH < 20
- #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xb9\xb2" // "フィラメントケイ" ("Fil. Dia.")
-#else
+#if LCD_WIDTH > 19
#define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xc1\xae\xaf\xb9\xb2" // "フィラメントチョッケイ" ("Fil. Dia.")
+#else
+ #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xb9\xb2" // "フィラメントケイ" ("Fil. Dia.")
#endif
#define MSG_CONTRAST "LCD\xba\xdd\xc4\xd7\xbd\xc4" // "LCDコントラスト" ("LCD contrast")
#define MSG_STORE_EPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "メモリヘカクノウ" ("Store memory")
@@ -162,15 +162,7 @@
#define MSG_NO_MOVE "\xb3\xba\xde\xb7\xcf\xbe\xdd" // "ウゴキマセン" ("No move.")
#define MSG_KILLED "\xcb\xbc\xde\xae\xb3\xc3\xb2\xbc" // "ヒジョウテイシ" ("KILLED. ")
#define MSG_STOPPED "\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "テイシシマシタ" ("STOPPED. ")
-#if LCD_WIDTH < 20
- #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3" // "ヒキコミリョウ" ("Retract mm")
- #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S" // "ヒキコミリョウS" ("Swap Re.mm")
- #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde" // "ヒキコミソクド" ("Retract V")
- #define MSG_CONTROL_RETRACT_ZLIFT "\xc9\xbd\xde\xd9\xc0\xb2\xcb" // "ノズルタイヒ" ("Hop mm")
- #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3" // "ホショウリョウ" ("UnRet +mm")
- #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S" // "ホショウリョウS" ("S UnRet+mm")
- #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde" // "ホショウソクド" ("UnRet V")
-#else
+#if LCD_WIDTH > 19
#define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3 mm" // "ヒキコミリョウ mm" ("Retract mm")
#define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S mm" // "ヒキコミリョウS mm" ("Swap Re.mm")
#define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde mm/s" // "ヒキコミソクド mm/s" ("Retract V")
@@ -178,55 +170,123 @@
#define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3 mm" // "ホショウリョウ mm" ("UnRet +mm")
#define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S mm" // "ホショウリョウS mm" ("S UnRet+mm")
#define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde mm/s" // "ホショウソクド mm/s" ("UnRet V")
+#else
+ #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3" // "ヒキコミリョウ" ("Retract mm")
+ #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S" // "ヒキコミリョウS" ("Swap Re.mm")
+ #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde" // "ヒキコミソクド" ("Retract V")
+ #define MSG_CONTROL_RETRACT_ZLIFT "\xc9\xbd\xde\xd9\xc0\xb2\xcb" // "ノズルタイヒ" ("Hop mm")
+ #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3" // "ホショウリョウ" ("UnRet +mm")
+ #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S" // "ホショウリョウS" ("S UnRet+mm")
+ #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde" // "ホショウソクド" ("UnRet V")
#endif
#define MSG_AUTORETRACT "\xbc\xde\xc4\xde\xb3\xcb\xb7\xba\xd0" // "ジドウヒキコミ" ("AutoRetr.")
#define MSG_FILAMENTCHANGE "\xcc\xa8\xd7\xd2\xdd\xc4\xba\xb3\xb6\xdd" // "フィラメントコウカン" ("Change filament")
#define MSG_INIT_SDCARD "SD\xb6\xb0\xc4\xde\xbb\xb2\xd6\xd0\xba\xd0" // "SDカードサイヨミコミ" ("Init. SD card")
#define MSG_CNG_SDCARD "SD\xb6\xb0\xc4\xde\xba\xb3\xb6\xdd" // "SDカードコウカン" ("Change SD card")
#define MSG_ZPROBE_OUT "Z\xcc\xdf\xdb\xb0\xcc\xde\x20\xcd\xde\xaf\xc4\xde\xb6\xde\xb2" // "Zプローブ ベッドガイ" ("Z probe out. bed")
-#if LCD_WIDTH < 20
- #define MSG_YX_UNHOMED "\xbb\xb7\xc6X/Y\xa6\xcc\xaf\xb7\xbb\xbe\xd6" // "サキニX/Yヲフッキサセヨ" ("Home X/Y before Z")
- #define MSG_XYZ_UNHOMED "\xbb\xb7\xc6\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xa6\xbe\xd6" // "サキニゲンテンフッキヲセヨ" ("Home XYZ first")
+#define MSG_HOME "\xbb\xb7\xc6" // "サキニ" ("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#if LCD_WIDTH > 19
+ #define MSG_FIRST "\xa6\xcc\xaf\xb7\xbb\xbe\xc3\xb8\xc0\xde\xbb\xb2" // "ヲフッキサセテクダサイ" ("first")
#else
- #define MSG_YX_UNHOMED "\xbb\xb7\xc6X/Y\xa6\xcc\xaf\xb7\xbb\xbe\xc3\xb8\xc0\xde\xbb\xb2" // "サキニX/Yヲフッキサセテクダサイ" ("Home X/Y before Z")
- #define MSG_XYZ_UNHOMED "\xbb\xb7\xc6\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xa6\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "サキニゲンテンフッキヲシテクダサイ" ("Home XYZ first")
+ #define MSG_FIRST "\xa6\xcc\xaf\xb7\xbb\xbe\xd6" // "ヲフッキサセヨ" ("first")
#endif
#define MSG_ZPROBE_ZOFFSET "Z\xb5\xcc\xbe\xaf\xc4" // "Zオフセット" ("Z Offset")
#define MSG_BABYSTEP_X "X\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Xジク ビドウ" ("Babystep X")
#define MSG_BABYSTEP_Y "Y\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Yジク ビドウ" ("Babystep Y")
#define MSG_BABYSTEP_Z "Z\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Zジク ビドウ" ("Babystep Z")
-#if LCD_WIDTH < 20
- #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1" // "イドウゲンカイケンチ" ("Endstop abort")
-#else
+#if LCD_WIDTH > 19
#define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1\xb7\xc9\xb3" // "イドウゲンカイケンチキノウ" ("Endstop abort")
+#else
+ #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1" // "イドウゲンカイケンチ" ("Endstop abort")
#endif
#define MSG_HEATING_FAILED_LCD "\xb6\xc8\xc2\xbc\xaf\xca\xdf\xb2" // "カネツシッパイ" ("Heating failed")
-#if LCD_WIDTH < 20
- #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0" // "エラー:ジョウチョウサーミスタ" ("Err: REDUNDANT TEMP")
-#else
+#if LCD_WIDTH > 19
#define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0\xb0\xb7\xc9\xb3" // "エラー:ジョウチョウサーミスターキノウ" ("Err: REDUNDANT TEMP")
+#else
+ #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0" // "エラー:ジョウチョウサーミスタ" ("Err: REDUNDANT TEMP")
#endif
#define MSG_THERMAL_RUNAWAY "\xc8\xc2\xce\xde\xb3\xbf\xb3" // "ネツボウソウ" ("THERMAL RUNAWAY")
#define MSG_ERR_MAXTEMP "\xb4\xd7\xb0:\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:サイコウオンチョウカ" ("Err: MAXTEMP")
#define MSG_ERR_MINTEMP "\xb4\xd7\xb0:\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:サイテイオンミマン" ("Err: MINTEMP")
-#if LCD_WIDTH < 20
- #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd" // "エラー:ベッド サイコウオン" ("Err: MAXTEMP BED")
- #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd" // "エラー:ベッド サイテイオン" ("Err: MINTEMP BED")
-#else
+#if LCD_WIDTH > 19
#define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:ベッド サイコウオンチョウカ" ("Err: MAXTEMP BED")
#define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:ベッド サイテイオンミマン" ("Err: MINTEMP BED")
+#else
+ #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd" // "エラー:ベッド サイコウオン" ("Err: MAXTEMP BED")
+ #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd" // "エラー:ベッド サイテイオン" ("Err: MINTEMP BED")
#endif
-#define MSG_END_HOUR "\xbc\xde\xb6\xdd" // "ジカン" ("hours")
-#define MSG_END_MINUTE "\xcc\xdd" // "フン" ("minutes")
+#define MSG_HALTED "\xcc\xdf\xd8\xdd\xc0\xb0\xca\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "プリンターハテイシシマシタ" ("PRINTER HALTED")
+#define MSG_PLEASE_RESET "\xd8\xbe\xaf\xc4\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "リセットシテクダサイ" ("Please reset")
+#define MSG_SHORT_DAY "d" // One character only
+#define MSG_SHORT_HOUR "h" // One character only
+#define MSG_SHORT_MINUTE "m" // One character only
#define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3" // "カネツチュウ" ("Heating...")
#define MSG_HEATING_COMPLETE "\xb6\xc8\xc2\xb6\xdd\xd8\xae\xb3" // "カネツカンリョウ" ("Heating done.")
#define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xc1\xad\xb3" // "ベッド カネツチュウ" ("Bed Heating.")
#define MSG_BED_DONE "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xb6\xdd\xd8\xae\xb3" // "ベッド カネツカンリョウ" ("Bed done.")
-
#define MSG_DELTA_CALIBRATE "\xc3\xde\xd9\xc0\x20\xba\xb3\xbe\xb2" // "デルタ コウセイ" ("Delta Calibration")
#define MSG_DELTA_CALIBRATE_X "X\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Xジク コウセイ" ("Calibrate X")
#define MSG_DELTA_CALIBRATE_Y "Y\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Yジク コウセイ" ("Calibrate Y")
#define MSG_DELTA_CALIBRATE_Z "Z\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Zジク コウセイ" ("Calibrate Z")
#define MSG_DELTA_CALIBRATE_CENTER "\xc1\xad\xb3\xbc\xdd\x20\xba\xb3\xbe\xb2" // "チュウシン コウセイ" ("Calibrate Center")
+#define MSG_INFO_MENU "\xba\xc9\xcc\xdf\xd8\xdd\xc0\xb0\xc6\xc2\xb2\xc3" // "コノプリンターニツイテ" ("About Printer")
+#define MSG_INFO_PRINTER_MENU "\xcc\xdf\xd8\xdd\xc0\xb0\xbc\xde\xae\xb3\xce\xb3" // "プリンタージョウホウ" ("Printer Info")
+#define MSG_INFO_STATS_MENU "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xae\xb3\xb7\xae\xb3" // "プリントジョウキョウ" ("Printer Stats")
+#define MSG_INFO_BOARD_MENU "\xbe\xb2\xb7\xde\xae\xb9\xb2\xbc\xde\xae\xb3\xce\xb3" // "セイギョケイジョウホウ" ("Board Info")
+#define MSG_INFO_THERMISTOR_MENU "\xbb\xb0\xd0\xbd\xc0\xb0" // "サーミスター" ("Thermistors")
+#define MSG_INFO_EXTRUDERS "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\xbd\xb3" // "エクストルーダースウ" ("Extruders")
+#define MSG_INFO_BAUDRATE "\xce\xde\xb0\xda\xb0\xc4" // "ボーレート" ("Baud")
+#define MSG_INFO_PROTOCOL "\xcc\xdf\xdb\xc4\xba\xd9" // "プロトコル" ("Protocol")
+#define MSG_INFO_PRINT_COUNT "\xcc\xdf\xd8\xdd\xc4\xbd\xb3 " // "プリントスウ " ("Print Count")
+#define MSG_INFO_COMPLETED_PRINTS "\xb6\xdd\xd8\xae\xb3\xbd\xb3" // "カンリョウスウ" ("Completed")
+#define MSG_INFO_PRINT_TIME "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd\xd9\xb2\xb9\xb2" // "プリントジカンルイケイ" ("Total print time")
+#define MSG_INFO_PRINT_LONGEST "\xbb\xb2\xc1\xae\xb3\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd" // "サイチョウプリントジカン" ("Longest job time")
+#if LCD_WIDTH > 19
+ #define MSG_INFO_PRINT_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4\xbc\xd6\xb3\xd8\xae\xb3\xd9\xb2\xb9\xb2" // "フィラメントシヨウリョウルイケイ" ("Extruded total")
+#else
+ #define MSG_INFO_PRINT_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xbc\xd6\xb3\xd8\xae\xb3" // "フィラメントソウシヨウリョウ" ("Extruded")
+#endif
+#define MSG_INFO_MIN_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xc3\xb2\xb5\xdd" // "セッテイサイテイオン" ("Min Temp")
+#define MSG_INFO_MAX_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xba\xb3\xb5\xdd" // "セッテイサイコウオン" ("Max Temp")
+#if LCD_WIDTH > 19
+ #define MSG_INFO_PSU "\xc3\xde\xdd\xb9\xde\xdd\xbc\xad\xcd\xde\xc2" // "デンゲンシュベツ" ("Power Supply")
+#else
+ #define MSG_INFO_PSU "\xc3\xde\xdd\xb9\xde\xdd" // "デンゲン" ("Power Supply")
+#endif
+#define MSG_FILAMENT_CHANGE_HEADER "\xcc\xa8\xd7\xd2\xdd\xc4\xba\xb3\xb6\xdd" // "フィラメントコウカン" ("CHANGE FILAMENT")
+#define MSG_FILAMENT_CHANGE_OPTION_HEADER "\xc4\xde\xb3\xbb\xa6\xbe\xdd\xc0\xb8\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "ドウサヲセンタクシテクダサイ" ("CHANGE OPTIONS:")
+#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "\xbb\xd7\xc6\xb5\xbc\xc0\xde\xbd" // "サラニオシダス" ("Extrude more")
+#define MSG_FILAMENT_CHANGE_OPTION_RESUME "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "プリントサイカイ" ("Resume print")
+#if LCD_HEIGHT >= 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "\xba\xb3\xb6\xdd\xa6\xb6\xb2\xbc\xbc\xcf\xbd" // "コウカンヲカイシシマス" ("Wait for start")
+ #define MSG_FILAMENT_CHANGE_INIT_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("of the filament")
+ #define MSG_FILAMENT_CHANGE_INIT_3 "" // "" ("change")
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xc7\xb7\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントヌキダシチュウ" ("Wait for")
+ #define MSG_FILAMENT_CHANGE_UNLOAD_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament unload")
+ #define MSG_FILAMENT_CHANGE_UNLOAD_3 ""
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xa6\xbf\xb3\xc6\xad\xb3\xbc," // "フィラメントヲソウニュウシ," ("Insert filament")
+ #define MSG_FILAMENT_CHANGE_INSERT_2 "\xb8\xd8\xaf\xb8\xbd\xd9\xc4\xbf\xde\xaf\xba\xb3\xbc\xcf\xbd" // "クリックスルトゾッコウシマス" ("and press button")
+ #define MSG_FILAMENT_CHANGE_INSERT_3 "" // "" ("to continue...")
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xc3\xdd\xc1\xad\xb3" // "フィラメントソウテンチュウ" ("Wait for")
+ #define MSG_FILAMENT_CHANGE_LOAD_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament load")
+ #define MSG_FILAMENT_CHANGE_LOAD_3 ""
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xb5\xbc\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントオシダシチュウ" ("Wait for")
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament extrude")
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_3 ""
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "\xcc\xdf\xd8\xdd\xc4\xa6\xbb\xb2\xb6\xb2\xbc\xcf\xbd" // "プリントヲサイカイシマス" ("Wait for print")
+ #define MSG_FILAMENT_CHANGE_RESUME_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("to resume")
+ #define MSG_FILAMENT_CHANGE_RESUME_3 ""
+#else // LCD_HEIGHT < 4
+ #define MSG_FILAMENT_CHANGE_INIT_1 "\xba\xb3\xb6\xdd\xa6\xb6\xb2\xbc\xbc\xcf\xbd" // "コウカンヲカイシシマス" ("Please wait...")
+ #define MSG_FILAMENT_CHANGE_UNLOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xc7\xb7\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントヌキダシチュウ" ("Ejecting...")
+ #if LCD_WIDTH > 19
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "\xbf\xb3\xc6\xad\xb3\xbc\x2c\xb8\xd8\xaf\xb8\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "ソウニュウシ,クリックシテクダサイ" ("Insert and Click")
+ #else
+ #define MSG_FILAMENT_CHANGE_INSERT_1 "\xbf\xb3\xc6\xad\xb3\xbc\x2c\xb8\xd8\xaf\xb8\xbe\xd6" // "ソウニュウシ,クリックセヨ" ("Insert and Click")
+ #endif
+ #define MSG_FILAMENT_CHANGE_LOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xc3\xdd\xc1\xad\xb3" // "フィラメントソウテンチュウ" ("Loading...")
+ #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xb5\xbc\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントオシダシチュウ" ("Extruding...")
+ #define MSG_FILAMENT_CHANGE_RESUME_1 "\xcc\xdf\xd8\xdd\xc4\xa6\xbb\xb2\xb6\xb2\xbc\xcf\xbd" // "プリントヲサイカイシマス" ("Resuming...")
+#endif // LCD_HEIGHT < 4
#endif // LANGUAGE_KANA_H
diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h
index e38afa09c..3e46f57d8 100644
--- a/Marlin/language_kana_utf8.h
+++ b/Marlin/language_kana_utf8.h
@@ -59,16 +59,16 @@
#define MSG_SET_HOME_OFFSETS "キジュンオフセットセッテイ" // "Set home offsets"
#define MSG_HOME_OFFSETS_APPLIED "オフセットガテキヨウサレマシタ" // "Offsets applied"
#define MSG_SET_ORIGIN "キジュンセット" // "Set origin"
-#define MSG_PREHEAT_PLA "PLA ヨネツ" // "Preheat PLA"
-#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
-#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " スベテ" // " All"
-#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " ベッド" // " Bed"
-#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " セッテイ" // " conf"
-#define MSG_PREHEAT_ABS "ABS ヨネツ" // "Preheat ABS"
-#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
-#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " スベテ" // " All"
-#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " ベッド" // " Bed"
-#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " セッテイ" // " conf"
+#define MSG_PREHEAT_1 "PLA ヨネツ" // "Preheat PLA"
+#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " "
+#define MSG_PREHEAT_1_ALL "PLA スベテヨネツ" // " All"
+#define MSG_PREHEAT_1_BEDONLY "PLA ベッドヨネツ" // " Bed"
+#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 "セッテイ" // " conf"
+#define MSG_PREHEAT_2 "ABS ヨネツ" // "Preheat ABS"
+#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " "
+#define MSG_PREHEAT_2_ALL "ABS スベテヨネツ" // " All"
+#define MSG_PREHEAT_2_BEDONLY "ABS ベッドヨネツ" // " Bed"
+#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 "セッテイ" // " conf"
#define MSG_COOLDOWN "カネツテイシ" // "Cooldown"
#define MSG_SWITCH_PS_ON "デンゲン オン" // "Switch power on"
#define MSG_SWITCH_PS_OFF "デンゲン オフ" // "Switch power off"
@@ -100,6 +100,7 @@
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
+#define MSG_SELECT "センタク" // "Select"
#define MSG_ACC "カソクド mm/s2" // "Accel"
#define MSG_VXY_JERK "XYジク ヤクド mm/s" // "Vxy-jerk"
#define MSG_VZ_JERK "Zジク ヤクド mm/s" // "Vz-jerk"
@@ -155,8 +156,8 @@
#define MSG_INIT_SDCARD "SDカードサイヨミコミ" // "Init. SD card"
#define MSG_CNG_SDCARD "SDカードコウカン" // "Change SD card"
#define MSG_ZPROBE_OUT "Zプローブ ベッドガイ" // "Z probe out. bed"
-#define MSG_YX_UNHOMED "サキニX/Yヲフッキサセテクダサイ" // "Home X/Y before Z"
-#define MSG_XYZ_UNHOMED "サキニゲンテンフッキヲシテクダサイ" // "Home XYZ first"
+#define MSG_HOME "サキニ" // "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "ヲフッキサセテクダサイ" // "first"
#define MSG_ZPROBE_ZOFFSET "Zオフセット" // "Z Offset"
#define MSG_BABYSTEP_X "Xジク ビドウ" // "Babystep X"
#define MSG_BABYSTEP_Y "Yジク ビドウ" // "Babystep Y"
@@ -169,17 +170,57 @@
#define MSG_ERR_MINTEMP "エラー:サイテイオンミマン" // "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "エラー:ベッド サイコウオンチョウカ" // "Err: MAXTEMP BED"
#define MSG_ERR_MINTEMP_BED "エラー:ベッド サイテイオンミマン" // "Err: MINTEMP BED"
-#define MSG_END_HOUR "ジカン" // "hours"
-#define MSG_END_MINUTE "フン" // "minutes"
+#define MSG_HALTED "プリンターハテイシシマシタ" // "PRINTER HALTED"
+#define MSG_PLEASE_RESET "リセットシテクダサイ" // "Please reset"
+#define MSG_SHORT_DAY "d" // One character only
+#define MSG_SHORT_HOUR "h" // One character only
+#define MSG_SHORT_MINUTE "m" // One character only
#define MSG_HEATING "カネツチュウ" // "Heating..."
#define MSG_HEATING_COMPLETE "カネツカンリョウ" // "Heating done."
#define MSG_BED_HEATING "ベッド カネツチュウ" // "Bed Heating."
#define MSG_BED_DONE "ベッド カネツカンリョウ" // "Bed done."
-
#define MSG_DELTA_CALIBRATE "デルタ コウセイ" // "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Xジク コウセイ" // "Calibrate X"
#define MSG_DELTA_CALIBRATE_Y "Yジク コウセイ" // "Calibrate Y"
#define MSG_DELTA_CALIBRATE_Z "Zジク コウセイ" // "Calibrate Z"
#define MSG_DELTA_CALIBRATE_CENTER "チュウシン コウセイ" // "Calibrate Center"
+#define MSG_INFO_MENU "コノプリンターニツイテ" // "About Printer"
+#define MSG_INFO_PRINTER_MENU "プリンタージョウホウ" // "Printer Info"
+#define MSG_INFO_STATS_MENU "プリントジョウキョウ" // "Printer Stats"
+#define MSG_INFO_BOARD_MENU "セイギョケイジョウホウ" // "Board Info"
+#define MSG_INFO_THERMISTOR_MENU "サーミスター" // "Thermistors"
+#define MSG_INFO_EXTRUDERS "エクストルーダースウ" // "Extruders"
+#define MSG_INFO_BAUDRATE "ボーレート" // "Baud"
+#define MSG_INFO_PROTOCOL "プロトコル" // "Protocol"
+#define MSG_INFO_PRINT_COUNT "プリントスウ " // "Print Count"
+#define MSG_INFO_COMPLETED_PRINTS "カンリョウスウ" // "Completed"
+#define MSG_INFO_PRINT_TIME "プリントジカンルイケイ" // "Total print time"
+#define MSG_INFO_PRINT_LONGEST "サイチョウプリントジカン" // "Longest job time"
+#define MSG_INFO_PRINT_FILAMENT "フィラメントシヨウリョウルイケイ" // "Extruded total"
+#define MSG_INFO_MIN_TEMP "セッテイサイテイオン" // "Min Temp"
+#define MSG_INFO_MAX_TEMP "セッテイサイコウオン" // "Max Temp"
+#define MSG_INFO_PSU "デンゲンシュベツ" // "Power Supply"
+#define MSG_FILAMENT_CHANGE_HEADER "フィラメントコウカン" // "CHANGE FILAMENT"
+#define MSG_FILAMENT_CHANGE_OPTION_HEADER "ドウサヲセンタクシテクダサイ" // "CHANGE OPTIONS:"
+#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "サラニオシダス" // "Extrude more"
+#define MSG_FILAMENT_CHANGE_OPTION_RESUME "プリントサイカイ" // "Resume print"
+#define MSG_FILAMENT_CHANGE_INIT_1 "コウカンヲカイシシマス" // "Wait for start"
+#define MSG_FILAMENT_CHANGE_INIT_2 "シバラクオマチクダサイ" // "of the filament"
+#define MSG_FILAMENT_CHANGE_INIT_3 "" // "change"
+#define MSG_FILAMENT_CHANGE_UNLOAD_1 "フィラメントヌキダシチュウ" // "Wait for"
+#define MSG_FILAMENT_CHANGE_UNLOAD_2 "シバラクオマチクダサイ" // "filament unload"
+#define MSG_FILAMENT_CHANGE_UNLOAD_3 ""
+#define MSG_FILAMENT_CHANGE_INSERT_1 "フィラメントヲソウニュウシ," // "Insert filament"
+#define MSG_FILAMENT_CHANGE_INSERT_2 "クリックスルトゾッコウシマス" // "and press button"
+#define MSG_FILAMENT_CHANGE_INSERT_3 "" // "to continue..."
+#define MSG_FILAMENT_CHANGE_LOAD_1 "フィラメントソウテンチュウ" // "Wait for"
+#define MSG_FILAMENT_CHANGE_LOAD_2 "シバラクオマチクダサイ" // "filament load"
+#define MSG_FILAMENT_CHANGE_LOAD_3 ""
+#define MSG_FILAMENT_CHANGE_EXTRUDE_1 "フィラメントオシダシチュウ" // "Wait for"
+#define MSG_FILAMENT_CHANGE_EXTRUDE_2 "シバラクオマチクダサイ" // "filament extrude"
+#define MSG_FILAMENT_CHANGE_EXTRUDE_3 ""
+#define MSG_FILAMENT_CHANGE_RESUME_1 "プリントヲサイカイシマス" // "Wait for print"
+#define MSG_FILAMENT_CHANGE_RESUME_2 "シバラクオマチクダサイ" // "to resume"
+#define MSG_FILAMENT_CHANGE_RESUME_3 ""
#endif // LANGUAGE_KANA_UTF_H
diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h
index 670bd7c20..5f682bd90 100644
--- a/Marlin/language_nl.h
+++ b/Marlin/language_nl.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_NL_H
#define LANGUAGE_NL_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -49,16 +48,16 @@
#define MSG_SET_HOME_OFFSETS "Zet home offsets"
#define MSG_HOME_OFFSETS_APPLIED "H offset toegep."
#define MSG_SET_ORIGIN "Nulpunt instellen"
-#define MSG_PREHEAT_PLA "PLA voorverwarmen"
-#define MSG_PREHEAT_PLA_N "PLA voorverw. "
-#define MSG_PREHEAT_PLA_ALL "PLA voorverw. aan"
-#define MSG_PREHEAT_PLA_BEDONLY "PLA voorverw. Bed"
-#define MSG_PREHEAT_PLA_SETTINGS "PLA verw. conf"
-#define MSG_PREHEAT_ABS "ABS voorverwarmen"
-#define MSG_PREHEAT_ABS_N "ABS voorverw. "
-#define MSG_PREHEAT_ABS_ALL "ABS voorverw. aan"
-#define MSG_PREHEAT_ABS_BEDONLY "ABS voorverw. Bed"
-#define MSG_PREHEAT_ABS_SETTINGS "ABS verw. conf"
+#define MSG_PREHEAT_1 "PLA voorverwarmen"
+#define MSG_PREHEAT_1_N "PLA voorverw. "
+#define MSG_PREHEAT_1_ALL "PLA voorverw. aan"
+#define MSG_PREHEAT_1_BEDONLY "PLA voorverw. Bed"
+#define MSG_PREHEAT_1_SETTINGS "PLA verw. conf"
+#define MSG_PREHEAT_2 "ABS voorverwarmen"
+#define MSG_PREHEAT_2_N "ABS voorverw. "
+#define MSG_PREHEAT_2_ALL "ABS voorverw. aan"
+#define MSG_PREHEAT_2_BEDONLY "ABS voorverw. Bed"
+#define MSG_PREHEAT_2_SETTINGS "ABS verw. conf"
#define MSG_COOLDOWN "Afkoelen"
#define MSG_SWITCH_PS_ON "Stroom aan"
#define MSG_SWITCH_PS_OFF "Stroom uit"
@@ -144,7 +143,8 @@
#define MSG_INIT_SDCARD "Init. SD kaart"
#define MSG_CNG_SDCARD "Verv. SD Kaart"
#define MSG_ZPROBE_OUT "Z probe uit. bed"
-#define MSG_YX_UNHOMED "Home X/Y voor Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystap X"
#define MSG_BABYSTEP_Y "Babystap Y"
@@ -157,13 +157,10 @@
#define MSG_ERR_MINTEMP "Err: Min. temp"
#define MSG_ERR_MAXTEMP_BED "Err: Max.tmp bed"
#define MSG_ERR_MINTEMP_BED "Err: Min.tmp bed"
-#define MSG_END_HOUR "uur"
-#define MSG_END_MINUTE "minuten"
#define MSG_HEATING "Voorwarmen..."
#define MSG_HEATING_COMPLETE "Voorverw. kompl."
#define MSG_BED_HEATING "Bed voorverw."
#define MSG_BED_DONE "Bed is voorverw."
-
#define MSG_DELTA_CALIBRATE "Delta Calibratie"
#define MSG_DELTA_CALIBRATE_X "Kalibreer X"
#define MSG_DELTA_CALIBRATE_Y "Kalibreer Y"
diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h
index 8a54f6484..b1559c4a4 100644
--- a/Marlin/language_pl.h
+++ b/Marlin/language_pl.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_PL_H
#define LANGUAGE_PL_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -51,16 +50,16 @@
#define MSG_SET_HOME_OFFSETS "Ust. poz. zer."
#define MSG_HOME_OFFSETS_APPLIED "Poz. zerowa ust."
#define MSG_SET_ORIGIN "Ustaw punkt zero"
-#define MSG_PREHEAT_PLA "Rozgrzej PLA"
-#define MSG_PREHEAT_PLA_N "Rozgrzej PLA "
-#define MSG_PREHEAT_PLA_ALL "Roz. PLA Wszystko"
-#define MSG_PREHEAT_PLA_BEDONLY "Rozgrzej PLA Loze"
-#define MSG_PREHEAT_PLA_SETTINGS "Ustaw. rozg. PLA"
-#define MSG_PREHEAT_ABS "Rozgrzej ABS"
-#define MSG_PREHEAT_ABS_N "Rozgrzej ABS "
-#define MSG_PREHEAT_ABS_ALL "Roz. ABS Wszystko"
-#define MSG_PREHEAT_ABS_BEDONLY "Rozgrzej ABS Loze"
-#define MSG_PREHEAT_ABS_SETTINGS "Ustaw. rozg. ABS"
+#define MSG_PREHEAT_1 "Rozgrzej PLA"
+#define MSG_PREHEAT_1_N "Rozgrzej PLA "
+#define MSG_PREHEAT_1_ALL "Roz. PLA Wszystko"
+#define MSG_PREHEAT_1_BEDONLY "Rozgrzej PLA Loze"
+#define MSG_PREHEAT_1_SETTINGS "Ustaw. rozg. PLA"
+#define MSG_PREHEAT_2 "Rozgrzej ABS"
+#define MSG_PREHEAT_2_N "Rozgrzej ABS "
+#define MSG_PREHEAT_2_ALL "Roz. ABS Wszystko"
+#define MSG_PREHEAT_2_BEDONLY "Rozgrzej ABS Loze"
+#define MSG_PREHEAT_2_SETTINGS "Ustaw. rozg. ABS"
#define MSG_H1 "1"
#define MSG_H2 "2"
#define MSG_H3 "3"
@@ -167,7 +166,8 @@
#define MSG_INIT_SDCARD "Inicjal. karty SD"
#define MSG_CNG_SDCARD "Zmiana karty SD"
#define MSG_ZPROBE_OUT "Sonda Z za lozem"
-#define MSG_YX_UNHOMED "Wroc w XY przed Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Offset Z"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
@@ -180,16 +180,14 @@
#define MSG_ERR_MINTEMP "Err: min. temp."
#define MSG_ERR_MAXTEMP_BED "Err: max. temp. loza"
#define MSG_ERR_MINTEMP_BED "Err: min. temp. loza"
-#define MSG_END_HOUR "godzin"
-#define MSG_END_MINUTE "minut"
#define MSG_HEATING "Rozgrzewanie..."
#define MSG_HEATING_COMPLETE "Rozgrzano"
#define MSG_BED_HEATING "Rozgrzewanie loza..."
#define MSG_BED_DONE "Rozgrzano loze"
-#define MSG_DELTA_CALIBRATE "Kalibrowanie Delty"
-#define MSG_DELTA_CALIBRATE_X "Kalibruj X"
-#define MSG_DELTA_CALIBRATE_Y "Kalibruj Y"
-#define MSG_DELTA_CALIBRATE_Z "Kalibruj Z"
-#define MSG_DELTA_CALIBRATE_CENTER "Kalibruj środek"
+#define MSG_DELTA_CALIBRATE "Kalibrowanie Delty"
+#define MSG_DELTA_CALIBRATE_X "Kalibruj X"
+#define MSG_DELTA_CALIBRATE_Y "Kalibruj Y"
+#define MSG_DELTA_CALIBRATE_Z "Kalibruj Z"
+#define MSG_DELTA_CALIBRATE_CENTER "Kalibruj środek"
#endif // LANGUAGE_PL_H
diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h
index f75f0330a..3db6e15c7 100644
--- a/Marlin/language_pt-br.h
+++ b/Marlin/language_pt-br.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_PT_BR_H
#define LANGUAGE_PT_BR_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -49,16 +48,16 @@
#define MSG_SET_HOME_OFFSETS "Ajustar Jogo"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Ajustar orig."
-#define MSG_PREHEAT_PLA "Pre-aquecer PLA"
-#define MSG_PREHEAT_PLA_N "Pre-aquecer PLA"
-#define MSG_PREHEAT_PLA_ALL "Pre-aq.Todo PLA"
-#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
-#define MSG_PREHEAT_PLA_SETTINGS "Ajustar PLA"
-#define MSG_PREHEAT_ABS "Pre-aquecer ABS"
-#define MSG_PREHEAT_ABS_N "Pre-aquecer ABS"
-#define MSG_PREHEAT_ABS_ALL "Pre-aq.Todo ABS"
-#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
-#define MSG_PREHEAT_ABS_SETTINGS "Ajustar ABS"
+#define MSG_PREHEAT_1 "Pre-aquecer PLA"
+#define MSG_PREHEAT_1_N "Pre-aquecer PLA"
+#define MSG_PREHEAT_1_ALL "Pre-aq.Todo PLA"
+#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
+#define MSG_PREHEAT_1_SETTINGS "Ajustar PLA"
+#define MSG_PREHEAT_2 "Pre-aquecer ABS"
+#define MSG_PREHEAT_2_N "Pre-aquecer ABS"
+#define MSG_PREHEAT_2_ALL "Pre-aq.Todo ABS"
+#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
+#define MSG_PREHEAT_2_SETTINGS "Ajustar ABS"
#define MSG_COOLDOWN "Esfriar"
#define MSG_SWITCH_PS_ON "Ligar"
#define MSG_SWITCH_PS_OFF "Desligar"
@@ -144,7 +143,8 @@
#define MSG_INIT_SDCARD "Iniciar SD"
#define MSG_CNG_SDCARD "Trocar SD"
#define MSG_ZPROBE_OUT "Son. fora da mesa"
-#define MSG_YX_UNHOMED "Pos. Desconhecida"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Deslocamento no Z"
#define MSG_BABYSTEP_X "Passinho X"
#define MSG_BABYSTEP_Y "Passinho Y"
@@ -157,13 +157,10 @@
#define MSG_ERR_MINTEMP "Err: T Minima"
#define MSG_ERR_MAXTEMP_BED "Err: T Base Maxima"
#define MSG_ERR_MINTEMP_BED "Err: T Base Minima"
-#define MSG_END_HOUR "Horas"
-#define MSG_END_MINUTE "Minutos"
#define MSG_HEATING "Aquecendo..."
#define MSG_HEATING_COMPLETE "Aquecida."
#define MSG_BED_HEATING "Aquecendo base.."
#define MSG_BED_DONE "Base aquecida."
-
#define MSG_DELTA_CALIBRATE "Calibrar Delta"
#define MSG_DELTA_CALIBRATE_X "Calibrar X"
#define MSG_DELTA_CALIBRATE_Y "Calibrar Y"
diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h
index b1db4a779..a556c2430 100644
--- a/Marlin/language_pt-br_utf8.h
+++ b/Marlin/language_pt-br_utf8.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_PT_BR_UTF_H
#define LANGUAGE_PT_BR_UTF_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -49,16 +48,16 @@
#define MSG_SET_HOME_OFFSETS "Ajustar Jogo"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Ajustar orig."
-#define MSG_PREHEAT_PLA "Pre-aquecer PLA"
-#define MSG_PREHEAT_PLA_N "Pre-aquecer PLA"
-#define MSG_PREHEAT_PLA_ALL "Pre-aq.Todo PLA"
-#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
-#define MSG_PREHEAT_PLA_SETTINGS "Ajustar PLA"
-#define MSG_PREHEAT_ABS "Pre-aquecer ABS"
-#define MSG_PREHEAT_ABS_N "Pre-aquecer ABS"
-#define MSG_PREHEAT_ABS_ALL "Pre-aq.Todo ABS"
-#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
-#define MSG_PREHEAT_ABS_SETTINGS "Ajustar ABS"
+#define MSG_PREHEAT_1 "Pre-aquecer PLA"
+#define MSG_PREHEAT_1_N "Pre-aquecer PLA"
+#define MSG_PREHEAT_1_ALL "Pre-aq.Todo PLA"
+#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
+#define MSG_PREHEAT_1_SETTINGS "Ajustar PLA"
+#define MSG_PREHEAT_2 "Pre-aquecer ABS"
+#define MSG_PREHEAT_2_N "Pre-aquecer ABS"
+#define MSG_PREHEAT_2_ALL "Pre-aq.Todo ABS"
+#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
+#define MSG_PREHEAT_2_SETTINGS "Ajustar ABS"
#define MSG_COOLDOWN "Esfriar"
#define MSG_SWITCH_PS_ON "Ligar"
#define MSG_SWITCH_PS_OFF "Desligar"
@@ -144,7 +143,8 @@
#define MSG_INIT_SDCARD "Iniciar SD"
#define MSG_CNG_SDCARD "Trocar SD"
#define MSG_ZPROBE_OUT "Son. fora da mesa"
-#define MSG_YX_UNHOMED "Pos. Desconhecida"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Deslocamento no Z"
#define MSG_BABYSTEP_X "Passinho X"
#define MSG_BABYSTEP_Y "Passinho Y"
@@ -157,13 +157,10 @@
#define MSG_ERR_MINTEMP "Err: T Mínima"
#define MSG_ERR_MAXTEMP_BED "Err: T Base Máxima"
#define MSG_ERR_MINTEMP_BED "Err: T Base Mínima"
-#define MSG_END_HOUR "Horas"
-#define MSG_END_MINUTE "Minutos"
#define MSG_HEATING "Aquecendo..."
#define MSG_HEATING_COMPLETE "Aquecida."
#define MSG_BED_HEATING "Aquecendo base.."
#define MSG_BED_DONE "Base aquecida."
-
#define MSG_DELTA_CALIBRATE "Calibrar Delta"
#define MSG_DELTA_CALIBRATE_X "Calibrar X"
#define MSG_DELTA_CALIBRATE_Y "Calibrar Y"
diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h
index c15572923..a0df879fc 100644
--- a/Marlin/language_pt.h
+++ b/Marlin/language_pt.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_PT_H
#define LANGUAGE_PT_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -53,16 +52,16 @@
#define MSG_SET_HOME_OFFSETS "Definir desvio"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Definir origem"
-#define MSG_PREHEAT_PLA "Pre-aquecer PLA"
-#define MSG_PREHEAT_PLA_N "Pre-aquecer PLA"
-#define MSG_PREHEAT_PLA_ALL "Pre-aq. PLA Tudo"
-#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
-#define MSG_PREHEAT_PLA_SETTINGS "Definicoes PLA"
-#define MSG_PREHEAT_ABS "Pre-aquecer ABS"
-#define MSG_PREHEAT_ABS_N "Pre-aquecer ABS "
-#define MSG_PREHEAT_ABS_ALL "Pre-aq. ABS Tudo"
-#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
-#define MSG_PREHEAT_ABS_SETTINGS "Definicoes ABS"
+#define MSG_PREHEAT_1 "Pre-aquecer PLA"
+#define MSG_PREHEAT_1_N "Pre-aquecer PLA"
+#define MSG_PREHEAT_1_ALL "Pre-aq. PLA Tudo"
+#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
+#define MSG_PREHEAT_1_SETTINGS "Definicoes PLA"
+#define MSG_PREHEAT_2 "Pre-aquecer ABS"
+#define MSG_PREHEAT_2_N "Pre-aquecer ABS "
+#define MSG_PREHEAT_2_ALL "Pre-aq. ABS Tudo"
+#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
+#define MSG_PREHEAT_2_SETTINGS "Definicoes ABS"
#define MSG_COOLDOWN "Arrefecer"
#define MSG_SWITCH_PS_ON "Ligar"
#define MSG_SWITCH_PS_OFF "Desligar"
@@ -152,7 +151,8 @@
#define MSG_INIT_SDCARD "Inici. cartao SD"
#define MSG_CNG_SDCARD "Trocar cartao SD"
#define MSG_ZPROBE_OUT "Sensor fora/base"
-#define MSG_YX_UNHOMED "XY antes de Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Desvio Z"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
@@ -165,13 +165,10 @@
#define MSG_ERR_MINTEMP "Err: T Minima"
#define MSG_ERR_MAXTEMP_BED "Err: T Base Maxima"
#define MSG_ERR_MINTEMP_BED "Err: T Base Minima"
-#define MSG_END_HOUR "horas"
-#define MSG_END_MINUTE "minutos"
#define MSG_HEATING "Aquecendo..."
#define MSG_HEATING_COMPLETE "Aquecida."
#define MSG_BED_HEATING "Aquecendo base.."
#define MSG_BED_DONE "Base aquecida."
-
#define MSG_DELTA_CALIBRATE "Calibracao Delta"
#define MSG_DELTA_CALIBRATE_X "Calibrar X"
#define MSG_DELTA_CALIBRATE_Y "Calibrar Y"
diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h
index ad1d881a3..24ce828b5 100644
--- a/Marlin/language_pt_utf8.h
+++ b/Marlin/language_pt_utf8.h
@@ -30,7 +30,6 @@
#ifndef LANGUAGE_PT_UTF_H
#define LANGUAGE_PT_UTF_H
-#define MAPPER_NON
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
#define DISPLAY_CHARSET_ISO10646_1
@@ -53,16 +52,16 @@
#define MSG_SET_HOME_OFFSETS "Definir desvio"
#define MSG_HOME_OFFSETS_APPLIED "Offsets aplicados"
#define MSG_SET_ORIGIN "Definir origem"
-#define MSG_PREHEAT_PLA "Pre-aquecer PLA"
-#define MSG_PREHEAT_PLA_N "Pre-aquecer PLA"
-#define MSG_PREHEAT_PLA_ALL "Pre-aq. PLA Tudo"
-#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
-#define MSG_PREHEAT_PLA_SETTINGS "Definições PLA"
-#define MSG_PREHEAT_ABS "Pre-aquecer ABS"
-#define MSG_PREHEAT_ABS_N "Pre-aquecer ABS "
-#define MSG_PREHEAT_ABS_ALL "Pre-aq. ABS Tudo"
-#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
-#define MSG_PREHEAT_ABS_SETTINGS "Definições ABS"
+#define MSG_PREHEAT_1 "Pre-aquecer PLA"
+#define MSG_PREHEAT_1_N "Pre-aquecer PLA"
+#define MSG_PREHEAT_1_ALL "Pre-aq. PLA Tudo"
+#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
+#define MSG_PREHEAT_1_SETTINGS "Definições PLA"
+#define MSG_PREHEAT_2 "Pre-aquecer ABS"
+#define MSG_PREHEAT_2_N "Pre-aquecer ABS "
+#define MSG_PREHEAT_2_ALL "Pre-aq. ABS Tudo"
+#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
+#define MSG_PREHEAT_2_SETTINGS "Definições ABS"
#define MSG_COOLDOWN "Arrefecer"
#define MSG_SWITCH_PS_ON "Ligar"
#define MSG_SWITCH_PS_OFF "Desligar"
@@ -152,7 +151,8 @@
#define MSG_INIT_SDCARD "Inici. cartão SD"
#define MSG_CNG_SDCARD "Trocar cartão SD"
#define MSG_ZPROBE_OUT "Sensor fora/base"
-#define MSG_YX_UNHOMED "XY antes de Z"
+#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST
+#define MSG_FIRST "first"
#define MSG_ZPROBE_ZOFFSET "Desvio Z"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
@@ -165,13 +165,10 @@
#define MSG_ERR_MINTEMP "Err: T Mínima"
#define MSG_ERR_MAXTEMP_BED "Err: T Base Máxima"
#define MSG_ERR_MINTEMP_BED "Err: T Base Mínima"
-#define MSG_END_HOUR "horas"
-#define MSG_END_MINUTE "minutos"
#define MSG_HEATING "Aquecendo..."
#define MSG_HEATING_COMPLETE "Aquecida."
#define MSG_BED_HEATING "Aquecendo base.."
#define MSG_BED_DONE "Base aquecida."
-
#define MSG_DELTA_CALIBRATE "Calibração Delta"
#define MSG_DELTA_CALIBRATE_X "Calibrar X"
#define MSG_DELTA_CALIBRATE_Y "Calibrar Y"
diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h
index de96dac14..aa381c88f 100644
--- a/Marlin/language_ru.h
+++ b/Marlin/language_ru.h
@@ -49,16 +49,16 @@
#define MSG_SET_HOME_OFFSETS "Запомнить парковку"
#define MSG_HOME_OFFSETS_APPLIED "Offsets applied"
#define MSG_SET_ORIGIN "Запомнить ноль"
-#define MSG_PREHEAT_PLA "Преднагрев PLA"
-#define MSG_PREHEAT_PLA_N "Греть PLA Сопло "
-#define MSG_PREHEAT_PLA_ALL "Греть PLA Все"
-#define MSG_PREHEAT_PLA_BEDONLY "Греть PLA Стол"
-#define MSG_PREHEAT_PLA_SETTINGS "Настройки PLA"
-#define MSG_PREHEAT_ABS "Преднагрев ABS"
-#define MSG_PREHEAT_ABS_N "Греть ABS Сопло "
-#define MSG_PREHEAT_ABS_ALL "Греть ABS Все"
-#define MSG_PREHEAT_ABS_BEDONLY "Греть ABS Стол"
-#define MSG_PREHEAT_ABS_SETTINGS "Настройки ABS"
+#define MSG_PREHEAT_1 "Преднагрев PLA"
+#define MSG_PREHEAT_1_N "Греть PLA Сопло "
+#define MSG_PREHEAT_1_ALL "Греть PLA Все"
+#define MSG_PREHEAT_1_BEDONLY "Греть PLA Стол"
+#define MSG_PREHEAT_1_SETTINGS "Настройки PLA"
+#define MSG_PREHEAT_2 "Преднагрев ABS"
+#define MSG_PREHEAT_2_N "Греть ABS Сопло "
+#define MSG_PREHEAT_2_ALL "Греть ABS Все"
+#define MSG_PREHEAT_2_BEDONLY "Греть ABS Стол"
+#define MSG_PREHEAT_2_SETTINGS "Настройки ABS"
#define MSG_COOLDOWN "Охлаждение"
#define MSG_SWITCH_PS_ON "Включить Питание"
#define MSG_SWITCH_PS_OFF "Отключить Питание"
@@ -156,13 +156,10 @@
#define MSG_ERR_MINTEMP "Ошибка: Т мин."
#define MSG_ERR_MAXTEMP_BED "Ошибка:Т макс.стол"
#define MSG_ERR_MINTEMP_BED "Ошибка:Т мин.стол"
-#define MSG_END_HOUR "часов"
-#define MSG_END_MINUTE "минут"
#define MSG_HEATING "Нагреваю сопло..."
#define MSG_HEATING_COMPLETE "Нагрев выполнен"
#define MSG_BED_HEATING "Нагреваю стол"
#define MSG_BED_DONE "Стол разогрет"
-
#define MSG_DELTA_CALIBRATE "Калибровка Delta"
#define MSG_DELTA_CALIBRATE_X "Калибровать X"
#define MSG_DELTA_CALIBRATE_Y "Калибровать Y"
diff --git a/Marlin/language_test.h b/Marlin/language_test.h
index 17ad7bca0..99fa712a7 100644
--- a/Marlin/language_test.h
+++ b/Marlin/language_test.h
@@ -46,11 +46,10 @@
// Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not
// impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system).
-
-#define MAPPER_NON // For direct ascii codes ( until now all languages except ru, de, fi, kana_utf8, ... )
//#define MAPPER_C2C3 // For most European languages when language file is in utf8
//#define MAPPER_D0D1 // For Cyrillic
//#define MAPPER_E382E383 // For Katakana
+//#define MAPPER_NON // For direct ascii codes. Fall back mapper - if no other is defined.
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h
//#define SIMULATE_ROMFONT
@@ -58,6 +57,7 @@
// Select the better font for full graphic displays.
//#define DISPLAY_CHARSET_ISO10646_1
//#define DISPLAY_CHARSET_ISO10646_5
+//#define DISPLAY_CHARSET_ISO10646_GREEK
//#define DISPLAY_CHARSET_ISO10646_KANA
@@ -141,8 +141,8 @@
#define MSG_DISABLE_STEPPERS STRG_C2_8
#define MSG_AUTO_HOME STRG_C2_9
#define MSG_SET_HOME_OFFSETS STRG_C2_a
- #define MSG_PREHEAT_PLA STRG_C2_b
- #define MSG_PREHEAT_ABS STRG_C3_8
+ #define MSG_PREHEAT_1 STRG_C2_b
+ #define MSG_PREHEAT_2 STRG_C3_8
#define MSG_COOLDOWN STRG_C3_9
#define MSG_SWITCH_PS_OFF STRG_C3_a
#define MSG_MOVE_AXIS STRG_C3_b
@@ -176,8 +176,8 @@
#define MSG_DISABLE_STEPPERS STRG_D0_8
#define MSG_AUTO_HOME STRG_D0_9
#define MSG_SET_HOME_OFFSETS STRG_D0_a
- #define MSG_PREHEAT_PLA STRG_D0_b
- #define MSG_PREHEAT_ABS STRG_D1_8
+ #define MSG_PREHEAT_1 STRG_D0_b
+ #define MSG_PREHEAT_2 STRG_D1_8
#define MSG_COOLDOWN STRG_D1_9
#define MSG_SWITCH_PS_OFF STRG_D1_a
#define MSG_MOVE_AXIS STRG_D1_b
@@ -211,8 +211,8 @@
#define MSG_DISABLE_STEPPERS STRG_E382_8
#define MSG_AUTO_HOME STRG_E382_9
#define MSG_SET_HOME_OFFSETS STRG_E382_a
- #define MSG_PREHEAT_PLA STRG_E382_b
- #define MSG_PREHEAT_ABS STRG_E383_8
+ #define MSG_PREHEAT_1 STRG_E382_b
+ #define MSG_PREHEAT_2 STRG_E383_8
#define MSG_COOLDOWN STRG_E383_9
#define MSG_SWITCH_PS_OFF STRG_E383_a
#define MSG_MOVE_AXIS STRG_E383_b
diff --git a/Marlin/macros.h b/Marlin/macros.h
index eaa9875e0..5eec73e34 100644
--- a/Marlin/macros.h
+++ b/Marlin/macros.h
@@ -23,6 +23,19 @@
#ifndef MACROS_H
#define MACROS_H
+#define NUM_AXIS 4
+
+#define FORCE_INLINE __attribute__((always_inline)) inline
+
+// Bracket code that shouldn't be interrupted
+#ifndef CRITICAL_SECTION_START
+ #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
+ #define CRITICAL_SECTION_END SREG = _sreg;
+#endif
+
+// Remove compiler warning on an unused variable
+#define UNUSED(x) (void) (x)
+
// Macros to make a string from a macro
#define STRINGIFY_(M) #M
#define STRINGIFY(M) STRINGIFY_(M)
@@ -34,8 +47,12 @@
#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b))
// Macros for maths shortcuts
+#ifndef M_PI
+ #define M_PI 3.14159265358979323846
+#endif
#define RADIANS(d) ((d)*M_PI/180.0)
#define DEGREES(r) ((r)*180.0/M_PI)
+#define HYPOT(x,y) sqrt(sq(x)+sq(y))
// Macros to contrain values
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
@@ -55,6 +72,17 @@
#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-')
#define COUNT(a) (sizeof(a)/sizeof(*a))
+// Macros for initializing arrays
+#define ARRAY_6(v1, v2, v3, v4, v5, v6, args...) { v1, v2, v3, v4, v5, v6 }
+#define ARRAY_5(v1, v2, v3, v4, v5, args...) { v1, v2, v3, v4, v5 }
+#define ARRAY_4(v1, v2, v3, v4, args...) { v1, v2, v3, v4 }
+#define ARRAY_3(v1, v2, v3, args...) { v1, v2, v3 }
+#define ARRAY_2(v1, v2, args...) { v1, v2 }
+#define ARRAY_1(v1, args...) { v1 }
+
+#define _ARRAY_N(N, args...) ARRAY_ ##N(args)
+#define ARRAY_N(N, args...) _ARRAY_N(N, args)
+
// Macros for adding
#define INC_0 1
#define INC_1 2
@@ -86,6 +114,8 @@
#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0)
#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
-#define NOOP do{}while(0)
+#define NOOP do{} while(0)
+
+#define CEILING(x,y) (((x) + (y) - 1) / (y))
#endif //__MACROS_H
diff --git a/Marlin/mesh_bed_leveling.cpp b/Marlin/mesh_bed_leveling.cpp
index ee70068a1..babad8aaa 100644
--- a/Marlin/mesh_bed_leveling.cpp
+++ b/Marlin/mesh_bed_leveling.cpp
@@ -29,11 +29,9 @@
mesh_bed_leveling::mesh_bed_leveling() { reset(); }
void mesh_bed_leveling::reset() {
- active = 0;
+ status = MBL_STATUS_NONE;
z_offset = 0;
- for (int8_t y = MESH_NUM_Y_POINTS; y--;)
- for (int8_t x = MESH_NUM_X_POINTS; x--;)
- z_values[y][x] = 0;
+ memset(z_values, 0, sizeof(z_values));
}
#endif // MESH_BED_LEVELING
diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h
index 7b2201fb9..eb668e1c8 100644
--- a/Marlin/mesh_bed_leveling.h
+++ b/Marlin/mesh_bed_leveling.h
@@ -23,13 +23,12 @@
#include "Marlin.h"
#if ENABLED(MESH_BED_LEVELING)
-
#define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X))/(MESH_NUM_X_POINTS - 1))
#define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y))/(MESH_NUM_Y_POINTS - 1))
class mesh_bed_leveling {
public:
- bool active;
+ uint8_t status; // Has Mesh and Is Active bits
float z_offset;
float z_values[MESH_NUM_Y_POINTS][MESH_NUM_X_POINTS];
@@ -41,6 +40,11 @@
static FORCE_INLINE float get_probe_y(int8_t i) { return MESH_MIN_Y + (MESH_Y_DIST) * i; }
void set_z(const int8_t px, const int8_t py, const float z) { z_values[py][px] = z; }
+ bool active() { return TEST(status, MBL_STATUS_ACTIVE_BIT); }
+ void set_active(bool onOff) { if (onOff) SBI(status, MBL_STATUS_ACTIVE_BIT); else CBI(status, MBL_STATUS_ACTIVE_BIT); }
+ bool has_mesh() { return TEST(status, MBL_STATUS_HAS_MESH_BIT); }
+ void set_has_mesh(bool onOff) { if (onOff) SBI(status, MBL_STATUS_HAS_MESH_BIT); else CBI(status, MBL_STATUS_HAS_MESH_BIT); }
+
inline void zigzag(int8_t index, int8_t &px, int8_t &py) {
px = index % (MESH_NUM_X_POINTS);
py = index / (MESH_NUM_X_POINTS);
@@ -53,12 +57,12 @@
set_z(px, py, z);
}
- int8_t cel_index_x(float x) {
+ int8_t cell_index_x(float x) {
int8_t cx = int(x - (MESH_MIN_X)) / (MESH_X_DIST);
return constrain(cx, 0, (MESH_NUM_X_POINTS) - 2);
}
- int8_t cel_index_y(float y) {
+ int8_t cell_index_y(float y) {
int8_t cy = int(y - (MESH_MIN_Y)) / (MESH_Y_DIST);
return constrain(cy, 0, (MESH_NUM_Y_POINTS) - 2);
}
@@ -80,8 +84,8 @@
}
float get_z(float x0, float y0) {
- int8_t cx = cel_index_x(x0),
- cy = cel_index_y(y0);
+ int8_t cx = cell_index_x(x0),
+ cy = cell_index_y(y0);
if (cx < 0 || cy < 0) return z_offset;
float z1 = calc_z0(x0,
get_probe_x(cx), z_values[cy][cx],
diff --git a/Marlin/nozzle.h b/Marlin/nozzle.h
new file mode 100644
index 000000000..cce22db41
--- /dev/null
+++ b/Marlin/nozzle.h
@@ -0,0 +1,195 @@
+/*
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __NOZZLE_H__
+#define __NOZZLE_H__
+
+#include "Marlin.h"
+#include "point_t.h"
+
+/**
+ * @brief Nozzle class
+ *
+ * @todo: Do not ignore the end.z value and allow XYZ movements
+ */
+class Nozzle {
+ private:
+ /**
+ * @brief Stroke clean pattern
+ * @details Wipes the nozzle back and forth in a linear movement
+ *
+ * @param start point_t defining the starting point
+ * @param end point_t defining the ending point
+ * @param strokes number of strokes to execute
+ */
+ static void stroke(
+ __attribute__((unused)) point_t const &start,
+ __attribute__((unused)) point_t const &end,
+ __attribute__((unused)) uint8_t const &strokes
+ ) __attribute__((optimize ("Os"))) {
+ #if ENABLED(NOZZLE_CLEAN_FEATURE)
+
+ #if ENABLED(NOZZLE_CLEAN_GOBACK)
+ // Store the current coords
+ point_t const initial = {
+ current_position[X_AXIS],
+ current_position[Y_AXIS],
+ current_position[Z_AXIS],
+ current_position[E_AXIS]
+ };
+ #endif // NOZZLE_CLEAN_GOBACK
+
+ // Move to the starting point
+ do_blocking_move_to_xy(start.x, start.y);
+ do_blocking_move_to_z(start.z);
+
+ // Start the stroke pattern
+ for (uint8_t i = 0; i < (strokes >>1); i++) {
+ do_blocking_move_to_xy(end.x, end.y);
+ do_blocking_move_to_xy(start.x, start.y);
+ }
+
+ #if ENABLED(NOZZLE_CLEAN_GOBACK)
+ // Move the nozzle to the initial point
+ do_blocking_move_to_z(initial.z);
+ do_blocking_move_to_xy(initial.x, initial.y);
+ #endif // NOZZLE_CLEAN_GOBACK
+
+ #endif // NOZZLE_CLEAN_FEATURE
+ }
+
+ /**
+ * @brief Zig-zag clean pattern
+ * @details Apply a zig-zag cleanning pattern
+ *
+ * @param start point_t defining the starting point
+ * @param end point_t defining the ending point
+ * @param strokes number of strokes to execute
+ * @param objects number of objects to create
+ */
+ static void zigzag(
+ __attribute__((unused)) point_t const &start,
+ __attribute__((unused)) point_t const &end,
+ __attribute__((unused)) uint8_t const &strokes,
+ __attribute__((unused)) uint8_t const &objects
+ ) __attribute__((optimize ("Os"))) {
+ #if ENABLED(NOZZLE_CLEAN_FEATURE)
+ float A = fabs(end.y - start.y); // [twice the] Amplitude
+ float P = fabs(end.x - start.x) / (objects << 1); // Period
+
+ // Don't allow impossible triangles
+ if (A <= 0.0f || P <= 0.0f ) return;
+
+ #if ENABLED(NOZZLE_CLEAN_GOBACK)
+ // Store the current coords
+ point_t const initial = {
+ current_position[X_AXIS],
+ current_position[Y_AXIS],
+ current_position[Z_AXIS],
+ current_position[E_AXIS]
+ };
+ #endif // NOZZLE_CLEAN_GOBACK
+
+ for (uint8_t j = 0; j < strokes; j++) {
+ for (uint8_t i = 0; i < (objects << 1); i++) {
+ float const x = start.x + i * P;
+ float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
+
+ do_blocking_move_to_xy(x, y);
+ if (i == 0) do_blocking_move_to_z(start.z);
+ }
+
+ for (int i = (objects << 1); i > -1; i--) {
+ float const x = start.x + i * P;
+ float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
+
+ do_blocking_move_to_xy(x, y);
+ }
+ }
+
+ #if ENABLED(NOZZLE_CLEAN_GOBACK)
+ // Move the nozzle to the initial point
+ do_blocking_move_to_z(initial.z);
+ do_blocking_move_to_xy(initial.x, initial.y);
+ #endif // NOZZLE_CLEAN_GOBACK
+
+ #endif // NOZZLE_CLEAN_FEATURE
+ }
+
+ public:
+ /**
+ * @brief Clean the nozzle
+ * @details Starts the selected clean procedure pattern
+ *
+ * @param pattern one of the available patterns
+ * @param argument depends on the cleaning pattern
+ */
+ static void clean(
+ __attribute__((unused)) uint8_t const &pattern,
+ __attribute__((unused)) uint8_t const &strokes,
+ __attribute__((unused)) uint8_t const &objects = 0
+ ) __attribute__((optimize ("Os"))) {
+ #if ENABLED(NOZZLE_CLEAN_FEATURE)
+ switch (pattern) {
+ case 1:
+ Nozzle::zigzag(
+ NOZZLE_CLEAN_START_POINT,
+ NOZZLE_CLEAN_END_POINT, strokes, objects);
+ break;
+
+ default:
+ Nozzle::stroke(
+ NOZZLE_CLEAN_START_POINT,
+ NOZZLE_CLEAN_END_POINT, strokes);
+ }
+ #endif // NOZZLE_CLEAN_FEATURE
+ }
+
+ static void park(
+ __attribute__((unused)) uint8_t const &z_action
+ ) __attribute__((optimize ("Os"))) {
+ #if ENABLED(NOZZLE_PARK_FEATURE)
+ float const z = current_position[Z_AXIS];
+ point_t const park = NOZZLE_PARK_POINT;
+
+ switch(z_action) {
+ case 1: // force Z-park height
+ do_blocking_move_to_z(park.z);
+ break;
+
+ case 2: // Raise by Z-park height
+ do_blocking_move_to_z(
+ (z + park.z > Z_MAX_POS) ? Z_MAX_POS : z + park.z);
+ break;
+
+ default: // Raise to Z-park height if lower
+ if (current_position[Z_AXIS] < park.z)
+ do_blocking_move_to_z(park.z);
+ }
+
+ do_blocking_move_to_xy(park.x, park.y);
+
+ #endif // NOZZLE_PARK_FEATURE
+ }
+};
+
+#endif
diff --git a/Marlin/pins.h b/Marlin/pins.h
index 8447db61e..3657675db 100644
--- a/Marlin/pins.h
+++ b/Marlin/pins.h
@@ -31,6 +31,10 @@
#include "pins_GEN7_13.h"
#elif MB(GEN7_14)
#include "pins_GEN7_14.h"
+#elif MB(CNCONTROLS_11)
+ #include "pins_CNCONTROLS_11.h"
+#elif MB(CNCONTROLS_12)
+ #include "pins_CNCONTROLS_12.h"
#elif MB(CHEAPTRONIC)
#include "pins_CHEAPTRONIC.h"
#elif MB(SETHI)
@@ -38,13 +42,35 @@
#elif MB(RAMPS_OLD)
#include "pins_RAMPS_OLD.h"
#elif MB(RAMPS_13_EFB)
- #include "pins_RAMPS_13_EFB.h"
-#elif MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF) || MB(RAMPS_13_SF)
+ #define IS_RAMPS_EFB
+ #include "pins_RAMPS_13.h"
+#elif MB(RAMPS_13_EEB)
+ #define IS_RAMPS_EEB
+ #include "pins_RAMPS_13.h"
+#elif MB(RAMPS_13_EFF)
+ #define IS_RAMPS_EFF
+ #include "pins_RAMPS_13.h"
+#elif MB(RAMPS_13_EEF)
+ #define IS_RAMPS_EEF
+ #include "pins_RAMPS_13.h"
+#elif MB(RAMPS_13_SF)
+ #define IS_RAMPS_SF
#include "pins_RAMPS_13.h"
#elif MB(RAMPS_14_EFB)
- #include "pins_RAMPS_14_EFB.h"
-#elif MB(RAMPS_14_EEB) || MB(RAMPS_14_EFF) || MB(RAMPS_14_EEF) || MB(RAMPS_14_SF)
- #include "pins_RAMPS_14.h"
+ #define IS_RAMPS_EFB
+ #include "pins_RAMPS.h"
+#elif MB(RAMPS_14_EEB)
+ #define IS_RAMPS_EEB
+ #include "pins_RAMPS.h"
+#elif MB(RAMPS_14_EFF)
+ #define IS_RAMPS_EFF
+ #include "pins_RAMPS.h"
+#elif MB(RAMPS_14_EEF)
+ #define IS_RAMPS_EEF
+ #include "pins_RAMPS.h"
+#elif MB(RAMPS_14_SF)
+ #define IS_RAMPS_SF
+ #include "pins_RAMPS.h"
#elif MB(GEN6)
#include "pins_GEN6.h"
#elif MB(GEN6_DELUXE)
@@ -75,6 +101,8 @@
#include "pins_3DRAG.h"
#elif MB(K8200)
#include "pins_K8200.h"
+#elif MB(K8400)
+ #include "pins_K8400.h"
#elif MB(TEENSYLU)
#include "pins_TEENSYLU.h"
#elif MB(RUMBA)
@@ -118,7 +146,7 @@
#elif MB(LEAPFROG)
#include "pins_LEAPFROG.h"
#elif MB(BAM_DICE)
- #include "pins_RAMPS_14.h"
+ #include "pins_RAMPS.h"
#elif MB(BAM_DICE_DUE)
#include "pins_BAM_DICE_DUE.h"
#elif MB(FELIX2)
@@ -127,6 +155,8 @@
#include "pins_MKS_BASE.h"
#elif MB(RIGIDBOARD)
#include "pins_RIGIDBOARD.h"
+#elif MB(RIGIDBOARD_V2)
+ #include "pins_RIGIDBOARD_V2.h"
#elif MB(MEGACONTROLLER)
#include "pins_MEGACONTROLLER.h"
#elif MB(BQ_ZUM_MEGA_3D)
@@ -243,20 +273,49 @@
#define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : (p) + 0xA0)
// List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
-#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, HEATER_0_PIN, EXTRUDER_0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
+#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN,
#define _E1_PINS
#define _E2_PINS
#define _E3_PINS
#if EXTRUDERS > 1
#undef _E1_PINS
- #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN, E1_MS1_PIN, E1_MS2_PIN, EXTRUDER_1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN),
+ #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
#if EXTRUDERS > 2
#undef _E2_PINS
- #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN, EXTRUDER_2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN),
+ #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
#if EXTRUDERS > 3
#undef _E3_PINS
- #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, HEATER_3_PIN, EXTRUDER_3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN),
+ #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
+ #endif
+ #endif
+#endif
+
+#define _H0_PINS HEATER_0_PIN, EXTRUDER_0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
+#define _H1_PINS
+#define _H2_PINS
+#define _H3_PINS
+
+#if HOTENDS > 1
+ #undef _H1_PINS
+ #define _H1_PINS HEATER_1_PIN, EXTRUDER_1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN),
+ #if HOTENDS > 2
+ #undef _H2_PINS
+ #define _H2_PINS HEATER_2_PIN, EXTRUDER_2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN),
+ #if HOTENDS > 3
+ #undef _H3_PINS
+ #define _H3_PINS HEATER_3_PIN, EXTRUDER_3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN),
+ #endif
+ #endif
+#elif ENABLED(MIXING_EXTRUDER)
+ #undef _E1_PINS
+ #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN,
+ #if MIXING_STEPPERS > 2
+ #undef _E2_PINS
+ #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
+ #if MIXING_STEPPERS > 3
+ #undef _E3_PINS
+ #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
#endif
#endif
#endif
@@ -345,34 +404,41 @@
#define __EPIN(p,q) E##p##_##q##_PIN
#define _EPIN(p,q) __EPIN(p,q)
-#if ENABLED(DUAL_X_CARRIAGE)
- // The X2 axis, if any, should be the next open extruder port
+// The X2 axis, if any, should be the next open extruder port
+#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)
#ifndef X2_STEP_PIN
- #define X2_STEP_PIN _EPIN(EXTRUDERS, STEP)
- #define X2_DIR_PIN _EPIN(EXTRUDERS, DIR)
- #define X2_ENABLE_PIN _EPIN(EXTRUDERS, ENABLE)
+ #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP)
+ #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR)
+ #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
#endif
#undef _X2_PINS
#define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN,
- #define Y2_Z2_E_INDEX INCREMENT(EXTRUDERS)
+ #define Y2_E_INDEX INCREMENT(E_STEPPERS)
#else
- #define Y2_Z2_E_INDEX EXTRUDERS
+ #define Y2_E_INDEX E_STEPPERS
#endif
// The Y2 axis, if any, should be the next open extruder port
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_STEP_PIN)
- #define Y2_STEP_PIN _EPIN(Y2_Z2_E_INDEX, STEP)
- #define Y2_DIR_PIN _EPIN(Y2_Z2_E_INDEX, DIR)
- #define Y2_ENABLE_PIN _EPIN(Y2_Z2_E_INDEX, ENABLE)
+#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
+ #ifndef Y2_STEP_PIN
+ #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP)
+ #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR)
+ #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
+ #endif
#undef _Y2_PINS
#define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN,
+ #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
+#else
+ #define Z2_E_INDEX Y2_E_INDEX
#endif
// The Z2 axis, if any, should be the next open extruder port
-#if ENABLED(Z_DUAL_STEPPER_DRIVERS) && !defined(Z2_STEP_PIN)
- #define Z2_STEP_PIN _EPIN(Y2_Z2_E_INDEX, STEP)
- #define Z2_DIR_PIN _EPIN(Y2_Z2_E_INDEX, DIR)
- #define Z2_ENABLE_PIN _EPIN(Y2_Z2_E_INDEX, ENABLE)
+#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
+ #ifndef Z2_STEP_PIN
+ #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP)
+ #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR)
+ #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
+ #endif
#undef _Z2_PINS
#define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN,
#endif
@@ -383,11 +449,24 @@
Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \
PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLERFAN_PIN, \
_E0_PINS _E1_PINS _E2_PINS _E3_PINS BED_PINS \
+ _H0_PINS _H1_PINS _H2_PINS _H3_PINS \
_X2_PINS _Y2_PINS _Z2_PINS \
X_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \
}
#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
-#endif //__PINS_H
+#ifndef SCK_PIN
+ #define SCK_PIN SCK
+#endif
+#ifndef MISO_PIN
+ #define MISO_PIN MISO
+#endif
+#ifndef MOSI_PIN
+ #define MOSI_PIN MOSI
+#endif
+#ifndef SS_PIN
+ #define SS_PIN SS
+#endif
+#endif //__PINS_H
diff --git a/Marlin/pins_3DRAG.h b/Marlin/pins_3DRAG.h
index 9de52e389..a3a616902 100644
--- a/Marlin/pins_3DRAG.h
+++ b/Marlin/pins_3DRAG.h
@@ -21,13 +21,22 @@
*/
/**
- * 3DRAG (and K8200) Arduino Mega with RAMPS v1.4 pin assignments
+ * 3DRAG (and K8200 / K8400) Arduino Mega with RAMPS v1.4 pin assignments
*/
-#include "pins_RAMPS_14.h"
+#ifndef BOARD_NAME
+ #define BOARD_NAME "3Drag"
+#endif
-#define DEFAULT_MACHINE_NAME "3Drag"
-#define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/"
+#ifndef DEFAULT_MACHINE_NAME
+ #define DEFAULT_MACHINE_NAME "3Drag"
+#endif
+
+#ifndef DEFAULT_SOURCE_CODE_URL
+ #define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/"
+#endif
+
+#include "pins_RAMPS.h"
#undef Z_ENABLE_PIN
#define Z_ENABLE_PIN 63
@@ -77,7 +86,7 @@
#undef BTN_ENC
#define BTN_EN1 16
#define BTN_EN2 17
- #define BTN_ENC 23 //the click
+ #define BTN_ENC 23
#else
diff --git a/Marlin/pins_5DPRINT.h b/Marlin/pins_5DPRINT.h
index 1365cd407..dae7e2034 100644
--- a/Marlin/pins_5DPRINT.h
+++ b/Marlin/pins_5DPRINT.h
@@ -31,6 +31,7 @@
#endif
#define DEFAULT_MACHINE_NAME "Makibox"
+#define BOARD_NAME "5DPrint D8"
#define LARGE_FLASH true
@@ -62,19 +63,12 @@
#define TEMP_0_PIN 1 // Extruder / Analog pin numbering
#define TEMP_BED_PIN 0 // Bed / Analog pin numbering
-// The SDSS pin uses a different pin mapping from file Sd2PinMap.h
+// The SDSS pin uses a different pin mapping from file fastio.h
#define SDSS 20
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 9
- #define MISO_PIN 11
- #define MOSI_PIN 10
-#endif
-
// Microstepping pins
// Note that the pin mapping is not from fastio.h
-// See Sd2PinMap.h for the pin configurations
+// See Sd2PinMap.h for the pin configurations ???
#define X_MS1_PIN 25
#define X_MS2_PIN 26
#define Y_MS1_PIN 9
diff --git a/Marlin/pins_99.h b/Marlin/pins_99.h
index 8ae78b26e..6b7d1e891 100644
--- a/Marlin/pins_99.h
+++ b/Marlin/pins_99.h
@@ -23,7 +23,8 @@
/**
* Board 99 pin assignments
*/
-
+#define BOARD_NAME "99 Unknown"
+
#define X_STEP_PIN 2
#define X_DIR_PIN 3
#define X_ENABLE_PIN -1
diff --git a/Marlin/pins_A4JP.h b/Marlin/pins_A4JP.h
index ca217414d..990abc309 100644
--- a/Marlin/pins_A4JP.h
+++ b/Marlin/pins_A4JP.h
@@ -28,6 +28,8 @@
#error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "AJ4P"
+
// Servo support
#define SERVO0_PIN 22 // Motor header MX1
#define SERVO1_PIN 23 // Motor header MX2
diff --git a/Marlin/pins_AZTEEG_X1.h b/Marlin/pins_AZTEEG_X1.h
index 21bb491f5..8f87a7eaa 100644
--- a/Marlin/pins_AZTEEG_X1.h
+++ b/Marlin/pins_AZTEEG_X1.h
@@ -24,6 +24,7 @@
* Azteeg X1 pin assignments
*/
-#define SANGUINOLOLU_V_1_2
+#define BOARD_NAME "Azteeg X1"
+#define SANGUINOLOLU_V_1_2
#include "pins_SANGUINOLOLU_11.h"
diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h
index 2668d0913..b33818ee7 100644
--- a/Marlin/pins_AZTEEG_X3.h
+++ b/Marlin/pins_AZTEEG_X3.h
@@ -24,28 +24,26 @@
* AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments
*/
-#include "pins_RAMPS_14_EFB.h"
+#if HOTENDS > 2
+ #error "Azteeg X3 supports up to 2 hotends. Comment this line to keep going."
+#endif
-//LCD Pins//
+#define BOARD_NAME "Azteeg X3"
-#if ENABLED(VIKI2) || ENABLED(miniVIKI)
+#include "pins_RAMPS_13.h"
- #define BEEPER_PIN 33
+#if ENABLED(VIKI2) || ENABLED(miniVIKI)
- // Pins for DOGM SPI LCD Support
+ #undef DOGLCD_A0
+ #undef DOGLCD_CS
+ #undef BTN_ENC
#define DOGLCD_A0 31
#define DOGLCD_CS 32
- #define LCD_SCREEN_ROT_180
-
- //The encoder and click button
- #define BTN_EN1 22
- #define BTN_EN2 7
- #define BTN_ENC 12 //the click switch
-
- #define SDSS 53
- #define SD_DETECT -1 // Pin 49 if using display sd interface
+ #define BTN_ENC 12
#if ENABLED(TEMP_STAT_LEDS)
+ #undef STAT_LED_RED
+ #undef STAT_LED_BLUE
#define STAT_LED_RED 64
#define STAT_LED_BLUE 63
#endif
diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h
index a209d0b83..f4114c568 100644
--- a/Marlin/pins_AZTEEG_X3_PRO.h
+++ b/Marlin/pins_AZTEEG_X3_PRO.h
@@ -24,7 +24,9 @@
* AZTEEG_X3_PRO (Arduino Mega) pin assignments
*/
-#include "pins_RAMPS_14.h"
+#define BOARD_NAME "Azteeg X3 Pro"
+
+#include "pins_RAMPS.h"
#undef FAN_PIN
#define FAN_PIN 6 //Part Cooling System
@@ -58,14 +60,10 @@
#define Z_MAX_PIN 18
#endif
-
-#if ENABLED(Z_MIN_PROBE_ENDSTOP)
- //#undef Z_MIN_PIN
- //#define Z_MIN_PIN 15
- // Define a pin to use as the signal pin on Arduino for the Z probe endstop.
+#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 19
#endif
-//
+
#define E2_STEP_PIN 23
#define E2_DIR_PIN 25
#define E2_ENABLE_PIN 40
@@ -105,27 +103,10 @@
#undef SERVO0_PIN
#define SERVO0_PIN 47
-//LCD Pins//
-
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
- #define BEEPER_PIN 33
- // Pins for DOGM SPI LCD Support
- #define DOGLCD_A0 44
- #define DOGLCD_CS 45
- #define LCD_SCREEN_ROT_180
-
- //The encoder and click button
- #define BTN_EN1 22
- #define BTN_EN2 7
- #define BTN_ENC 39 //the click switch
-
- #define SDSS 53
- #define SD_DETECT_PIN 49
-
- #define KILL_PIN 31
-#endif
-
-#if ENABLED(TEMP_STAT_LEDS)
- #define STAT_LED_RED 32
- #define STAT_LED_BLUE 35
+ #undef SD_DETECT_PIN
+ #define SD_DETECT_PIN 49 // For easy adapter board
+#elif ENABLED(TEMP_STAT_LEDS)
+ #define STAT_LED_RED 32
+ #define STAT_LED_BLUE 35
#endif
diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h
index 355daf5c1..0c5914f2b 100644
--- a/Marlin/pins_BAM_DICE_DUE.h
+++ b/Marlin/pins_BAM_DICE_DUE.h
@@ -24,7 +24,13 @@
* BAM&DICE Due (Arduino Mega) pin assignments
*/
-#include "pins_RAMPS_14_EFB.h"
+#if HOTENDS > 2
+ #error "2PrintBeta Due supports up to 2 hotends. Comment this line to keep going."
+#endif
+
+#define BOARD_NAME "2PrintBeta Due"
+
+#include "pins_RAMPS.h"
#undef TEMP_0_PIN
#undef TEMP_1_PIN
diff --git a/Marlin/pins_BQ_ZUM_MEGA_3D.h b/Marlin/pins_BQ_ZUM_MEGA_3D.h
index c6b53d870..c5509d4e5 100644
--- a/Marlin/pins_BQ_ZUM_MEGA_3D.h
+++ b/Marlin/pins_BQ_ZUM_MEGA_3D.h
@@ -28,6 +28,8 @@
#error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "ZUM Mega 3D"
+
#include "pins_RAMPS_13.h"
#undef X_MAX_PIN
@@ -59,23 +61,6 @@
#undef PS_ON_PIN // 12
#define PS_ON_PIN 81 // External Power Supply
-#if ENABLED(BQ_LCD_SMART_CONTROLLER) // Most similar to REPRAP_DISCOUNT_SMART_CONTROLLER
- #define KILL_PIN 41
-
- #define BEEPER_PIN 37
-
- #define BTN_EN1 31
- #define BTN_EN2 33
- #define BTN_ENC 35
-
- #define LCD_PIN_BL 39
- #define LCD_PINS_RS 16
- #define LCD_PINS_ENABLE 17
- #define LCD_PINS_D4 23
-
- #define SD_DETECT_PIN 49
-#endif
-
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#undef Z_MIN_PIN
#undef Z_MAX_PIN
diff --git a/Marlin/pins_BRAINWAVE.h b/Marlin/pins_BRAINWAVE.h
index 20713502f..9dfeb3ab1 100644
--- a/Marlin/pins_BRAINWAVE.h
+++ b/Marlin/pins_BRAINWAVE.h
@@ -31,6 +31,8 @@
#error "Oops! Make sure you have 'Brainwave' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Brainwave"
+
#define X_STEP_PIN 27
#define X_DIR_PIN 29
#define X_ENABLE_PIN 28
@@ -62,11 +64,3 @@
#define TEMP_BED_PIN 6 // Bed / Analog pin numbering
#define LED_PIN 39
-
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 9
- #define MISO_PIN 11
- #define MOSI_PIN 10
-#endif
-
diff --git a/Marlin/pins_BRAINWAVE_PRO.h b/Marlin/pins_BRAINWAVE_PRO.h
index 7961608ab..cba0d4694 100644
--- a/Marlin/pins_BRAINWAVE_PRO.h
+++ b/Marlin/pins_BRAINWAVE_PRO.h
@@ -37,23 +37,28 @@
#error "Uncomment #define AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h for this config"
#endif
+#define BOARD_NAME "Brainwave Pro"
+
#define LARGE_FLASH true
+#define X_STOP_PIN 47
+#define Y_STOP_PIN 18
+#define Z_MAX_PIN 36
+#ifndef Z_MIN_PROBE_PIN
+ #define Z_MIN_PROBE_PIN 17
+#endif
+
#define X_STEP_PIN 33
#define X_DIR_PIN 32
#define X_ENABLE_PIN 11
-#define X_STOP_PIN 47
#define Y_STEP_PIN 31
#define Y_DIR_PIN 30
#define Y_ENABLE_PIN 8
-#define Y_STOP_PIN 18
#define Z_STEP_PIN 29
#define Z_DIR_PIN 28
#define Z_ENABLE_PIN 37
-#define Z_MAX_PIN 36
-#define Z_MIN_PROBE_PIN 17 // Bed Z probe
#define E0_STEP_PIN 35
#define E0_DIR_PIN 34
@@ -70,11 +75,3 @@
#define SDSS 20
#define LED_PIN 19
#define SD_DETECT_PIN 12
-
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 21
- #define MISO_PIN 23
- #define MOSI_PIN 22
-#endif
-
diff --git a/Marlin/pins_CHEAPTRONIC.h b/Marlin/pins_CHEAPTRONIC.h
index 8c5f90002..2fbb4e835 100644
--- a/Marlin/pins_CHEAPTRONIC.h
+++ b/Marlin/pins_CHEAPTRONIC.h
@@ -28,6 +28,7 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Cheaptronic v1.0"
#define LARGE_FLASH true
// X motor stepper
@@ -83,8 +84,4 @@
#define BTN_EN2 -1
#define BTN_ENC -1
-#define BLEN_C 2
-#define BLEN_B 1
-#define BLEN_A 0
-
// Cheaptronic v1.0 doesn't use this
diff --git a/Marlin/pins_CNCONTROLS_11.h b/Marlin/pins_CNCONTROLS_11.h
new file mode 100644
index 000000000..1de35a2c1
--- /dev/null
+++ b/Marlin/pins_CNCONTROLS_11.h
@@ -0,0 +1,101 @@
+/**
+ * CartesioV11 pin assignments
+ */
+
+#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
+ #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
+#endif
+
+#define BOARD_NAME "CN Controls V11"
+
+//#define LARGE_FLASH true
+
+#define X_ENABLE_PIN 35
+#define X_STEP_PIN 34
+#define X_DIR_PIN 36
+#define X_MIN_PIN 43
+#define X_MAX_PIN -1
+
+#define Y_ENABLE_PIN 38
+#define Y_STEP_PIN 37
+#define Y_DIR_PIN 39
+#define Y_MIN_PIN 45
+#define Y_MAX_PIN -1
+
+#define Z_ENABLE_PIN 41
+#define Z_STEP_PIN 40
+#define Z_DIR_PIN 48
+#define Z_MIN_PIN 42
+#define Z_MAX_PIN -1
+
+#define E0_ENABLE_PIN 3
+#define E0_STEP_PIN 29
+#define E0_DIR_PIN 28
+#define HEATER_0_PIN 5
+#define TEMP_0_PIN 0 // ANALOG INPUT !!
+
+#define E1_ENABLE_PIN 60
+#define E1_STEP_PIN 61
+#define E1_DIR_PIN 62
+#define HEATER_1_PIN 58
+#define TEMP_1_PIN 3 // 3 for tool2 -> 2 for chambertemp
+
+#define E2_ENABLE_PIN 16
+#define E2_STEP_PIN 15
+#define E2_DIR_PIN 14
+#define HEATER_2_PIN 64
+#define TEMP_2_PIN 2 // 9 for tool3 -> 2 for chambertemp
+
+#define E3_ENABLE_PIN 47
+#define E3_STEP_PIN 44
+#define E3_DIR_PIN 49
+#define HEATER_3_PIN 46
+#define TEMP_3_PIN 11 // 11 for tool4 -> 2 for chambertemp
+
+#define HEATER_BED_PIN 2
+#define TEMP_BED_PIN 1 // ANALOG INPUT !!
+
+// Tools
+
+//#define TOOL_0_PIN 4
+//#define TOOL_1_PIN 59
+//#define TOOL_2_PIN 8
+//#define TOOL_3_PIN 30
+//#define TOOL_PWM_PIN 7 // common PWM pin for all tools
+
+// Common I/O
+
+//#define TEMP_CHAMBER_PIN 2 // ANALOG INPUT !!
+//#define FIL_RUNOUT_PIN -1
+//#define PWM_1_PIN 11
+//#define PWM_2_PIN 10
+//#define SPARE_IO 12
+//#define FAN_PIN 7 // common PWM pin for all tools
+
+// User interface
+#define BEEPER_PIN 6
+
+// Pins for DOGM SPI LCD Support
+#define DOGLCD_A0 26
+#define DOGLCD_CS 24
+#define DOGLCD_MOSI -1
+#define DOGLCD_SCK -1
+
+// The encoder and click button
+#define BTN_EN1 23
+#define BTN_EN2 25
+#define BTN_ENC 27
+
+// Hardware buttons for manual movement of XYZ
+#define SHIFT_OUT 19
+#define SHIFT_LD 18
+#define SHIFT_CLK 17
+
+//#define UI1 31
+//#define UI2 22
+
+// Other
+#define SDSS 53
+#define SD_DETECT_PIN 13
+#define STAT_LED_BLUE -1
+#define STAT_LED_RED 31
diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h
new file mode 100644
index 000000000..cb338346d
--- /dev/null
+++ b/Marlin/pins_CNCONTROLS_12.h
@@ -0,0 +1,105 @@
+/**
+ * CartesioV12 pin assignments
+ */
+
+#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
+ #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
+#endif
+
+#define BOARD_NAME "CN Controls V12"
+
+//#define LARGE_FLASH true
+
+#define X_ENABLE_PIN 26
+#define X_STEP_PIN 25
+#define X_DIR_PIN 27
+#define X_MIN_PIN 19
+#define X_MAX_PIN -1
+
+#define Y_ENABLE_PIN 29
+#define Y_STEP_PIN 28
+#define Y_DIR_PIN 30
+#define Y_MIN_PIN 22
+#define Y_MAX_PIN -1
+
+#define Z_ENABLE_PIN 32
+#define Z_STEP_PIN 31
+#define Z_DIR_PIN 33
+#define Z_MIN_PIN 23
+#define Z_MAX_PIN -1
+
+#define E0_ENABLE_PIN 58
+#define E0_STEP_PIN 57
+#define E0_DIR_PIN 55
+#define HEATER_0_PIN 11
+#define TEMP_0_PIN 0 // ANALOG INPUT !!
+
+#define E1_ENABLE_PIN 60
+#define E1_STEP_PIN 61
+#define E1_DIR_PIN 62
+#define HEATER_1_PIN 9
+#define TEMP_1_PIN 9 // 9 for tool2 -> 13 for chambertemp
+
+#define E2_ENABLE_PIN 44
+#define E2_STEP_PIN 46
+#define E2_DIR_PIN 66
+#define HEATER_2_PIN 6
+#define TEMP_2_PIN 13 // 10 for tool3 -> 13 for chambertemp
+
+#define E3_ENABLE_PIN 47
+#define E3_STEP_PIN 45
+#define E3_DIR_PIN 69
+#define HEATER_3_PIN 3
+#define TEMP_3_PIN 11 // 11 for tool4 -> 13 for chambertemp
+
+#define HEATER_BED_PIN 24
+#define TEMP_BED_PIN 14 // ANALOG INPUT !!
+
+// Tools
+
+//#define TOOL_0_PIN 56
+//#define TOOL_0_PWM_PIN 10 // red warning led at dual extruder
+//#define TOOL_1_PIN 59
+//#define TOOL_1_PWM_PIN 8 // lights at dual extruder
+//#define TOOL_2_PIN 4
+//#define TOOL_2_PWM_PIN 5
+//#define TOOL_3_PIN 14
+//#define TOOL_3_PWM_PIN 2
+
+// Common I/O
+
+//#define TEMP_CHAMBER_PIN 13 // ANALOG INPUT !!
+#define FIL_RUNOUT_PIN 18
+//#define PWM_1_PIN 12
+//#define PWM_2_PIN 13
+//#define SPARE_IO 17
+#define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools
+
+// User interface
+#define BEEPER_PIN 16
+
+// Pins for DOGM SPI LCD Support
+#define DOGLCD_A0 39
+#define DOGLCD_CS 35
+#define DOGLCD_MOSI 48
+#define DOGLCD_SCK 49
+#define LCD_SCREEN_ROT_180
+
+// The encoder and click button
+#define BTN_EN1 36
+#define BTN_EN2 34
+#define BTN_ENC 38
+
+// Hardware buttons for manual movement of XYZ
+#define SHIFT_OUT 42
+#define SHIFT_LD 41
+#define SHIFT_CLK 40
+
+//#define UI1 43
+//#define UI2 37
+
+// Other
+#define SDSS 53
+#define SD_DETECT_PIN 15
+#define STAT_LED_BLUE -1
+#define STAT_LED_RED 10 // TOOL_0_PWM_PIN
diff --git a/Marlin/pins_ELEFU_3.h b/Marlin/pins_ELEFU_3.h
index 3e4fcf3e6..2b8e64d8e 100644
--- a/Marlin/pins_ELEFU_3.h
+++ b/Marlin/pins_ELEFU_3.h
@@ -28,6 +28,8 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Elefu Ra v3"
+
#define X_STEP_PIN 49
#define X_DIR_PIN 13
#define X_ENABLE_PIN 48
@@ -85,11 +87,7 @@
#define BTN_EN1 14
#define BTN_EN2 39
- #define BTN_ENC 15 //the click
-
- #define BLEN_C 2
- #define BLEN_B 1
- #define BLEN_A 0
+ #define BTN_ENC 15
#endif // RA_CONTROL_PANEL
diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h
index e5aa87922..31906b515 100644
--- a/Marlin/pins_FELIX2.h
+++ b/Marlin/pins_FELIX2.h
@@ -24,10 +24,16 @@
* FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments
*/
-#include "pins_RAMPS_14_EFB.h"
+#if HOTENDS > 2
+ #error "Felix 2.0+ supports up to 2 hotends. Comment this line to keep going."
+#endif
-#undef HEATER_1_PIN
-#define HEATER_1_PIN 7 // EXTRUDER 2
+#define BOARD_NAME "Felix 2.0+"
+
+// Power outputs EFBF or EFBE
+#define MOSFET_D_PIN 7
+
+#include "pins_RAMPS.h"
#undef SDPOWER
#define SDPOWER 1
@@ -36,9 +42,6 @@
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
- #define BLEN_C 2
- #define BLEN_B 1
- #define BLEN_A 0
#define SD_DETECT_PIN 6
#endif // NEWPANEL && ULTRA_LCD
diff --git a/Marlin/pins_GEN3_MONOLITHIC.h b/Marlin/pins_GEN3_MONOLITHIC.h
index fb31a8bf1..85d5b3fae 100644
--- a/Marlin/pins_GEN3_MONOLITHIC.h
+++ b/Marlin/pins_GEN3_MONOLITHIC.h
@@ -28,6 +28,7 @@
#error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Gen3 Monolithic"
#define DEBUG_PIN 0
// x axis
diff --git a/Marlin/pins_GEN3_PLUS.h b/Marlin/pins_GEN3_PLUS.h
index a96b6b8da..7889a0103 100644
--- a/Marlin/pins_GEN3_PLUS.h
+++ b/Marlin/pins_GEN3_PLUS.h
@@ -28,6 +28,8 @@
#error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Gen3+"
+
#define X_STEP_PIN 15
#define X_DIR_PIN 18
#define X_STOP_PIN 20
diff --git a/Marlin/pins_GEN6.h b/Marlin/pins_GEN6.h
index f44c696d0..ae3d33a9a 100644
--- a/Marlin/pins_GEN6.h
+++ b/Marlin/pins_GEN6.h
@@ -30,6 +30,10 @@
#endif
#endif
+#ifndef BOARD_NAME
+ #define BOARD_NAME "Gen6"
+#endif
+
//x axis pins
#define X_STEP_PIN 15
#define X_DIR_PIN 18
diff --git a/Marlin/pins_GEN6_DELUXE.h b/Marlin/pins_GEN6_DELUXE.h
index 718f517c6..b1a1037ed 100644
--- a/Marlin/pins_GEN6_DELUXE.h
+++ b/Marlin/pins_GEN6_DELUXE.h
@@ -24,4 +24,6 @@
* Gen6 Deluxe pin assignments
*/
+#define BOARD_NAME "Gen6 Deluxe"
+
#include "pins_GEN6.h"
diff --git a/Marlin/pins_GEN7_12.h b/Marlin/pins_GEN7_12.h
index 58fad2fe0..1e59ae6fa 100644
--- a/Marlin/pins_GEN7_12.h
+++ b/Marlin/pins_GEN7_12.h
@@ -28,6 +28,10 @@
#error "Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu."
#endif
+#ifndef BOARD_NAME
+ #define BOARD_NAME "Gen7 v1.1 / 1.2"
+#endif
+
#ifndef GEN7_VERSION
#define GEN7_VERSION 12 // v1.x
#endif
diff --git a/Marlin/pins_GEN7_13.h b/Marlin/pins_GEN7_13.h
index 5887aeca8..2365ae8be 100644
--- a/Marlin/pins_GEN7_13.h
+++ b/Marlin/pins_GEN7_13.h
@@ -24,7 +24,7 @@
* Gen7 v1.3 pin assignments
*/
-#define MOTHERBOARD BOARD_GEN7_12
-#define GEN7_VERSION 13 // v1.3
+#define BOARD_NAME "Gen7 v1.3"
+#define GEN7_VERSION 13 // v1.3
#include "pins_GEN7_12.h"
diff --git a/Marlin/pins_GEN7_14.h b/Marlin/pins_GEN7_14.h
index b85a09314..87ccb6018 100644
--- a/Marlin/pins_GEN7_14.h
+++ b/Marlin/pins_GEN7_14.h
@@ -24,12 +24,14 @@
* Gen7 v1.4 pin assignments
*/
-#define GEN7_VERSION 14 // v1.4
-
#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
#error "Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Gen7 v1.4"
+
+#define GEN7_VERSION 14 // v1.4
+
//x axis pins
#define X_STEP_PIN 29
#define X_DIR_PIN 28
diff --git a/Marlin/pins_GEN7_CUSTOM.h b/Marlin/pins_GEN7_CUSTOM.h
index 11a0a4447..06aaebd65 100644
--- a/Marlin/pins_GEN7_CUSTOM.h
+++ b/Marlin/pins_GEN7_CUSTOM.h
@@ -31,6 +31,8 @@
#error "Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Gen7 Custom"
+
//x axis pins
#define X_STEP_PIN 21 // different from standard GEN7
#define X_DIR_PIN 20 // different from standard GEN7
@@ -84,5 +86,5 @@
//buttons are directly attached
#define BTN_EN1 11
#define BTN_EN2 10
-#define BTN_ENC 12 //the click
+#define BTN_ENC 12
diff --git a/Marlin/pins_K8200.h b/Marlin/pins_K8200.h
index ac65297eb..cc3e73117 100644
--- a/Marlin/pins_K8200.h
+++ b/Marlin/pins_K8200.h
@@ -25,10 +25,8 @@
* Identical to 3DRAG
*/
-#include "pins_3DRAG.h"
-
-#undef DEFAULT_MACHINE_NAME
+#define BOARD_NAME "Velleman K8200"
#define DEFAULT_MACHINE_NAME "K8200"
-
-#undef DEFAULT_SOURCE_CODE_URL
#define DEFAULT_SOURCE_CODE_URL "https://github.com/CONSULitAS/Marlin-K8200"
+
+#include "pins_3DRAG.h"
diff --git a/Marlin/pins_K8400.h b/Marlin/pins_K8400.h
new file mode 100644
index 000000000..a15e9e494
--- /dev/null
+++ b/Marlin/pins_K8400.h
@@ -0,0 +1,52 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * Velleman K8400 (Vertex)
+ * 3DRAG clone
+ *
+ * K8400 has some minor differences over a normal 3Drag:
+ * - No X/Y max endstops
+ * - Second extruder step pin has moved
+ * - No power supply control
+ * - Second heater has moved pin
+ */
+
+#define BOARD_NAME "K8400"
+#define DEFAULT_MACHINE_NAME "Vertex"
+#define DEFAULT_SOURCE_CODE_URL "https://github.com/birkett/Vertex-K8400-Firmware"
+
+#include "pins_3DRAG.h"
+
+#undef X_MAX_PIN
+#define X_MAX_PIN -1
+#undef Y_MAX_PIN
+#define Y_MAX_PIN -1
+
+#undef E1_STEP_PIN
+#define E1_STEP_PIN 32
+
+#undef PS_ON_PIN
+#undef KILL_PIN
+
+#undef HEATER_1_PIN
+#define HEATER_1_PIN 11
diff --git a/Marlin/pins_LEAPFROG.h b/Marlin/pins_LEAPFROG.h
index 5acad0479..acfba0373 100644
--- a/Marlin/pins_LEAPFROG.h
+++ b/Marlin/pins_LEAPFROG.h
@@ -28,6 +28,8 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Leapfrog"
+
#define X_STEP_PIN 28
#define X_DIR_PIN 63
#define X_ENABLE_PIN 29
diff --git a/Marlin/pins_MEGACONTROLLER.h b/Marlin/pins_MEGACONTROLLER.h
index d7d5418d3..7ea4ee34b 100644
--- a/Marlin/pins_MEGACONTROLLER.h
+++ b/Marlin/pins_MEGACONTROLLER.h
@@ -28,10 +28,12 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
-#if EXTRUDERS > 2
- #error "Mega Controller supports up to 2 extruders. Comment this line to keep going."
+#if E_STEPPERS > 2 || HOTENDS > 2
+ #error "Mega Controller supports up to 2 hotends / E-steppers. Comment this line to keep going."
#endif
+#define BOARD_NAME "Mega Controller"
+
#define SERVO0_PIN 30
#define SERVO1_PIN 31
#define SERVO2_PIN 32
@@ -111,11 +113,11 @@
//#define LCD_SCREEN_ROT_90
//#define LCD_SCREEN_ROT_180
//#define LCD_SCREEN_ROT_270
- //The encoder and click button
+
#define BTN_EN1 48
#define BTN_EN2 11
- #define BTN_ENC 10 //the click switch
- //not connected to a pin
+ #define BTN_ENC 10
+
#define SD_DETECT_PIN 49
-#endif //Minipanel
+#endif // MINIPANEL
diff --git a/Marlin/pins_MEGATRONICS.h b/Marlin/pins_MEGATRONICS.h
index 3cd467db8..1b95f525f 100644
--- a/Marlin/pins_MEGATRONICS.h
+++ b/Marlin/pins_MEGATRONICS.h
@@ -28,6 +28,7 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Megatronics"
#define LARGE_FLASH true
#define X_STEP_PIN 26
@@ -74,7 +75,8 @@
#define TEMP_1_PIN 15 // ANALOG NUMBERING
#define TEMP_BED_PIN 14 // ANALOG NUMBERING
-#define BEEPER_PIN 33 // AUX-4
+// AUX-4
+#define BEEPER_PIN 33
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
@@ -90,10 +92,6 @@
#define BTN_EN2 64
#define BTN_ENC 43
- #define BLEN_C 2
- #define BLEN_B 1
- #define BLEN_A 0
-
#define SD_DETECT_PIN -1 // RAMPS doesn't use this
#endif // ULTRA_LCD && NEWPANEL
diff --git a/Marlin/pins_MEGATRONICS_2.h b/Marlin/pins_MEGATRONICS_2.h
index 6fb347552..991ab4a9c 100644
--- a/Marlin/pins_MEGATRONICS_2.h
+++ b/Marlin/pins_MEGATRONICS_2.h
@@ -28,6 +28,7 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Megatronics v2.0"
#define LARGE_FLASH true
#define X_STEP_PIN 26
@@ -100,9 +101,4 @@
// Buttons are directly attached using keypad
#define BTN_EN1 61
#define BTN_EN2 59
-#define BTN_ENC 43 //the click
-
-#define BLEN_C 2
-#define BLEN_B 1
-#define BLEN_A 0
-
+#define BTN_ENC 43
diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h
index 8410ce061..a983ee2a7 100644
--- a/Marlin/pins_MEGATRONICS_3.h
+++ b/Marlin/pins_MEGATRONICS_3.h
@@ -28,6 +28,14 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
+#define MEGATRONICS_31
+
+#if ENABLED(MEGATRONICS_31)
+ #define BOARD_NAME "Megatronics v3.1"
+#else
+ #define BOARD_NAME "Megatronics v3.0"
+#endif
+
#define LARGE_FLASH true
#if ENABLED(Z_PROBE_SLED)
@@ -35,28 +43,28 @@
#endif
// Servo support
-#define SERVO0_PIN 46 //AUX3-6
-#define SERVO1_PIN 47 //AUX3-5
-#define SERVO2_PIN 48 //AUX3-4
-#define SERVO3_PIN 49 //AUX3-3
+#define SERVO0_PIN 46 // AUX3-6
+#define SERVO1_PIN 47 // AUX3-5
+#define SERVO2_PIN 48 // AUX3-4
+#define SERVO3_PIN 49 // AUX3-3
#define X_STEP_PIN 58
#define X_DIR_PIN 57
#define X_ENABLE_PIN 59
#define X_MIN_PIN 37
-#define X_MAX_PIN 40 // put to -1 to disable
+#define X_MAX_PIN 40
#define Y_STEP_PIN 5
#define Y_DIR_PIN 17
#define Y_ENABLE_PIN 4
#define Y_MIN_PIN 41
-#define Y_MAX_PIN 38 // put to -1 to disable
+#define Y_MAX_PIN 38
#define Z_STEP_PIN 16
#define Z_DIR_PIN 11
#define Z_ENABLE_PIN 3
#define Z_MIN_PIN 18
-#define Z_MAX_PIN 19 // put to -1 to disable
+#define Z_MAX_PIN 19
#define E0_STEP_PIN 28
#define E0_DIR_PIN 27
@@ -103,26 +111,37 @@
#define TEMP_BED_PIN 14 // ANALOG NUMBERING
#endif
+/**
+ * Controllers and LCDs
+ */
#define BEEPER_PIN 61
-#define LCD_PINS_RS 32
-#define LCD_PINS_ENABLE 31
-#define LCD_PINS_D4 14
-#define LCD_PINS_D5 30
-#define LCD_PINS_D6 39
-#define LCD_PINS_D7 15
-
-#define SHIFT_CLK 43
-#define SHIFT_LD 35
-#define SHIFT_OUT 34
-#define SHIFT_EN 44
-
-// Buttons are directly attached using keypad
#define BTN_EN1 44
#define BTN_EN2 45
-#define BTN_ENC 33 // the click
+#define BTN_ENC 33
-#define BLEN_C 2
-#define BLEN_B 1
-#define BLEN_A 0
+#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
+ #define LCD_PINS_RS 56 // CS chip select / SS chip slave select
+ #define LCD_PINS_ENABLE 51 // SID (MOSI)
+ #define LCD_PINS_D4 52 // SCK (CLK) clock
+ #define SD_DETECT_PIN 35
+#else
+ #define LCD_PINS_RS 32
+ #define LCD_PINS_ENABLE 31
+ #define LCD_PINS_D4 14
+ #define LCD_PINS_D5 30
+ #define LCD_PINS_D6 39
+ #define LCD_PINS_D7 15
+
+ #define SHIFT_CLK 43
+ #define SHIFT_LD 35
+ #define SHIFT_OUT 34
+ #define SHIFT_EN 44
+
+ #if ENABLED(MEGATRONICS_31)
+ #define SD_DETECT_PIN 56
+ #else
+ #define SD_DETECT_PIN -1
+ #endif
+#endif
diff --git a/Marlin/pins_MELZI.h b/Marlin/pins_MELZI.h
index dae033bf8..677f0cf36 100644
--- a/Marlin/pins_MELZI.h
+++ b/Marlin/pins_MELZI.h
@@ -24,10 +24,11 @@
* Melzi pin assignments
*/
-#define SANGUINOLOLU_V_1_2
+#define BOARD_NAME "Melzi"
#if defined(__AVR_ATmega1284P__)
#define LARGE_FLASH true
#endif
+#define SANGUINOLOLU_V_1_2
#include "pins_SANGUINOLOLU_11.h"
diff --git a/Marlin/pins_MELZI_MAKR3D.h b/Marlin/pins_MELZI_MAKR3D.h
index fe77e27bc..877f8cbd2 100644
--- a/Marlin/pins_MELZI_MAKR3D.h
+++ b/Marlin/pins_MELZI_MAKR3D.h
@@ -24,12 +24,11 @@
* Melzi with ATmega1284 (MaKr3d version) pin assignments
*/
-#undef MOTHERBOARD
-#define MOTHERBOARD BOARD_MELZI
-#define SANGUINOLOLU_V_1_2
+#define BOARD_NAME "Melzi ATmega1284"
#if defined(__AVR_ATmega1284P__)
#define LARGE_FLASH true
#endif
+#define SANGUINOLOLU_V_1_2
#include "pins_SANGUINOLOLU_11.h"
diff --git a/Marlin/pins_MINIRAMBO.h b/Marlin/pins_MINIRAMBO.h
index 1485c72bc..089ea5996 100644
--- a/Marlin/pins_MINIRAMBO.h
+++ b/Marlin/pins_MINIRAMBO.h
@@ -28,6 +28,7 @@
#error "Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Mini Rambo"
#define LARGE_FLASH true
#define X_STEP_PIN 37
@@ -94,7 +95,9 @@
#if ENABLED(NEWPANEL)
- #define BEEPER_PIN 84 // Beeper on AUX-4
+ // Beeper on AUX-4
+ #define BEEPER_PIN 84
+
#define LCD_PINS_RS 82
#define LCD_PINS_ENABLE 18
#define LCD_PINS_D4 19
diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h
index e21993fff..34faa9ad3 100644
--- a/Marlin/pins_MINITRONICS.h
+++ b/Marlin/pins_MINITRONICS.h
@@ -28,6 +28,7 @@
#error "Oops! Make sure you have 'Minitronics' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Minitronics v1.0 / v1.1"
#define LARGE_FLASH true
#define X_STEP_PIN 48
@@ -73,21 +74,36 @@
#define HEATER_1_PIN 8 // EXTRUDER 2
#define HEATER_BED_PIN 3 // BED
+/**
+ * Controllers and LCDs
+ */
#define BEEPER_PIN -1
-#define LCD_PINS_RS -1
-#define LCD_PINS_ENABLE -1
-#define LCD_PINS_D4 -1
-#define LCD_PINS_D5 -1
-#define LCD_PINS_D6 -1
-#define LCD_PINS_D7 -1
+#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
+
+ #define LCD_PINS_RS 15 // CS chip select /SS chip slave select
+ #define LCD_PINS_ENABLE 11 // SID (MOSI)
+ #define LCD_PINS_D4 10 // SCK (CLK) clock
+
+ #define BTN_EN1 18
+ #define BTN_EN2 17
+ #define BTN_ENC 25
-// Buttons are directly attached using keypad
-#define BTN_EN1 -1
-#define BTN_EN2 -1
-#define BTN_ENC -1 // the click
+ #define SD_DETECT_PIN 30
-#define BLEN_C 2
-#define BLEN_B 1
-#define BLEN_A 0
+#else
+ #define LCD_PINS_RS -1
+ #define LCD_PINS_ENABLE -1
+ #define LCD_PINS_D4 -1
+ #define LCD_PINS_D5 -1
+ #define LCD_PINS_D6 -1
+ #define LCD_PINS_D7 -1
+
+ // Buttons are directly attached using keypad
+ #define BTN_EN1 -1
+ #define BTN_EN2 -1
+ #define BTN_ENC -1
+
+ #define SD_DETECT_PIN -1 // Minitronics doesn't use this
+#endif
diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h
index 5857a2bf9..3b5b242ab 100644
--- a/Marlin/pins_MKS_13.h
+++ b/Marlin/pins_MKS_13.h
@@ -29,7 +29,100 @@
* MKS v1.4 (Extruder, Extruder, Fan, Bed)
*/
-#include "pins_RAMPS_14_EFB.h"
+#if HOTENDS > 2
+ #error "MKS 1.3/1.4 supports up to 2 hotends. Comment this line to keep going."
+#endif
-#undef HEATER_1_PIN
-#define HEATER_1_PIN 7 // EXTRUDER 2 (-1 on RAMPS 1.4)
+#define BOARD_NAME "MKS > v1.3"
+
+// Power outputs EFBF or EFBE
+#define MOSFET_D_PIN 7
+
+#include "pins_RAMPS.h"
+
+#if ENABLED(VIKI2) || ENABLED(miniVIKI)
+ /**
+ * VIKI2 Has two groups of wires with...
+ *
+ * +Vin + Input supply, requires 120ma for LCD and mSD card
+ * GND Ground Pin
+ * MOSI Data input for LCD and SD
+ * MISO Data output for SD
+ * SCK Clock for LCD and SD
+ * AO Reg. Sel for LCD
+ * LCS Chip Select for LCD
+ * SDCS Chip Select for SD
+ * SDCD Card Detect pin for SD
+ * ENCA Encoder output A
+ * ENCB Encoder output B
+ * ENCBTN Encoder button switch
+ *
+ * BTN Panel mounted button switch
+ * BUZZER Piezo buzzer
+ * BLUE-LED Blue LED ring pin (3 to 5v, mosfet buffered)
+ * RED-LED Red LED ring pin (3 to 5v, mosfet buffered)
+ *
+ * This configuration uses the following arrangement:
+ *
+ * EXP1 D37 = EN2 D35 = EN1 EXP2 D50 = MISO D52 = SCK
+ * D17 = BLUE D16 = RED D31 = ENC D53 = SDCS
+ * D23 = KILL D25 = BUZZ D33 = --- D51 = MOSI
+ * D27 = A0 D29 = LCS D49 = SDCD RST = ---
+ * GND = GND 5V = 5V GND = --- D41 = ---
+ */
+
+ #undef BTN_EN1
+ #undef BTN_EN2
+ #undef BTN_ENC
+ #undef DOGLCD_A0
+ #undef DOGLCD_CS
+ #undef SD_DETECT_PIN
+ #undef BEEPER_PIN
+ #undef KILL_PIN
+
+ //
+ // VIKI2 12-wire lead
+ //
+
+ // orange/white SDCD
+ #define SD_DETECT_PIN 49
+
+ // white ENCA
+ #define BTN_EN1 35
+
+ // green ENCB
+ #define BTN_EN2 37
+
+ // purple ENCBTN
+ #define BTN_ENC 31
+
+ // brown A0
+ #define DOGLCD_A0 27
+
+ // green/white LCS
+ #define DOGLCD_CS 29
+
+ // 50 gray MISO
+ // 51 yellow MOSI
+ // 52 orange SCK
+
+ // blue SDCS
+ //#define SDSS 53
+
+ //
+ // VIKI2 4-wire lead
+ //
+
+ // blue BTN
+ #define KILL_PIN 23
+
+ // green BUZZER
+ #define BEEPER_PIN 25
+
+ // yellow RED-LED
+ #define STAT_LED_RED 16
+
+ // white BLUE-LED
+ #define STAT_LED_BLUE 17
+
+#endif
diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h
index 5ca8e05b9..8c7222017 100644
--- a/Marlin/pins_MKS_BASE.h
+++ b/Marlin/pins_MKS_BASE.h
@@ -24,7 +24,13 @@
* MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments
*/
-#include "pins_RAMPS_14_EFB.h"
+#if HOTENDS > 2
+ #error "MKS BASE 1.0 supports up to 2 hotends. Comment this line to keep going."
+#endif
-#undef HEATER_1_PIN
-#define HEATER_1_PIN 7
+#define BOARD_NAME "MKS BASE 1.0"
+
+// Power outputs EFBF or EFBE
+#define MOSFET_D_PIN 7
+
+#include "pins_RAMPS.h"
\ No newline at end of file
diff --git a/Marlin/pins_OMCA.h b/Marlin/pins_OMCA.h
index 261e64549..9ec6309d5 100644
--- a/Marlin/pins_OMCA.h
+++ b/Marlin/pins_OMCA.h
@@ -55,6 +55,8 @@
#error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. (Final OMCA board)"
#endif
+#define BOARD_NAME "Final OMCA"
+
#define X_STEP_PIN 26
#define X_DIR_PIN 25
#define X_ENABLE_PIN 10
diff --git a/Marlin/pins_OMCA_A.h b/Marlin/pins_OMCA_A.h
index 1b82c5c46..39d232aee 100644
--- a/Marlin/pins_OMCA_A.h
+++ b/Marlin/pins_OMCA_A.h
@@ -54,6 +54,8 @@
#error "Oops! Make sure you have 'SanguinoA' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Alpha OMCA"
+
#define X_STEP_PIN 21
#define X_DIR_PIN 20
#define X_ENABLE_PIN 24
diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h
index 5534589cb..fb1874b64 100644
--- a/Marlin/pins_PRINTRBOARD.h
+++ b/Marlin/pins_PRINTRBOARD.h
@@ -35,6 +35,7 @@
#error "These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h"
#endif
+#define BOARD_NAME "Printrboard"
#define LARGE_FLASH true
// Disable JTAG pins so they can be used for the Extrudrboard
@@ -85,13 +86,6 @@
#define SDSS 26
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 9
- #define MISO_PIN 11
- #define MOSI_PIN 10
-#endif
-
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
//we have no buzzer installed
#define BEEPER_PIN -1
@@ -121,7 +115,8 @@
#endif // ULTRA_LCD && NEWPANEL
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
- #define BEEPER_PIN 32 //FastIO
+ //FastIO
+ #define BEEPER_PIN 32
// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 42 //Non-FastIO
#define DOGLCD_CS 43 //Non-FastIO
@@ -130,7 +125,7 @@
//The encoder and click button (FastIO Pins)
#define BTN_EN1 26
#define BTN_EN2 27
- #define BTN_ENC 47 //the click switch
+ #define BTN_ENC 47
#define SDSS 45
#define SD_DETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test)
diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h
index c6773466f..61b23fb4c 100644
--- a/Marlin/pins_PRINTRBOARD_REVF.h
+++ b/Marlin/pins_PRINTRBOARD_REVF.h
@@ -35,6 +35,7 @@
#error "These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h"
#endif
+#define BOARD_NAME "Printrboard Rev F"
#define LARGE_FLASH true
#define X_STEP_PIN 0
@@ -89,13 +90,7 @@
#define DAC_STEPPER_MAX 3520
#define DAC_STEPPER_VREF 1 //internal Vref, gain 1x = 2.048V
#define DAC_STEPPER_GAIN 0
-
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 9
- #define MISO_PIN 11
- #define MOSI_PIN 10
-#endif
+#define DAC_OR_ADDRESS 0x00
#if ENABLED(ULTRA_LCD)
#define BEEPER_PIN -1
@@ -111,10 +106,6 @@
#define BTN_EN2 17
#define BTN_ENC 18//the click
- #define BLEN_C 2
- #define BLEN_B 1
- #define BLEN_A 0
-
#define SD_DETECT_PIN -1
//encoder rotation values
@@ -134,7 +125,7 @@
//The encoder and click button (FastIO Pins)
#define BTN_EN1 26
#define BTN_EN2 27
- #define BTN_ENC 47 //the click switch
+ #define BTN_ENC 47
#define SDSS 45
#define SD_DETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test)
diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h
index a42731a1a..278774caf 100644
--- a/Marlin/pins_RAMBO.h
+++ b/Marlin/pins_RAMBO.h
@@ -28,6 +28,8 @@
#error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Rambo"
+
#define LARGE_FLASH true
// Servo support
@@ -40,26 +42,30 @@
#define SLED_PIN -1
#endif
-#define X_STEP_PIN 37
-#define X_DIR_PIN 48
#define X_MIN_PIN 12
#define X_MAX_PIN 24
+#define Y_MIN_PIN 11
+#define Y_MAX_PIN 23
+#define Z_MIN_PIN 10
+#define Z_MAX_PIN 30
+#ifndef Z_MIN_PROBE_PIN
+ #define Z_MIN_PROBE_PIN 10
+#endif
+
+#define X_STEP_PIN 37
+#define X_DIR_PIN 48
#define X_ENABLE_PIN 29
#define X_MS1_PIN 40
#define X_MS2_PIN 41
#define Y_STEP_PIN 36
#define Y_DIR_PIN 49
-#define Y_MIN_PIN 11
-#define Y_MAX_PIN 23
#define Y_ENABLE_PIN 28
#define Y_MS1_PIN 69
#define Y_MS2_PIN 39
#define Z_STEP_PIN 35
#define Z_DIR_PIN 47
-#define Z_MIN_PIN 10
-#define Z_MAX_PIN 30
#define Z_ENABLE_PIN 27
#define Z_MS1_PIN 68
#define Z_MS2_PIN 67
@@ -112,8 +118,6 @@
#if ENABLED(NEWPANEL)
- #define BEEPER_PIN 79 // Beeper on AUX-4
-
#define LCD_PINS_RS 70
#define LCD_PINS_ENABLE 71
#define LCD_PINS_D4 72
@@ -121,20 +125,41 @@
#define LCD_PINS_D6 74
#define LCD_PINS_D7 75
- //buttons are directly attached using AUX-2
- #define BTN_EN1 76
- #define BTN_EN2 77
- #define BTN_ENC 78 //the click
+ #if ENABLED(VIKI2) || ENABLED(miniVIKI)
+ #define BEEPER_PIN 44
+
+ #define DOGLCD_A0 70
+ #define DOGLCD_CS 71
+ #define LCD_SCREEN_ROT_180
+
+ #define BTN_EN1 85
+ #define BTN_EN2 84
+ #define BTN_ENC 83
+
+ #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board
- #define BLEN_C 2
- #define BLEN_B 1
- #define BLEN_A 0
+ #if ENABLED(TEMP_STAT_LEDS)
+ #define STAT_LED_RED 22
+ #define STAT_LED_BLUE 32
+ #endif
- #define SD_DETECT_PIN 81 // Ramps doesn't use this
+ #else
+
+ #define BEEPER_PIN 79 // AUX-4
+
+ // AUX-2
+ #define BTN_EN1 76
+ #define BTN_EN2 77
+ #define BTN_ENC 78
+
+ #define SD_DETECT_PIN 81
+
+ #endif // VIKI2/miniVIKI
#else //!NEWPANEL - old style panel with shift register
- #define BEEPER_PIN 33 // No Beeper added
+ // No Beeper added
+ #define BEEPER_PIN 33
//buttons are attached to a shift register
// Not wired yet
@@ -150,38 +175,7 @@
#define LCD_PINS_D6 27
#define LCD_PINS_D7 29
- //bits in the shift register that carry the buttons for:
- // left up center down right red
- #define BL_LE 7
- #define BL_UP 6
- #define BL_MI 5
- #define BL_DW 4
- #define BL_RI 3
- #define BL_ST 2
- #define BLEN_B 1
- #define BLEN_A 0
-
#endif // !NEWPANEL
#endif // ULTRA_LCD
-#if ENABLED(VIKI2) || ENABLED(miniVIKI)
- #define BEEPER_PIN 44
- // Pins for DOGM SPI LCD Support
- #define DOGLCD_A0 70
- #define DOGLCD_CS 71
- #define LCD_SCREEN_ROT_180
-
- //The encoder and click button
- #define BTN_EN1 85
- #define BTN_EN2 84
- #define BTN_ENC 83 //the click switch
-
- #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board
-
- #if ENABLED(TEMP_STAT_LEDS)
- #define STAT_LED_RED 22
- #define STAT_LED_BLUE 32
- #endif
-#endif // VIKI2/miniVIKI
-
diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS.h
similarity index 60%
rename from Marlin/pins_RAMPS_14.h
rename to Marlin/pins_RAMPS.h
index 612e8ec31..5f2e0d119 100644
--- a/Marlin/pins_RAMPS_14.h
+++ b/Marlin/pins_RAMPS.h
@@ -25,16 +25,16 @@
*
* Applies to the following boards:
*
- * RAMPS_14_EFB (Extruder, Fan, Bed)
- * RAMPS_14_EEB (Extruder, Extruder, Bed)
- * RAMPS_14_EFF (Extruder, Fan, Fan)
- * RAMPS_14_EEF (Extruder, Extruder, Fan)
+ * RAMPS_14_EFB (Hotend, Fan, Bed)
+ * RAMPS_14_EEB (Hotend0, Hotend1, Bed)
+ * RAMPS_14_EFF (Hotend, Fan0, Fan1)
+ * RAMPS_14_EEF (Hotend0, Hotend1, Fan)
* RAMPS_14_SF (Spindle, Controller Fan)
*
- * RAMPS_13_EFB (Extruder, Fan, Bed)
- * RAMPS_13_EEB (Extruder, Extruder, Bed)
- * RAMPS_13_EFF (Extruder, Fan, Fan)
- * RAMPS_13_EEF (Extruder, Extruder, Fan)
+ * RAMPS_13_EFB (Hotend, Fan, Bed)
+ * RAMPS_13_EEB (Hotend0, Hotend1, Bed)
+ * RAMPS_13_EFF (Hotend, Fan0, Fan1)
+ * RAMPS_13_EEF (Hotend0, Hotend1, Fan)
* RAMPS_13_SF (Spindle, Controller Fan)
*
* Other pins_MYBOARD.h files may override these defaults
@@ -48,6 +48,10 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
+#ifndef BOARD_NAME
+ #define BOARD_NAME "RAMPS 1.4"
+#endif
+
#define LARGE_FLASH true
#ifdef IS_RAMPS_13
@@ -59,25 +63,29 @@
#define SERVO2_PIN 5
#define SERVO3_PIN 4
-#define X_STEP_PIN 54
-#define X_DIR_PIN 55
-#define X_ENABLE_PIN 38
#define X_MIN_PIN 3
#ifndef X_MAX_PIN
#define X_MAX_PIN 2
#endif
+#define Y_MIN_PIN 14
+#define Y_MAX_PIN 15
+#define Z_MIN_PIN 18
+#define Z_MAX_PIN 19
+#ifndef Z_MIN_PROBE_PIN
+ #define Z_MIN_PROBE_PIN 32
+#endif
+
+#define X_STEP_PIN 54
+#define X_DIR_PIN 55
+#define X_ENABLE_PIN 38
#define Y_STEP_PIN 60
#define Y_DIR_PIN 61
#define Y_ENABLE_PIN 56
-#define Y_MIN_PIN 14
-#define Y_MAX_PIN 15
#define Z_STEP_PIN 46
#define Z_DIR_PIN 48
#define Z_ENABLE_PIN 62
-#define Z_MIN_PIN 18
-#define Z_MAX_PIN 19
#define E0_STEP_PIN 26
#define E0_DIR_PIN 28
@@ -93,72 +101,117 @@
// Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
#define FILWIDTH_PIN 5 // ANALOG NUMBERING
-#if ENABLED(Z_MIN_PROBE_ENDSTOP)
- // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
- #define Z_MIN_PROBE_PIN 32
-#endif
+// define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
+#define FIL_RUNOUT_PIN 4
-#if ENABLED(FILAMENT_RUNOUT_SENSOR)
- // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
- #define FILRUNOUT_PIN 4
+#define PS_ON_PIN 12
+#define TEMP_0_PIN 13 // ANALOG NUMBERING
+#define TEMP_1_PIN 15 // ANALOG NUMBERING
+#define TEMP_BED_PIN 14 // ANALOG NUMBERING
+
+#if ENABLED(Z_PROBE_SLED)
+ #define SLED_PIN -1
#endif
-#if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB)
- #define FAN_PIN 9 // (Sprinter config)
- #if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF)
- #define CONTROLLERFAN_PIN -1 // Pin used for the fan to cool controller
+// Augmentation for auto-assigning RAMPS plugs
+#if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D)
+ #if HOTENDS > 1
+ #if TEMP_SENSOR_BED
+ #define IS_RAMPS_EEB
+ #else
+ #define IS_RAMPS_EEF
+ #endif
+ #elif TEMP_SENSOR_BED
+ #define IS_RAMPS_EFB
+ #else
+ #define IS_RAMPS_EFF
#endif
-#elif MB(RAMPS_14_EEF) || MB(RAMPS_14_SF) || MB(RAMPS_13_EEF) || MB(RAMPS_13_SF)
- #define FAN_PIN 8
-#else
- #define FAN_PIN 4 // IO pin. Buffer needed
#endif
-#define PS_ON_PIN 12
+/**
+ * Hi Voltage PWM Pin Assignments
+ */
-#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL)
- #define KILL_PIN 41
+#ifndef MOSFET_D_PIN
+ #define MOSFET_D_PIN -1
+#endif
+#ifndef RAMPS_D8_PIN
+ #define RAMPS_D8_PIN 8
+#endif
+#ifndef RAMPS_D9_PIN
+ #define RAMPS_D9_PIN 9
+#endif
+#ifndef RAMPS_D10_PIN
+ #define RAMPS_D10_PIN 10
#endif
-#if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF)
- #define HEATER_0_PIN 8
-#else
- #define HEATER_0_PIN 10 // EXTRUDER 1
- #if !MB(RAMPS_14_EEF) && !MB(RAMPS_13_EEF) && !MB(RAMPS_14_SF) && !MB(RAMPS_13_SF)
- #define HEATER_BED_PIN 8 // BED
+#define HEATER_0_PIN RAMPS_D10_PIN
+
+#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed
+ #define FAN_PIN RAMPS_D9_PIN
+ #define HEATER_BED_PIN RAMPS_D8_PIN
+#elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan
+ #define HEATER_1_PIN RAMPS_D9_PIN
+ #define FAN_PIN RAMPS_D8_PIN
+#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
+ #define HEATER_1_PIN RAMPS_D9_PIN
+ #define HEATER_BED_PIN RAMPS_D8_PIN
+#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan
+ #define FAN_PIN RAMPS_D9_PIN
+ #define FAN1_PIN RAMPS_D8_PIN
+ #define CONTROLLERFAN_PIN -1
+#elif ENABLED(IS_RAMPS_SF) // Spindle, Fan
+ #define FAN_PIN RAMPS_D8_PIN
+#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
+ #define FAN_PIN RAMPS_D9_PIN
+ #define HEATER_BED_PIN RAMPS_D8_PIN
+ #if HOTENDS == 1
+ #define FAN1_PIN MOSFET_D_PIN
+ #else
+ #define HEATER_1_PIN MOSFET_D_PIN
#endif
#endif
-#if !MB(RAMPS_14_SF) && !MB(RAMPS_13_SF) && !ENABLED(IS_RAMPS_EFB)
- #define HEATER_1_PIN 9 // EXTRUDER 2 (FAN On Sprinter)
+#ifndef FAN_PIN
+ #define FAN_PIN 4 // IO pin. Buffer needed
#endif
-#define TEMP_0_PIN 13 // ANALOG NUMBERING
-#define TEMP_1_PIN 15 // ANALOG NUMBERING
-#define TEMP_BED_PIN 14 // ANALOG NUMBERING
-
-#if ENABLED(Z_PROBE_SLED)
- #define SLED_PIN -1
-#endif
+/**
+ * LCD Controller Pin Assignments
+ */
#if ENABLED(ULTRA_LCD)
- #if ENABLED(NEWPANEL)
- #if ENABLED(PANEL_ONE)
- #define LCD_PINS_RS 40
- #define LCD_PINS_ENABLE 42
- #define LCD_PINS_D4 65
- #define LCD_PINS_D5 66
- #define LCD_PINS_D6 44
- #define LCD_PINS_D7 64
- #else
- #define LCD_PINS_RS 16
- #define LCD_PINS_ENABLE 17
- #define LCD_PINS_D4 23
- #define LCD_PINS_D5 25
- #define LCD_PINS_D6 27
- #define LCD_PINS_D7 29
+ #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
+ #define LCD_PINS_RS 49 //CS chip select /SS chip slave select
+ #define LCD_PINS_ENABLE 51 //SID (MOSI)
+ #define LCD_PINS_D4 52 //SCK (CLK) clock
+ #elif ENABLED(NEWPANEL) && ENABLED(PANEL_ONE)
+ #define LCD_PINS_RS 40
+ #define LCD_PINS_ENABLE 42
+ #define LCD_PINS_D4 65
+ #define LCD_PINS_D5 66
+ #define LCD_PINS_D6 44
+ #define LCD_PINS_D7 64
+ #else
+ #define LCD_PINS_RS 16
+ #define LCD_PINS_ENABLE 17
+ #define LCD_PINS_D4 23
+ #define LCD_PINS_D5 25
+ #define LCD_PINS_D6 27
+ #define LCD_PINS_D7 29
+ #if DISABLED(NEWPANEL)
+ #define BEEPER_PIN 33
+ // Buttons are attached to a shift register
+ // Not wired yet
+ //#define SHIFT_CLK 38
+ //#define SHIFT_LD 42
+ //#define SHIFT_OUT 40
+ //#define SHIFT_EN 17
#endif
+ #endif
+
+ #if ENABLED(NEWPANEL)
#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
#define BEEPER_PIN 37
@@ -168,6 +221,17 @@
#define BTN_ENC 35
#define SD_DETECT_PIN 49
+ #define KILL_PIN 41
+
+ #if ENABLED(BQ_LCD_SMART_CONTROLLER)
+ #define LCD_PIN_BL 39
+ #endif
+
+ #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
+ #define BTN_EN1 64
+ #define BTN_EN2 59
+ #define BTN_ENC 63
+ #define SD_DETECT_PIN 42
#elif ENABLED(LCD_I2C_PANELOLU2)
#define BTN_EN1 47 // reverse if the encoder turns the wrong way.
#define BTN_EN2 43
@@ -183,6 +247,27 @@
#define BTN_ENC -1
#define LCD_SDSS 53
#define SD_DETECT_PIN 49
+ #elif ENABLED(VIKI2) || ENABLED(miniVIKI)
+ #define BEEPER_PIN 33
+
+ // Pins for DOGM SPI LCD Support
+ #define DOGLCD_A0 44
+ #define DOGLCD_CS 45
+ #define LCD_SCREEN_ROT_180
+
+ #define BTN_EN1 22
+ #define BTN_EN2 7
+ #define BTN_ENC 39
+
+ #define SDSS 53
+ #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board
+
+ #define KILL_PIN 31
+
+ #if ENABLED(TEMP_STAT_LEDS)
+ #define STAT_LED_RED 32
+ #define STAT_LED_BLUE 35
+ #endif
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#define BTN_EN1 35 // reverse if the encoder turns the wrong way.
#define BTN_EN2 37
@@ -212,13 +297,14 @@
//The encoder and click button
#define BTN_EN1 40
#define BTN_EN2 63
- #define BTN_ENC 59 //the click switch
+ #define BTN_ENC 59
//not connected to a pin
#define SD_DETECT_PIN 49
#else
- #define BEEPER_PIN 33 // Beeper on AUX-4
+ // Beeper on AUX-4
+ #define BEEPER_PIN 33
// buttons are directly attached using AUX-2
#if ENABLED(REPRAPWORLD_KEYPAD)
@@ -240,30 +326,13 @@
#if ENABLED(G3D_PANEL)
#define SD_DETECT_PIN 49
+ #define KILL_PIN 41
#else
// #define SD_DETECT_PIN -1 // Ramps doesn't use this
#endif
#endif
- #else // !NEWPANEL (Old-style panel with shift register)
-
- #define BEEPER_PIN 33 // No Beeper added
-
- // Buttons are attached to a shift register
- // Not wired yet
- //#define SHIFT_CLK 38
- //#define SHIFT_LD 42
- //#define SHIFT_OUT 40
- //#define SHIFT_EN 17
-
- #define LCD_PINS_RS 16
- #define LCD_PINS_ENABLE 17
- #define LCD_PINS_D4 23
- #define LCD_PINS_D5 25
- #define LCD_PINS_D6 27
- #define LCD_PINS_D7 29
-
- #endif // !NEWPANEL
+ #endif // NEWPANEL
#endif // ULTRA_LCD
@@ -273,14 +342,3 @@
#else
#define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
#endif
-
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 52
- #define MISO_PIN 50
- #define MOSI_PIN 51
-#endif
-
-#ifndef KILL_PIN
- // #define KILL_PIN -1
-#endif
diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h
index 5655f35a1..effce9070 100644
--- a/Marlin/pins_RAMPS_13.h
+++ b/Marlin/pins_RAMPS_13.h
@@ -33,6 +33,9 @@
*
*/
-#define IS_RAMPS_13
+#ifndef BOARD_NAME
+ #define BOARD_NAME "RAMPS 1.3"
+#endif
-#include "pins_RAMPS_14.h"
+#define IS_RAMPS_13
+#include "pins_RAMPS.h"
diff --git a/Marlin/pins_RAMPS_OLD.h b/Marlin/pins_RAMPS_OLD.h
index e731d65c4..213bd3f1e 100644
--- a/Marlin/pins_RAMPS_OLD.h
+++ b/Marlin/pins_RAMPS_OLD.h
@@ -28,6 +28,8 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "MEGA/RAMPS <1.2"
+
// Uncomment the following line for RAMPS v1.0
//#define RAMPS_V_1_0
@@ -76,10 +78,3 @@
#else
#define MAX6675_SS 66// Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
#endif
-
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 52
- #define MISO_PIN 50
- #define MOSI_PIN 51
-#endif
diff --git a/Marlin/pins_RIGIDBOARD.h b/Marlin/pins_RIGIDBOARD.h
index 69ce67d87..a60e492ac 100644
--- a/Marlin/pins_RIGIDBOARD.h
+++ b/Marlin/pins_RIGIDBOARD.h
@@ -24,19 +24,15 @@
* RIGIDBOARD Arduino Mega with RAMPS v1.4 pin assignments
*/
-#include "pins_RAMPS_14.h"
+#define BOARD_NAME "RigidBoard"
-#if ENABLED(Z_MIN_PROBE_ENDSTOP)
- #undef Z_MAX_PIN
- #define Z_MAX_PIN -1
- #undef Z_MIN_PROBE_PIN
+#define RAMPS_D10_PIN 9 // EXTRUDER 1
+#define MOSFET_D_PIN 12 // EXTRUDER 2 or FAN
+#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 19 // Z-MAX pin J14 End Stops
#endif
-#undef HEATER_0_PIN
-#undef HEATER_1_PIN
-#define HEATER_0_PIN 9 // EXTRUDER 1
-#define HEATER_1_PIN 12 // EXTRUDER 2 (FAN On Sprinter)
+#include "pins_RAMPS.h"
#undef TEMP_0_PIN
#undef TEMP_1_PIN
diff --git a/Marlin/pins_RIGIDBOARD_V2.h b/Marlin/pins_RIGIDBOARD_V2.h
new file mode 100644
index 000000000..7aad12e9a
--- /dev/null
+++ b/Marlin/pins_RIGIDBOARD_V2.h
@@ -0,0 +1,43 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/**
+ * RIGIDBOARD V2 Arduino Mega with RAMPS v1.4 pin assignments
+ */
+
+#include "pins_RIGIDBOARD.h"
+
+#undef BOARD_NAME
+#define BOARD_NAME "RigidBoard V2"
+
+// I2C based DAC like on the Printrboard REVF
+#define DAC_STEPPER_CURRENT
+// Channels available for DAC, For Rigidboard there are 4
+#define DAC_STEPPER_ORDER {0,1,2,3}
+
+#define DAC_STEPPER_SENSE 0.11
+#define DAC_STEPPER_ADDRESS 0
+#define DAC_STEPPER_MAX 5000
+#define DAC_STEPPER_VREF 1 //internal Vref, gain 1x = 2.048V
+#define DAC_STEPPER_GAIN 0
+#define DAC_DISABLE_PIN 42 // set low to enable DAC
+#define DAC_OR_ADDRESS 0x01
diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h
index d92f3a835..ec5e0236e 100644
--- a/Marlin/pins_RUMBA.h
+++ b/Marlin/pins_RUMBA.h
@@ -28,11 +28,12 @@
#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
#endif
-#if EXTRUDERS > 3
- #error "RUMBA supports up to 3 extruders. Comment this line to keep going."
+#if E_STEPPERS > 3 || HOTENDS > 3
+ #error "RUMBA supports up to 3 hotends / E-steppers. Comment this line to keep going."
#endif
#define DEFAULT_MACHINE_NAME "Rumba"
+#define BOARD_NAME "Rumba"
#define X_STEP_PIN 17
#define X_DIR_PIN 16
@@ -52,8 +53,7 @@
#define Z_MIN_PIN 33
#define Z_MAX_PIN 32
-#if ENABLED(Z_MIN_PROBE_ENDSTOP)
- // Define a pin to use as the signal pin on Arduino for the Z probe endstop.
+#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 33
#endif
@@ -77,43 +77,36 @@
#define PS_ON_PIN 45
#define KILL_PIN 46
-#if TEMP_SENSOR_0 != 0
- #define HEATER_0_PIN 2 // EXTRUDER 1
- #if TEMP_SENSOR_0 == -1
- #define TEMP_0_PIN 6 // ANALOG NUMBERING - connector *K1* on RUMBA thermocouple ADD ON is used
- #else
- #define TEMP_0_PIN 15 // ANALOG NUMBERING - default connector for thermistor *T0* on rumba board is used
- #endif
+#define HEATER_0_PIN 2 // EXTRUDER 1
+#define HEATER_1_PIN 3 // EXTRUDER 2
+#define HEATER_2_PIN 6 // EXTRUDER 3
+
+#if TEMP_SENSOR_0 == -1
+ #define TEMP_0_PIN 6 // ANALOG NUMBERING - connector *K1* on RUMBA thermocouple ADD ON is used
+#else
+ #define TEMP_0_PIN 15 // ANALOG NUMBERING - default connector for thermistor *T0* on rumba board is used
#endif
-#if TEMP_SENSOR_1 != 0
- #define HEATER_1_PIN 3 // EXTRUDER 2
- #if TEMP_SENSOR_1 == -1
- #define TEMP_1_PIN 5 // ANALOG NUMBERING - connector *K2* on RUMBA thermocouple ADD ON is used
- #else
- #define TEMP_1_PIN 14 // ANALOG NUMBERING - default connector for thermistor *T1* on rumba board is used
- #endif
+#if TEMP_SENSOR_1 == -1
+ #define TEMP_1_PIN 5 // ANALOG NUMBERING - connector *K2* on RUMBA thermocouple ADD ON is used
+#else
+ #define TEMP_1_PIN 14 // ANALOG NUMBERING - default connector for thermistor *T1* on rumba board is used
#endif
-#if TEMP_SENSOR_2 != 0
- #define HEATER_2_PIN 6 // EXTRUDER 3
- #if TEMP_SENSOR_2 == -1
- #define TEMP_2_PIN 7 // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_BED is defined as thermocouple
- #else
- #define TEMP_2_PIN 13 // ANALOG NUMBERING - default connector for thermistor *T2* on rumba board is used
- #endif
+#if TEMP_SENSOR_2 == -1
+ #define TEMP_2_PIN 7 // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_BED is defined as thermocouple
+#else
+ #define TEMP_2_PIN 13 // ANALOG NUMBERING - default connector for thermistor *T2* on rumba board is used
#endif
//optional for extruder 4 or chamber: #define TEMP_X_PIN 12 // ANALOG NUMBERING - default connector for thermistor *T3* on rumba board is used
//optional FAN1 can be used as 4th heater output: #define HEATER_3_PIN 8 // EXTRUDER 4
-#if TEMP_SENSOR_BED != 0
- #define HEATER_BED_PIN 9 // BED
- #if TEMP_SENSOR_BED == -1
- #define TEMP_BED_PIN 7 // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_2 is defined as thermocouple
- #else
- #define TEMP_BED_PIN 11 // ANALOG NUMBERING - default connector for thermistor *THB* on rumba board is used
- #endif
+#define HEATER_BED_PIN 9 // BED
+#if TEMP_SENSOR_BED == -1
+ #define TEMP_BED_PIN 7 // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_2 is defined as thermocouple
+#else
+ #define TEMP_BED_PIN 11 // ANALOG NUMBERING - default connector for thermistor *THB* on rumba board is used
#endif
#define SDSS 53
diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h
index 518cf501e..8d272ada4 100644
--- a/Marlin/pins_SAINSMART_2IN1.h
+++ b/Marlin/pins_SAINSMART_2IN1.h
@@ -24,13 +24,15 @@
* Sainsmart 2-in-1 pin assignments
*/
-#include "pins_RAMPS_14_EFB.h"
+#if HOTENDS > 2
+ #error "Sainsmart 2-in-1 supports up to 2 hotends. Comment this line to keep going."
+#endif
-#undef FAN_PIN
-#define FAN_PIN 7 // PART FAN in front of board next to Extruder heat
+#define BOARD_NAME "Sainsmart"
-#undef HEATER_0_PIN
-#define HEATER_0_PIN 9 // EXTRUDER 1
+#define RAMPS_D10_PIN 9 // E
+#define RAMPS_D9_PIN 7 // F PART FAN in front of board next to Extruder heat
+ // RAMPS_D8_PIN 8 // B
+#define MOSFET_D_PIN 10 // F / E
-#undef HEATER_1_PIN
-#define HEATER_1_PIN 10 // EXTRUDER 2
+#include "pins_RAMPS.h"
diff --git a/Marlin/pins_SANGUINOLOLU_11.h b/Marlin/pins_SANGUINOLOLU_11.h
index bd7722640..a6220c596 100644
--- a/Marlin/pins_SANGUINOLOLU_11.h
+++ b/Marlin/pins_SANGUINOLOLU_11.h
@@ -28,6 +28,12 @@
#error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu."
#endif
+#ifndef BOARD_NAME
+ #define BOARD_NAME "Sanguinololu <1.2"
+#endif
+
+#define IS_MELZI (MB(MELZI) || MB(MELZI_MAKR3D))
+
#define X_STEP_PIN 15
#define X_DIR_PIN 21
#define X_STOP_PIN 18
@@ -43,11 +49,11 @@
#define E0_STEP_PIN 1
#define E0_DIR_PIN 0
-#if MB(AZTEEG_X1) || MB(STB_11) || MB(MELZI)
+#if MB(AZTEEG_X1) || MB(STB_11) || IS_MELZI
#define FAN_PIN 4 // Works for Panelolu2 too
#endif
-#if MB(MELZI)
+#if IS_MELZI
#define LED_PIN 27 // On some broken versions of the Sanguino libraries the pin definitions are wrong, so LED_PIN needs to be 28. But you should upgrade your Sanguino libraries! See #368.
#elif MB(STB_11)
#define LCD_PIN_BL 17 // LCD backlight LED
@@ -101,11 +107,14 @@
#if ENABLED(U8GLIB_ST7920) //SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
- #if MB(MELZI) // Melzi board
+ #if IS_MELZI // Melzi board
#define LCD_PINS_RS 30 //CS chip select /SS chip slave select
#define LCD_PINS_ENABLE 29 //SID (MOSI)
#define LCD_PINS_D4 17 //SCK (CLK) clock
- #define BEEPER_PIN 27 // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with Marlin so this can be used for BEEPER_PIN. You can use this pin with M42 instead of BEEPER_PIN.
+ // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with
+ // Marlin so this can be used for BEEPER_PIN. You can use this pin
+ // with M42 instead of BEEPER_PIN.
+ #define BEEPER_PIN 27
#else // Sanguinololu 1.3
#define LCD_PINS_RS 4
#define LCD_PINS_ENABLE 17
@@ -144,7 +153,7 @@
#define BTN_EN1 11
#define BTN_EN2 10
#if ENABLED(LCD_I2C_PANELOLU2)
- #if MB(MELZI)
+ #if IS_MELZI
#define BTN_ENC 29
#define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi
#else
diff --git a/Marlin/pins_SANGUINOLOLU_12.h b/Marlin/pins_SANGUINOLOLU_12.h
index 84d86275e..f214d6f02 100644
--- a/Marlin/pins_SANGUINOLOLU_12.h
+++ b/Marlin/pins_SANGUINOLOLU_12.h
@@ -32,10 +32,11 @@
* STB_11
*/
-#define SANGUINOLOLU_V_1_2
+#define BOARD_NAME "Sanguinololu 1.2"
#if defined(__AVR_ATmega1284P__)
#define LARGE_FLASH true
#endif
+#define SANGUINOLOLU_V_1_2
#include "pins_SANGUINOLOLU_11.h"
diff --git a/Marlin/pins_SAV_MKI.h b/Marlin/pins_SAV_MKI.h
index b6f4504ba..530f63ada 100644
--- a/Marlin/pins_SAV_MKI.h
+++ b/Marlin/pins_SAV_MKI.h
@@ -33,6 +33,7 @@
#define DEFAULT_MACHINE_NAME "SAV MkI"
#define DEFAULT_SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
+#define BOARD_NAME "SAV MkI"
#define LARGE_FLASH true
@@ -64,12 +65,6 @@
#define TEMP_0_PIN 7 // Extruder / Analog pin numbering
#define TEMP_BED_PIN 6 // Bed / Analog pin numbering
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 9
- #define MISO_PIN 11
- #define MOSI_PIN 10
-#endif
#define SDSS 20 // PB0 - 8 in marlin env.
// Extension header pin mapping
diff --git a/Marlin/pins_SETHI.h b/Marlin/pins_SETHI.h
index a3e01e282..ff154acf5 100644
--- a/Marlin/pins_SETHI.h
+++ b/Marlin/pins_SETHI.h
@@ -28,6 +28,8 @@
#error "Oops! Make sure you have 'Sethi 3D' selected from the 'Tools -> Boards' menu."
#endif
+#define BOARD_NAME "Sethi 3D_1"
+
#ifndef GEN7_VERSION
#define GEN7_VERSION 12 // v1.x
#endif
diff --git a/Marlin/pins_STB_11.h b/Marlin/pins_STB_11.h
index 9ca93a3f7..318dc39c0 100644
--- a/Marlin/pins_STB_11.h
+++ b/Marlin/pins_STB_11.h
@@ -24,10 +24,11 @@
* STB V1.1 pin assignments
*/
-#define SANGUINOLOLU_V_1_2
+#define BOARD_NAME "STB V1.1"
#if defined(__AVR_ATmega1284P__)
#define LARGE_FLASH true
#endif
+#define SANGUINOLOLU_V_1_2
#include "pins_SANGUINOLOLU_11.h"
diff --git a/Marlin/pins_TEENSY2.h b/Marlin/pins_TEENSY2.h
index 1fe1342c5..f4f7d4c01 100644
--- a/Marlin/pins_TEENSY2.h
+++ b/Marlin/pins_TEENSY2.h
@@ -74,6 +74,8 @@
// (or build from command line)
#endif
+#define BOARD_NAME "Teensy++2.0"
+
#define LARGE_FLASH true
#define X_STEP_PIN 28 // 0 Marlin
@@ -107,13 +109,6 @@
#define LED_PIN 6
#define PS_ON_PIN 27
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 21 // 9
- #define MISO_PIN 23 // 11
- #define MOSI_PIN 22 // 10
-#endif
-
#if ENABLED(ULTIPANEL)
#define LCD_PINS_RS 8
#define LCD_PINS_ENABLE 9
diff --git a/Marlin/pins_TEENSYLU.h b/Marlin/pins_TEENSYLU.h
index 047d803f4..775837767 100644
--- a/Marlin/pins_TEENSYLU.h
+++ b/Marlin/pins_TEENSYLU.h
@@ -35,6 +35,8 @@
#error "These Teensylu assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h"
#endif
+#define BOARD_NAME "Teensylu"
+
#define LARGE_FLASH true
#define X_STEP_PIN 0
@@ -74,13 +76,6 @@
#define SDSS 8
-#if DISABLED(SDSUPPORT)
- // these pins are defined in the SD library if building with SD support
- #define SCK_PIN 9
- #define MISO_PIN 11
- #define MOSI_PIN 10
-#endif
-
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
#define BEEPER_PIN -1
diff --git a/Marlin/pins_ULTIMAIN_2.h b/Marlin/pins_ULTIMAIN_2.h
index 792e62117..c2de0a426 100644
--- a/Marlin/pins_ULTIMAIN_2.h
+++ b/Marlin/pins_ULTIMAIN_2.h
@@ -30,6 +30,7 @@
#define DEFAULT_MACHINE_NAME "Ultimaker"
#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin"
+#define BOARD_NAME "Ultimaker 2.x"
#define X_STEP_PIN 25
#define X_DIR_PIN 23
@@ -88,10 +89,6 @@
//buttons are directly attached
#define BTN_EN1 40
#define BTN_EN2 41
-#define BTN_ENC 19 //the click
-
-#define BLEN_C 2
-#define BLEN_B 1
-#define BLEN_A 0
+#define BTN_ENC 19
#define SD_DETECT_PIN 39
diff --git a/Marlin/pins_ULTIMAKER.h b/Marlin/pins_ULTIMAKER.h
index aab43ecb0..d770f3a61 100644
--- a/Marlin/pins_ULTIMAKER.h
+++ b/Marlin/pins_ULTIMAKER.h
@@ -30,6 +30,7 @@
#define DEFAULT_MACHINE_NAME "Ultimaker"
#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin"
+#define BOARD_NAME "Ultimaker"
#define LARGE_FLASH true
diff --git a/Marlin/pins_ULTIMAKER_OLD.h b/Marlin/pins_ULTIMAKER_OLD.h
index b13e1f572..33bc26c9a 100644
--- a/Marlin/pins_ULTIMAKER_OLD.h
+++ b/Marlin/pins_ULTIMAKER_OLD.h
@@ -30,6 +30,7 @@
#define DEFAULT_MACHINE_NAME "Ultimaker"
#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin"
+#define BOARD_NAME "Ultimaker <1.5.4"
#define LARGE_FLASH true
diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp
index d38f2d367..4e4d4a189 100644
--- a/Marlin/planner.cpp
+++ b/Marlin/planner.cpp
@@ -58,13 +58,14 @@
*
*/
-#include "Marlin.h"
#include "planner.h"
#include "stepper.h"
#include "temperature.h"
#include "ultralcd.h"
#include "language.h"
+#include "Marlin.h"
+
#if ENABLED(MESH_BED_LEVELING)
#include "mesh_bed_leveling.h"
#endif
@@ -80,29 +81,31 @@ block_t Planner::block_buffer[BLOCK_BUFFER_SIZE];
volatile uint8_t Planner::block_buffer_head = 0; // Index of the next block to be pushed
volatile uint8_t Planner::block_buffer_tail = 0;
-float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
-float Planner::axis_steps_per_unit[NUM_AXIS];
-unsigned long Planner::axis_steps_per_sqr_second[NUM_AXIS];
-unsigned long Planner::max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
+float Planner::max_feedrate_mm_s[NUM_AXIS], // Max speeds in mm per second
+ Planner::axis_steps_per_mm[NUM_AXIS],
+ Planner::steps_to_mm[NUM_AXIS];
+
+unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS],
+ Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
millis_t Planner::min_segment_time;
-float Planner::min_feedrate;
-float Planner::acceleration; // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX
-float Planner::retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
-float Planner::travel_acceleration; // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
-float Planner::max_xy_jerk; // The largest speed change requiring no acceleration
-float Planner::max_z_jerk;
-float Planner::max_e_jerk;
-float Planner::min_travel_feedrate;
+float Planner::min_feedrate_mm_s,
+ Planner::acceleration, // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX
+ Planner::retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
+ Planner::travel_acceleration, // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
+ Planner::max_xy_jerk, // The largest speed change requiring no acceleration
+ Planner::max_z_jerk,
+ Planner::max_e_jerk,
+ Planner::min_travel_feedrate_mm_s;
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level
#endif
#if ENABLED(AUTOTEMP)
- float Planner::autotemp_max = 250;
- float Planner::autotemp_min = 210;
- float Planner::autotemp_factor = 0.1;
+ float Planner::autotemp_max = 250,
+ Planner::autotemp_min = 210,
+ Planner::autotemp_factor = 0.1;
bool Planner::autotemp_enabled = false;
#endif
@@ -110,9 +113,8 @@ float Planner::min_travel_feedrate;
long Planner::position[NUM_AXIS] = { 0 };
-float Planner::previous_speed[NUM_AXIS];
-
-float Planner::previous_nominal_speed;
+float Planner::previous_speed[NUM_AXIS],
+ Planner::previous_nominal_speed;
#if ENABLED(DISABLE_INACTIVE_EXTRUDER)
uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 };
@@ -129,18 +131,16 @@ float Planner::previous_nominal_speed;
* Class and Instance Methods
*/
-Planner::Planner() {
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- bed_level_matrix.set_to_identity();
- #endif
- init();
-}
+Planner::Planner() { init(); }
void Planner::init() {
block_buffer_head = block_buffer_tail = 0;
memset(position, 0, sizeof(position)); // clear position
- for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = 0.0;
+ LOOP_XYZE(i) previous_speed[i] = 0.0;
previous_nominal_speed = 0.0;
+ #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ bed_level_matrix.set_to_identity();
+ #endif
}
/**
@@ -155,26 +155,26 @@ void Planner::calculate_trapezoid_for_block(block_t* block, float entry_factor,
NOLESS(initial_rate, 120);
NOLESS(final_rate, 120);
- long acceleration = block->acceleration_st;
- int32_t accelerate_steps = ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, acceleration));
- int32_t decelerate_steps = floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -acceleration));
+ long accel = block->acceleration_steps_per_s2;
+ int32_t accelerate_steps = ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel));
+ int32_t decelerate_steps = floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel));
// Calculate the size of Plateau of Nominal Rate.
int32_t plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps;
// Is the Plateau of Nominal Rate smaller than nothing? That means no cruising, and we will
- // have to use intersection_distance() to calculate when to abort acceleration and start braking
+ // have to use intersection_distance() to calculate when to abort accel and start braking
// in order to reach the final_rate exactly at the end of this block.
if (plateau_steps < 0) {
- accelerate_steps = ceil(intersection_distance(initial_rate, final_rate, acceleration, block->step_event_count));
+ accelerate_steps = ceil(intersection_distance(initial_rate, final_rate, accel, block->step_event_count));
accelerate_steps = max(accelerate_steps, 0); // Check limits due to numerical round-off
accelerate_steps = min((uint32_t)accelerate_steps, block->step_event_count);//(We can cast here to unsigned, because the above line ensures that we are above zero)
plateau_steps = 0;
}
#if ENABLED(ADVANCE)
- volatile long initial_advance = block->advance * entry_factor * entry_factor;
- volatile long final_advance = block->advance * exit_factor * exit_factor;
+ volatile long initial_advance = block->advance * sq(entry_factor);
+ volatile long final_advance = block->advance * sq(exit_factor);
#endif // ADVANCE
// block->accelerate_until = accelerate_steps;
@@ -386,7 +386,7 @@ void Planner::recalculate() {
#endif //AUTOTEMP
/**
- * Maintain fans, paste extruder pressure,
+ * Maintain fans, paste extruder pressure,
*/
void Planner::check_axes_activity() {
unsigned char axis_active[NUM_AXIS] = { 0 },
@@ -397,8 +397,12 @@ void Planner::check_axes_activity() {
#endif
#if ENABLED(BARICUDA)
- unsigned char tail_valve_pressure = baricuda_valve_pressure,
- tail_e_to_p_pressure = baricuda_e_to_p_pressure;
+ #if HAS_HEATER_1
+ unsigned char tail_valve_pressure = baricuda_valve_pressure;
+ #endif
+ #if HAS_HEATER_2
+ unsigned char tail_e_to_p_pressure = baricuda_e_to_p_pressure;
+ #endif
#endif
if (blocks_queued()) {
@@ -411,13 +415,17 @@ void Planner::check_axes_activity() {
#if ENABLED(BARICUDA)
block = &block_buffer[block_buffer_tail];
- tail_valve_pressure = block->valve_pressure;
- tail_e_to_p_pressure = block->e_to_p_pressure;
+ #if HAS_HEATER_1
+ tail_valve_pressure = block->valve_pressure;
+ #endif
+ #if HAS_HEATER_2
+ tail_e_to_p_pressure = block->e_to_p_pressure;
+ #endif
#endif
for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) {
block = &block_buffer[b];
- for (int i = 0; i < NUM_AXIS; i++) if (block->steps[i]) axis_active[i]++;
+ LOOP_XYZE(i) if (block->steps[i]) axis_active[i]++;
}
}
#if ENABLED(DISABLE_X)
@@ -521,14 +529,14 @@ void Planner::check_axes_activity() {
* Add a new linear movement to the buffer.
*
* x,y,z,e - target position in mm
- * feed_rate - (target) speed of the move
+ * fr_mm_s - (target) speed of the move
* extruder - target extruder
*/
#if ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(MESH_BED_LEVELING)
- void Planner::buffer_line(float x, float y, float z, const float& e, float feed_rate, const uint8_t extruder)
+ void Planner::buffer_line(float x, float y, float z, const float& e, float fr_mm_s, const uint8_t extruder)
#else
- void Planner::buffer_line(const float& x, const float& y, const float& z, const float& e, float feed_rate, const uint8_t extruder)
+ void Planner::buffer_line(const float& x, const float& y, const float& z, const float& e, float fr_mm_s, const uint8_t extruder)
#endif // AUTO_BED_LEVELING_FEATURE
{
// Calculate the buffer head after we push this byte
@@ -539,7 +547,8 @@ void Planner::check_axes_activity() {
while (block_buffer_tail == next_buffer_head) idle();
#if ENABLED(MESH_BED_LEVELING)
- if (mbl.active) z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]);
+ if (mbl.active())
+ z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]);
#elif ENABLED(AUTO_BED_LEVELING_FEATURE)
apply_rotation_xyz(bed_level_matrix, x, y, z);
#endif
@@ -548,10 +557,10 @@ void Planner::check_axes_activity() {
// Calculate target position in absolute steps
//this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow
long target[NUM_AXIS] = {
- lround(x * axis_steps_per_unit[X_AXIS]),
- lround(y * axis_steps_per_unit[Y_AXIS]),
- lround(z * axis_steps_per_unit[Z_AXIS]),
- lround(e * axis_steps_per_unit[E_AXIS])
+ lround(x * axis_steps_per_mm[X_AXIS]),
+ lround(y * axis_steps_per_mm[Y_AXIS]),
+ lround(z * axis_steps_per_mm[Z_AXIS]),
+ lround(e * axis_steps_per_mm[E_AXIS])
};
long dx = target[X_AXIS] - position[X_AXIS],
@@ -573,7 +582,7 @@ void Planner::check_axes_activity() {
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
}
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
- if (labs(de) > axis_steps_per_unit[E_AXIS] * (EXTRUDE_MAXLENGTH)) {
+ if (labs(de) > axis_steps_per_mm[E_AXIS] * (EXTRUDE_MAXLENGTH)) {
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
de = 0; // no difference
SERIAL_ECHO_START;
@@ -622,6 +631,12 @@ void Planner::check_axes_activity() {
// Bail if this is a zero-length block
if (block->step_event_count <= dropsegments) return;
+ // For a mixing extruder, get a magnified step_event_count for each
+ #if ENABLED(MIXING_EXTRUDER)
+ for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
+ block->mix_event_count[i] = (mixing_factor[i] < 0.0001) ? 0 : block->step_event_count / mixing_factor[i];
+ #endif
+
#if FAN_COUNT > 0
for (uint8_t i = 0; i < FAN_COUNT; i++) block->fan_speed[i] = fanSpeeds[i];
#endif
@@ -755,9 +770,9 @@ void Planner::check_axes_activity() {
}
if (block->steps[E_AXIS])
- NOLESS(feed_rate, min_feedrate);
+ NOLESS(fr_mm_s, min_feedrate_mm_s);
else
- NOLESS(feed_rate, min_travel_feedrate);
+ NOLESS(fr_mm_s, min_travel_feedrate_mm_s);
/**
* This part of the code calculates the total length of the movement.
@@ -768,33 +783,33 @@ void Planner::check_axes_activity() {
* Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
*/
#if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
- float delta_mm[6];
+ float delta_mm[7];
#if ENABLED(COREXY)
- delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
- delta_mm[Y_HEAD] = dy / axis_steps_per_unit[B_AXIS];
- delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
- delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_unit[A_AXIS];
- delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_unit[B_AXIS];
+ delta_mm[X_HEAD] = dx * steps_to_mm[A_AXIS];
+ delta_mm[Y_HEAD] = dy * steps_to_mm[B_AXIS];
+ delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS];
+ delta_mm[A_AXIS] = (dx + dy) * steps_to_mm[A_AXIS];
+ delta_mm[B_AXIS] = (dx - dy) * steps_to_mm[B_AXIS];
#elif ENABLED(COREXZ)
- delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
- delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
- delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS];
- delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_unit[A_AXIS];
- delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_unit[C_AXIS];
+ delta_mm[X_HEAD] = dx * steps_to_mm[A_AXIS];
+ delta_mm[Y_AXIS] = dy * steps_to_mm[Y_AXIS];
+ delta_mm[Z_HEAD] = dz * steps_to_mm[C_AXIS];
+ delta_mm[A_AXIS] = (dx + dz) * steps_to_mm[A_AXIS];
+ delta_mm[C_AXIS] = (dx - dz) * steps_to_mm[C_AXIS];
#elif ENABLED(COREYZ)
- delta_mm[X_AXIS] = dx / axis_steps_per_unit[A_AXIS];
- delta_mm[Y_HEAD] = dy / axis_steps_per_unit[Y_AXIS];
- delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS];
- delta_mm[B_AXIS] = (dy + dz) / axis_steps_per_unit[B_AXIS];
- delta_mm[C_AXIS] = (dy - dz) / axis_steps_per_unit[C_AXIS];
+ delta_mm[X_AXIS] = dx * steps_to_mm[X_AXIS];
+ delta_mm[Y_HEAD] = dy * steps_to_mm[B_AXIS];
+ delta_mm[Z_HEAD] = dz * steps_to_mm[C_AXIS];
+ delta_mm[B_AXIS] = (dy + dz) * steps_to_mm[B_AXIS];
+ delta_mm[C_AXIS] = (dy - dz) * steps_to_mm[C_AXIS];
#endif
#else
float delta_mm[4];
- delta_mm[X_AXIS] = dx / axis_steps_per_unit[X_AXIS];
- delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
- delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
+ delta_mm[X_AXIS] = dx * steps_to_mm[X_AXIS];
+ delta_mm[Y_AXIS] = dy * steps_to_mm[Y_AXIS];
+ delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS];
#endif
- delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0;
+ delta_mm[E_AXIS] = 0.01 * (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder];
if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) {
block->millimeters = fabs(delta_mm[E_AXIS]);
@@ -802,20 +817,20 @@ void Planner::check_axes_activity() {
else {
block->millimeters = sqrt(
#if ENABLED(COREXY)
- square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS])
+ sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_AXIS])
#elif ENABLED(COREXZ)
- square(delta_mm[X_HEAD]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_HEAD])
+ sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD])
#elif ENABLED(COREYZ)
- square(delta_mm[X_AXIS]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_HEAD])
+ sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD])
#else
- square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])
+ sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS])
#endif
);
}
float inverse_millimeters = 1.0 / block->millimeters; // Inverse millimeters to remove multiple divides
// Calculate moves/second for this move. No divide by zero due to previous checks.
- float inverse_second = feed_rate * inverse_millimeters;
+ float inverse_mm_s = fr_mm_s * inverse_millimeters;
int moves_queued = movesplanned();
@@ -823,25 +838,25 @@ void Planner::check_axes_activity() {
#if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN)
bool mq = moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2;
#if ENABLED(OLD_SLOWDOWN)
- if (mq) feed_rate *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE);
+ if (mq) fr_mm_s *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE);
#endif
#if ENABLED(SLOWDOWN)
// segment time im micro seconds
- unsigned long segment_time = lround(1000000.0/inverse_second);
+ unsigned long segment_time = lround(1000000.0/inverse_mm_s);
if (mq) {
if (segment_time < min_segment_time) {
// buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more.
- inverse_second = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued));
+ inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued));
#ifdef XY_FREQUENCY_LIMIT
- segment_time = lround(1000000.0 / inverse_second);
+ segment_time = lround(1000000.0 / inverse_mm_s);
#endif
}
}
#endif
#endif
- block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
- block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0
+ block->nominal_speed = block->millimeters * inverse_mm_s; // (mm/sec) Always > 0
+ block->nominal_rate = ceil(block->step_event_count * inverse_mm_s); // (step/sec) Always > 0
#if ENABLED(FILAMENT_WIDTH_SENSOR)
static float filwidth_e_count = 0, filwidth_delay_dist = 0;
@@ -862,7 +877,7 @@ void Planner::check_axes_activity() {
while (filwidth_delay_dist >= MMD_MM) filwidth_delay_dist -= MMD_MM;
// Convert into an index into the measurement array
- filwidth_delay_index1 = (int)(filwidth_delay_dist / 10.0 + 0.0001);
+ filwidth_delay_index1 = (int)(filwidth_delay_dist * 0.1 + 0.0001);
// If the index has changed (must have gone forward)...
if (filwidth_delay_index1 != filwidth_delay_index2) {
@@ -880,9 +895,9 @@ void Planner::check_axes_activity() {
// Calculate and limit speed in mm/sec for each axis
float current_speed[NUM_AXIS];
float speed_factor = 1.0; //factor <=1 do decrease speed
- for (int i = 0; i < NUM_AXIS; i++) {
- current_speed[i] = delta_mm[i] * inverse_second;
- float cs = fabs(current_speed[i]), mf = max_feedrate[i];
+ LOOP_XYZE(i) {
+ current_speed[i] = delta_mm[i] * inverse_mm_s;
+ float cs = fabs(current_speed[i]), mf = max_feedrate_mm_s[i];
if (cs > mf) speed_factor = min(speed_factor, mf / cs);
}
@@ -926,38 +941,30 @@ void Planner::check_axes_activity() {
// Correct the speed
if (speed_factor < 1.0) {
- for (unsigned char i = 0; i < NUM_AXIS; i++) current_speed[i] *= speed_factor;
+ LOOP_XYZE(i) current_speed[i] *= speed_factor;
block->nominal_speed *= speed_factor;
block->nominal_rate *= speed_factor;
}
// Compute and limit the acceleration rate for the trapezoid generator.
float steps_per_mm = block->step_event_count / block->millimeters;
- long bsx = block->steps[X_AXIS], bsy = block->steps[Y_AXIS], bsz = block->steps[Z_AXIS], bse = block->steps[E_AXIS];
- if (bsx == 0 && bsy == 0 && bsz == 0) {
- block->acceleration_st = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
- }
- else if (bse == 0) {
- block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
+ if (!block->steps[X_AXIS] && !block->steps[Y_AXIS] && !block->steps[Z_AXIS]) {
+ block->acceleration_steps_per_s2 = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
}
else {
- block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
+ // Limit acceleration per axis
+ block->acceleration_steps_per_s2 = ceil((block->steps[E_AXIS] ? acceleration : travel_acceleration) * steps_per_mm);
+ if (max_acceleration_steps_per_s2[X_AXIS] < (block->acceleration_steps_per_s2 * block->steps[X_AXIS]) / block->step_event_count)
+ block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[X_AXIS] * block->step_event_count) / block->steps[X_AXIS];
+ if (max_acceleration_steps_per_s2[Y_AXIS] < (block->acceleration_steps_per_s2 * block->steps[Y_AXIS]) / block->step_event_count)
+ block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[Y_AXIS] * block->step_event_count) / block->steps[Y_AXIS];
+ if (max_acceleration_steps_per_s2[Z_AXIS] < (block->acceleration_steps_per_s2 * block->steps[Z_AXIS]) / block->step_event_count)
+ block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[Z_AXIS] * block->step_event_count) / block->steps[Z_AXIS];
+ if (max_acceleration_steps_per_s2[E_AXIS] < (block->acceleration_steps_per_s2 * block->steps[E_AXIS]) / block->step_event_count)
+ block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[E_AXIS] * block->step_event_count) / block->steps[E_AXIS];
}
- // Limit acceleration per axis
- unsigned long acc_st = block->acceleration_st,
- xsteps = axis_steps_per_sqr_second[X_AXIS],
- ysteps = axis_steps_per_sqr_second[Y_AXIS],
- zsteps = axis_steps_per_sqr_second[Z_AXIS],
- esteps = axis_steps_per_sqr_second[E_AXIS],
- allsteps = block->step_event_count;
- if (xsteps < (acc_st * bsx) / allsteps) acc_st = (xsteps * allsteps) / bsx;
- if (ysteps < (acc_st * bsy) / allsteps) acc_st = (ysteps * allsteps) / bsy;
- if (zsteps < (acc_st * bsz) / allsteps) acc_st = (zsteps * allsteps) / bsz;
- if (esteps < (acc_st * bse) / allsteps) acc_st = (esteps * allsteps) / bse;
-
- block->acceleration_st = acc_st;
- block->acceleration = acc_st / steps_per_mm;
- block->acceleration_rate = (long)(acc_st * 16777216.0 / (F_CPU / 8.0));
+ block->acceleration = block->acceleration_steps_per_s2 / steps_per_mm;
+ block->acceleration_rate = (long)(block->acceleration_steps_per_s2 * 16777216.0 / ((F_CPU) * 0.125));
#if 0 // Use old jerk for now
@@ -1003,10 +1010,12 @@ void Planner::check_axes_activity() {
#endif
// Start with a safe speed
- float vmax_junction = max_xy_jerk / 2;
- float vmax_junction_factor = 1.0;
- float mz2 = max_z_jerk / 2, me2 = max_e_jerk / 2;
- float csz = current_speed[Z_AXIS], cse = current_speed[E_AXIS];
+ float vmax_junction = max_xy_jerk * 0.5,
+ vmax_junction_factor = 1.0,
+ mz2 = max_z_jerk * 0.5,
+ me2 = max_e_jerk * 0.5,
+ csz = current_speed[Z_AXIS],
+ cse = current_speed[E_AXIS];
if (fabs(csz) > mz2) vmax_junction = min(vmax_junction, mz2);
if (fabs(cse) > me2) vmax_junction = min(vmax_junction, me2);
vmax_junction = min(vmax_junction, block->nominal_speed);
@@ -1017,7 +1026,7 @@ void Planner::check_axes_activity() {
dsy = current_speed[Y_AXIS] - previous_speed[Y_AXIS],
dsz = fabs(csz - previous_speed[Z_AXIS]),
dse = fabs(cse - previous_speed[E_AXIS]),
- jerk = sqrt(dsx * dsx + dsy * dsy);
+ jerk = HYPOT(dsx, dsy);
// if ((fabs(previous_speed[X_AXIS]) > 0.0001) || (fabs(previous_speed[Y_AXIS]) > 0.0001)) {
vmax_junction = block->nominal_speed;
@@ -1046,18 +1055,34 @@ void Planner::check_axes_activity() {
block->recalculate_flag = true; // Always calculate trapezoid for new block
// Update previous path unit_vector and nominal speed
- for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = current_speed[i];
+ LOOP_XYZE(i) previous_speed[i] = current_speed[i];
previous_nominal_speed = block->nominal_speed;
- #if ENABLED(ADVANCE)
+ #if ENABLED(LIN_ADVANCE)
+
+ // block->steps[E_AXIS] == block->step_event_count: A problem occurs when there's a very tiny move before a retract.
+ // In this case, the retract and the move will be executed together.
+ // This leads to an enormous number of advance steps due to a huge e_acceleration.
+ // The math is correct, but you don't want a retract move done with advance!
+ // So this situation is filtered out here.
+ if (!block->steps[E_AXIS] || (!block->steps[X_AXIS] && !block->steps[Y_AXIS] && !block->steps[Z_AXIS]) || stepper.get_advance_k() == 0 || (uint32_t) block->steps[E_AXIS] == block->step_event_count) {
+ block->use_advance_lead = false;
+ }
+ else {
+ block->use_advance_lead = true;
+ block->e_speed_multiplier8 = (block->steps[E_AXIS] << 8) / block->step_event_count;
+ }
+
+ #elif ENABLED(ADVANCE)
+
// Calculate advance rate
- if (!bse || (!bsx && !bsy && !bsz)) {
+ if (!block->steps[E_AXIS] || (!block->steps[X_AXIS] && !block->steps[Y_AXIS] && !block->steps[Z_AXIS])) {
block->advance_rate = 0;
block->advance = 0;
}
else {
- long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_st);
- float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * (cse * cse * (EXTRUSION_AREA) * (EXTRUSION_AREA)) * 256;
+ long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_steps_per_s2);
+ float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * HYPOT(cse, EXTRUSION_AREA) * 256;
block->advance = advance;
block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;
}
@@ -1068,7 +1093,8 @@ void Planner::check_axes_activity() {
SERIAL_ECHOPGM("advance rate :");
SERIAL_ECHOLN(block->advance_rate/256.0);
*/
- #endif // ADVANCE
+
+ #endif // ADVANCE or LIN_ADVANCE
calculate_trapezoid_for_block(block, block->entry_speed / block->nominal_speed, safe_speed / block->nominal_speed);
@@ -1076,7 +1102,7 @@ void Planner::check_axes_activity() {
block_buffer_head = next_buffer_head;
// Update position
- for (int i = 0; i < NUM_AXIS; i++) position[i] = target[i];
+ LOOP_XYZE(i) position[i] = target[i];
recalculate();
@@ -1120,42 +1146,60 @@ void Planner::check_axes_activity() {
#endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING
{
#if ENABLED(MESH_BED_LEVELING)
- if (mbl.active) z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]);
+
+ if (mbl.active())
+ z += mbl.get_z(RAW_X_POSITION(x), RAW_Y_POSITION(y));
+
#elif ENABLED(AUTO_BED_LEVELING_FEATURE)
+
apply_rotation_xyz(bed_level_matrix, x, y, z);
+
#endif
- long nx = position[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]),
- ny = position[Y_AXIS] = lround(y * axis_steps_per_unit[Y_AXIS]),
- nz = position[Z_AXIS] = lround(z * axis_steps_per_unit[Z_AXIS]),
- ne = position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]);
+ long nx = position[X_AXIS] = lround(x * axis_steps_per_mm[X_AXIS]),
+ ny = position[Y_AXIS] = lround(y * axis_steps_per_mm[Y_AXIS]),
+ nz = position[Z_AXIS] = lround(z * axis_steps_per_mm[Z_AXIS]),
+ ne = position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]);
stepper.set_position(nx, ny, nz, ne);
previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
- for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = 0.0;
+ LOOP_XYZE(i) previous_speed[i] = 0.0;
}
/**
* Directly set the planner E position (hence the stepper E position).
*/
void Planner::set_e_position_mm(const float& e) {
- position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]);
+ position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]);
stepper.set_e_position(position[E_AXIS]);
+ previous_speed[E_AXIS] = 0.0;
}
// Recalculate the steps/s^2 acceleration rates, based on the mm/s^2
void Planner::reset_acceleration_rates() {
- for (int i = 0; i < NUM_AXIS; i++)
- axis_steps_per_sqr_second[i] = max_acceleration_units_per_sq_second[i] * axis_steps_per_unit[i];
+ LOOP_XYZE(i)
+ max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i];
+}
+
+// Recalculate position, steps_to_mm if axis_steps_per_mm changes!
+void Planner::refresh_positioning() {
+ LOOP_XYZE(i) steps_to_mm[i] = 1.0 / axis_steps_per_mm[i];
+ #if ENABLED(DELTA) || ENABLED(SCARA)
+ inverse_kinematics(current_position);
+ set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
+ #else
+ set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
+ #endif
+ reset_acceleration_rates();
}
#if ENABLED(AUTOTEMP)
void Planner::autotemp_M109() {
autotemp_enabled = code_seen('F');
- if (autotemp_enabled) autotemp_factor = code_value();
- if (code_seen('S')) autotemp_min = code_value();
- if (code_seen('B')) autotemp_max = code_value();
+ if (autotemp_enabled) autotemp_factor = code_value_temp_diff();
+ if (code_seen('S')) autotemp_min = code_value_temp_abs();
+ if (code_seen('B')) autotemp_max = code_value_temp_abs();
}
#endif
diff --git a/Marlin/planner.h b/Marlin/planner.h
index 96e580db9..740553668 100644
--- a/Marlin/planner.h
+++ b/Marlin/planner.h
@@ -32,7 +32,8 @@
#ifndef PLANNER_H
#define PLANNER_H
-#include "Marlin.h"
+#include "types.h"
+#include "MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
@@ -58,13 +59,21 @@ typedef struct {
long steps[NUM_AXIS]; // Step count along each axis
unsigned long step_event_count; // The number of step events required to complete this block
- long accelerate_until; // The index of the step event on which to stop acceleration
- long decelerate_after; // The index of the step event on which to start decelerating
- long acceleration_rate; // The acceleration rate used for acceleration calculation
+ #if ENABLED(MIXING_EXTRUDER)
+ unsigned long mix_event_count[MIXING_STEPPERS]; // Scaled step_event_count for the mixing steppers
+ #endif
+
+ long accelerate_until, // The index of the step event on which to stop acceleration
+ decelerate_after, // The index of the step event on which to start decelerating
+ acceleration_rate; // The acceleration rate used for acceleration calculation
unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
- #if ENABLED(ADVANCE)
+ // Advance extrusion
+ #if ENABLED(LIN_ADVANCE)
+ bool use_advance_lead;
+ int e_speed_multiplier8; // Factorised by 2^8 to avoid float
+ #elif ENABLED(ADVANCE)
long advance_rate;
volatile long initial_advance;
volatile long final_advance;
@@ -72,27 +81,26 @@ typedef struct {
#endif
// Fields used by the motion planner to manage acceleration
- float nominal_speed; // The nominal speed for this block in mm/sec
- float entry_speed; // Entry speed at previous-current junction in mm/sec
- float max_entry_speed; // Maximum allowable junction entry speed in mm/sec
- float millimeters; // The total travel of this block in mm
- float acceleration; // acceleration mm/sec^2
- unsigned char recalculate_flag; // Planner flag to recalculate trapezoids on entry junction
- unsigned char nominal_length_flag; // Planner flag for nominal speed always reached
+ float nominal_speed, // The nominal speed for this block in mm/sec
+ entry_speed, // Entry speed at previous-current junction in mm/sec
+ max_entry_speed, // Maximum allowable junction entry speed in mm/sec
+ millimeters, // The total travel of this block in mm
+ acceleration; // acceleration mm/sec^2
+ unsigned char recalculate_flag, // Planner flag to recalculate trapezoids on entry junction
+ nominal_length_flag; // Planner flag for nominal speed always reached
// Settings for the trapezoid generator
- unsigned long nominal_rate; // The nominal step rate for this block in step_events/sec
- unsigned long initial_rate; // The jerk-adjusted step rate at start of block
- unsigned long final_rate; // The minimal rate at exit
- unsigned long acceleration_st; // acceleration steps/sec^2
+ unsigned long nominal_rate, // The nominal step rate for this block in step_events/sec
+ initial_rate, // The jerk-adjusted step rate at start of block
+ final_rate, // The minimal rate at exit
+ acceleration_steps_per_s2; // acceleration steps/sec^2
#if FAN_COUNT > 0
unsigned long fan_speed[FAN_COUNT];
#endif
#if ENABLED(BARICUDA)
- unsigned long valve_pressure;
- unsigned long e_to_p_pressure;
+ unsigned long valve_pressure, e_to_p_pressure;
#endif
volatile char busy;
@@ -112,20 +120,21 @@ class Planner {
static volatile uint8_t block_buffer_head; // Index of the next block to be pushed
static volatile uint8_t block_buffer_tail;
- static float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
- static float axis_steps_per_unit[NUM_AXIS];
- static unsigned long axis_steps_per_sqr_second[NUM_AXIS];
- static unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
+ static float max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second
+ static float axis_steps_per_mm[NUM_AXIS];
+ static float steps_to_mm[NUM_AXIS];
+ static unsigned long max_acceleration_steps_per_s2[NUM_AXIS];
+ static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
static millis_t min_segment_time;
- static float min_feedrate;
+ static float min_feedrate_mm_s;
static float acceleration; // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX
static float retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
static float travel_acceleration; // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
static float max_xy_jerk; // The largest speed change requiring no acceleration
static float max_z_jerk;
static float max_e_jerk;
- static float min_travel_feedrate;
+ static float min_travel_feedrate_mm_s;
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level
@@ -135,7 +144,7 @@ class Planner {
/**
* The current position of the tool in absolute steps
- * Reclculated if any axis_steps_per_unit are changed by gcode
+ * Recalculated if any axis_steps_per_mm are changed by gcode
*/
static long position[NUM_AXIS];
@@ -180,6 +189,7 @@ class Planner {
*/
static void reset_acceleration_rates();
+ static void refresh_positioning();
// Manage fans, paste pressure, etc.
static void check_axes_activity();
@@ -189,6 +199,8 @@ class Planner {
*/
static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); }
+ static bool is_full() { return (block_buffer_tail == BLOCK_MOD(block_buffer_head + 1)); }
+
#if ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(MESH_BED_LEVELING)
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
@@ -202,16 +214,16 @@ class Planner {
* Add a new linear movement to the buffer.
*
* x,y,z,e - target position in mm
- * feed_rate - (target) speed of the move
+ * fr_mm_s - (target) speed of the move (mm/s)
* extruder - target extruder
*/
- static void buffer_line(float x, float y, float z, const float& e, float feed_rate, const uint8_t extruder);
+ static void buffer_line(float x, float y, float z, const float& e, float fr_mm_s, const uint8_t extruder);
/**
* Set the planner.position and individual stepper positions.
* Used by G92, G28, G29, and other procedures.
*
- * Multiplies by axis_steps_per_unit[] and does necessary conversion
+ * Multiplies by axis_steps_per_mm[] and does necessary conversion
* for COREXY / COREXZ / COREYZ to set the corresponding stepper positions.
*
* Clears previous speed values.
@@ -220,7 +232,7 @@ class Planner {
#else
- static void buffer_line(const float& x, const float& y, const float& z, const float& e, float feed_rate, const uint8_t extruder);
+ static void buffer_line(const float& x, const float& y, const float& z, const float& e, float fr_mm_s, const uint8_t extruder);
static void set_position_mm(const float& x, const float& y, const float& z, const float& e);
#endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING
@@ -279,9 +291,9 @@ class Planner {
* Calculate the distance (not time) it takes to accelerate
* from initial_rate to target_rate using the given acceleration:
*/
- static float estimate_acceleration_distance(float initial_rate, float target_rate, float acceleration) {
- if (acceleration == 0) return 0; // acceleration was 0, set acceleration distance to 0
- return (target_rate * target_rate - initial_rate * initial_rate) / (acceleration * 2);
+ static float estimate_acceleration_distance(float initial_rate, float target_rate, float accel) {
+ if (accel == 0) return 0; // accel was 0, set acceleration distance to 0
+ return (sq(target_rate) - sq(initial_rate)) / (accel * 2);
}
/**
@@ -292,9 +304,9 @@ class Planner {
* This is used to compute the intersection point between acceleration and deceleration
* in cases where the "trapezoid" has no plateau (i.e., never reaches maximum speed)
*/
- static float intersection_distance(float initial_rate, float final_rate, float acceleration, float distance) {
- if (acceleration == 0) return 0; // acceleration was 0, set intersection distance to 0
- return (acceleration * 2 * distance - initial_rate * initial_rate + final_rate * final_rate) / (acceleration * 4);
+ static float intersection_distance(float initial_rate, float final_rate, float accel, float distance) {
+ if (accel == 0) return 0; // accel was 0, set intersection distance to 0
+ return (accel * 2 * distance - sq(initial_rate) + sq(final_rate)) / (accel * 4);
}
/**
@@ -302,8 +314,8 @@ class Planner {
* to reach 'target_velocity' using 'acceleration' within a given
* 'distance'.
*/
- static float max_allowable_speed(float acceleration, float target_velocity, float distance) {
- return sqrt(target_velocity * target_velocity - 2 * acceleration * distance);
+ static float max_allowable_speed(float accel, float target_velocity, float distance) {
+ return sqrt(sq(target_velocity) - 2 * accel * distance);
}
static void calculate_trapezoid_for_block(block_t* block, float entry_factor, float exit_factor);
diff --git a/Marlin/planner_bezier.cpp b/Marlin/planner_bezier.cpp
index b789b3db5..6ca7afd1d 100644
--- a/Marlin/planner_bezier.cpp
+++ b/Marlin/planner_bezier.cpp
@@ -105,7 +105,7 @@ inline static float dist1(float x1, float y1, float x2, float y2) { return fabs(
* the mitigation offered by MIN_STEP and the small computational
* power available on Arduino, I think it is not wise to implement it.
*/
-void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS], const float offset[4], float feed_rate, uint8_t extruder) {
+void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS], const float offset[4], float fr_mm_s, uint8_t extruder) {
// Absolute first and second control points are recovered.
float first0 = position[X_AXIS] + offset[0];
float first1 = position[Y_AXIS] + offset[1];
@@ -189,13 +189,13 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS]
clamp_to_software_endstops(bez_target);
#if ENABLED(DELTA) || ENABLED(SCARA)
- calculate_delta(bez_target);
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ inverse_kinematics(bez_target);
+ #if ENABLED(DELTA) && ENABLED(AUTO_BED_LEVELING_FEATURE)
adjust_delta(bez_target);
#endif
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], bez_target[E_AXIS], feed_rate, extruder);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], bez_target[E_AXIS], fr_mm_s, extruder);
#else
- planner.buffer_line(bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS], bez_target[E_AXIS], feed_rate, extruder);
+ planner.buffer_line(bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS], bez_target[E_AXIS], fr_mm_s, extruder);
#endif
}
}
diff --git a/Marlin/planner_bezier.h b/Marlin/planner_bezier.h
index 61026b8f6..d17e7c80a 100644
--- a/Marlin/planner_bezier.h
+++ b/Marlin/planner_bezier.h
@@ -36,7 +36,7 @@ void cubic_b_spline(
const float position[NUM_AXIS], // current position
const float target[NUM_AXIS], // target position
const float offset[4], // a pair of offsets
- float feed_rate,
+ float fr_mm_s,
uint8_t extruder
);
diff --git a/Marlin/point_t.h b/Marlin/point_t.h
new file mode 100644
index 000000000..360abce64
--- /dev/null
+++ b/Marlin/point_t.h
@@ -0,0 +1,77 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __POINT_T__
+#define __POINT_T__
+
+/**
+ * @brief Cartesian Point
+ * @details Represents a three dimensional point on Cartesian coordinate system,
+ * using an additional fourth dimension for the extrusion length.
+ *
+ * @param x The x-coordinate of the point.
+ * @param y The y-coordinate of the point.
+ * @param z The z-coordinate of the point.
+ * @param e The e-coordinate of the point.
+ */
+struct point_t {
+ float x;
+ float y;
+ float z;
+ float e;
+
+ /**
+ * @brief Two dimensional point constructor
+ *
+ * @param x The x-coordinate of the point.
+ * @param y The y-coordinate of the point.
+ */
+ point_t(float const x, float const y)
+ : point_t(x, y, NAN, NAN) {}
+
+ /**
+ * @brief Three dimensional point constructor
+ *
+ * @param x The x-coordinate of the point.
+ * @param y The y-coordinate of the point.
+ * @param z The z-coordinate of the point.
+ */
+ point_t(float const x, float const y, float const z)
+ : point_t(x, y, z, NAN) {}
+
+ /**
+ * @brief Tree dimensional point constructor with extrusion length
+ *
+ * @param x The x-coordinate of the point.
+ * @param y The y-coordinate of the point.
+ * @param z The z-coordinate of the point.
+ * @param e The e-coordinate of the point.
+ */
+ point_t(float const x, float const y, float const z, float const e) {
+ this->x = x;
+ this->y = y;
+ this->z = z;
+ this->e = e;
+ }
+};
+
+#endif // __POINT_T__
diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp
index 0c79087ff..b6cef6e71 100644
--- a/Marlin/printcounter.cpp
+++ b/Marlin/printcounter.cpp
@@ -22,17 +22,18 @@
#include "Marlin.h"
#include "printcounter.h"
+#include "duration_t.h"
PrintCounter::PrintCounter(): super() {
this->loadStats();
}
-uint16_t PrintCounter::deltaDuration() {
+millis_t PrintCounter::deltaDuration() {
#if ENABLED(DEBUG_PRINTCOUNTER)
PrintCounter::debug(PSTR("deltaDuration"));
#endif
- uint16_t tmp = this->lastDuration;
+ millis_t tmp = this->lastDuration;
this->lastDuration = this->duration();
return this->lastDuration - tmp;
}
@@ -41,13 +42,25 @@ bool PrintCounter::isLoaded() {
return this->loaded;
}
+void PrintCounter::incFilamentUsed(double const &amount) {
+ #if ENABLED(DEBUG_PRINTCOUNTER)
+ PrintCounter::debug(PSTR("incFilamentUsed"));
+ #endif
+
+ // Refuses to update data if object is not loaded
+ if (!this->isLoaded()) return;
+
+ this->data.filamentUsed += amount; // mm
+}
+
+
void PrintCounter::initStats() {
#if ENABLED(DEBUG_PRINTCOUNTER)
PrintCounter::debug(PSTR("initStats"));
#endif
this->loaded = true;
- this->data = { 0, 0, 0, 0 };
+ this->data = { 0, 0, 0, 0, 0.0 };
this->saveStats();
eeprom_write_byte((uint8_t *) this->address, 0x16);
@@ -60,7 +73,8 @@ void PrintCounter::loadStats() {
// Checks if the EEPROM block is initialized
if (eeprom_read_byte((uint8_t *) this->address) != 0x16) this->initStats();
- else eeprom_read_block(&this->data, (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics));
+ else eeprom_read_block(&this->data,
+ (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics));
this->loaded = true;
}
@@ -70,32 +84,38 @@ void PrintCounter::saveStats() {
PrintCounter::debug(PSTR("saveStats"));
#endif
- // Refuses to save data is object is not loaded
+ // Refuses to save data if object is not loaded
if (!this->isLoaded()) return;
// Saves the struct to EEPROM
- eeprom_update_block(&this->data, (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics));
+ eeprom_update_block(&this->data,
+ (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics));
}
void PrintCounter::showStats() {
- SERIAL_ECHOPGM("Print statistics: Total: ");
+ char buffer[21];
+ duration_t elapsed;
+
+ SERIAL_PROTOCOLPGM(MSG_STATS);
+
+ SERIAL_ECHOPGM("Prints: ");
SERIAL_ECHO(this->data.totalPrints);
SERIAL_ECHOPGM(", Finished: ");
SERIAL_ECHO(this->data.finishedPrints);
- SERIAL_ECHOPGM(", Failed: ");
+ SERIAL_ECHOPGM(", Failed: "); // Note: Removes 1 from failures with an active counter
SERIAL_ECHO(this->data.totalPrints - this->data.finishedPrints
- - ((this->isRunning() || this->isPaused()) ? 1 : 0)); // Removes 1 from failures with an active counter
+ - ((this->isRunning() || this->isPaused()) ? 1 : 0));
- uint32_t t = this->data.printTime /60;
- SERIAL_ECHOPGM(", Total print time: ");
- SERIAL_ECHO(t / 60);
+ SERIAL_EOL;
+ SERIAL_PROTOCOLPGM(MSG_STATS);
- SERIAL_ECHOPGM("h ");
- SERIAL_ECHO(t % 60);
+ elapsed = this->data.printTime;
+ elapsed.toString(buffer);
- SERIAL_ECHOPGM("min");
+ SERIAL_ECHOPGM("Total time: ");
+ SERIAL_ECHO(buffer);
#if ENABLED(DEBUG_PRINTCOUNTER)
SERIAL_ECHOPGM(" (");
@@ -103,35 +123,52 @@ void PrintCounter::showStats() {
SERIAL_ECHOPGM(")");
#endif
- // @todo longestPrint missing implementation
+ elapsed = this->data.longestPrint;
+ elapsed.toString(buffer);
+
+ SERIAL_ECHOPGM(", Longest job: ");
+ SERIAL_ECHO(buffer);
+
+ #if ENABLED(DEBUG_PRINTCOUNTER)
+ SERIAL_ECHOPGM(" (");
+ SERIAL_ECHO(this->data.longestPrint);
+ SERIAL_ECHOPGM(")");
+ #endif
+
+ SERIAL_EOL;
+ SERIAL_PROTOCOLPGM(MSG_STATS);
+
+ SERIAL_ECHOPGM("Filament used: ");
+ SERIAL_ECHO(this->data.filamentUsed / 1000);
+ SERIAL_ECHOPGM("m");
+
SERIAL_EOL;
}
void PrintCounter::tick() {
if (!this->isRunning()) return;
- static uint32_t update_before = millis(),
- eeprom_before = millis();
+ static uint32_t update_last = millis(),
+ eeprom_last = millis();
- uint32_t now = millis();
+ millis_t now = millis();
// Trying to get the amount of calculations down to the bare min
const static uint16_t i = this->updateInterval * 1000;
- if (now - update_before >= i) {
+ if (now - update_last >= i) {
#if ENABLED(DEBUG_PRINTCOUNTER)
PrintCounter::debug(PSTR("tick"));
#endif
this->data.printTime += this->deltaDuration();
- update_before = now;
+ update_last = now;
}
// Trying to get the amount of calculations down to the bare min
- const static uint32_t j = this->saveInterval * 1000;
-
- if (now - eeprom_before >= j) {
- eeprom_before = now;
+ const static millis_t j = this->saveInterval * 1000;
+ if (now - eeprom_last >= j) {
+ eeprom_last = now;
this->saveStats();
}
}
@@ -163,6 +200,10 @@ bool PrintCounter::stop() {
if (super::stop()) {
this->data.finishedPrints++;
this->data.printTime += this->deltaDuration();
+
+ if (this->duration() > this->data.longestPrint)
+ this->data.longestPrint = this->duration();
+
this->saveStats();
return true;
}
diff --git a/Marlin/printcounter.h b/Marlin/printcounter.h
index dbee3f9e6..0e9d06f45 100644
--- a/Marlin/printcounter.h
+++ b/Marlin/printcounter.h
@@ -24,6 +24,7 @@
#define PRINTCOUNTER_H
#include "macros.h"
+#include "language.h"
#include "stopwatch.h"
#include
@@ -35,8 +36,9 @@ struct printStatistics { // 13 bytes
//const uint8_t magic; // Magic header, it will always be 0x16
uint16_t totalPrints; // Number of prints
uint16_t finishedPrints; // Number of complete prints
- uint32_t printTime; // Total printing time
- uint32_t longestPrint; // Longest print job - not in use
+ uint32_t printTime; // Accumulated printing time
+ uint32_t longestPrint; // Longest successfull print job
+ double filamentUsed; // Accumulated filament consumed in mm
};
class PrintCounter: public Stopwatch {
@@ -74,7 +76,7 @@ class PrintCounter: public Stopwatch {
* @details Stores the timestamp of the last deltaDuration(), this is
* required due to the updateInterval cycle.
*/
- uint16_t lastDuration;
+ millis_t lastDuration;
/**
* @brief Stats were loaded from EERPROM
@@ -90,7 +92,7 @@ class PrintCounter: public Stopwatch {
* used internally for print statistics accounting is not intended to be a
* user callable function.
*/
- uint16_t deltaDuration();
+ millis_t deltaDuration();
public:
/**
@@ -105,6 +107,14 @@ class PrintCounter: public Stopwatch {
*/
bool isLoaded();
+ /**
+ * @brief Increments the total filament used
+ * @details The total filament used counter will be incremented by "amount".
+ *
+ * @param amount The amount of filament used in mm
+ */
+ void incFilamentUsed(double const &amount);
+
/**
* @brief Resets the Print Statistics
* @details Resets the statistics to zero and saves them to EEPROM creating
@@ -131,6 +141,12 @@ class PrintCounter: public Stopwatch {
*/
void showStats();
+ /**
+ * @brief Return the currently loaded statistics
+ * @details Return the raw data, in the same structure used internally
+ */
+ printStatistics getStats() { return this->data; }
+
/**
* @brief Loop function
* @details This function should be called at loop, it will take care of
diff --git a/Marlin/qr_solve.h b/Marlin/qr_solve.h
index b985d622f..3ea30e9e7 100644
--- a/Marlin/qr_solve.h
+++ b/Marlin/qr_solve.h
@@ -20,7 +20,7 @@
*
*/
-#include "Configuration.h"
+#include "MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_GRID)
diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp
index 1b8442a0d..b5f9ed86d 100644
--- a/Marlin/servo.cpp
+++ b/Marlin/servo.cpp
@@ -21,51 +21,36 @@
*/
/**
- servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
- Copyright (c) 2009 Michael Margolis. All right reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
+ * Copyright (c) 2009 Michael Margolis. All right reserved.
*/
/**
-
- A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method.
- The servos are pulsed in the background using the value most recently written using the write() method
-
- Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached.
- Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four.
-
- The methods are:
-
- Servo - Class for manipulating servo motors connected to Arduino pins.
-
- attach(pin ) - Attaches a servo motor to an i/o pin.
- attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds
- default min is 544, max is 2400
-
- write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds)
- writeMicroseconds() - Sets the servo pulse width in microseconds
- move(pin, angle) - Sequence of attach(pin), write(angle).
- With DEACTIVATE_SERVOS_AFTER_MOVE it waits SERVO_DEACTIVATION_DELAY and detaches.
- read() - Gets the last written servo pulse width as an angle between 0 and 180.
- readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release)
- attached() - Returns true if there is a servo attached.
- detach() - Stops an attached servos from pulsing its i/o pin.
-
-*/
-#include "Configuration.h"
+ * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method.
+ * The servos are pulsed in the background using the value most recently written using the write() method
+ *
+ * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached.
+ * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four.
+ *
+ * The methods are:
+ *
+ * Servo - Class for manipulating servo motors connected to Arduino pins.
+ *
+ * attach(pin) - Attach a servo motor to an i/o pin.
+ * attach(pin, min, max) - Attach to a pin, setting min and max values in microseconds
+ * Default min is 544, max is 2400
+ *
+ * write() - Set the servo angle in degrees. (Invalid angles —over MIN_PULSE_WIDTH— are treated as µs.)
+ * writeMicroseconds() - Set the servo pulse width in microseconds.
+ * move(pin, angle) - Sequence of attach(pin), write(angle), delay(SERVO_DELAY).
+ * With DEACTIVATE_SERVOS_AFTER_MOVE it detaches after SERVO_DELAY.
+ * read() - Get the last-written servo pulse width as an angle between 0 and 180.
+ * readMicroseconds() - Get the last-written servo pulse width in microseconds.
+ * attached() - Return true if a servo is attached.
+ * detach() - Stop an attached servo from pulsing its i/o pin.
+ *
+ */
+#include "MarlinConfig.h"
#if HAS_SERVOS
@@ -238,6 +223,7 @@ static void finISR(timer16_Sequence_t timer) {
}
#else //!WIRING
// For arduino - in future: call here to a currently undefined function to reset the timer
+ UNUSED(timer);
#endif
}
@@ -324,8 +310,8 @@ bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
void Servo::move(int value) {
if (this->attach(0) >= 0) {
this->write(value);
+ delay(SERVO_DELAY);
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- delay(SERVO_DEACTIVATION_DELAY);
this->detach();
#endif
}
diff --git a/Marlin/servo.h b/Marlin/servo.h
index d764fc440..07532bc30 100644
--- a/Marlin/servo.h
+++ b/Marlin/servo.h
@@ -63,7 +63,7 @@
attached() - Returns true if there is a servo attached.
detach() - Stops an attached servos from pulsing its i/o pin.
move(angle) - Sequence of attach(0), write(angle),
- With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DEACTIVATION_DELAY and detach.
+ With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach.
*/
#ifndef servo_h
@@ -147,7 +147,7 @@ class Servo {
void writeMicroseconds(int value); // write pulse width in microseconds
void move(int value); // attach the servo, then move to value
// if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds
- // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DEACTIVATION_DELAY, then detach
+ // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach
int read(); // returns current pulse width as an angle between 0 and 180 degrees
int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release)
bool attached(); // return true if this servo is attached, otherwise false
diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp
index 3df97cd52..88e8cd560 100644
--- a/Marlin/stepper.cpp
+++ b/Marlin/stepper.cpp
@@ -89,13 +89,24 @@ long Stepper::counter_X = 0,
volatile unsigned long Stepper::step_events_completed = 0; // The number of step events executed in the current block
-#if ENABLED(ADVANCE)
+#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
+
unsigned char Stepper::old_OCR0A;
- long Stepper::final_advance = 0,
- Stepper::old_advance = 0,
- Stepper::e_steps[4],
- Stepper::advance_rate,
- Stepper::advance;
+ volatile unsigned char Stepper::eISR_Rate = 200; // Keep the ISR at a low rate until needed
+
+ #if ENABLED(LIN_ADVANCE)
+ volatile int Stepper::e_steps[E_STEPPERS];
+ int Stepper::extruder_advance_k = LIN_ADVANCE_K,
+ Stepper::final_estep_rate,
+ Stepper::current_estep_rate[E_STEPPERS],
+ Stepper::current_adv_steps[E_STEPPERS];
+ #else
+ long Stepper::e_steps[E_STEPPERS],
+ Stepper::final_advance = 0,
+ Stepper::old_advance = 0,
+ Stepper::advance_rate,
+ Stepper::advance;
+ #endif
#endif
long Stepper::acceleration_time, Stepper::deceleration_time;
@@ -103,13 +114,20 @@ long Stepper::acceleration_time, Stepper::deceleration_time;
volatile long Stepper::count_position[NUM_AXIS] = { 0 };
volatile signed char Stepper::count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
+#if ENABLED(MIXING_EXTRUDER)
+ long Stepper::counter_M[MIXING_STEPPERS];
+#endif
+
unsigned short Stepper::acc_step_rate; // needed for deceleration start point
uint8_t Stepper::step_loops, Stepper::step_loops_nominal;
unsigned short Stepper::OCR1A_nominal;
volatile long Stepper::endstops_trigsteps[3];
-#if ENABLED(DUAL_X_CARRIAGE)
+#if ENABLED(X_DUAL_STEPPER_DRIVERS)
+ #define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) != INVERT_X2_VS_X_DIR); }while(0)
+ #define X_APPLY_STEP(v,Q) do{ X_STEP_WRITE(v); X2_STEP_WRITE(v); }while(0)
+#elif ENABLED(DUAL_X_CARRIAGE)
#define X_APPLY_DIR(v,ALWAYS) \
if (extruder_duplication_enabled || ALWAYS) { \
X_DIR_WRITE(v); \
@@ -132,15 +150,15 @@ volatile long Stepper::endstops_trigsteps[3];
#endif
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- #define Y_APPLY_DIR(v,Q) { Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); }
- #define Y_APPLY_STEP(v,Q) { Y_STEP_WRITE(v); Y2_STEP_WRITE(v); }
+ #define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); }while(0)
+ #define Y_APPLY_STEP(v,Q) do{ Y_STEP_WRITE(v); Y2_STEP_WRITE(v); }while(0)
#else
#define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v)
#define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v)
#endif
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
- #define Z_APPLY_DIR(v,Q) { Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }
+ #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }while(0)
#if ENABLED(Z_DUAL_ENDSTOPS)
#define Z_APPLY_STEP(v,Q) \
if (performing_homing) { \
@@ -158,14 +176,16 @@ volatile long Stepper::endstops_trigsteps[3];
Z2_STEP_WRITE(v); \
}
#else
- #define Z_APPLY_STEP(v,Q) { Z_STEP_WRITE(v); Z2_STEP_WRITE(v); }
+ #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); }while(0)
#endif
#else
#define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v)
#define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v)
#endif
-#define E_APPLY_STEP(v,Q) E_STEP_WRITE(v)
+#if DISABLED(MIXING_EXTRUDER)
+ #define E_APPLY_STEP(v,Q) E_STEP_WRITE(v)
+#endif
// intRes = longIn1 * longIn2 >> 24
// uses:
@@ -308,8 +328,15 @@ void Stepper::isr() {
if (current_block) {
current_block->busy = true;
trapezoid_generator_reset();
- counter_X = -(current_block->step_event_count >> 1);
- counter_Y = counter_Z = counter_E = counter_X;
+
+ // Initialize Bresenham counters to 1/2 the ceiling
+ counter_X = counter_Y = counter_Z = counter_E = -(current_block->step_event_count >> 1);
+
+ #if ENABLED(MIXING_EXTRUDER)
+ MIXING_STEPPERS_LOOP(i)
+ counter_M[i] = -(current_block->mix_event_count[i] >> 1);
+ #endif
+
step_events_completed = 0;
#if ENABLED(Z_LATE_ENABLE)
@@ -321,7 +348,7 @@ void Stepper::isr() {
#endif
// #if ENABLED(ADVANCE)
- // e_steps[current_block->active_extruder] = 0;
+ // e_steps[TOOL_E_INDEX] = 0;
// #endif
}
else {
@@ -329,14 +356,14 @@ void Stepper::isr() {
}
}
- if (current_block != NULL) {
+ if (current_block) {
// Update endstops state, if enabled
- #if HAS_BED_PROBE
- if (endstops.enabled || endstops.z_probe_enabled) endstops.update();
- #else
- if (endstops.enabled) endstops.update();
- #endif
+ if (endstops.enabled
+ #if HAS_BED_PROBE
+ || endstops.z_probe_enabled
+ #endif
+ ) endstops.update();
// Take multiple steps per interrupt (For high speed moves)
for (int8_t i = 0; i < step_loops; i++) {
@@ -344,13 +371,73 @@ void Stepper::isr() {
customizedSerial.checkRx(); // Check for serial chars.
#endif
- #if ENABLED(ADVANCE)
+ #if ENABLED(LIN_ADVANCE)
+
+ counter_E += current_block->steps[E_AXIS];
+ if (counter_E > 0) {
+ counter_E -= current_block->step_event_count;
+ #if DISABLED(MIXING_EXTRUDER)
+ // Don't step E here for mixing extruder
+ count_position[E_AXIS] += count_direction[E_AXIS];
+ e_steps[TOOL_E_INDEX] += motor_direction(E_AXIS) ? -1 : 1;
+ #endif
+ }
+
+ #if ENABLED(MIXING_EXTRUDER)
+ // Step mixing steppers proportionally
+ long dir = motor_direction(E_AXIS) ? -1 : 1;
+ MIXING_STEPPERS_LOOP(j) {
+ counter_m[j] += current_block->steps[E_AXIS];
+ if (counter_m[j] > 0) {
+ counter_m[j] -= current_block->mix_event_count[j];
+ e_steps[j] += dir;
+ }
+ }
+ #endif
+
+ if (current_block->use_advance_lead) {
+ int delta_adv_steps = (((long)extruder_advance_k * current_estep_rate[TOOL_E_INDEX]) >> 9) - current_adv_steps[TOOL_E_INDEX];
+ #if ENABLED(MIXING_EXTRUDER)
+ // Mixing extruders apply advance lead proportionally
+ MIXING_STEPPERS_LOOP(j) {
+ int steps = delta_adv_steps * current_block->step_event_count / current_block->mix_event_count[j];
+ e_steps[j] += steps;
+ current_adv_steps[j] += steps;
+ }
+ #else
+ // For most extruders, advance the single E stepper
+ e_steps[TOOL_E_INDEX] += delta_adv_steps;
+ current_adv_steps[TOOL_E_INDEX] += delta_adv_steps;
+ #endif
+ }
+
+ #elif ENABLED(ADVANCE)
+
+ // Always count the unified E axis
counter_E += current_block->steps[E_AXIS];
if (counter_E > 0) {
counter_E -= current_block->step_event_count;
- e_steps[current_block->active_extruder] += motor_direction(E_AXIS) ? -1 : 1;
+ #if DISABLED(MIXING_EXTRUDER)
+ // Don't step E here for mixing extruder
+ e_steps[TOOL_E_INDEX] += motor_direction(E_AXIS) ? -1 : 1;
+ #endif
}
- #endif //ADVANCE
+
+ #if ENABLED(MIXING_EXTRUDER)
+
+ // Step mixing steppers proportionally
+ long dir = motor_direction(E_AXIS) ? -1 : 1;
+ MIXING_STEPPERS_LOOP(j) {
+ counter_m[j] += current_block->steps[E_AXIS];
+ if (counter_m[j] > 0) {
+ counter_m[j] -= current_block->mix_event_count[j];
+ e_steps[j] += dir;
+ }
+ }
+
+ #endif // MIXING_EXTRUDER
+
+ #endif // ADVANCE or LIN_ADVANCE
#define _COUNTER(AXIS) counter_## AXIS
#define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
@@ -363,9 +450,22 @@ void Stepper::isr() {
STEP_ADD(X);
STEP_ADD(Y);
STEP_ADD(Z);
- #if DISABLED(ADVANCE)
- STEP_ADD(E);
- #endif
+
+ #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
+ #if ENABLED(MIXING_EXTRUDER)
+ // Keep updating the single E axis
+ counter_E += current_block->steps[E_AXIS];
+ // Tick the counters used for this mix
+ MIXING_STEPPERS_LOOP(j) {
+ // Step mixing steppers (proportionally)
+ counter_M[j] += current_block->steps[E_AXIS];
+ // Step when the counter goes over zero
+ if (counter_M[j] > 0) En_STEP_WRITE(j, !INVERT_E_STEP_PIN);
+ }
+ #else // !MIXING_EXTRUDER
+ STEP_ADD(E);
+ #endif
+ #endif // !ADVANCE && !LIN_ADVANCE
#define STEP_IF_COUNTER(AXIS) \
if (_COUNTER(AXIS) > 0) { \
@@ -377,13 +477,34 @@ void Stepper::isr() {
STEP_IF_COUNTER(X);
STEP_IF_COUNTER(Y);
STEP_IF_COUNTER(Z);
- #if DISABLED(ADVANCE)
- STEP_IF_COUNTER(E);
- #endif
+
+ #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
+ #if ENABLED(MIXING_EXTRUDER)
+ // Always step the single E axis
+ if (counter_E > 0) {
+ counter_E -= current_block->step_event_count;
+ count_position[E_AXIS] += count_direction[E_AXIS];
+ }
+ MIXING_STEPPERS_LOOP(j) {
+ if (counter_M[j] > 0) {
+ counter_M[j] -= current_block->mix_event_count[j];
+ En_STEP_WRITE(j, INVERT_E_STEP_PIN);
+ }
+ }
+ #else // !MIXING_EXTRUDER
+ STEP_IF_COUNTER(E);
+ #endif
+ #endif // !ADVANCE && !LIN_ADVANCE
step_events_completed++;
if (step_events_completed >= current_block->step_event_count) break;
}
+
+ #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
+ // If we have esteps to execute, fire the next ISR "now"
+ if (e_steps[TOOL_E_INDEX]) OCR0A = TCNT0 + 2;
+ #endif
+
// Calculate new timer value
unsigned short timer, step_rate;
if (step_events_completed <= (unsigned long)current_block->accelerate_until) {
@@ -399,16 +520,45 @@ void Stepper::isr() {
OCR1A = timer;
acceleration_time += timer;
- #if ENABLED(ADVANCE)
+ #if ENABLED(LIN_ADVANCE)
+
+ if (current_block->use_advance_lead)
+ current_estep_rate[TOOL_E_INDEX] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8;
+
+ if (current_block->use_advance_lead) {
+ #if ENABLED(MIXING_EXTRUDER)
+ MIXING_STEPPERS_LOOP(j)
+ current_estep_rate[j] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8 * current_block->step_event_count / current_block->mix_event_count[j]) >> 8;
+ #else
+ current_estep_rate[TOOL_E_INDEX] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8;
+ #endif
+ }
+
+ #elif ENABLED(ADVANCE)
advance += advance_rate * step_loops;
//NOLESS(advance, current_block->advance);
+ long advance_whole = advance >> 8,
+ advance_factor = advance_whole - old_advance;
+
// Do E steps + advance steps
- e_steps[current_block->active_extruder] += ((advance >> 8) - old_advance);
- old_advance = advance >> 8;
+ #if ENABLED(MIXING_EXTRUDER)
+ // ...for mixing steppers proportionally
+ MIXING_STEPPERS_LOOP(j)
+ e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j];
+ #else
+ // ...for the active extruder
+ e_steps[TOOL_E_INDEX] += advance_factor;
+ #endif
+
+ old_advance = advance_whole;
- #endif //ADVANCE
+ #endif // ADVANCE or LIN_ADVANCE
+
+ #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
+ eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[TOOL_E_INDEX]);
+ #endif
}
else if (step_events_completed > (unsigned long)current_block->decelerate_after) {
MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
@@ -425,17 +575,52 @@ void Stepper::isr() {
OCR1A = timer;
deceleration_time += timer;
- #if ENABLED(ADVANCE)
+ #if ENABLED(LIN_ADVANCE)
+
+ if (current_block->use_advance_lead) {
+ #if ENABLED(MIXING_EXTRUDER)
+ MIXING_STEPPERS_LOOP(j)
+ current_estep_rate[j] = ((unsigned long)step_rate * current_block->e_speed_multiplier8 * current_block->step_event_count / current_block->mix_event_count[j]) >> 8;
+ #else
+ current_estep_rate[TOOL_E_INDEX] = ((unsigned long)step_rate * current_block->e_speed_multiplier8) >> 8;
+ #endif
+ }
+
+ #elif ENABLED(ADVANCE)
+
advance -= advance_rate * step_loops;
NOLESS(advance, final_advance);
// Do E steps + advance steps
- uint32_t advance_whole = advance >> 8;
- e_steps[current_block->active_extruder] += advance_whole - old_advance;
+ long advance_whole = advance >> 8,
+ advance_factor = advance_whole - old_advance;
+
+ #if ENABLED(MIXING_EXTRUDER)
+ MIXING_STEPPERS_LOOP(j)
+ e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j];
+ #else
+ e_steps[TOOL_E_INDEX] += advance_factor;
+ #endif
+
old_advance = advance_whole;
- #endif //ADVANCE
+
+ #endif // ADVANCE or LIN_ADVANCE
+
+ #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
+ eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[TOOL_E_INDEX]);
+ #endif
}
else {
+
+ #if ENABLED(LIN_ADVANCE)
+
+ if (current_block->use_advance_lead)
+ current_estep_rate[TOOL_E_INDEX] = final_estep_rate;
+
+ eISR_Rate = (OCR1A_nominal >> 2) * step_loops_nominal / abs(e_steps[TOOL_E_INDEX]);
+
+ #endif
+
OCR1A = OCR1A_nominal;
// ensure we're running at the correct step rate, even if we just came off an acceleration
step_loops = step_loops_nominal;
@@ -451,13 +636,15 @@ void Stepper::isr() {
}
}
-#if ENABLED(ADVANCE)
+#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
+
// Timer interrupt for E. e_steps is set in the main routine;
// Timer 0 is shared with millies
ISR(TIMER0_COMPA_vect) { Stepper::advance_isr(); }
void Stepper::advance_isr() {
- old_OCR0A += 52; // ~10kHz interrupt (250000 / 26 = 9615kHz)
+
+ old_OCR0A += eISR_Rate;
OCR0A = old_OCR0A;
#define STEP_E_ONCE(INDEX) \
@@ -467,29 +654,30 @@ void Stepper::isr() {
E## INDEX ##_DIR_WRITE(INVERT_E## INDEX ##_DIR); \
e_steps[INDEX]++; \
} \
- else if (e_steps[INDEX] > 0) { \
+ else { \
E## INDEX ##_DIR_WRITE(!INVERT_E## INDEX ##_DIR); \
e_steps[INDEX]--; \
} \
E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \
}
- // Step all E steppers that have steps, up to 4 steps per interrupt
- for (unsigned char i = 0; i < 4; i++) {
+ // Step all E steppers that have steps
+ for (uint8_t i = 0; i < step_loops; i++) {
STEP_E_ONCE(0);
- #if EXTRUDERS > 1
+ #if E_STEPPERS > 1
STEP_E_ONCE(1);
- #if EXTRUDERS > 2
+ #if E_STEPPERS > 2
STEP_E_ONCE(2);
- #if EXTRUDERS > 3
+ #if E_STEPPERS > 3
STEP_E_ONCE(3);
#endif
#endif
#endif
}
+
}
-#endif // ADVANCE
+#endif // ADVANCE or LIN_ADVANCE
void Stepper::init() {
@@ -601,14 +789,15 @@ void Stepper::init() {
// Initialize Step Pins
#if HAS_X_STEP
- AXIS_INIT(x, X, X);
- #if ENABLED(DUAL_X_CARRIAGE) && HAS_X2_STEP
- AXIS_INIT(x, X2, X);
+ #if ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE)
+ X2_STEP_INIT;
+ X2_STEP_WRITE(INVERT_X_STEP_PIN);
#endif
+ AXIS_INIT(x, X, X);
#endif
#if HAS_Y_STEP
- #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_STEP
+ #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
Y2_STEP_INIT;
Y2_STEP_WRITE(INVERT_Y_STEP_PIN);
#endif
@@ -616,7 +805,7 @@ void Stepper::init() {
#endif
#if HAS_Z_STEP
- #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_STEP
+ #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
Z2_STEP_INIT;
Z2_STEP_WRITE(INVERT_Z_STEP_PIN);
#endif
@@ -656,14 +845,22 @@ void Stepper::init() {
TCNT1 = 0;
ENABLE_STEPPER_DRIVER_INTERRUPT();
- #if ENABLED(ADVANCE)
+ #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
+
+ for (int i = 0; i < E_STEPPERS; i++) {
+ e_steps[i] = 0;
+ #if ENABLED(LIN_ADVANCE)
+ current_adv_steps[i] = 0;
+ #endif
+ }
+
#if defined(TCCR0A) && defined(WGM01)
CBI(TCCR0A, WGM01);
CBI(TCCR0A, WGM00);
#endif
- e_steps[0] = e_steps[1] = e_steps[2] = e_steps[3] = 0;
SBI(TIMSK0, OCIE0A);
- #endif //ADVANCE
+
+ #endif // ADVANCE or LIN_ADVANCE
endstops.enable(true); // Start with endstops active. After homing they can be disabled
sei();
@@ -747,14 +944,14 @@ float Stepper::get_axis_position_mm(AxisEnum axis) {
CRITICAL_SECTION_END;
// ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1
// ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2
- axis_steps = (pos1 + ((axis == CORE_AXIS_1) ? pos2 : -pos2)) / 2.0f;
+ axis_steps = (pos1 + ((axis == CORE_AXIS_1) ? pos2 : -pos2)) * 0.5f;
}
else
axis_steps = position(axis);
#else
axis_steps = position(axis);
#endif
- return axis_steps / planner.axis_steps_per_unit[axis];
+ return axis_steps * planner.steps_to_mm[axis];
}
void Stepper::finish_and_disable() {
@@ -776,9 +973,9 @@ void Stepper::endstop_triggered(AxisEnum axis) {
float axis_pos = count_position[axis];
if (axis == CORE_AXIS_1)
- axis_pos = (axis_pos + count_position[CORE_AXIS_2]) / 2;
+ axis_pos = (axis_pos + count_position[CORE_AXIS_2]) * 0.5;
else if (axis == CORE_AXIS_2)
- axis_pos = (count_position[CORE_AXIS_1] - axis_pos) / 2;
+ axis_pos = (count_position[CORE_AXIS_1] - axis_pos) * 0.5;
endstops_trigsteps[axis] = axis_pos;
#else // !COREXY && !COREXZ && !COREYZ
@@ -918,7 +1115,7 @@ void Stepper::digipot_init() {
SPI.begin();
pinMode(DIGIPOTSS_PIN, OUTPUT);
- for (int i = 0; i < COUNT(digipot_motor_current); i++) {
+ for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) {
//digitalPotWrite(digipot_ch[i], digipot_motor_current[i]);
digipot_current(i, digipot_motor_current[i]);
}
@@ -1021,7 +1218,7 @@ void Stepper::microstep_mode(uint8_t driver, uint8_t stepping_mode) {
}
void Stepper::microstep_readings() {
- SERIAL_PROTOCOLPGM("MS1,MS2 Pins\n");
+ SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins");
SERIAL_PROTOCOLPGM("X: ");
SERIAL_PROTOCOL(digitalRead(X_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(X_MS2_PIN));
@@ -1040,3 +1237,14 @@ void Stepper::microstep_readings() {
SERIAL_PROTOCOLLN(digitalRead(E1_MS2_PIN));
#endif
}
+
+#if ENABLED(LIN_ADVANCE)
+
+ void Stepper::advance_M905(const float &k) {
+ if (k >= 0) extruder_advance_k = k;
+ SERIAL_ECHO_START;
+ SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k);
+ SERIAL_EOL;
+ }
+
+#endif // LIN_ADVANCE
diff --git a/Marlin/stepper.h b/Marlin/stepper.h
index 30223b55b..1dd1531e4 100644
--- a/Marlin/stepper.h
+++ b/Marlin/stepper.h
@@ -22,7 +22,7 @@
/**
* stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors
- * Part of Grbl
+ * Derived from Grbl
*
* Copyright (c) 2009-2011 Simen Svale Skogsrud
*
@@ -47,6 +47,7 @@
#include "speed_lookuptable.h"
#include "stepper_indirection.h"
#include "language.h"
+#include "types.h"
class Stepper;
extern Stepper stepper;
@@ -90,10 +91,6 @@ class Stepper {
static bool performing_homing;
#endif
- #if ENABLED(ADVANCE)
- static long e_steps[4];
- #endif
-
private:
static unsigned char last_direction_bits; // The next stepping-bits to be output
@@ -107,10 +104,23 @@ class Stepper {
static long counter_X, counter_Y, counter_Z, counter_E;
static volatile unsigned long step_events_completed; // The number of step events executed in the current block
- #if ENABLED(ADVANCE)
+ #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
static unsigned char old_OCR0A;
- static long advance_rate, advance, old_advance, final_advance;
- #endif
+ static volatile unsigned char eISR_Rate;
+ #if ENABLED(LIN_ADVANCE)
+ static volatile int e_steps[E_STEPPERS];
+ static int extruder_advance_k;
+ static int final_estep_rate;
+ static int current_estep_rate[E_STEPPERS]; // Actual extruder speed [steps/s]
+ static int current_adv_steps[E_STEPPERS]; // The amount of current added esteps due to advance.
+ // i.e., the current amount of pressure applied
+ // to the spring (=filament).
+ #else
+ static long e_steps[E_STEPPERS];
+ static long advance_rate, advance, final_advance;
+ static long old_advance;
+ #endif
+ #endif // ADVANCE or LIN_ADVANCE
static long acceleration_time, deceleration_time;
//unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate;
@@ -125,7 +135,7 @@ class Stepper {
#ifndef PWM_MOTOR_CURRENT
#define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT
#endif
- const int motor_current_setting[3] = PWM_MOTOR_CURRENT;
+ static constexpr int motor_current_setting[3] = PWM_MOTOR_CURRENT;
#endif
//
@@ -138,6 +148,16 @@ class Stepper {
//
static volatile signed char count_direction[NUM_AXIS];
+ //
+ // Mixing extruder mix counters
+ //
+ #if ENABLED(MIXING_EXTRUDER)
+ static long counter_M[MIXING_STEPPERS];
+ #define MIXING_STEPPERS_LOOP(VAR) \
+ for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) \
+ if (current_block->mix_event_count[VAR])
+ #endif
+
public:
//
@@ -148,7 +168,7 @@ class Stepper {
//
// Initialize stepper hardware
//
- void init();
+ static void init();
//
// Interrupt Service Routines
@@ -156,20 +176,20 @@ class Stepper {
static void isr();
- #if ENABLED(ADVANCE)
+ #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
static void advance_isr();
#endif
//
// Block until all buffered steps are executed
//
- void synchronize();
+ static void synchronize();
//
// Set the current position in steps
//
- void set_position(const long& x, const long& y, const long& z, const long& e);
- void set_e_position(const long& e);
+ static void set_position(const long& x, const long& y, const long& z, const long& e);
+ static void set_e_position(const long& e);
//
// Set direction bits for all steppers
@@ -179,33 +199,33 @@ class Stepper {
//
// Get the position of a stepper, in steps
//
- long position(AxisEnum axis);
+ static long position(AxisEnum axis);
//
// Report the positions of the steppers, in steps
//
- void report_positions();
+ static void report_positions();
//
// Get the position (mm) of an axis based on stepper position(s)
//
- float get_axis_position_mm(AxisEnum axis);
+ static float get_axis_position_mm(AxisEnum axis);
//
// The stepper subsystem goes to sleep when it runs out of things to execute. Call this
// to notify the subsystem that it is time to go to work.
//
- void wake_up();
+ static void wake_up();
//
// Wait for moves to finish and disable all steppers
//
- void finish_and_disable();
+ static void finish_and_disable();
//
// Quickly stop all steppers and clear the blocks queue
//
- void quick_stop();
+ static void quick_stop();
//
// The direction of a single motor
@@ -213,39 +233,44 @@ class Stepper {
static FORCE_INLINE bool motor_direction(AxisEnum axis) { return TEST(last_direction_bits, axis); }
#if HAS_DIGIPOTSS
- void digitalPotWrite(int address, int value);
+ static void digitalPotWrite(int address, int value);
#endif
- void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2);
- void digipot_current(uint8_t driver, int current);
- void microstep_mode(uint8_t driver, uint8_t stepping);
- void microstep_readings();
+ static void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2);
+ static void digipot_current(uint8_t driver, int current);
+ static void microstep_mode(uint8_t driver, uint8_t stepping);
+ static void microstep_readings();
#if ENABLED(Z_DUAL_ENDSTOPS)
- FORCE_INLINE void set_homing_flag(bool state) { performing_homing = state; }
- FORCE_INLINE void set_z_lock(bool state) { locked_z_motor = state; }
- FORCE_INLINE void set_z2_lock(bool state) { locked_z2_motor = state; }
+ static FORCE_INLINE void set_homing_flag(bool state) { performing_homing = state; }
+ static FORCE_INLINE void set_z_lock(bool state) { locked_z_motor = state; }
+ static FORCE_INLINE void set_z2_lock(bool state) { locked_z2_motor = state; }
#endif
#if ENABLED(BABYSTEPPING)
- void babystep(const uint8_t axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention
+ static void babystep(const uint8_t axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention
#endif
- inline void kill_current_block() {
+ static inline void kill_current_block() {
step_events_completed = current_block->step_event_count;
}
//
// Handle a triggered endstop
//
- void endstop_triggered(AxisEnum axis);
+ static void endstop_triggered(AxisEnum axis);
//
// Triggered position of an axis in mm (not core-savvy)
//
- FORCE_INLINE float triggered_position_mm(AxisEnum axis) {
- return endstops_trigsteps[axis] / planner.axis_steps_per_unit[axis];
+ static FORCE_INLINE float triggered_position_mm(AxisEnum axis) {
+ return endstops_trigsteps[axis] * planner.steps_to_mm[axis];
}
+ #if ENABLED(LIN_ADVANCE)
+ void advance_M905(const float &k);
+ FORCE_INLINE int get_advance_k() { return extruder_advance_k; }
+ #endif
+
private:
static FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) {
@@ -301,12 +326,25 @@ class Stepper {
}
#if ENABLED(ADVANCE)
+
advance = current_block->initial_advance;
final_advance = current_block->final_advance;
+
// Do E steps + advance steps
- e_steps[current_block->active_extruder] += ((advance >>8) - old_advance);
- old_advance = advance >>8;
+ #if ENABLED(MIXING_EXTRUDER)
+ long advance_factor = (advance >> 8) - old_advance;
+ // ...for mixing steppers proportionally
+ MIXING_STEPPERS_LOOP(j)
+ e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j];
+ #else
+ // ...for the active extruder
+ e_steps[TOOL_E_INDEX] += ((advance >> 8) - old_advance);
+ #endif
+
+ old_advance = advance >> 8;
+
#endif
+
deceleration_time = 0;
// step_rate to timer interval
OCR1A_nominal = calc_timer(current_block->nominal_rate);
@@ -315,6 +353,13 @@ class Stepper {
acc_step_rate = current_block->initial_rate;
acceleration_time = calc_timer(acc_step_rate);
OCR1A = acceleration_time;
+
+ #if ENABLED(LIN_ADVANCE)
+ if (current_block->use_advance_lead) {
+ current_estep_rate[current_block->active_extruder] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8;
+ final_estep_rate = (current_block->nominal_rate * current_block->e_speed_multiplier8) >> 8;
+ }
+ #endif
// SERIAL_ECHO_START;
// SERIAL_ECHOPGM("advance :");
@@ -327,8 +372,8 @@ class Stepper {
// SERIAL_ECHOLN(current_block->final_advance/256.0);
}
- void digipot_init();
- void microstep_init();
+ static void digipot_init();
+ static void microstep_init();
};
diff --git a/Marlin/stepper_dac.cpp b/Marlin/stepper_dac.cpp
index 2e3248daa..6c71b89f6 100644
--- a/Marlin/stepper_dac.cpp
+++ b/Marlin/stepper_dac.cpp
@@ -51,6 +51,11 @@
const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER;
int dac_init() {
+ #if PIN_EXISTS(DAC_DISABLE)
+ pinMode(DAC_DISABLE_PIN, OUTPUT);
+ digitalWrite(DAC_DISABLE_PIN, LOW); // set pin low to enable DAC
+ #endif
+
mcp4728_init();
if (mcp4728_simpleCommand(RESET)) return -1;
@@ -98,7 +103,7 @@
SERIAL_ECHOPAIR(" (", dac_amps(2));
SERIAL_ECHOPAIR(") E:", dac_perc(3));
SERIAL_ECHOPAIR(" (", dac_amps(3));
- SERIAL_ECHOLN(")");
+ SERIAL_ECHOLNPGM(")");
}
void dac_commit_eeprom() {
diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp
index 0ede05614..101249e3c 100644
--- a/Marlin/stepper_indirection.cpp
+++ b/Marlin/stepper_indirection.cpp
@@ -42,7 +42,8 @@
*/
#include "stepper_indirection.h"
-#include "Configuration.h"
+
+#include "MarlinConfig.h"
#if ENABLED(HAVE_TMCDRIVER)
#include
diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h
index 24e4c7c0a..6fd19dd4d 100644
--- a/Marlin/stepper_indirection.h
+++ b/Marlin/stepper_indirection.h
@@ -44,506 +44,352 @@
#ifndef STEPPER_INDIRECTION_H
#define STEPPER_INDIRECTION_H
-#include "macros.h"
+#include "MarlinConfig.h"
-// X motor
-#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN)
-#define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE)
-#define X_STEP_READ READ(X_STEP_PIN)
-
-#define X_DIR_INIT SET_OUTPUT(X_DIR_PIN)
-#define X_DIR_WRITE(STATE) WRITE(X_DIR_PIN,STATE)
-#define X_DIR_READ READ(X_DIR_PIN)
-
-#define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN)
-#define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE)
-#define X_ENABLE_READ READ(X_ENABLE_PIN)
-
-// X2 motor
-#if ENABLED(DUAL_X_CARRIAGE)
- #define X2_STEP_INIT SET_OUTPUT(X2_STEP_PIN)
- #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE)
- #define X2_STEP_READ READ(X2_STEP_PIN)
-
- #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN)
- #define X2_DIR_WRITE(STATE) WRITE(X2_DIR_PIN,STATE)
- #define X2_DIR_READ READ(X_DIR_PIN)
-
- #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN)
- #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE)
- #define X2_ENABLE_READ READ(X_ENABLE_PIN)
-#endif // DUAL_X_CARRIAGE
-
-// Y motor
-#define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN)
-#define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE)
-#define Y_STEP_READ READ(Y_STEP_PIN)
-
-#define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN)
-#define Y_DIR_WRITE(STATE) WRITE(Y_DIR_PIN,STATE)
-#define Y_DIR_READ READ(Y_DIR_PIN)
-
-#define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN)
-#define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE)
-#define Y_ENABLE_READ READ(Y_ENABLE_PIN)
-
-// Y2 motor
-#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
- #define Y2_STEP_INIT SET_OUTPUT(Y2_STEP_PIN)
- #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE)
- #define Y2_STEP_READ READ(Y2_STEP_PIN)
-
- #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN)
- #define Y2_DIR_WRITE(STATE) WRITE(Y2_DIR_PIN,STATE)
- #define Y2_DIR_READ READ(Y2_DIR_PIN)
-
- #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN)
- #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE)
- #define Y2_ENABLE_READ READ(Y2_ENABLE_PIN)
-#endif // Y_DUAL_STEPPER_DRIVERS
-
-// Z motor
-#define Z_STEP_INIT SET_OUTPUT(Z_STEP_PIN)
-#define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE)
-#define Z_STEP_READ READ(Z_STEP_PIN)
-
-#define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN)
-#define Z_DIR_WRITE(STATE) WRITE(Z_DIR_PIN,STATE)
-#define Z_DIR_READ READ(Z_DIR_PIN)
-
-#define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN)
-#define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE)
-#define Z_ENABLE_READ READ(Z_ENABLE_PIN)
-
-// Z2 motor
-#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
- #define Z2_STEP_INIT SET_OUTPUT(Z2_STEP_PIN)
- #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE)
- #define Z2_STEP_READ READ(Z2_STEP_PIN)
-
- #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN)
- #define Z2_DIR_WRITE(STATE) WRITE(Z2_DIR_PIN,STATE)
- #define Z2_DIR_READ READ(Z2_DIR_PIN)
-
- #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN)
- #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE)
- #define Z2_ENABLE_READ READ(Z2_ENABLE_PIN)
-#endif // Z_DUAL_STEPPER_DRIVERS
-
-// E0 motor
-#define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN)
-#define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE)
-#define E0_STEP_READ READ(E0_STEP_PIN)
-
-#define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN)
-#define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE)
-#define E0_DIR_READ READ(E0_DIR_PIN)
-
-#define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN)
-#define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE)
-#define E0_ENABLE_READ READ(E0_ENABLE_PIN)
-
-// E1 motor
-#define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN)
-#define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE)
-#define E1_STEP_READ READ(E1_STEP_PIN)
-
-#define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN)
-#define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE)
-#define E1_DIR_READ READ(E1_DIR_PIN)
-
-#define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN)
-#define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE)
-#define E1_ENABLE_READ READ(E1_ENABLE_PIN)
-
-// E2 motor
-#define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN)
-#define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE)
-#define E2_STEP_READ READ(E2_STEP_PIN)
-
-#define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN)
-#define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE)
-#define E2_DIR_READ READ(E2_DIR_PIN)
-
-#define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN)
-#define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE)
-#define E2_ENABLE_READ READ(E2_ENABLE_PIN)
-
-// E3 motor
-#define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN)
-#define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE)
-#define E3_STEP_READ READ(E3_STEP_PIN)
-
-#define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN)
-#define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE)
-#define E3_DIR_READ READ(E3_DIR_PIN)
-
-#define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN)
-#define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE)
-#define E3_ENABLE_READ READ(E3_ENABLE_PIN)
-
-#if EXTRUDERS > 3
- #define E_STEP_WRITE(v) {switch(current_block->active_extruder){case 3:E3_STEP_WRITE(v);break;case 2:E2_STEP_WRITE(v);break;case 1:E1_STEP_WRITE(v);break;default:E0_STEP_WRITE(v);}}
- #define NORM_E_DIR() {switch(current_block->active_extruder){case 3:E3_DIR_WRITE(!INVERT_E3_DIR);break;case 2:E2_DIR_WRITE(!INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(!INVERT_E1_DIR);break;default:E0_DIR_WRITE(!INVERT_E0_DIR);}}
- #define REV_E_DIR() {switch(current_block->active_extruder){case 3:E3_DIR_WRITE(INVERT_E3_DIR);break;case 2:E2_DIR_WRITE(INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(INVERT_E1_DIR);break;default:E0_DIR_WRITE(INVERT_E0_DIR);}}
-#elif EXTRUDERS > 2
- #define E_STEP_WRITE(v) {switch(current_block->active_extruder){case 2:E2_STEP_WRITE(v);break;case 1:E1_STEP_WRITE(v);break;default:E0_STEP_WRITE(v);}}
- #define NORM_E_DIR() {switch(current_block->active_extruder){case 2:E2_DIR_WRITE(!INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(!INVERT_E1_DIR);break;default:E0_DIR_WRITE(!INVERT_E0_DIR);}}
- #define REV_E_DIR() {switch(current_block->active_extruder){case 2:E2_DIR_WRITE(INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(INVERT_E1_DIR);break;default:E0_DIR_WRITE(INVERT_E0_DIR);}}
-#elif EXTRUDERS > 1
- #define _E_STEP_WRITE(v) {if(current_block->active_extruder==1){E1_STEP_WRITE(v);}else{E0_STEP_WRITE(v);}}
- #define _NORM_E_DIR() {if(current_block->active_extruder==1){E1_DIR_WRITE(!INVERT_E1_DIR);}else{E0_DIR_WRITE(!INVERT_E0_DIR);}}
- #define _REV_E_DIR() {if(current_block->active_extruder==1){E1_DIR_WRITE(INVERT_E1_DIR);}else{E0_DIR_WRITE(INVERT_E0_DIR);}}
- #if DISABLED(DUAL_X_CARRIAGE)
- #define E_STEP_WRITE(v) _E_STEP_WRITE(v)
- #define NORM_E_DIR() _NORM_E_DIR()
- #define REV_E_DIR() _REV_E_DIR()
- #else
- #define E_STEP_WRITE(v) {if(extruder_duplication_enabled){E0_STEP_WRITE(v);E1_STEP_WRITE(v);}else _E_STEP_WRITE(v);}
- #define NORM_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(!INVERT_E0_DIR);E1_DIR_WRITE(!INVERT_E1_DIR);}else _NORM_E_DIR();}
- #define REV_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(INVERT_E0_DIR);E1_DIR_WRITE(INVERT_E1_DIR);}else _REV_E_DIR();}
- #endif
-#else
- #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
- #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
- #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
-#endif
-
-//////////////////////////////////
-// Pin redefines for TMC drivers.
-// TMC26X drivers have step and dir on normal pins, but everything else via SPI
-//////////////////////////////////
+// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI
#if ENABLED(HAVE_TMCDRIVER)
#include
#include
-
void tmc_init();
- #if ENABLED(X_IS_TMC)
- extern TMC26XStepper stepperX;
- #undef X_ENABLE_INIT
- #define X_ENABLE_INIT ((void)0)
+#endif
- #undef X_ENABLE_WRITE
- #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
+// L6470 has STEP on normal pins, but DIR/ENABLE via SPI
+#if ENABLED(HAVE_L6470DRIVER)
+ #include
+ #include
+ void L6470_init();
+#endif
- #undef X_ENABLE_READ
+// X Stepper
+#if ENABLED(HAVE_L6470DRIVER) && ENABLED(X_IS_L6470)
+ extern L6470 stepperX;
+ #define X_ENABLE_INIT NOOP
+ #define X_ENABLE_WRITE(STATE) do{if(STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree();}while(0)
+ #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ)
+ #define X_DIR_INIT NOOP
+ #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE)
+ #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR)
+#else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(X_IS_TMC)
+ extern TMC26XStepper stepperX;
+ #define X_ENABLE_INIT NOOP
+ #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
#define X_ENABLE_READ stepperX.isEnabled()
-
+ #else
+ #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN)
+ #define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE)
+ #define X_ENABLE_READ READ(X_ENABLE_PIN)
#endif
- #if ENABLED(X2_IS_TMC)
- extern TMC26XStepper stepperX2;
- #undef X2_ENABLE_INIT
- #define X2_ENABLE_INIT ((void)0)
-
- #undef X2_ENABLE_WRITE
- #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
+ #define X_DIR_INIT SET_OUTPUT(X_DIR_PIN)
+ #define X_DIR_WRITE(STATE) WRITE(X_DIR_PIN,STATE)
+ #define X_DIR_READ READ(X_DIR_PIN)
+#endif
+#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN)
+#define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE)
+#define X_STEP_READ READ(X_STEP_PIN)
- #undef X2_ENABLE_READ
- #define X2_ENABLE_READ stepperX2.isEnabled()
- #endif
- #if ENABLED(Y_IS_TMC)
+// Y Stepper
+#if ENABLED(HAVE_L6470DRIVER) && ENABLED(Y_IS_L6470)
+ extern L6470 stepperY;
+ #define Y_ENABLE_INIT NOOP
+ #define Y_ENABLE_WRITE(STATE) do{if(STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree();}while(0)
+ #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ)
+ #define Y_DIR_INIT NOOP
+ #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE)
+ #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR)
+#else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Y_IS_TMC)
extern TMC26XStepper stepperY;
- #undef Y_ENABLE_INIT
- #define Y_ENABLE_INIT ((void)0)
-
- #undef Y_ENABLE_WRITE
+ #define Y_ENABLE_INIT NOOP
#define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
-
- #undef Y_ENABLE_READ
#define Y_ENABLE_READ stepperY.isEnabled()
+ #else
+ #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN)
+ #define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE)
+ #define Y_ENABLE_READ READ(Y_ENABLE_PIN)
#endif
- #if ENABLED(Y2_IS_TMC)
- extern TMC26XStepper stepperY2;
- #undef Y2_ENABLE_INIT
- #define Y2_ENABLE_INIT ((void)0)
-
- #undef Y2_ENABLE_WRITE
- #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
+ #define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN)
+ #define Y_DIR_WRITE(STATE) WRITE(Y_DIR_PIN,STATE)
+ #define Y_DIR_READ READ(Y_DIR_PIN)
+#endif
+#define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN)
+#define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE)
+#define Y_STEP_READ READ(Y_STEP_PIN)
- #undef Y2_ENABLE_READ
- #define Y2_ENABLE_READ stepperY2.isEnabled()
- #endif
- #if ENABLED(Z_IS_TMC)
+// Z Stepper
+#if ENABLED(HAVE_L6470DRIVER) && ENABLED(Z_IS_L6470)
+ extern L6470 stepperZ;
+ #define Z_ENABLE_INIT NOOP
+ #define Z_ENABLE_WRITE(STATE) do{if(STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree();}while(0)
+ #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ)
+ #define Z_DIR_INIT NOOP
+ #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE)
+ #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR)
+#else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Z_IS_TMC)
extern TMC26XStepper stepperZ;
- #undef Z_ENABLE_INIT
- #define Z_ENABLE_INIT ((void)0)
-
- #undef Z_ENABLE_WRITE
+ #define Z_ENABLE_INIT NOOP
#define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
-
- #undef Z_ENABLE_READ
#define Z_ENABLE_READ stepperZ.isEnabled()
+ #else
+ #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN)
+ #define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE)
+ #define Z_ENABLE_READ READ(Z_ENABLE_PIN)
#endif
- #if ENABLED(Z2_IS_TMC)
- extern TMC26XStepper stepperZ2;
- #undef Z2_ENABLE_INIT
- #define Z2_ENABLE_INIT ((void)0)
-
- #undef Z2_ENABLE_WRITE
- #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
-
- #undef Z2_ENABLE_READ
- #define Z2_ENABLE_READ stepperZ2.isEnabled()
- #endif
- #if ENABLED(E0_IS_TMC)
- extern TMC26XStepper stepperE0;
- #undef E0_ENABLE_INIT
- #define E0_ENABLE_INIT ((void)0)
-
- #undef E0_ENABLE_WRITE
- #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
-
- #undef E0_ENABLE_READ
- #define E0_ENABLE_READ stepperE0.isEnabled()
- #endif
- #if ENABLED(E1_IS_TMC)
- extern TMC26XStepper stepperE1;
- #undef E1_ENABLE_INIT
- #define E1_ENABLE_INIT ((void)0)
-
- #undef E1_ENABLE_WRITE
- #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
-
- #undef E1_ENABLE_READ
- #define E1_ENABLE_READ stepperE1.isEnabled()
- #endif
- #if ENABLED(E2_IS_TMC)
- extern TMC26XStepper stepperE2;
- #undef E2_ENABLE_INIT
- #define E2_ENABLE_INIT ((void)0)
-
- #undef E2_ENABLE_WRITE
- #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
-
- #undef E2_ENABLE_READ
- #define E2_ENABLE_READ stepperE2.isEnabled()
- #endif
- #if ENABLED(E3_IS_TMC)
- extern TMC26XStepper stepperE3;
- #undef E3_ENABLE_INIT
- #define E3_ENABLE_INIT ((void)0)
-
- #undef E3_ENABLE_WRITE
- #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
-
- #undef E3_ENABLE_READ
- #define E3_ENABLE_READ stepperE3.isEnabled()
- #endif
-
-#endif // HAVE_TMCDRIVER
-
-//////////////////////////////////
-// Pin redefines for L6470 drivers.
-// L640 drivers have step on normal pins, but dir and everything else via SPI
-//////////////////////////////////
-#if ENABLED(HAVE_L6470DRIVER)
-
- #include
- #include
-
- void L6470_init();
- #if ENABLED(X_IS_L6470)
- extern L6470 stepperX;
- #undef X_ENABLE_INIT
- #define X_ENABLE_INIT ((void)0)
-
- #undef X_ENABLE_WRITE
- #define X_ENABLE_WRITE(STATE) {if(STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree();}
-
- #undef X_ENABLE_READ
- #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ)
-
- #undef X_DIR_INIT
- #define X_DIR_INIT ((void)0)
-
- #undef X_DIR_WRITE
- #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE)
-
- #undef X_DIR_READ
- #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR)
+ #define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN)
+ #define Z_DIR_WRITE(STATE) WRITE(Z_DIR_PIN,STATE)
+ #define Z_DIR_READ READ(Z_DIR_PIN)
+#endif
+#define Z_STEP_INIT SET_OUTPUT(Z_STEP_PIN)
+#define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE)
+#define Z_STEP_READ READ(Z_STEP_PIN)
- #endif
- #if ENABLED(X2_IS_L6470)
+// X2 Stepper
+#if HAS_X2_ENABLE
+ #if ENABLED(HAVE_L6470DRIVER) && ENABLED(X2_IS_L6470)
extern L6470 stepperX2;
- #undef X2_ENABLE_INIT
- #define X2_ENABLE_INIT ((void)0)
-
- #undef X2_ENABLE_WRITE
- #define X2_ENABLE_WRITE(STATE) (if(STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree();)
-
- #undef X2_ENABLE_READ
+ #define X2_ENABLE_INIT NOOP
+ #define X2_ENABLE_WRITE(STATE) do{if(STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree();}while(0)
#define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ)
-
- #undef X2_DIR_INIT
- #define X2_DIR_INIT ((void)0)
-
- #undef X2_DIR_WRITE
+ #define X2_DIR_INIT NOOP
#define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE)
-
- #undef X2_DIR_READ
#define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR)
+ #else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(X2_IS_TMC)
+ extern TMC26XStepper stepperX2;
+ #define X2_ENABLE_INIT NOOP
+ #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
+ #define X2_ENABLE_READ stepperX2.isEnabled()
+ #else
+ #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN)
+ #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE)
+ #define X2_ENABLE_READ READ(X2_ENABLE_PIN)
+ #endif
+ #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN)
+ #define X2_DIR_WRITE(STATE) WRITE(X2_DIR_PIN,STATE)
+ #define X2_DIR_READ READ(X2_DIR_PIN)
#endif
- #if ENABLED(Y_IS_L6470)
- extern L6470 stepperY;
- #undef Y_ENABLE_INIT
- #define Y_ENABLE_INIT ((void)0)
-
- #undef Y_ENABLE_WRITE
- #define Y_ENABLE_WRITE(STATE) (if(STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree();)
-
- #undef Y_ENABLE_READ
- #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ)
-
- #undef Y_DIR_INIT
- #define Y_DIR_INIT ((void)0)
-
- #undef Y_DIR_WRITE
- #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE)
+ #define X2_STEP_INIT SET_OUTPUT(X2_STEP_PIN)
+ #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE)
+ #define X2_STEP_READ READ(X2_STEP_PIN)
+#endif
- #undef Y_DIR_READ
- #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR)
- #endif
- #if ENABLED(Y2_IS_L6470)
+// Y2 Stepper
+#if HAS_Y2_ENABLE
+ #if ENABLED(HAVE_L6470DRIVER) && ENABLED(Y2_IS_L6470)
extern L6470 stepperY2;
- #undef Y2_ENABLE_INIT
- #define Y2_ENABLE_INIT ((void)0)
-
- #undef Y2_ENABLE_WRITE
- #define Y2_ENABLE_WRITE(STATE) (if(STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree();)
-
- #undef Y2_ENABLE_READ
+ #define Y2_ENABLE_INIT NOOP
+ #define Y2_ENABLE_WRITE(STATE) do{if(STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree();}while(0)
#define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ)
-
- #undef Y2_DIR_INIT
- #define Y2_DIR_INIT ((void)0)
-
- #undef Y2_DIR_WRITE
+ #define Y2_DIR_INIT NOOP
#define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE)
-
- #undef Y2_DIR_READ
#define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR)
+ #else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Y2_IS_TMC)
+ extern TMC26XStepper stepperY2;
+ #define Y2_ENABLE_INIT NOOP
+ #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
+ #define Y2_ENABLE_READ stepperY2.isEnabled()
+ #else
+ #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN)
+ #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE)
+ #define Y2_ENABLE_READ READ(Y2_ENABLE_PIN)
+ #endif
+ #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN)
+ #define Y2_DIR_WRITE(STATE) WRITE(Y2_DIR_PIN,STATE)
+ #define Y2_DIR_READ READ(Y2_DIR_PIN)
#endif
- #if ENABLED(Z_IS_L6470)
- extern L6470 stepperZ;
- #undef Z_ENABLE_INIT
- #define Z_ENABLE_INIT ((void)0)
-
- #undef Z_ENABLE_WRITE
- #define Z_ENABLE_WRITE(STATE) (if(STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree();)
-
- #undef Z_ENABLE_READ
- #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ)
-
- #undef Z_DIR_INIT
- #define Z_DIR_INIT ((void)0)
-
- #undef Z_DIR_WRITE
- #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE)
+ #define Y2_STEP_INIT SET_OUTPUT(Y2_STEP_PIN)
+ #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE)
+ #define Y2_STEP_READ READ(Y2_STEP_PIN)
+#endif
- #undef Y_DIR_READ
- #define Y_DIR_READ (stepperZ.getStatus() & STATUS_DIR)
- #endif
- #if ENABLED(Z2_IS_L6470)
+// Z2 Stepper
+#if HAS_Z2_ENABLE
+ #if ENABLED(HAVE_L6470DRIVER) && ENABLED(Z2_IS_L6470)
extern L6470 stepperZ2;
- #undef Z2_ENABLE_INIT
- #define Z2_ENABLE_INIT ((void)0)
-
- #undef Z2_ENABLE_WRITE
- #define Z2_ENABLE_WRITE(STATE) (if(STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree();)
-
- #undef Z2_ENABLE_READ
+ #define Z2_ENABLE_INIT NOOP
+ #define Z2_ENABLE_WRITE(STATE) do{if(STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree();}while(0)
#define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ)
-
- #undef Z2_DIR_INIT
- #define Z2_DIR_INIT ((void)0)
-
- #undef Z2_DIR_WRITE
+ #define Z2_DIR_INIT NOOP
#define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE)
-
- #undef Y2_DIR_READ
- #define Y2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR)
+ #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR)
+ #else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Z2_IS_TMC)
+ extern TMC26XStepper stepperZ2;
+ #define Z2_ENABLE_INIT NOOP
+ #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
+ #define Z2_ENABLE_READ stepperZ2.isEnabled()
+ #else
+ #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN)
+ #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE)
+ #define Z2_ENABLE_READ READ(Z2_ENABLE_PIN)
+ #endif
+ #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN)
+ #define Z2_DIR_WRITE(STATE) WRITE(Z2_DIR_PIN,STATE)
+ #define Z2_DIR_READ READ(Z2_DIR_PIN)
#endif
- #if ENABLED(E0_IS_L6470)
- extern L6470 stepperE0;
- #undef E0_ENABLE_INIT
- #define E0_ENABLE_INIT ((void)0)
-
- #undef E0_ENABLE_WRITE
- #define E0_ENABLE_WRITE(STATE) (if(STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree();)
-
- #undef E0_ENABLE_READ
- #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ)
-
- #undef E0_DIR_INIT
- #define E0_DIR_INIT ((void)0)
-
- #undef E0_DIR_WRITE
- #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE)
+ #define Z2_STEP_INIT SET_OUTPUT(Z2_STEP_PIN)
+ #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE)
+ #define Z2_STEP_READ READ(Z2_STEP_PIN)
+#endif
- #undef E0_DIR_READ
- #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR)
+// E0 Stepper
+#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E0_IS_L6470)
+ extern L6470 stepperE0;
+ #define E0_ENABLE_INIT NOOP
+ #define E0_ENABLE_WRITE(STATE) do{if(STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree();}while(0)
+ #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ)
+ #define E0_DIR_INIT NOOP
+ #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE)
+ #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR)
+#else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E0_IS_TMC)
+ extern TMC26XStepper stepperE0;
+ #define E0_ENABLE_INIT NOOP
+ #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
+ #define E0_ENABLE_READ stepperE0.isEnabled()
+ #else
+ #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN)
+ #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE)
+ #define E0_ENABLE_READ READ(E0_ENABLE_PIN)
#endif
- #if ENABLED(E1_IS_L6470)
- extern L6470 stepperE1;
- #undef E1_ENABLE_INIT
- #define E1_ENABLE_INIT ((void)0)
-
- #undef E1_ENABLE_WRITE
- #define E1_ENABLE_WRITE(STATE) (if(STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree();)
-
- #undef E1_ENABLE_READ
- #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ)
-
- #undef E1_DIR_INIT
- #define E1_DIR_INIT ((void)0)
-
- #undef E1_DIR_WRITE
- #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE)
+ #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN)
+ #define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE)
+ #define E0_DIR_READ READ(E0_DIR_PIN)
+#endif
+#define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN)
+#define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE)
+#define E0_STEP_READ READ(E0_STEP_PIN)
- #undef E1_DIR_READ
- #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR)
+// E1 Stepper
+#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E1_IS_L6470)
+ extern L6470 stepperE1;
+ #define E1_ENABLE_INIT NOOP
+ #define E1_ENABLE_WRITE(STATE) do{if(STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree();}while(0)
+ #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ)
+ #define E1_DIR_INIT NOOP
+ #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE)
+ #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR)
+#else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E1_IS_TMC)
+ extern TMC26XStepper stepperE1;
+ #define E1_ENABLE_INIT NOOP
+ #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
+ #define E1_ENABLE_READ stepperE1.isEnabled()
+ #else
+ #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN)
+ #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE)
+ #define E1_ENABLE_READ READ(E1_ENABLE_PIN)
#endif
- #if ENABLED(E2_IS_L6470)
- extern L6470 stepperE2;
- #undef E2_ENABLE_INIT
- #define E2_ENABLE_INIT ((void)0)
-
- #undef E2_ENABLE_WRITE
- #define E2_ENABLE_WRITE(STATE) (if(STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree();)
-
- #undef E2_ENABLE_READ
- #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ)
-
- #undef E2_DIR_INIT
- #define E2_DIR_INIT ((void)0)
-
- #undef E2_DIR_WRITE
- #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE)
+ #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN)
+ #define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE)
+ #define E1_DIR_READ READ(E1_DIR_PIN)
+#endif
+#define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN)
+#define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE)
+#define E1_STEP_READ READ(E1_STEP_PIN)
- #undef E2_DIR_READ
- #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR)
+// E2 Stepper
+#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E2_IS_L6470)
+ extern L6470 stepperE2;
+ #define E2_ENABLE_INIT NOOP
+ #define E2_ENABLE_WRITE(STATE) do{if(STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree();}while(0)
+ #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ)
+ #define E2_DIR_INIT NOOP
+ #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE)
+ #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR)
+#else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E2_IS_TMC)
+ extern TMC26XStepper stepperE2;
+ #define E2_ENABLE_INIT NOOP
+ #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
+ #define E2_ENABLE_READ stepperE2.isEnabled()
+ #else
+ #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN)
+ #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE)
+ #define E2_ENABLE_READ READ(E2_ENABLE_PIN)
#endif
- #if ENABLED(E3_IS_L6470)
- extern L6470 stepperE3;
- #undef E3_ENABLE_INIT
- #define E3_ENABLE_INIT ((void)0)
-
- #undef E3_ENABLE_WRITE
- #define E3_ENABLE_WRITE(STATE) (if(STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree();)
-
- #undef E3_ENABLE_READ
- #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ)
-
- #undef E3_DIR_INIT
- #define E3_DIR_INIT ((void)0)
-
- #undef E3_DIR_WRITE
- #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE)
+ #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN)
+ #define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE)
+ #define E2_DIR_READ READ(E2_DIR_PIN)
+#endif
+#define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN)
+#define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE)
+#define E2_STEP_READ READ(E2_STEP_PIN)
- #undef E3_DIR_READ
- #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR)
+// E3 Stepper
+#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E3_IS_L6470)
+ extern L6470 stepperE3;
+ #define E3_ENABLE_INIT NOOP
+ #define E3_ENABLE_WRITE(STATE) do{if(STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree();}while(0)
+ #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ)
+ #define E3_DIR_INIT NOOP
+ #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE)
+ #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR)
+#else
+ #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E3_IS_TMC)
+ extern TMC26XStepper stepperE3;
+ #define E3_ENABLE_INIT NOOP
+ #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
+ #define E3_ENABLE_READ stepperE3.isEnabled()
+ #else
+ #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN)
+ #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE)
+ #define E3_ENABLE_READ READ(E3_ENABLE_PIN)
#endif
+ #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN)
+ #define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE)
+ #define E3_DIR_READ READ(E3_DIR_PIN)
+#endif
+#define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN)
+#define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE)
+#define E3_STEP_READ READ(E3_STEP_PIN)
-#endif //HAVE_L6470DRIVER
+/**
+ * Extruder indirection for the single E axis
+ */
+#if ENABLED(SWITCHING_EXTRUDER)
+ #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
+ #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? INVERT_E0_DIR : !INVERT_E0_DIR)
+ #define REV_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? !INVERT_E0_DIR : INVERT_E0_DIR)
+#elif EXTRUDERS > 3
+ #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } }
+ #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); } }
+ #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(INVERT_E3_DIR); } }
+#elif EXTRUDERS > 2
+ #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); } }
+ #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } }
+ #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); } }
+#elif EXTRUDERS > 1
+ #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
+ #define E_STEP_WRITE(v) { if (extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } }
+ #define NORM_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }
+ #define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
+ #else
+ #define E_STEP_WRITE(v) { if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } }
+ #define NORM_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }
+ #define REV_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
+ #endif
+#elif ENABLED(MIXING_EXTRUDER)
+ #define E_STEP_WRITE(v) NOOP /* not used for mixing extruders! */
+ #if MIXING_STEPPERS > 3
+ #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } }
+ #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); E3_DIR_WRITE(!INVERT_E3_DIR); }
+ #define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); E3_DIR_WRITE( INVERT_E3_DIR); }
+ #elif MIXING_STEPPERS > 2
+ #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); } }
+ #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); }
+ #define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); }
+ #else
+ #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); } }
+ #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); }
+ #define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); }
+ #endif
+#else
+ #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
+ #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
+ #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
+#endif
#endif // STEPPER_INDIRECTION_H
diff --git a/Marlin/stopwatch.cpp b/Marlin/stopwatch.cpp
index 7a9e90d3c..ef701a11b 100644
--- a/Marlin/stopwatch.cpp
+++ b/Marlin/stopwatch.cpp
@@ -33,7 +33,7 @@ bool Stopwatch::stop() {
#endif
if (this->isRunning() || this->isPaused()) {
- this->state = STOPWATCH_STOPPED;
+ this->state = STOPPED;
this->stopTimestamp = millis();
return true;
}
@@ -46,7 +46,7 @@ bool Stopwatch::pause() {
#endif
if (this->isRunning()) {
- this->state = STOPWATCH_PAUSED;
+ this->state = PAUSED;
this->stopTimestamp = millis();
return true;
}
@@ -62,7 +62,7 @@ bool Stopwatch::start() {
if (this->isPaused()) this->accumulator = this->duration();
else this->reset();
- this->state = STOPWATCH_RUNNING;
+ this->state = RUNNING;
this->startTimestamp = millis();
return true;
}
@@ -74,23 +74,23 @@ void Stopwatch::reset() {
Stopwatch::debug(PSTR("reset"));
#endif
- this->state = STOPWATCH_STOPPED;
+ this->state = STOPPED;
this->startTimestamp = 0;
this->stopTimestamp = 0;
this->accumulator = 0;
}
bool Stopwatch::isRunning() {
- return (this->state == STOPWATCH_RUNNING) ? true : false;
+ return (this->state == RUNNING) ? true : false;
}
bool Stopwatch::isPaused() {
- return (this->state == STOPWATCH_PAUSED) ? true : false;
+ return (this->state == PAUSED) ? true : false;
}
-uint16_t Stopwatch::duration() {
+millis_t Stopwatch::duration() {
return (((this->isRunning()) ? millis() : this->stopTimestamp)
- - this->startTimestamp) / 1000 + this->accumulator;
+ - this->startTimestamp) / 1000UL + this->accumulator;
}
#if ENABLED(DEBUG_STOPWATCH)
diff --git a/Marlin/stopwatch.h b/Marlin/stopwatch.h
index f5ce2335a..709482884 100644
--- a/Marlin/stopwatch.h
+++ b/Marlin/stopwatch.h
@@ -28,12 +28,6 @@
// Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM)
//#define DEBUG_STOPWATCH
-enum StopwatchState {
- STOPWATCH_STOPPED,
- STOPWATCH_RUNNING,
- STOPWATCH_PAUSED
-};
-
/**
* @brief Stopwatch class
* @details This class acts as a timer proving stopwatch functionality including
@@ -41,10 +35,16 @@ enum StopwatchState {
*/
class Stopwatch {
private:
- StopwatchState state;
- uint16_t accumulator;
- uint32_t startTimestamp;
- uint32_t stopTimestamp;
+ enum State {
+ STOPPED,
+ RUNNING,
+ PAUSED
+ };
+
+ Stopwatch::State state;
+ millis_t accumulator;
+ millis_t startTimestamp;
+ millis_t stopTimestamp;
public:
/**
@@ -101,7 +101,7 @@ class Stopwatch {
* @details Returns the total number of seconds the timer has been running.
* @return the delta since starting the stopwatch
*/
- uint16_t duration();
+ millis_t duration();
#if ENABLED(DEBUG_STOPWATCH)
diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp
index 02766f8be..552ef8b2d 100644
--- a/Marlin/temperature.cpp
+++ b/Marlin/temperature.cpp
@@ -27,8 +27,11 @@
#include "Marlin.h"
#include "ultralcd.h"
#include "temperature.h"
+#include "thermistortables.h"
#include "language.h"
-#include "Sd2PinMap.h"
+#if ENABLED(BABYSTEPPING)
+ #include "stepper.h"
+#endif
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"
@@ -42,21 +45,20 @@
static void* heater_ttbl_map[2] = {(void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN };
#else
- static void* heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE);
- static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN);
+ static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE);
+ static uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN);
#endif
Temperature thermalManager;
// public:
-int Temperature::current_temperature_raw[EXTRUDERS] = { 0 };
-float Temperature::current_temperature[EXTRUDERS] = { 0.0 };
-int Temperature::target_temperature[EXTRUDERS] = { 0 };
-
-int Temperature::current_temperature_bed_raw = 0;
-float Temperature::current_temperature_bed = 0.0;
-int Temperature::target_temperature_bed = 0;
+float Temperature::current_temperature[HOTENDS] = { 0.0 },
+ Temperature::current_temperature_bed = 0.0;
+int Temperature::current_temperature_raw[HOTENDS] = { 0 },
+ Temperature::target_temperature[HOTENDS] = { 0 },
+ Temperature::current_temperature_bed_raw = 0,
+ Temperature::target_temperature_bed = 0;
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
float Temperature::redundant_temperature = 0.0;
@@ -69,18 +71,18 @@ unsigned char Temperature::soft_pwm_bed;
#endif
#if ENABLED(PIDTEMP)
- #if ENABLED(PID_PARAMS_PER_EXTRUDER)
- float Temperature::Kp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kp),
- Temperature::Ki[EXTRUDERS] = ARRAY_BY_EXTRUDERS1((DEFAULT_Ki) * (PID_dT)),
- Temperature::Kd[EXTRUDERS] = ARRAY_BY_EXTRUDERS1((DEFAULT_Kd) / (PID_dT));
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- float Temperature::Kc[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kc);
+ #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
+ float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp),
+ Temperature::Ki[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Ki) * (PID_dT)),
+ Temperature::Kd[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Kd) / (PID_dT));
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ float Temperature::Kc[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kc);
#endif
#else
float Temperature::Kp = DEFAULT_Kp,
Temperature::Ki = (DEFAULT_Ki) * (PID_dT),
Temperature::Kd = (DEFAULT_Kd) / (PID_dT);
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ #if ENABLED(PID_EXTRUSION_SCALING)
float Temperature::Kc = DEFAULT_Kc;
#endif
#endif
@@ -97,16 +99,17 @@ unsigned char Temperature::soft_pwm_bed;
#endif
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
- int Temperature::watch_target_temp[EXTRUDERS] = { 0 };
- millis_t Temperature::watch_heater_next_ms[EXTRUDERS] = { 0 };
+ int Temperature::watch_target_temp[HOTENDS] = { 0 };
+ millis_t Temperature::watch_heater_next_ms[HOTENDS] = { 0 };
#endif
-#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_BED_TEMP_PERIOD > 0
+#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
int Temperature::watch_target_bed_temp = 0;
millis_t Temperature::watch_bed_next_ms = 0;
#endif
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
+ bool Temperature::allow_cold_extrude = false;
float Temperature::extrude_min_temp = EXTRUDE_MINTEMP;
#endif
@@ -120,34 +123,34 @@ unsigned char Temperature::soft_pwm_bed;
volatile bool Temperature::temp_meas_ready = false;
#if ENABLED(PIDTEMP)
- float Temperature::temp_iState[EXTRUDERS] = { 0 };
- float Temperature::temp_dState[EXTRUDERS] = { 0 };
- float Temperature::pTerm[EXTRUDERS];
- float Temperature::iTerm[EXTRUDERS];
- float Temperature::dTerm[EXTRUDERS];
-
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- float Temperature::cTerm[EXTRUDERS];
- long Temperature::last_position[EXTRUDERS];
+ float Temperature::temp_iState[HOTENDS] = { 0 },
+ Temperature::temp_dState[HOTENDS] = { 0 },
+ Temperature::pTerm[HOTENDS],
+ Temperature::iTerm[HOTENDS],
+ Temperature::dTerm[HOTENDS];
+
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ float Temperature::cTerm[HOTENDS];
+ long Temperature::last_e_position;
long Temperature::lpq[LPQ_MAX_LEN];
int Temperature::lpq_ptr = 0;
#endif
- float Temperature::pid_error[EXTRUDERS];
- float Temperature::temp_iState_min[EXTRUDERS];
- float Temperature::temp_iState_max[EXTRUDERS];
- bool Temperature::pid_reset[EXTRUDERS];
+ float Temperature::pid_error[HOTENDS],
+ Temperature::temp_iState_min[HOTENDS],
+ Temperature::temp_iState_max[HOTENDS];
+ bool Temperature::pid_reset[HOTENDS];
#endif
#if ENABLED(PIDTEMPBED)
- float Temperature::temp_iState_bed = { 0 };
- float Temperature::temp_dState_bed = { 0 };
- float Temperature::pTerm_bed;
- float Temperature::iTerm_bed;
- float Temperature::dTerm_bed;
- float Temperature::pid_error_bed;
- float Temperature::temp_iState_min_bed;
- float Temperature::temp_iState_max_bed;
+ float Temperature::temp_iState_bed = { 0 },
+ Temperature::temp_dState_bed = { 0 },
+ Temperature::pTerm_bed,
+ Temperature::iTerm_bed,
+ Temperature::dTerm_bed,
+ Temperature::pid_error_bed,
+ Temperature::temp_iState_min_bed,
+ Temperature::temp_iState_max_bed;
#else
millis_t Temperature::next_bed_check_ms;
#endif
@@ -156,10 +159,18 @@ unsigned long Temperature::raw_temp_value[4] = { 0 };
unsigned long Temperature::raw_temp_bed_value = 0;
// Init min and max temp with extreme values to prevent false errors during startup
-int Temperature::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);
-int Temperature::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);
-int Temperature::minttemp[EXTRUDERS] = { 0 };
-int Temperature::maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(16383);
+int Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP),
+ Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP),
+ Temperature::minttemp[HOTENDS] = { 0 },
+ Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383);
+
+#ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ int Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 };
+#endif
+
+#ifdef MILLISECONDS_PREHEAT_TIME
+ unsigned long Temperature::preheat_end_time[HOTENDS] = { 0 };
+#endif
#ifdef BED_MINTEMP
int Temperature::bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP;
@@ -177,7 +188,7 @@ int Temperature::maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(16383);
millis_t Temperature::next_auto_fan_check_ms;
#endif
-unsigned char Temperature::soft_pwm[EXTRUDERS];
+unsigned char Temperature::soft_pwm[HOTENDS];
#if ENABLED(FAN_SOFT_PWM)
unsigned char Temperature::soft_pwm_fan[FAN_COUNT];
@@ -189,7 +200,7 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
#if HAS_PID_HEATING
- void Temperature::PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false*/) {
+ void Temperature::PID_autotune(float temp, int hotend, int ncycles, bool set_result/*=false*/) {
float input = 0.0;
int cycles = 0;
bool heating = true;
@@ -206,15 +217,18 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
next_auto_fan_check_ms = temp_ms + 2500UL;
#endif
- if (false
- #if ENABLED(PIDTEMP)
- || extruder >= EXTRUDERS
- #else
- || extruder >= 0
- #endif
- #if DISABLED(PIDTEMPBED)
- || extruder < 0
- #endif
+ if (hotend >=
+ #if ENABLED(PIDTEMP)
+ HOTENDS
+ #else
+ 0
+ #endif
+ || hotend <
+ #if ENABLED(PIDTEMPBED)
+ -1
+ #else
+ 0
+ #endif
) {
SERIAL_ECHOLN(MSG_PID_BAD_EXTRUDER_NUM);
return;
@@ -225,18 +239,20 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
disable_all_heaters(); // switch off all heaters.
#if HAS_PID_FOR_BOTH
- if (extruder < 0)
+ if (hotend < 0)
soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2;
else
- soft_pwm[extruder] = bias = d = (PID_MAX) / 2;
+ soft_pwm[hotend] = bias = d = (PID_MAX) / 2;
#elif ENABLED(PIDTEMP)
- soft_pwm[extruder] = bias = d = (PID_MAX) / 2;
+ soft_pwm[hotend] = bias = d = (PID_MAX) / 2;
#else
soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2;
#endif
+ wait_for_heatup = true;
+
// PID Tuning loop
- for (;;) {
+ while (wait_for_heatup) {
millis_t ms = millis();
@@ -245,9 +261,9 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
input =
#if HAS_PID_FOR_BOTH
- extruder < 0 ? current_temperature_bed : current_temperature[extruder]
+ hotend < 0 ? current_temperature_bed : current_temperature[hotend]
#elif ENABLED(PIDTEMP)
- current_temperature[extruder]
+ current_temperature[hotend]
#else
current_temperature_bed
#endif
@@ -267,12 +283,12 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
if (ELAPSED(ms, t2 + 5000UL)) {
heating = false;
#if HAS_PID_FOR_BOTH
- if (extruder < 0)
+ if (hotend < 0)
soft_pwm_bed = (bias - d) >> 1;
else
- soft_pwm[extruder] = (bias - d) >> 1;
+ soft_pwm[hotend] = (bias - d) >> 1;
#elif ENABLED(PIDTEMP)
- soft_pwm[extruder] = (bias - d) >> 1;
+ soft_pwm[hotend] = (bias - d) >> 1;
#elif ENABLED(PIDTEMPBED)
soft_pwm_bed = (bias - d) >> 1;
#endif
@@ -290,7 +306,7 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
if (cycles > 0) {
long max_pow =
#if HAS_PID_FOR_BOTH
- extruder < 0 ? MAX_BED_POWER : PID_MAX
+ hotend < 0 ? MAX_BED_POWER : PID_MAX
#elif ENABLED(PIDTEMP)
PID_MAX
#else
@@ -301,47 +317,47 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
bias = constrain(bias, 20, max_pow - 20);
d = (bias > max_pow / 2) ? max_pow - 1 - bias : bias;
- SERIAL_PROTOCOLPGM(MSG_BIAS); SERIAL_PROTOCOL(bias);
- SERIAL_PROTOCOLPGM(MSG_D); SERIAL_PROTOCOL(d);
- SERIAL_PROTOCOLPGM(MSG_T_MIN); SERIAL_PROTOCOL(min);
- SERIAL_PROTOCOLPGM(MSG_T_MAX); SERIAL_PROTOCOLLN(max);
+ SERIAL_PROTOCOLPAIR(MSG_BIAS, bias);
+ SERIAL_PROTOCOLPAIR(MSG_D, d);
+ SERIAL_PROTOCOLPAIR(MSG_T_MIN, min);
+ SERIAL_PROTOCOLPAIR(MSG_T_MAX, max);
if (cycles > 2) {
- Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0);
- Tu = ((float)(t_low + t_high) / 1000.0);
- SERIAL_PROTOCOLPGM(MSG_KU); SERIAL_PROTOCOL(Ku);
- SERIAL_PROTOCOLPGM(MSG_TU); SERIAL_PROTOCOLLN(Tu);
+ Ku = (4.0 * d) / (3.14159265 * (max - min) * 0.5);
+ Tu = ((float)(t_low + t_high) * 0.001);
+ SERIAL_PROTOCOLPAIR(MSG_KU, Ku);
+ SERIAL_PROTOCOLPAIR(MSG_TU, Tu);
workKp = 0.6 * Ku;
workKi = 2 * workKp / Tu;
- workKd = workKp * Tu / 8;
+ workKd = workKp * Tu * 0.125;
SERIAL_PROTOCOLLNPGM(MSG_CLASSIC_PID);
- SERIAL_PROTOCOLPGM(MSG_KP); SERIAL_PROTOCOLLN(workKp);
- SERIAL_PROTOCOLPGM(MSG_KI); SERIAL_PROTOCOLLN(workKi);
- SERIAL_PROTOCOLPGM(MSG_KD); SERIAL_PROTOCOLLN(workKd);
+ SERIAL_PROTOCOLPAIR(MSG_KP, workKp);
+ SERIAL_PROTOCOLPAIR(MSG_KI, workKi);
+ SERIAL_PROTOCOLPAIR(MSG_KD, workKd);
/**
workKp = 0.33*Ku;
workKi = workKp/Tu;
workKd = workKp*Tu/3;
- SERIAL_PROTOCOLLNPGM(" Some overshoot ");
- SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(workKp);
- SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(workKi);
- SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(workKd);
+ SERIAL_PROTOCOLLNPGM(" Some overshoot");
+ SERIAL_PROTOCOLPAIR(" Kp: ", workKp);
+ SERIAL_PROTOCOLPAIR(" Ki: ", workKi);
+ SERIAL_PROTOCOLPAIR(" Kd: ", workKd);
workKp = 0.2*Ku;
workKi = 2*workKp/Tu;
workKd = workKp*Tu/3;
- SERIAL_PROTOCOLLNPGM(" No overshoot ");
- SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(workKp);
- SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(workKi);
- SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(workKd);
+ SERIAL_PROTOCOLLNPGM(" No overshoot");
+ SERIAL_PROTOCOLPAIR(" Kp: ", workKp);
+ SERIAL_PROTOCOLPAIR(" Ki: ", workKi);
+ SERIAL_PROTOCOLPAIR(" Kd: ", workKd);
*/
}
}
#if HAS_PID_FOR_BOTH
- if (extruder < 0)
+ if (hotend < 0)
soft_pwm_bed = (bias + d) >> 1;
else
- soft_pwm[extruder] = (bias + d) >> 1;
+ soft_pwm[hotend] = (bias + d) >> 1;
#elif ENABLED(PIDTEMP)
- soft_pwm[extruder] = (bias + d) >> 1;
+ soft_pwm[hotend] = (bias + d) >> 1;
#else
soft_pwm_bed = (bias + d) >> 1;
#endif
@@ -373,18 +389,18 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED);
#if HAS_PID_FOR_BOTH
- const char* estring = extruder < 0 ? "bed" : "";
- SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kp "); SERIAL_PROTOCOLLN(workKp);
- SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Ki "); SERIAL_PROTOCOLLN(workKi);
- SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kd "); SERIAL_PROTOCOLLN(workKd);
+ const char* estring = hotend < 0 ? "bed" : "";
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp);
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi);
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd);
#elif ENABLED(PIDTEMP)
- SERIAL_PROTOCOLPGM("#define DEFAULT_Kp "); SERIAL_PROTOCOLLN(workKp);
- SERIAL_PROTOCOLPGM("#define DEFAULT_Ki "); SERIAL_PROTOCOLLN(workKi);
- SERIAL_PROTOCOLPGM("#define DEFAULT_Kd "); SERIAL_PROTOCOLLN(workKd);
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_Kp ", workKp);
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_Ki ", workKi);
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_Kd ", workKd);
#else
- SERIAL_PROTOCOLPGM("#define DEFAULT_bedKp "); SERIAL_PROTOCOLLN(workKp);
- SERIAL_PROTOCOLPGM("#define DEFAULT_bedKi "); SERIAL_PROTOCOLLN(workKi);
- SERIAL_PROTOCOLPGM("#define DEFAULT_bedKd "); SERIAL_PROTOCOLLN(workKd);
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKp ", workKp);
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKi ", workKi);
+ SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKd ", workKd);
#endif
#define _SET_BED_PID() \
@@ -394,15 +410,15 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
updatePID()
#define _SET_EXTRUDER_PID() \
- PID_PARAM(Kp, extruder) = workKp; \
- PID_PARAM(Ki, extruder) = scalePID_i(workKi); \
- PID_PARAM(Kd, extruder) = scalePID_d(workKd); \
+ PID_PARAM(Kp, hotend) = workKp; \
+ PID_PARAM(Ki, hotend) = scalePID_i(workKi); \
+ PID_PARAM(Kd, hotend) = scalePID_d(workKd); \
updatePID()
// Use the result? (As with "M303 U1")
if (set_result) {
#if HAS_PID_FOR_BOTH
- if (extruder < 0) {
+ if (hotend < 0) {
_SET_BED_PID();
}
else {
@@ -418,6 +434,7 @@ unsigned char Temperature::soft_pwm[EXTRUDERS];
}
lcd_update();
}
+ if (!wait_for_heatup) disable_all_heaters();
}
#endif // HAS_PID_HEATING
@@ -430,11 +447,11 @@ Temperature::Temperature() { }
void Temperature::updatePID() {
#if ENABLED(PIDTEMP)
- for (int e = 0; e < EXTRUDERS; e++) {
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ last_e_position = 0;
+ #endif
+ HOTEND_LOOP() {
temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e);
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- last_position[e] = 0;
- #endif
}
#endif
#if ENABLED(PIDTEMPBED)
@@ -459,12 +476,12 @@ int Temperature::getHeaterPower(int heater) {
EXTRUDER_3_AUTO_FAN_PIN == EXTRUDER_2_AUTO_FAN_PIN ? 2 : 3
};
uint8_t fanState = 0;
- for (int f = 0; f <= EXTRUDERS; f++) {
- if (current_temperature[f] > EXTRUDER_AUTO_FAN_TEMPERATURE)
- SBI(fanState, fanBit[f]);
+ HOTEND_LOOP() {
+ if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE)
+ SBI(fanState, fanBit[e]);
}
uint8_t fanDone = 0;
- for (int f = 0; f <= 3; f++) {
+ for (int8_t f = 0; f <= 3; f++) {
int8_t pin = fanPin[f];
if (pin >= 0 && !TEST(fanDone, fanBit[f])) {
unsigned char newFanSpeed = TEST(fanState, fanBit[f]) ? EXTRUDER_AUTO_FAN_SPEED : 0;
@@ -501,95 +518,97 @@ void Temperature::_temp_error(int e, const char* serial_msg, const char* lcd_msg
}
void Temperature::max_temp_error(uint8_t e) {
- _temp_error(e, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP));
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ _temp_error(HOTEND_INDEX, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP));
}
void Temperature::min_temp_error(uint8_t e) {
- _temp_error(e, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP));
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ _temp_error(HOTEND_INDEX, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP));
}
float Temperature::get_pid_output(int e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #define _HOTEND_TEST true
+ #else
+ #define _HOTEND_TEST e == active_extruder
+ #endif
float pid_output;
#if ENABLED(PIDTEMP)
#if DISABLED(PID_OPENLOOP)
- pid_error[e] = target_temperature[e] - current_temperature[e];
- dTerm[e] = K2 * PID_PARAM(Kd, e) * (current_temperature[e] - temp_dState[e]) + K1 * dTerm[e];
- temp_dState[e] = current_temperature[e];
- if (pid_error[e] > PID_FUNCTIONAL_RANGE) {
+ pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX];
+ dTerm[HOTEND_INDEX] = K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + K1 * dTerm[HOTEND_INDEX];
+ temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX];
+ if (pid_error[HOTEND_INDEX] > PID_FUNCTIONAL_RANGE) {
pid_output = BANG_MAX;
- pid_reset[e] = true;
+ pid_reset[HOTEND_INDEX] = true;
}
- else if (pid_error[e] < -(PID_FUNCTIONAL_RANGE) || target_temperature[e] == 0) {
+ else if (pid_error[HOTEND_INDEX] < -(PID_FUNCTIONAL_RANGE) || target_temperature[HOTEND_INDEX] == 0) {
pid_output = 0;
- pid_reset[e] = true;
+ pid_reset[HOTEND_INDEX] = true;
}
else {
- if (pid_reset[e]) {
- temp_iState[e] = 0.0;
- pid_reset[e] = false;
+ if (pid_reset[HOTEND_INDEX]) {
+ temp_iState[HOTEND_INDEX] = 0.0;
+ pid_reset[HOTEND_INDEX] = false;
}
- pTerm[e] = PID_PARAM(Kp, e) * pid_error[e];
- temp_iState[e] += pid_error[e];
- temp_iState[e] = constrain(temp_iState[e], temp_iState_min[e], temp_iState_max[e]);
- iTerm[e] = PID_PARAM(Ki, e) * temp_iState[e];
+ pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX];
+ temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX];
+ temp_iState[HOTEND_INDEX] = constrain(temp_iState[HOTEND_INDEX], temp_iState_min[HOTEND_INDEX], temp_iState_max[HOTEND_INDEX]);
+ iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX];
- pid_output = pTerm[e] + iTerm[e] - dTerm[e];
+ pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX];
- #if ENABLED(SINGLENOZZLE)
- #define _NOZZLE_TEST true
- #define _NOZZLE_EXTRUDER active_extruder
- #define _CTERM_INDEX 0
- #else
- #define _NOZZLE_TEST e == active_extruder
- #define _NOZZLE_EXTRUDER e
- #define _CTERM_INDEX e
- #endif
-
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- cTerm[_CTERM_INDEX] = 0;
- if (_NOZZLE_TEST) {
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ cTerm[HOTEND_INDEX] = 0;
+ if (_HOTEND_TEST) {
long e_position = stepper.position(E_AXIS);
- if (e_position > last_position[_NOZZLE_EXTRUDER]) {
- lpq[lpq_ptr++] = e_position - last_position[_NOZZLE_EXTRUDER];
- last_position[_NOZZLE_EXTRUDER] = e_position;
+ if (e_position > last_e_position) {
+ lpq[lpq_ptr] = e_position - last_e_position;
+ last_e_position = e_position;
}
else {
- lpq[lpq_ptr++] = 0;
+ lpq[lpq_ptr] = 0;
}
- if (lpq_ptr >= lpq_len) lpq_ptr = 0;
- cTerm[_CTERM_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_unit[E_AXIS]) * PID_PARAM(Kc, e);
- pid_output += cTerm[e];
+ if (++lpq_ptr >= lpq_len) lpq_ptr = 0;
+ cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX);
+ pid_output += cTerm[HOTEND_INDEX];
}
- #endif //PID_ADD_EXTRUSION_RATE
+ #endif // PID_EXTRUSION_SCALING
if (pid_output > PID_MAX) {
- if (pid_error[e] > 0) temp_iState[e] -= pid_error[e]; // conditional un-integration
+ if (pid_error[HOTEND_INDEX] > 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration
pid_output = PID_MAX;
}
else if (pid_output < 0) {
- if (pid_error[e] < 0) temp_iState[e] -= pid_error[e]; // conditional un-integration
+ if (pid_error[HOTEND_INDEX] < 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration
pid_output = 0;
}
}
#else
- pid_output = constrain(target_temperature[e], 0, PID_MAX);
+ pid_output = constrain(target_temperature[HOTEND_INDEX], 0, PID_MAX);
#endif //PID_OPENLOOP
#if ENABLED(PID_DEBUG)
SERIAL_ECHO_START;
- SERIAL_ECHOPAIR(MSG_PID_DEBUG, e);
- SERIAL_ECHOPAIR(MSG_PID_DEBUG_INPUT, current_temperature[e]);
+ SERIAL_ECHOPAIR(MSG_PID_DEBUG, HOTEND_INDEX);
+ SERIAL_ECHOPAIR(MSG_PID_DEBUG_INPUT, current_temperature[HOTEND_INDEX]);
SERIAL_ECHOPAIR(MSG_PID_DEBUG_OUTPUT, pid_output);
- SERIAL_ECHOPAIR(MSG_PID_DEBUG_PTERM, pTerm[e]);
- SERIAL_ECHOPAIR(MSG_PID_DEBUG_ITERM, iTerm[e]);
- SERIAL_ECHOPAIR(MSG_PID_DEBUG_DTERM, dTerm[e]);
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- SERIAL_ECHOPAIR(MSG_PID_DEBUG_CTERM, cTerm[e]);
+ SERIAL_ECHOPAIR(MSG_PID_DEBUG_PTERM, pTerm[HOTEND_INDEX]);
+ SERIAL_ECHOPAIR(MSG_PID_DEBUG_ITERM, iTerm[HOTEND_INDEX]);
+ SERIAL_ECHOPAIR(MSG_PID_DEBUG_DTERM, dTerm[HOTEND_INDEX]);
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ SERIAL_ECHOPAIR(MSG_PID_DEBUG_CTERM, cTerm[HOTEND_INDEX]);
#endif
SERIAL_EOL;
#endif //PID_DEBUG
#else /* PID off */
- pid_output = (current_temperature[e] < target_temperature[e]) ? PID_MAX : 0;
+ pid_output = (current_temperature[HOTEND_INDEX] < target_temperature[HOTEND_INDEX]) ? PID_MAX : 0;
#endif
return pid_output;
@@ -623,16 +642,16 @@ float Temperature::get_pid_output(int e) {
#if ENABLED(PID_BED_DEBUG)
SERIAL_ECHO_START;
- SERIAL_ECHO(" PID_BED_DEBUG ");
- SERIAL_ECHO(": Input ");
+ SERIAL_ECHOPGM(" PID_BED_DEBUG ");
+ SERIAL_ECHOPGM(": Input ");
SERIAL_ECHO(current_temperature_bed);
- SERIAL_ECHO(" Output ");
+ SERIAL_ECHOPGM(" Output ");
SERIAL_ECHO(pid_output);
- SERIAL_ECHO(" pTerm ");
+ SERIAL_ECHOPGM(" pTerm ");
SERIAL_ECHO(pTerm_bed);
- SERIAL_ECHO(" iTerm ");
+ SERIAL_ECHOPGM(" iTerm ");
SERIAL_ECHO(iTerm_bed);
- SERIAL_ECHO(" dTerm ");
+ SERIAL_ECHOPGM(" dTerm ");
SERIAL_ECHOLN(dTerm_bed);
#endif //PID_BED_DEBUG
@@ -665,8 +684,8 @@ void Temperature::manage_heater() {
millis_t ms = millis();
#endif
- // Loop through all extruders
- for (int e = 0; e < EXTRUDERS; e++) {
+ // Loop through all hotends
+ HOTEND_LOOP() {
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
@@ -675,7 +694,7 @@ void Temperature::manage_heater() {
float pid_output = get_pid_output(e);
// Check if temperature is within the correct range
- soft_pwm[e] = current_temperature[e] > minttemp[e] && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
+ soft_pwm[e] = (current_temperature[e] > minttemp[e] || is_preheating(e)) && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
// Check if the temperature is failing to increase
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
@@ -719,7 +738,7 @@ void Temperature::manage_heater() {
}
#endif
- } // Extruders Loop
+ } // Hotends Loop
#if HAS_AUTO_FAN
if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently
@@ -737,7 +756,7 @@ void Temperature::manage_heater() {
// Get the delayed info and add 100 to reconstitute to a percent of
// the nominal filament diameter then square it to get an area
meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY);
- float vm = pow((measurement_delay[meas_shift_index] + 100.0) / 100.0, 2);
+ float vm = pow((measurement_delay[meas_shift_index] + 100.0) * 0.01, 2);
NOLESS(vm, 0.01);
volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm;
}
@@ -790,9 +809,9 @@ void Temperature::manage_heater() {
// For hot end temperature measurement.
float Temperature::analog2temp(int raw, uint8_t e) {
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
- if (e > EXTRUDERS)
+ if (e > HOTENDS)
#else
- if (e >= EXTRUDERS)
+ if (e >= HOTENDS)
#endif
{
SERIAL_ERROR_START;
@@ -873,7 +892,7 @@ void Temperature::updateTemperaturesFromRawValues() {
#if ENABLED(HEATER_0_USES_MAX6675)
current_temperature_raw[0] = read_max6675();
#endif
- for (uint8_t e = 0; e < EXTRUDERS; e++) {
+ HOTEND_LOOP() {
current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e);
}
current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw);
@@ -926,15 +945,15 @@ void Temperature::init() {
MCUCR = _BV(JTD);
#endif
- // Finish init of mult extruder arrays
- for (int e = 0; e < EXTRUDERS; e++) {
+ // Finish init of mult hotend arrays
+ HOTEND_LOOP() {
// populate with the first value
maxttemp[e] = maxttemp[0];
#if ENABLED(PIDTEMP)
temp_iState_min[e] = 0.0;
temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e);
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- last_position[e] = 0;
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ last_e_position = 0;
#endif
#endif //PIDTEMP
#if ENABLED(PIDTEMPBED)
@@ -943,6 +962,10 @@ void Temperature::init() {
#endif //PIDTEMPBED
}
+ #if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING)
+ last_e_position = 0;
+ #endif
+
#if HAS_HEATER_0
SET_OUTPUT(HEATER_0_PIN);
#endif
@@ -1000,8 +1023,7 @@ void Temperature::init() {
OUT_WRITE(MOSI_PIN, HIGH);
OUT_WRITE(MISO_PIN, HIGH);
#else
- pinMode(SS_PIN, OUTPUT);
- digitalWrite(SS_PIN, HIGH);
+ OUT_WRITE(SS_PIN, HIGH);
#endif
OUT_WRITE(MAX6675_SS, HIGH);
@@ -1083,30 +1105,30 @@ void Temperature::init() {
#ifdef HEATER_0_MAXTEMP
TEMP_MAX_ROUTINE(0);
#endif
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
#ifdef HEATER_1_MINTEMP
TEMP_MIN_ROUTINE(1);
#endif
#ifdef HEATER_1_MAXTEMP
TEMP_MAX_ROUTINE(1);
#endif
- #if EXTRUDERS > 2
+ #if HOTENDS > 2
#ifdef HEATER_2_MINTEMP
TEMP_MIN_ROUTINE(2);
#endif
#ifdef HEATER_2_MAXTEMP
TEMP_MAX_ROUTINE(2);
#endif
- #if EXTRUDERS > 3
+ #if HOTENDS > 3
#ifdef HEATER_3_MINTEMP
TEMP_MIN_ROUTINE(3);
#endif
#ifdef HEATER_3_MAXTEMP
TEMP_MAX_ROUTINE(3);
#endif
- #endif // EXTRUDERS > 3
- #endif // EXTRUDERS > 2
- #endif // EXTRUDERS > 1
+ #endif // HOTENDS > 3
+ #endif // HOTENDS > 2
+ #endif // HOTENDS > 1
#ifdef BED_MINTEMP
while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) {
@@ -1134,13 +1156,16 @@ void Temperature::init() {
* their target temperature by a configurable margin.
* This is called when the temperature is set. (M104, M109)
*/
- void Temperature::start_watching_heater(int e) {
- if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) {
- watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
- watch_heater_next_ms[e] = millis() + (WATCH_TEMP_PERIOD) * 1000UL;
+ void Temperature::start_watching_heater(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ if (degHotend(HOTEND_INDEX) < degTargetHotend(HOTEND_INDEX) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) {
+ watch_target_temp[HOTEND_INDEX] = degHotend(HOTEND_INDEX) + WATCH_TEMP_INCREASE;
+ watch_heater_next_ms[HOTEND_INDEX] = millis() + (WATCH_TEMP_PERIOD) * 1000UL;
}
else
- watch_heater_next_ms[e] = 0;
+ watch_heater_next_ms[HOTEND_INDEX] = 0;
}
#endif
@@ -1163,8 +1188,8 @@ void Temperature::init() {
#if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
- Temperature::TRState Temperature::thermal_runaway_state_machine[EXTRUDERS] = { TRInactive };
- millis_t Temperature::thermal_runaway_timer[EXTRUDERS] = { 0 };
+ Temperature::TRState Temperature::thermal_runaway_state_machine[HOTENDS] = { TRInactive };
+ millis_t Temperature::thermal_runaway_timer[HOTENDS] = { 0 };
#endif
#if HAS_THERMALLY_PROTECTED_BED
@@ -1174,7 +1199,7 @@ void Temperature::init() {
void Temperature::thermal_runaway_protection(Temperature::TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
- static float tr_target_temperature[EXTRUDERS + 1] = { 0.0 };
+ static float tr_target_temperature[HOTENDS + 1] = { 0.0 };
/**
SERIAL_ECHO_START;
@@ -1187,7 +1212,7 @@ void Temperature::init() {
SERIAL_EOL;
*/
- int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS;
+ int heater_index = heater_id >= 0 ? heater_id : HOTENDS;
// If the target temperature changes, restart
if (tr_target_temperature[heater_index] != target_temperature) {
@@ -1218,14 +1243,14 @@ void Temperature::init() {
#endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED
void Temperature::disable_all_heaters() {
- for (int i = 0; i < EXTRUDERS; i++) setTargetHotend(0, i);
+ HOTEND_LOOP() setTargetHotend(0, e);
setTargetBed(0);
// If all heaters go down then for sure our print job has stopped
print_job_timer.stop();
#define DISABLE_HEATER(NR) { \
- setTargetHotend(NR, 0); \
+ setTargetHotend(0, NR); \
soft_pwm[NR] = 0; \
WRITE_HEATER_ ## NR (LOW); \
}
@@ -1236,15 +1261,15 @@ void Temperature::disable_all_heaters() {
WRITE_HEATER_0P(LOW); // Should HEATERS_PARALLEL apply here? Then change to DISABLE_HEATER(0)
#endif
- #if EXTRUDERS > 1 && HAS_TEMP_1
+ #if HOTENDS > 1 && HAS_TEMP_1
DISABLE_HEATER(1);
#endif
- #if EXTRUDERS > 2 && HAS_TEMP_2
+ #if HOTENDS > 2 && HAS_TEMP_2
DISABLE_HEATER(2);
#endif
- #if EXTRUDERS > 3 && HAS_TEMP_3
+ #if HOTENDS > 3 && HAS_TEMP_3
DISABLE_HEATER(3);
#endif
@@ -1319,25 +1344,6 @@ void Temperature::disable_all_heaters() {
#endif //HEATER_0_USES_MAX6675
-/**
- * Stages in the ISR loop
- */
-enum TempState {
- PrepareTemp_0,
- MeasureTemp_0,
- PrepareTemp_BED,
- MeasureTemp_BED,
- PrepareTemp_1,
- MeasureTemp_1,
- PrepareTemp_2,
- MeasureTemp_2,
- PrepareTemp_3,
- MeasureTemp_3,
- Prepare_FILWIDTH,
- Measure_FILWIDTH,
- StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle
-};
-
/**
* Get raw temperatures
*/
@@ -1390,11 +1396,11 @@ void Temperature::isr() {
// Statics per heater
ISR_STATICS(0);
- #if (EXTRUDERS > 1) || ENABLED(HEATERS_PARALLEL)
+ #if (HOTENDS > 1) || ENABLED(HEATERS_PARALLEL)
ISR_STATICS(1);
- #if EXTRUDERS > 2
+ #if HOTENDS > 2
ISR_STATICS(2);
- #if EXTRUDERS > 3
+ #if HOTENDS > 3
ISR_STATICS(3);
#endif
#endif
@@ -1418,13 +1424,13 @@ void Temperature::isr() {
}
else WRITE_HEATER_0P(0); // If HEATERS_PARALLEL should apply, change to WRITE_HEATER_0
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
soft_pwm_1 = soft_pwm[1];
WRITE_HEATER_1(soft_pwm_1 > 0 ? 1 : 0);
- #if EXTRUDERS > 2
+ #if HOTENDS > 2
soft_pwm_2 = soft_pwm[2];
WRITE_HEATER_2(soft_pwm_2 > 0 ? 1 : 0);
- #if EXTRUDERS > 3
+ #if HOTENDS > 3
soft_pwm_3 = soft_pwm[3];
WRITE_HEATER_3(soft_pwm_3 > 0 ? 1 : 0);
#endif
@@ -1453,11 +1459,11 @@ void Temperature::isr() {
}
if (soft_pwm_0 < pwm_count) WRITE_HEATER_0(0);
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
if (soft_pwm_1 < pwm_count) WRITE_HEATER_1(0);
- #if EXTRUDERS > 2
+ #if HOTENDS > 2
if (soft_pwm_2 < pwm_count) WRITE_HEATER_2(0);
- #if EXTRUDERS > 3
+ #if HOTENDS > 3
if (soft_pwm_3 < pwm_count) WRITE_HEATER_3(0);
#endif
#endif
@@ -1524,11 +1530,11 @@ void Temperature::isr() {
if (slow_pwm_count == 0) {
SLOW_PWM_ROUTINE(0); // EXTRUDER 0
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
SLOW_PWM_ROUTINE(1); // EXTRUDER 1
- #if EXTRUDERS > 2
+ #if HOTENDS > 2
SLOW_PWM_ROUTINE(2); // EXTRUDER 2
- #if EXTRUDERS > 3
+ #if HOTENDS > 3
SLOW_PWM_ROUTINE(3); // EXTRUDER 3
#endif
#endif
@@ -1540,11 +1546,11 @@ void Temperature::isr() {
} // slow_pwm_count == 0
PWM_OFF_ROUTINE(0); // EXTRUDER 0
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
PWM_OFF_ROUTINE(1); // EXTRUDER 1
- #if EXTRUDERS > 2
+ #if HOTENDS > 2
PWM_OFF_ROUTINE(2); // EXTRUDER 2
- #if EXTRUDERS > 3
+ #if HOTENDS > 3
PWM_OFF_ROUTINE(3); // EXTRUDER 3
#endif
#endif
@@ -1589,11 +1595,11 @@ void Temperature::isr() {
// EXTRUDER 0
if (state_timer_heater_0 > 0) state_timer_heater_0--;
- #if EXTRUDERS > 1 // EXTRUDER 1
+ #if HOTENDS > 1 // EXTRUDER 1
if (state_timer_heater_1 > 0) state_timer_heater_1--;
- #if EXTRUDERS > 2 // EXTRUDER 2
+ #if HOTENDS > 2 // EXTRUDER 2
if (state_timer_heater_2 > 0) state_timer_heater_2--;
- #if EXTRUDERS > 3 // EXTRUDER 3
+ #if HOTENDS > 3 // EXTRUDER 3
if (state_timer_heater_3 > 0) state_timer_heater_3--;
#endif
#endif
@@ -1733,37 +1739,73 @@ void Temperature::isr() {
#define GE0 >=
#endif
if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0);
- if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0);
+ if (minttemp_raw[0] GE0 current_temperature_raw[0] && !is_preheating(0) && target_temperature[0] > 0.0f) {
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ if (++consecutive_low_temperature_error[0] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED)
+ #endif
+ min_temp_error(0);
+ }
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ else
+ consecutive_low_temperature_error[0] = 0;
+ #endif
#endif
- #if HAS_TEMP_1 && EXTRUDERS > 1
+ #if HAS_TEMP_1 && HOTENDS > 1
#if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP
#define GE1 <=
#else
#define GE1 >=
#endif
if (current_temperature_raw[1] GE1 maxttemp_raw[1]) max_temp_error(1);
- if (minttemp_raw[1] GE1 current_temperature_raw[1]) min_temp_error(1);
+ if (minttemp_raw[1] GE1 current_temperature_raw[1] && !is_preheating(1) && target_temperature[1] > 0.0f) {
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ if (++consecutive_low_temperature_error[1] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED)
+ #endif
+ min_temp_error(1);
+ }
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ else
+ consecutive_low_temperature_error[1] = 0;
+ #endif
#endif // TEMP_SENSOR_1
- #if HAS_TEMP_2 && EXTRUDERS > 2
+ #if HAS_TEMP_2 && HOTENDS > 2
#if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP
#define GE2 <=
#else
#define GE2 >=
#endif
if (current_temperature_raw[2] GE2 maxttemp_raw[2]) max_temp_error(2);
- if (minttemp_raw[2] GE2 current_temperature_raw[2]) min_temp_error(2);
+ if (minttemp_raw[2] GE2 current_temperature_raw[2] && !is_preheating(2) && target_temperature[2] > 0.0f) {
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ if (++consecutive_low_temperature_error[2] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED)
+ #endif
+ min_temp_error(2);
+ }
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ else
+ consecutive_low_temperature_error[2] = 0;
+ #endif
#endif // TEMP_SENSOR_2
- #if HAS_TEMP_3 && EXTRUDERS > 3
+ #if HAS_TEMP_3 && HOTENDS > 3
#if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP
#define GE3 <=
#else
#define GE3 >=
#endif
if (current_temperature_raw[3] GE3 maxttemp_raw[3]) max_temp_error(3);
- if (minttemp_raw[3] GE3 current_temperature_raw[3]) min_temp_error(3);
+ if (minttemp_raw[3] GE3 current_temperature_raw[3] && !is_preheating(3) && target_temperature[3] > 0.0f) {
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ if (++consecutive_low_temperature_error[3] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED)
+ #endif
+ min_temp_error(3);
+ }
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ else
+ consecutive_low_temperature_error[3] = 0;
+ #endif
#endif // TEMP_SENSOR_3
#if HAS_TEMP_BED
diff --git a/Marlin/temperature.h b/Marlin/temperature.h
index cb5710757..ffb47a59f 100644
--- a/Marlin/temperature.h
+++ b/Marlin/temperature.h
@@ -27,10 +27,12 @@
#ifndef TEMPERATURE_H
#define TEMPERATURE_H
-#include "Marlin.h"
#include "planner.h"
+#include "thermistortables.h"
-#if ENABLED(PID_ADD_EXTRUSION_RATE)
+#include "MarlinConfig.h"
+
+#if ENABLED(PID_EXTRUSION_SCALING)
#include "stepper.h"
#endif
@@ -38,17 +40,26 @@
#define SOFT_PWM_SCALE 0
#endif
+#if HOTENDS == 1
+ #define HOTEND_LOOP() const int8_t e = 0;
+ #define HOTEND_INDEX 0
+ #define EXTRUDER_IDX 0
+#else
+ #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
+ #define HOTEND_INDEX e
+ #define EXTRUDER_IDX active_extruder
+#endif
+
class Temperature {
public:
- static int current_temperature_raw[EXTRUDERS];
- static float current_temperature[EXTRUDERS];
- static int target_temperature[EXTRUDERS];
-
- static int current_temperature_bed_raw;
- static float current_temperature_bed;
- static int target_temperature_bed;
+ static float current_temperature[HOTENDS],
+ current_temperature_bed;
+ static int current_temperature_raw[HOTENDS],
+ target_temperature[HOTENDS],
+ current_temperature_bed_raw,
+ target_temperature_bed;
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
static float redundant_temperature;
@@ -66,23 +77,23 @@ class Temperature {
#if ENABLED(PIDTEMP)
- #if ENABLED(PID_PARAMS_PER_EXTRUDER)
+ #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
- static float Kp[EXTRUDERS], Ki[EXTRUDERS], Kd[EXTRUDERS];
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- static float Kc[EXTRUDERS];
+ static float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS];
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ static float Kc[HOTENDS];
#endif
- #define PID_PARAM(param, e) Temperature::param[e]
+ #define PID_PARAM(param, h) Temperature::param[h]
#else
static float Kp, Ki, Kd;
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
+ #if ENABLED(PID_EXTRUSION_SCALING)
static float Kc;
#endif
- #define PID_PARAM(param, e) Temperature::param
+ #define PID_PARAM(param, h) Temperature::param
- #endif // PID_PARAMS_PER_EXTRUDER
+ #endif // PID_PARAMS_PER_HOTEND
// Apply the scale factors to the PID values
#define scalePID_i(i) ( (i) * PID_dT )
@@ -101,18 +112,24 @@ class Temperature {
#endif
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
- static int watch_target_temp[EXTRUDERS];
- static millis_t watch_heater_next_ms[EXTRUDERS];
+ static int watch_target_temp[HOTENDS];
+ static millis_t watch_heater_next_ms[HOTENDS];
#endif
- #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_BED_TEMP_PERIOD > 0
+ #if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
static int watch_target_bed_temp;
static millis_t watch_bed_next_ms;
#endif
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
+ static bool allow_cold_extrude;
static float extrude_min_temp;
- static bool tooColdToExtrude(uint8_t e) { return degHotend(e) < extrude_min_temp; }
+ static bool tooColdToExtrude(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ return allow_cold_extrude ? false : degHotend(HOTEND_INDEX) < extrude_min_temp;
+ }
#else
static bool tooColdToExtrude(uint8_t e) { UNUSED(e); return false; }
#endif
@@ -127,46 +144,54 @@ class Temperature {
static volatile bool temp_meas_ready;
#if ENABLED(PIDTEMP)
- static float temp_iState[EXTRUDERS];
- static float temp_dState[EXTRUDERS];
- static float pTerm[EXTRUDERS];
- static float iTerm[EXTRUDERS];
- static float dTerm[EXTRUDERS];
-
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- static float cTerm[EXTRUDERS];
- static long last_position[EXTRUDERS];
+ static float temp_iState[HOTENDS],
+ temp_dState[HOTENDS],
+ pTerm[HOTENDS],
+ iTerm[HOTENDS],
+ dTerm[HOTENDS];
+
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ static float cTerm[HOTENDS];
+ static long last_e_position;
static long lpq[LPQ_MAX_LEN];
static int lpq_ptr;
#endif
- static float pid_error[EXTRUDERS];
- static float temp_iState_min[EXTRUDERS];
- static float temp_iState_max[EXTRUDERS];
- static bool pid_reset[EXTRUDERS];
+ static float pid_error[HOTENDS],
+ temp_iState_min[HOTENDS],
+ temp_iState_max[HOTENDS];
+ static bool pid_reset[HOTENDS];
#endif
#if ENABLED(PIDTEMPBED)
- static float temp_iState_bed;
- static float temp_dState_bed;
- static float pTerm_bed;
- static float iTerm_bed;
- static float dTerm_bed;
- static float pid_error_bed;
- static float temp_iState_min_bed;
- static float temp_iState_max_bed;
+ static float temp_iState_bed,
+ temp_dState_bed,
+ pTerm_bed,
+ iTerm_bed,
+ dTerm_bed,
+ pid_error_bed,
+ temp_iState_min_bed,
+ temp_iState_max_bed;
#else
static millis_t next_bed_check_ms;
#endif
- static unsigned long raw_temp_value[4];
- static unsigned long raw_temp_bed_value;
+ static unsigned long raw_temp_value[4],
+ raw_temp_bed_value;
// Init min and max temp with extreme values to prevent false errors during startup
- static int minttemp_raw[EXTRUDERS];
- static int maxttemp_raw[EXTRUDERS];
- static int minttemp[EXTRUDERS];
- static int maxttemp[EXTRUDERS];
+ static int minttemp_raw[HOTENDS],
+ maxttemp_raw[HOTENDS],
+ minttemp[HOTENDS],
+ maxttemp[HOTENDS];
+
+ #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
+ static int consecutive_low_temperature_error[HOTENDS];
+ #endif
+
+ #ifdef MILLISECONDS_PREHEAT_TIME
+ static unsigned long preheat_end_time[HOTENDS];
+ #endif
#ifdef BED_MINTEMP
static int bed_minttemp_raw;
@@ -184,7 +209,7 @@ class Temperature {
static millis_t next_auto_fan_check_ms;
#endif
- static unsigned char soft_pwm[EXTRUDERS];
+ static unsigned char soft_pwm[HOTENDS];
#if ENABLED(FAN_SOFT_PWM)
static unsigned char soft_pwm_fan[FAN_COUNT];
@@ -220,6 +245,32 @@ class Temperature {
*/
static void manage_heater();
+ /**
+ * Preheating hotends
+ */
+ #ifdef MILLISECONDS_PREHEAT_TIME
+ static bool is_preheating(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]);
+ }
+ static void start_preheat_time(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME;
+ }
+ static void reset_preheat_time(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ preheat_end_time[HOTEND_INDEX] = 0;
+ }
+ #else
+ #define is_preheating(n) (false)
+ #endif
+
#if ENABLED(FILAMENT_WIDTH_SENSOR)
static float analog2widthFil(); // Convert raw Filament Width to millimeters
static int widthFil_to_size_ratio(); // Convert raw Filament Width to an extrusion ratio
@@ -230,29 +281,53 @@ class Temperature {
//inline so that there is no performance decrease.
//deg=degreeCelsius
- static float degHotend(uint8_t extruder) { return current_temperature[extruder]; }
+ static float degHotend(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ return current_temperature[HOTEND_INDEX];
+ }
static float degBed() { return current_temperature_bed; }
#if ENABLED(SHOW_TEMP_ADC_VALUES)
- static float rawHotendTemp(uint8_t extruder) { return current_temperature_raw[extruder]; }
+ static float rawHotendTemp(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ return current_temperature_raw[HOTEND_INDEX];
+ }
static float rawBedTemp() { return current_temperature_bed_raw; }
#endif
- static float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }
+ static float degTargetHotend(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ return target_temperature[HOTEND_INDEX];
+ }
static float degTargetBed() { return target_temperature_bed; }
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
- static void start_watching_heater(int e = 0);
+ static void start_watching_heater(uint8_t e = 0);
#endif
#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
static void start_watching_bed();
#endif
- static void setTargetHotend(const float& celsius, uint8_t extruder) {
- target_temperature[extruder] = celsius;
+ static void setTargetHotend(const float& celsius, uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ #ifdef MILLISECONDS_PREHEAT_TIME
+ if (celsius == 0.0f)
+ reset_preheat_time(HOTEND_INDEX);
+ else if (target_temperature[HOTEND_INDEX] == 0.0f)
+ start_preheat_time(HOTEND_INDEX);
+ #endif
+ target_temperature[HOTEND_INDEX] = celsius;
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
- start_watching_heater(extruder);
+ start_watching_heater(HOTEND_INDEX);
#endif
}
@@ -263,10 +338,20 @@ class Temperature {
#endif
}
- static bool isHeatingHotend(uint8_t extruder) { return target_temperature[extruder] > current_temperature[extruder]; }
+ static bool isHeatingHotend(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ return target_temperature[HOTEND_INDEX] > current_temperature[HOTEND_INDEX];
+ }
static bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; }
- static bool isCoolingHotend(uint8_t extruder) { return target_temperature[extruder] < current_temperature[extruder]; }
+ static bool isCoolingHotend(uint8_t e) {
+ #if HOTENDS == 1
+ UNUSED(e);
+ #endif
+ return target_temperature[HOTEND_INDEX] < current_temperature[HOTEND_INDEX];
+ }
static bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; }
/**
@@ -283,7 +368,7 @@ class Temperature {
* Perform auto-tuning for hotend or bed in response to M303
*/
#if HAS_PID_HEATING
- static void PID_autotune(float temp, int extruder, int ncycles, bool set_result=false);
+ static void PID_autotune(float temp, int hotend, int ncycles, bool set_result=false);
#endif
/**
@@ -295,8 +380,8 @@ class Temperature {
#if ENABLED(AUTOTEMP)
if (planner.autotemp_enabled) {
planner.autotemp_enabled = false;
- if (degTargetHotend(active_extruder) > planner.autotemp_min)
- setTargetHotend(0, active_extruder);
+ if (degTargetHotend(EXTRUDER_IDX) > planner.autotemp_min)
+ setTargetHotend(0, EXTRUDER_IDX);
}
#endif
}
@@ -362,8 +447,8 @@ class Temperature {
static void thermal_runaway_protection(TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
- static TRState thermal_runaway_state_machine[EXTRUDERS];
- static millis_t thermal_runaway_timer[EXTRUDERS];
+ static TRState thermal_runaway_state_machine[HOTENDS];
+ static millis_t thermal_runaway_timer[HOTENDS];
#endif
#if HAS_THERMALLY_PROTECTED_BED
diff --git a/Marlin/thermistornames.h b/Marlin/thermistornames.h
new file mode 100644
index 000000000..64829ce74
--- /dev/null
+++ b/Marlin/thermistornames.h
@@ -0,0 +1,95 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#undef THERMISTOR_NAME
+
+// Thermcouples
+#if THERMISTOR_ID == -3
+ #define THERMISTOR_NAME "MAX31855"
+#elif THERMISTOR_ID == -2
+ #define THERMISTOR_NAME "MAX6675"
+#elif THERMISTOR_ID == -1
+ #define THERMISTOR_NAME "AD595"
+
+// Standard thermistors
+#elif THERMISTOR_ID == 1
+ #define THERMISTOR_NAME "EPCOS 100K"
+#elif THERMISTOR_ID == 2
+ #define THERMISTOR_NAME "ATC 204GT-2"
+#elif THERMISTOR_ID == 3
+ #define THERMISTOR_NAME "Mendel-parts"
+#elif THERMISTOR_ID == 4
+ #define THERMISTOR_NAME "Generic 10K"
+#elif THERMISTOR_ID == 5
+ #define THERMISTOR_NAME "ATC 104GT-2"
+#elif THERMISTOR_ID == 6
+ #define THERMISTOR_NAME "EPCOS (alt)"
+#elif THERMISTOR_ID == 7
+ #define THERMISTOR_NAME "HW 104LAG"
+#elif THERMISTOR_ID == 71
+ #define THERMISTOR_NAME "HW 104LAF"
+#elif THERMISTOR_ID == 8
+ #define THERMISTOR_NAME "E3104FXT"
+#elif THERMISTOR_ID == 9
+ #define THERMISTOR_NAME "GE AL03006"
+#elif THERMISTOR_ID == 10
+ #define THERMISTOR_NAME "RS 198-961"
+#elif THERMISTOR_ID == 11
+ #define THERMISTOR_NAME "1% beta 3950"
+#elif THERMISTOR_ID == 12
+ #define THERMISTOR_NAME "E3104FXT (alt)"
+#elif THERMISTOR_ID == 13
+ #define THERMISTOR_NAME "Hisens 3950"
+#elif THERMISTOR_ID == 20
+ #define THERMISTOR_NAME "PT100 UltiMB"
+#elif THERMISTOR_ID == 60
+ #define THERMISTOR_NAME "Makers Tool"
+#elif THERMISTOR_ID == 70
+ #define THERMISTOR_NAME "Hephestos 2"
+
+// Modified thermistors
+#elif THERMISTOR_ID == 51
+ #define THERMISTOR_NAME "EPCOS 1K"
+#elif THERMISTOR_ID == 52
+ #define THERMISTOR_NAME "ATC204GT-2 1K"
+#elif THERMISTOR_ID == 55
+ #define THERMISTOR_NAME "ATC104GT-2 1K"
+#elif THERMISTOR_ID == 1047
+ #define THERMISTOR_NAME "PT1000 4K7"
+#elif THERMISTOR_ID == 1010
+ #define THERMISTOR_NAME "PT1000 1K"
+#elif THERMISTOR_ID == 147
+ #define THERMISTOR_NAME "PT100 4K7"
+#elif THERMISTOR_ID == 110
+ #define THERMISTOR_NAME "PT100 1K"
+
+// High Temperature thermistors
+#elif THERMISTOR_ID == 66
+ #define THERMISTOR_NAME "Dyze 4.7M"
+
+// Dummies for dev testing
+#elif THERMISTOR_ID == 998
+ #define THERMISTOR_NAME "Dummy 1"
+#elif THERMISTOR_ID == 999
+ #define THERMISTOR_NAME "Dummy 2"
+
+#endif // THERMISTOR_ID
diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h
index 370ed342f..7980b7207 100644
--- a/Marlin/thermistortables.h
+++ b/Marlin/thermistortables.h
@@ -28,636 +28,638 @@
#define OVERSAMPLENR 16
-#if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORHEATER_2 == 1) || (THERMISTORHEATER_3 == 1) || (THERMISTORBED == 1) //100k bed thermistor
+#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORBED == n)
+#if ANY_THERMISTOR_IS(1) // 100k bed thermistor
const short temptable_1[][2] PROGMEM = {
- {23 * OVERSAMPLENR, 300},
- {25 * OVERSAMPLENR, 295},
- {27 * OVERSAMPLENR, 290},
- {28 * OVERSAMPLENR, 285},
- {31 * OVERSAMPLENR, 280},
- {33 * OVERSAMPLENR, 275},
- {35 * OVERSAMPLENR, 270},
- {38 * OVERSAMPLENR, 265},
- {41 * OVERSAMPLENR, 260},
- {44 * OVERSAMPLENR, 255},
- {48 * OVERSAMPLENR, 250},
- {52 * OVERSAMPLENR, 245},
- {56 * OVERSAMPLENR, 240},
- {61 * OVERSAMPLENR, 235},
- {66 * OVERSAMPLENR, 230},
- {71 * OVERSAMPLENR, 225},
- {78 * OVERSAMPLENR, 220},
- {84 * OVERSAMPLENR, 215},
- {92 * OVERSAMPLENR, 210},
- {100 * OVERSAMPLENR, 205},
- {109 * OVERSAMPLENR, 200},
- {120 * OVERSAMPLENR, 195},
- {131 * OVERSAMPLENR, 190},
- {143 * OVERSAMPLENR, 185},
- {156 * OVERSAMPLENR, 180},
- {171 * OVERSAMPLENR, 175},
- {187 * OVERSAMPLENR, 170},
- {205 * OVERSAMPLENR, 165},
- {224 * OVERSAMPLENR, 160},
- {245 * OVERSAMPLENR, 155},
- {268 * OVERSAMPLENR, 150},
- {293 * OVERSAMPLENR, 145},
- {320 * OVERSAMPLENR, 140},
- {348 * OVERSAMPLENR, 135},
- {379 * OVERSAMPLENR, 130},
- {411 * OVERSAMPLENR, 125},
- {445 * OVERSAMPLENR, 120},
- {480 * OVERSAMPLENR, 115},
- {516 * OVERSAMPLENR, 110},
- {553 * OVERSAMPLENR, 105},
- {591 * OVERSAMPLENR, 100},
- {628 * OVERSAMPLENR, 95},
- {665 * OVERSAMPLENR, 90},
- {702 * OVERSAMPLENR, 85},
- {737 * OVERSAMPLENR, 80},
- {770 * OVERSAMPLENR, 75},
- {801 * OVERSAMPLENR, 70},
- {830 * OVERSAMPLENR, 65},
- {857 * OVERSAMPLENR, 60},
- {881 * OVERSAMPLENR, 55},
- {903 * OVERSAMPLENR, 50},
- {922 * OVERSAMPLENR, 45},
- {939 * OVERSAMPLENR, 40},
- {954 * OVERSAMPLENR, 35},
- {966 * OVERSAMPLENR, 30},
- {977 * OVERSAMPLENR, 25},
- {985 * OVERSAMPLENR, 20},
- {993 * OVERSAMPLENR, 15},
- {999 * OVERSAMPLENR, 10},
- {1004 * OVERSAMPLENR, 5},
- {1008 * OVERSAMPLENR, 0} //safety
+ { 23 * OVERSAMPLENR, 300 },
+ { 25 * OVERSAMPLENR, 295 },
+ { 27 * OVERSAMPLENR, 290 },
+ { 28 * OVERSAMPLENR, 285 },
+ { 31 * OVERSAMPLENR, 280 },
+ { 33 * OVERSAMPLENR, 275 },
+ { 35 * OVERSAMPLENR, 270 },
+ { 38 * OVERSAMPLENR, 265 },
+ { 41 * OVERSAMPLENR, 260 },
+ { 44 * OVERSAMPLENR, 255 },
+ { 48 * OVERSAMPLENR, 250 },
+ { 52 * OVERSAMPLENR, 245 },
+ { 56 * OVERSAMPLENR, 240 },
+ { 61 * OVERSAMPLENR, 235 },
+ { 66 * OVERSAMPLENR, 230 },
+ { 71 * OVERSAMPLENR, 225 },
+ { 78 * OVERSAMPLENR, 220 },
+ { 84 * OVERSAMPLENR, 215 },
+ { 92 * OVERSAMPLENR, 210 },
+ { 100 * OVERSAMPLENR, 205 },
+ { 109 * OVERSAMPLENR, 200 },
+ { 120 * OVERSAMPLENR, 195 },
+ { 131 * OVERSAMPLENR, 190 },
+ { 143 * OVERSAMPLENR, 185 },
+ { 156 * OVERSAMPLENR, 180 },
+ { 171 * OVERSAMPLENR, 175 },
+ { 187 * OVERSAMPLENR, 170 },
+ { 205 * OVERSAMPLENR, 165 },
+ { 224 * OVERSAMPLENR, 160 },
+ { 245 * OVERSAMPLENR, 155 },
+ { 268 * OVERSAMPLENR, 150 },
+ { 293 * OVERSAMPLENR, 145 },
+ { 320 * OVERSAMPLENR, 140 },
+ { 348 * OVERSAMPLENR, 135 },
+ { 379 * OVERSAMPLENR, 130 },
+ { 411 * OVERSAMPLENR, 125 },
+ { 445 * OVERSAMPLENR, 120 },
+ { 480 * OVERSAMPLENR, 115 },
+ { 516 * OVERSAMPLENR, 110 },
+ { 553 * OVERSAMPLENR, 105 },
+ { 591 * OVERSAMPLENR, 100 },
+ { 628 * OVERSAMPLENR, 95 },
+ { 665 * OVERSAMPLENR, 90 },
+ { 702 * OVERSAMPLENR, 85 },
+ { 737 * OVERSAMPLENR, 80 },
+ { 770 * OVERSAMPLENR, 75 },
+ { 801 * OVERSAMPLENR, 70 },
+ { 830 * OVERSAMPLENR, 65 },
+ { 857 * OVERSAMPLENR, 60 },
+ { 881 * OVERSAMPLENR, 55 },
+ { 903 * OVERSAMPLENR, 50 },
+ { 922 * OVERSAMPLENR, 45 },
+ { 939 * OVERSAMPLENR, 40 },
+ { 954 * OVERSAMPLENR, 35 },
+ { 966 * OVERSAMPLENR, 30 },
+ { 977 * OVERSAMPLENR, 25 },
+ { 985 * OVERSAMPLENR, 20 },
+ { 993 * OVERSAMPLENR, 15 },
+ { 999 * OVERSAMPLENR, 10 },
+ { 1004 * OVERSAMPLENR, 5 },
+ { 1008 * OVERSAMPLENR, 0 } // safety
};
#endif
-#if (THERMISTORHEATER_0 == 2) || (THERMISTORHEATER_1 == 2) || (THERMISTORHEATER_2 == 2) || (THERMISTORHEATER_3 == 2) || (THERMISTORBED == 2) //200k bed thermistor
+
+#if ANY_THERMISTOR_IS(2) // 200k bed thermistor
+// 200k ATC Semitec 204GT-2
+// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
+// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
const short temptable_2[][2] PROGMEM = {
- //200k ATC Semitec 204GT-2
- //Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
- // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
- {1 * OVERSAMPLENR, 848},
- {30 * OVERSAMPLENR, 300}, //top rating 300C
- {34 * OVERSAMPLENR, 290},
- {39 * OVERSAMPLENR, 280},
- {46 * OVERSAMPLENR, 270},
- {53 * OVERSAMPLENR, 260},
- {63 * OVERSAMPLENR, 250},
- {74 * OVERSAMPLENR, 240},
- {87 * OVERSAMPLENR, 230},
- {104 * OVERSAMPLENR, 220},
- {124 * OVERSAMPLENR, 210},
- {148 * OVERSAMPLENR, 200},
- {176 * OVERSAMPLENR, 190},
- {211 * OVERSAMPLENR, 180},
- {252 * OVERSAMPLENR, 170},
- {301 * OVERSAMPLENR, 160},
- {357 * OVERSAMPLENR, 150},
- {420 * OVERSAMPLENR, 140},
- {489 * OVERSAMPLENR, 130},
- {562 * OVERSAMPLENR, 120},
- {636 * OVERSAMPLENR, 110},
- {708 * OVERSAMPLENR, 100},
- {775 * OVERSAMPLENR, 90},
- {835 * OVERSAMPLENR, 80},
- {884 * OVERSAMPLENR, 70},
- {924 * OVERSAMPLENR, 60},
- {955 * OVERSAMPLENR, 50},
- {977 * OVERSAMPLENR, 40},
- {993 * OVERSAMPLENR, 30},
- {1004 * OVERSAMPLENR, 20},
- {1012 * OVERSAMPLENR, 10},
- {1016 * OVERSAMPLENR, 0},
+ { 1 * OVERSAMPLENR, 848 },
+ { 30 * OVERSAMPLENR, 300 }, // top rating 300C
+ { 34 * OVERSAMPLENR, 290 },
+ { 39 * OVERSAMPLENR, 280 },
+ { 46 * OVERSAMPLENR, 270 },
+ { 53 * OVERSAMPLENR, 260 },
+ { 63 * OVERSAMPLENR, 250 },
+ { 74 * OVERSAMPLENR, 240 },
+ { 87 * OVERSAMPLENR, 230 },
+ { 104 * OVERSAMPLENR, 220 },
+ { 124 * OVERSAMPLENR, 210 },
+ { 148 * OVERSAMPLENR, 200 },
+ { 176 * OVERSAMPLENR, 190 },
+ { 211 * OVERSAMPLENR, 180 },
+ { 252 * OVERSAMPLENR, 170 },
+ { 301 * OVERSAMPLENR, 160 },
+ { 357 * OVERSAMPLENR, 150 },
+ { 420 * OVERSAMPLENR, 140 },
+ { 489 * OVERSAMPLENR, 130 },
+ { 562 * OVERSAMPLENR, 120 },
+ { 636 * OVERSAMPLENR, 110 },
+ { 708 * OVERSAMPLENR, 100 },
+ { 775 * OVERSAMPLENR, 90 },
+ { 835 * OVERSAMPLENR, 80 },
+ { 884 * OVERSAMPLENR, 70 },
+ { 924 * OVERSAMPLENR, 60 },
+ { 955 * OVERSAMPLENR, 50 },
+ { 977 * OVERSAMPLENR, 40 },
+ { 993 * OVERSAMPLENR, 30 },
+ { 1004 * OVERSAMPLENR, 20 },
+ { 1012 * OVERSAMPLENR, 10 },
+ { 1016 * OVERSAMPLENR, 0 }
};
-
#endif
-#if (THERMISTORHEATER_0 == 3) || (THERMISTORHEATER_1 == 3) || (THERMISTORHEATER_2 == 3) || (THERMISTORHEATER_3 == 3) || (THERMISTORBED == 3) //mendel-parts
+
+#if ANY_THERMISTOR_IS(3) // mendel-parts
const short temptable_3[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 864},
- {21 * OVERSAMPLENR, 300},
- {25 * OVERSAMPLENR, 290},
- {29 * OVERSAMPLENR, 280},
- {33 * OVERSAMPLENR, 270},
- {39 * OVERSAMPLENR, 260},
- {46 * OVERSAMPLENR, 250},
- {54 * OVERSAMPLENR, 240},
- {64 * OVERSAMPLENR, 230},
- {75 * OVERSAMPLENR, 220},
- {90 * OVERSAMPLENR, 210},
- {107 * OVERSAMPLENR, 200},
- {128 * OVERSAMPLENR, 190},
- {154 * OVERSAMPLENR, 180},
- {184 * OVERSAMPLENR, 170},
- {221 * OVERSAMPLENR, 160},
- {265 * OVERSAMPLENR, 150},
- {316 * OVERSAMPLENR, 140},
- {375 * OVERSAMPLENR, 130},
- {441 * OVERSAMPLENR, 120},
- {513 * OVERSAMPLENR, 110},
- {588 * OVERSAMPLENR, 100},
- {734 * OVERSAMPLENR, 80},
- {856 * OVERSAMPLENR, 60},
- {938 * OVERSAMPLENR, 40},
- {986 * OVERSAMPLENR, 20},
- {1008 * OVERSAMPLENR, 0},
- {1018 * OVERSAMPLENR, -20}
+ { 1 * OVERSAMPLENR, 864 },
+ { 21 * OVERSAMPLENR, 300 },
+ { 25 * OVERSAMPLENR, 290 },
+ { 29 * OVERSAMPLENR, 280 },
+ { 33 * OVERSAMPLENR, 270 },
+ { 39 * OVERSAMPLENR, 260 },
+ { 46 * OVERSAMPLENR, 250 },
+ { 54 * OVERSAMPLENR, 240 },
+ { 64 * OVERSAMPLENR, 230 },
+ { 75 * OVERSAMPLENR, 220 },
+ { 90 * OVERSAMPLENR, 210 },
+ { 107 * OVERSAMPLENR, 200 },
+ { 128 * OVERSAMPLENR, 190 },
+ { 154 * OVERSAMPLENR, 180 },
+ { 184 * OVERSAMPLENR, 170 },
+ { 221 * OVERSAMPLENR, 160 },
+ { 265 * OVERSAMPLENR, 150 },
+ { 316 * OVERSAMPLENR, 140 },
+ { 375 * OVERSAMPLENR, 130 },
+ { 441 * OVERSAMPLENR, 120 },
+ { 513 * OVERSAMPLENR, 110 },
+ { 588 * OVERSAMPLENR, 100 },
+ { 734 * OVERSAMPLENR, 80 },
+ { 856 * OVERSAMPLENR, 60 },
+ { 938 * OVERSAMPLENR, 40 },
+ { 986 * OVERSAMPLENR, 20 },
+ { 1008 * OVERSAMPLENR, 0 },
+ { 1018 * OVERSAMPLENR, -20 }
};
-
#endif
-#if (THERMISTORHEATER_0 == 4) || (THERMISTORHEATER_1 == 4) || (THERMISTORHEATER_2 == 4) || (THERMISTORHEATER_3 == 4) || (THERMISTORBED == 4) //10k thermistor
+
+#if ANY_THERMISTOR_IS(4) // 10k thermistor
const short temptable_4[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 430},
- {54 * OVERSAMPLENR, 137},
- {107 * OVERSAMPLENR, 107},
- {160 * OVERSAMPLENR, 91},
- {213 * OVERSAMPLENR, 80},
- {266 * OVERSAMPLENR, 71},
- {319 * OVERSAMPLENR, 64},
- {372 * OVERSAMPLENR, 57},
- {425 * OVERSAMPLENR, 51},
- {478 * OVERSAMPLENR, 46},
- {531 * OVERSAMPLENR, 41},
- {584 * OVERSAMPLENR, 35},
- {637 * OVERSAMPLENR, 30},
- {690 * OVERSAMPLENR, 25},
- {743 * OVERSAMPLENR, 20},
- {796 * OVERSAMPLENR, 14},
- {849 * OVERSAMPLENR, 7},
- {902 * OVERSAMPLENR, 0},
- {955 * OVERSAMPLENR, -11},
- {1008 * OVERSAMPLENR, -35}
+ { 1 * OVERSAMPLENR, 430 },
+ { 54 * OVERSAMPLENR, 137 },
+ { 107 * OVERSAMPLENR, 107 },
+ { 160 * OVERSAMPLENR, 91 },
+ { 213 * OVERSAMPLENR, 80 },
+ { 266 * OVERSAMPLENR, 71 },
+ { 319 * OVERSAMPLENR, 64 },
+ { 372 * OVERSAMPLENR, 57 },
+ { 425 * OVERSAMPLENR, 51 },
+ { 478 * OVERSAMPLENR, 46 },
+ { 531 * OVERSAMPLENR, 41 },
+ { 584 * OVERSAMPLENR, 35 },
+ { 637 * OVERSAMPLENR, 30 },
+ { 690 * OVERSAMPLENR, 25 },
+ { 743 * OVERSAMPLENR, 20 },
+ { 796 * OVERSAMPLENR, 14 },
+ { 849 * OVERSAMPLENR, 7 },
+ { 902 * OVERSAMPLENR, 0 },
+ { 955 * OVERSAMPLENR, -11 },
+ { 1008 * OVERSAMPLENR, -35 }
};
#endif
-#if (THERMISTORHEATER_0 == 5) || (THERMISTORHEATER_1 == 5) || (THERMISTORHEATER_2 == 5) || (THERMISTORHEATER_3 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2)
+#if ANY_THERMISTOR_IS(5) // 100k ParCan thermistor (104GT-2)
+// ATC Semitec 104GT-2 (Used in ParCan)
+// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
+// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
const short temptable_5[][2] PROGMEM = {
- // ATC Semitec 104GT-2 (Used in ParCan)
- // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
- // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
- {1 * OVERSAMPLENR, 713},
- {17 * OVERSAMPLENR, 300}, //top rating 300C
- {20 * OVERSAMPLENR, 290},
- {23 * OVERSAMPLENR, 280},
- {27 * OVERSAMPLENR, 270},
- {31 * OVERSAMPLENR, 260},
- {37 * OVERSAMPLENR, 250},
- {43 * OVERSAMPLENR, 240},
- {51 * OVERSAMPLENR, 230},
- {61 * OVERSAMPLENR, 220},
- {73 * OVERSAMPLENR, 210},
- {87 * OVERSAMPLENR, 200},
- {106 * OVERSAMPLENR, 190},
- {128 * OVERSAMPLENR, 180},
- {155 * OVERSAMPLENR, 170},
- {189 * OVERSAMPLENR, 160},
- {230 * OVERSAMPLENR, 150},
- {278 * OVERSAMPLENR, 140},
- {336 * OVERSAMPLENR, 130},
- {402 * OVERSAMPLENR, 120},
- {476 * OVERSAMPLENR, 110},
- {554 * OVERSAMPLENR, 100},
- {635 * OVERSAMPLENR, 90},
- {713 * OVERSAMPLENR, 80},
- {784 * OVERSAMPLENR, 70},
- {846 * OVERSAMPLENR, 60},
- {897 * OVERSAMPLENR, 50},
- {937 * OVERSAMPLENR, 40},
- {966 * OVERSAMPLENR, 30},
- {986 * OVERSAMPLENR, 20},
- {1000 * OVERSAMPLENR, 10},
- {1010 * OVERSAMPLENR, 0}
+ { 1 * OVERSAMPLENR, 713 },
+ { 17 * OVERSAMPLENR, 300 }, // top rating 300C
+ { 20 * OVERSAMPLENR, 290 },
+ { 23 * OVERSAMPLENR, 280 },
+ { 27 * OVERSAMPLENR, 270 },
+ { 31 * OVERSAMPLENR, 260 },
+ { 37 * OVERSAMPLENR, 250 },
+ { 43 * OVERSAMPLENR, 240 },
+ { 51 * OVERSAMPLENR, 230 },
+ { 61 * OVERSAMPLENR, 220 },
+ { 73 * OVERSAMPLENR, 210 },
+ { 87 * OVERSAMPLENR, 200 },
+ { 106 * OVERSAMPLENR, 190 },
+ { 128 * OVERSAMPLENR, 180 },
+ { 155 * OVERSAMPLENR, 170 },
+ { 189 * OVERSAMPLENR, 160 },
+ { 230 * OVERSAMPLENR, 150 },
+ { 278 * OVERSAMPLENR, 140 },
+ { 336 * OVERSAMPLENR, 130 },
+ { 402 * OVERSAMPLENR, 120 },
+ { 476 * OVERSAMPLENR, 110 },
+ { 554 * OVERSAMPLENR, 100 },
+ { 635 * OVERSAMPLENR, 90 },
+ { 713 * OVERSAMPLENR, 80 },
+ { 784 * OVERSAMPLENR, 70 },
+ { 846 * OVERSAMPLENR, 60 },
+ { 897 * OVERSAMPLENR, 50 },
+ { 937 * OVERSAMPLENR, 40 },
+ { 966 * OVERSAMPLENR, 30 },
+ { 986 * OVERSAMPLENR, 20 },
+ { 1000 * OVERSAMPLENR, 10 },
+ { 1010 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 6) || (THERMISTORHEATER_1 == 6) || (THERMISTORHEATER_2 == 6) || (THERMISTORHEATER_3 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor
+#if ANY_THERMISTOR_IS(6) // 100k Epcos thermistor
const short temptable_6[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 350},
- {28 * OVERSAMPLENR, 250}, //top rating 250C
- {31 * OVERSAMPLENR, 245},
- {35 * OVERSAMPLENR, 240},
- {39 * OVERSAMPLENR, 235},
- {42 * OVERSAMPLENR, 230},
- {44 * OVERSAMPLENR, 225},
- {49 * OVERSAMPLENR, 220},
- {53 * OVERSAMPLENR, 215},
- {62 * OVERSAMPLENR, 210},
- {71 * OVERSAMPLENR, 205}, //fitted graphically
- {78 * OVERSAMPLENR, 200}, //fitted graphically
- {94 * OVERSAMPLENR, 190},
- {102 * OVERSAMPLENR, 185},
- {116 * OVERSAMPLENR, 170},
- {143 * OVERSAMPLENR, 160},
- {183 * OVERSAMPLENR, 150},
- {223 * OVERSAMPLENR, 140},
- {270 * OVERSAMPLENR, 130},
- {318 * OVERSAMPLENR, 120},
- {383 * OVERSAMPLENR, 110},
- {413 * OVERSAMPLENR, 105},
- {439 * OVERSAMPLENR, 100},
- {484 * OVERSAMPLENR, 95},
- {513 * OVERSAMPLENR, 90},
- {607 * OVERSAMPLENR, 80},
- {664 * OVERSAMPLENR, 70},
- {781 * OVERSAMPLENR, 60},
- {810 * OVERSAMPLENR, 55},
- {849 * OVERSAMPLENR, 50},
- {914 * OVERSAMPLENR, 45},
- {914 * OVERSAMPLENR, 40},
- {935 * OVERSAMPLENR, 35},
- {954 * OVERSAMPLENR, 30},
- {970 * OVERSAMPLENR, 25},
- {978 * OVERSAMPLENR, 22},
- {1008 * OVERSAMPLENR, 3},
- {1023 * OVERSAMPLENR, 0} //to allow internal 0 degrees C
+ { 1 * OVERSAMPLENR, 350 },
+ { 28 * OVERSAMPLENR, 250 }, // top rating 250C
+ { 31 * OVERSAMPLENR, 245 },
+ { 35 * OVERSAMPLENR, 240 },
+ { 39 * OVERSAMPLENR, 235 },
+ { 42 * OVERSAMPLENR, 230 },
+ { 44 * OVERSAMPLENR, 225 },
+ { 49 * OVERSAMPLENR, 220 },
+ { 53 * OVERSAMPLENR, 215 },
+ { 62 * OVERSAMPLENR, 210 },
+ { 71 * OVERSAMPLENR, 205 }, // fitted graphically
+ { 78 * OVERSAMPLENR, 200 }, // fitted graphically
+ { 94 * OVERSAMPLENR, 190 },
+ { 102 * OVERSAMPLENR, 185 },
+ { 116 * OVERSAMPLENR, 170 },
+ { 143 * OVERSAMPLENR, 160 },
+ { 183 * OVERSAMPLENR, 150 },
+ { 223 * OVERSAMPLENR, 140 },
+ { 270 * OVERSAMPLENR, 130 },
+ { 318 * OVERSAMPLENR, 120 },
+ { 383 * OVERSAMPLENR, 110 },
+ { 413 * OVERSAMPLENR, 105 },
+ { 439 * OVERSAMPLENR, 100 },
+ { 484 * OVERSAMPLENR, 95 },
+ { 513 * OVERSAMPLENR, 90 },
+ { 607 * OVERSAMPLENR, 80 },
+ { 664 * OVERSAMPLENR, 70 },
+ { 781 * OVERSAMPLENR, 60 },
+ { 810 * OVERSAMPLENR, 55 },
+ { 849 * OVERSAMPLENR, 50 },
+ { 914 * OVERSAMPLENR, 45 },
+ { 914 * OVERSAMPLENR, 40 },
+ { 935 * OVERSAMPLENR, 35 },
+ { 954 * OVERSAMPLENR, 30 },
+ { 970 * OVERSAMPLENR, 25 },
+ { 978 * OVERSAMPLENR, 22 },
+ { 1008 * OVERSAMPLENR, 3 },
+ { 1023 * OVERSAMPLENR, 0 } // to allow internal 0 degrees C
};
#endif
-#if (THERMISTORHEATER_0 == 7) || (THERMISTORHEATER_1 == 7) || (THERMISTORHEATER_2 == 7) || (THERMISTORHEATER_3 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01
+#if ANY_THERMISTOR_IS(7) // 100k Honeywell 135-104LAG-J01
const short temptable_7[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 941},
- {19 * OVERSAMPLENR, 362},
- {37 * OVERSAMPLENR, 299}, //top rating 300C
- {55 * OVERSAMPLENR, 266},
- {73 * OVERSAMPLENR, 245},
- {91 * OVERSAMPLENR, 229},
- {109 * OVERSAMPLENR, 216},
- {127 * OVERSAMPLENR, 206},
- {145 * OVERSAMPLENR, 197},
- {163 * OVERSAMPLENR, 190},
- {181 * OVERSAMPLENR, 183},
- {199 * OVERSAMPLENR, 177},
- {217 * OVERSAMPLENR, 171},
- {235 * OVERSAMPLENR, 166},
- {253 * OVERSAMPLENR, 162},
- {271 * OVERSAMPLENR, 157},
- {289 * OVERSAMPLENR, 153},
- {307 * OVERSAMPLENR, 149},
- {325 * OVERSAMPLENR, 146},
- {343 * OVERSAMPLENR, 142},
- {361 * OVERSAMPLENR, 139},
- {379 * OVERSAMPLENR, 135},
- {397 * OVERSAMPLENR, 132},
- {415 * OVERSAMPLENR, 129},
- {433 * OVERSAMPLENR, 126},
- {451 * OVERSAMPLENR, 123},
- {469 * OVERSAMPLENR, 121},
- {487 * OVERSAMPLENR, 118},
- {505 * OVERSAMPLENR, 115},
- {523 * OVERSAMPLENR, 112},
- {541 * OVERSAMPLENR, 110},
- {559 * OVERSAMPLENR, 107},
- {577 * OVERSAMPLENR, 105},
- {595 * OVERSAMPLENR, 102},
- {613 * OVERSAMPLENR, 99},
- {631 * OVERSAMPLENR, 97},
- {649 * OVERSAMPLENR, 94},
- {667 * OVERSAMPLENR, 92},
- {685 * OVERSAMPLENR, 89},
- {703 * OVERSAMPLENR, 86},
- {721 * OVERSAMPLENR, 84},
- {739 * OVERSAMPLENR, 81},
- {757 * OVERSAMPLENR, 78},
- {775 * OVERSAMPLENR, 75},
- {793 * OVERSAMPLENR, 72},
- {811 * OVERSAMPLENR, 69},
- {829 * OVERSAMPLENR, 66},
- {847 * OVERSAMPLENR, 62},
- {865 * OVERSAMPLENR, 59},
- {883 * OVERSAMPLENR, 55},
- {901 * OVERSAMPLENR, 51},
- {919 * OVERSAMPLENR, 46},
- {937 * OVERSAMPLENR, 41},
- {955 * OVERSAMPLENR, 35},
- {973 * OVERSAMPLENR, 27},
- {991 * OVERSAMPLENR, 17},
- {1009 * OVERSAMPLENR, 1},
- {1023 * OVERSAMPLENR, 0} //to allow internal 0 degrees C
+ { 1 * OVERSAMPLENR, 941 },
+ { 19 * OVERSAMPLENR, 362 },
+ { 37 * OVERSAMPLENR, 299 }, // top rating 300C
+ { 55 * OVERSAMPLENR, 266 },
+ { 73 * OVERSAMPLENR, 245 },
+ { 91 * OVERSAMPLENR, 229 },
+ { 109 * OVERSAMPLENR, 216 },
+ { 127 * OVERSAMPLENR, 206 },
+ { 145 * OVERSAMPLENR, 197 },
+ { 163 * OVERSAMPLENR, 190 },
+ { 181 * OVERSAMPLENR, 183 },
+ { 199 * OVERSAMPLENR, 177 },
+ { 217 * OVERSAMPLENR, 171 },
+ { 235 * OVERSAMPLENR, 166 },
+ { 253 * OVERSAMPLENR, 162 },
+ { 271 * OVERSAMPLENR, 157 },
+ { 289 * OVERSAMPLENR, 153 },
+ { 307 * OVERSAMPLENR, 149 },
+ { 325 * OVERSAMPLENR, 146 },
+ { 343 * OVERSAMPLENR, 142 },
+ { 361 * OVERSAMPLENR, 139 },
+ { 379 * OVERSAMPLENR, 135 },
+ { 397 * OVERSAMPLENR, 132 },
+ { 415 * OVERSAMPLENR, 129 },
+ { 433 * OVERSAMPLENR, 126 },
+ { 451 * OVERSAMPLENR, 123 },
+ { 469 * OVERSAMPLENR, 121 },
+ { 487 * OVERSAMPLENR, 118 },
+ { 505 * OVERSAMPLENR, 115 },
+ { 523 * OVERSAMPLENR, 112 },
+ { 541 * OVERSAMPLENR, 110 },
+ { 559 * OVERSAMPLENR, 107 },
+ { 577 * OVERSAMPLENR, 105 },
+ { 595 * OVERSAMPLENR, 102 },
+ { 613 * OVERSAMPLENR, 99 },
+ { 631 * OVERSAMPLENR, 97 },
+ { 649 * OVERSAMPLENR, 94 },
+ { 667 * OVERSAMPLENR, 92 },
+ { 685 * OVERSAMPLENR, 89 },
+ { 703 * OVERSAMPLENR, 86 },
+ { 721 * OVERSAMPLENR, 84 },
+ { 739 * OVERSAMPLENR, 81 },
+ { 757 * OVERSAMPLENR, 78 },
+ { 775 * OVERSAMPLENR, 75 },
+ { 793 * OVERSAMPLENR, 72 },
+ { 811 * OVERSAMPLENR, 69 },
+ { 829 * OVERSAMPLENR, 66 },
+ { 847 * OVERSAMPLENR, 62 },
+ { 865 * OVERSAMPLENR, 59 },
+ { 883 * OVERSAMPLENR, 55 },
+ { 901 * OVERSAMPLENR, 51 },
+ { 919 * OVERSAMPLENR, 46 },
+ { 937 * OVERSAMPLENR, 41 },
+ { 955 * OVERSAMPLENR, 35 },
+ { 973 * OVERSAMPLENR, 27 },
+ { 991 * OVERSAMPLENR, 17 },
+ { 1009 * OVERSAMPLENR, 1 },
+ { 1023 * OVERSAMPLENR, 0 } // to allow internal 0 degrees C
};
#endif
-#if (THERMISTORHEATER_0 == 71) || (THERMISTORHEATER_1 == 71) || (THERMISTORHEATER_2 == 71) || (THERMISTORHEATER_3 == 71) || (THERMISTORBED == 71) // 100k Honeywell 135-104LAF-J01
+#if ANY_THERMISTOR_IS(71) // 100k Honeywell 135-104LAF-J01
// R0 = 100000 Ohm
// T0 = 25 °C
// Beta = 3974
// R1 = 0 Ohm
// R2 = 4700 Ohm
const short temptable_71[][2] PROGMEM = {
- {35 * OVERSAMPLENR, 300},
- {51 * OVERSAMPLENR, 270},
- {54 * OVERSAMPLENR, 265},
- {58 * OVERSAMPLENR, 260},
- {59 * OVERSAMPLENR, 258},
- {61 * OVERSAMPLENR, 256},
- {63 * OVERSAMPLENR, 254},
- {64 * OVERSAMPLENR, 252},
- {66 * OVERSAMPLENR, 250},
- {67 * OVERSAMPLENR, 249},
- {68 * OVERSAMPLENR, 248},
- {69 * OVERSAMPLENR, 247},
- {70 * OVERSAMPLENR, 246},
- {71 * OVERSAMPLENR, 245},
- {72 * OVERSAMPLENR, 244},
- {73 * OVERSAMPLENR, 243},
- {74 * OVERSAMPLENR, 242},
- {75 * OVERSAMPLENR, 241},
- {76 * OVERSAMPLENR, 240},
- {77 * OVERSAMPLENR, 239},
- {78 * OVERSAMPLENR, 238},
- {79 * OVERSAMPLENR, 237},
- {80 * OVERSAMPLENR, 236},
- {81 * OVERSAMPLENR, 235},
- {82 * OVERSAMPLENR, 234},
- {84 * OVERSAMPLENR, 233},
- {85 * OVERSAMPLENR, 232},
- {86 * OVERSAMPLENR, 231},
- {87 * OVERSAMPLENR, 230},
- {89 * OVERSAMPLENR, 229},
- {90 * OVERSAMPLENR, 228},
- {91 * OVERSAMPLENR, 227},
- {92 * OVERSAMPLENR, 226},
- {94 * OVERSAMPLENR, 225},
- {95 * OVERSAMPLENR, 224},
- {97 * OVERSAMPLENR, 223},
- {98 * OVERSAMPLENR, 222},
- {99 * OVERSAMPLENR, 221},
- {101 * OVERSAMPLENR, 220},
- {102 * OVERSAMPLENR, 219},
- {104 * OVERSAMPLENR, 218},
- {106 * OVERSAMPLENR, 217},
- {107 * OVERSAMPLENR, 216},
- {109 * OVERSAMPLENR, 215},
- {110 * OVERSAMPLENR, 214},
- {112 * OVERSAMPLENR, 213},
- {114 * OVERSAMPLENR, 212},
- {115 * OVERSAMPLENR, 211},
- {117 * OVERSAMPLENR, 210},
- {119 * OVERSAMPLENR, 209},
- {121 * OVERSAMPLENR, 208},
- {123 * OVERSAMPLENR, 207},
- {125 * OVERSAMPLENR, 206},
- {126 * OVERSAMPLENR, 205},
- {128 * OVERSAMPLENR, 204},
- {130 * OVERSAMPLENR, 203},
- {132 * OVERSAMPLENR, 202},
- {134 * OVERSAMPLENR, 201},
- {136 * OVERSAMPLENR, 200},
- {139 * OVERSAMPLENR, 199},
- {141 * OVERSAMPLENR, 198},
- {143 * OVERSAMPLENR, 197},
- {145 * OVERSAMPLENR, 196},
- {147 * OVERSAMPLENR, 195},
- {150 * OVERSAMPLENR, 194},
- {152 * OVERSAMPLENR, 193},
- {154 * OVERSAMPLENR, 192},
- {157 * OVERSAMPLENR, 191},
- {159 * OVERSAMPLENR, 190},
- {162 * OVERSAMPLENR, 189},
- {164 * OVERSAMPLENR, 188},
- {167 * OVERSAMPLENR, 187},
- {170 * OVERSAMPLENR, 186},
- {172 * OVERSAMPLENR, 185},
- {175 * OVERSAMPLENR, 184},
- {178 * OVERSAMPLENR, 183},
- {181 * OVERSAMPLENR, 182},
- {184 * OVERSAMPLENR, 181},
- {187 * OVERSAMPLENR, 180},
- {190 * OVERSAMPLENR, 179},
- {193 * OVERSAMPLENR, 178},
- {196 * OVERSAMPLENR, 177},
- {199 * OVERSAMPLENR, 176},
- {202 * OVERSAMPLENR, 175},
- {205 * OVERSAMPLENR, 174},
- {208 * OVERSAMPLENR, 173},
- {212 * OVERSAMPLENR, 172},
- {215 * OVERSAMPLENR, 171},
- {219 * OVERSAMPLENR, 170},
- {237 * OVERSAMPLENR, 165},
- {256 * OVERSAMPLENR, 160},
- {300 * OVERSAMPLENR, 150},
- {351 * OVERSAMPLENR, 140},
- {470 * OVERSAMPLENR, 120},
- {504 * OVERSAMPLENR, 115},
- {538 * OVERSAMPLENR, 110},
- {552 * OVERSAMPLENR, 108},
- {566 * OVERSAMPLENR, 106},
- {580 * OVERSAMPLENR, 104},
- {594 * OVERSAMPLENR, 102},
- {608 * OVERSAMPLENR, 100},
- {622 * OVERSAMPLENR, 98},
- {636 * OVERSAMPLENR, 96},
- {650 * OVERSAMPLENR, 94},
- {664 * OVERSAMPLENR, 92},
- {678 * OVERSAMPLENR, 90},
- {712 * OVERSAMPLENR, 85},
- {745 * OVERSAMPLENR, 80},
- {758 * OVERSAMPLENR, 78},
- {770 * OVERSAMPLENR, 76},
- {783 * OVERSAMPLENR, 74},
- {795 * OVERSAMPLENR, 72},
- {806 * OVERSAMPLENR, 70},
- {818 * OVERSAMPLENR, 68},
- {829 * OVERSAMPLENR, 66},
- {840 * OVERSAMPLENR, 64},
- {850 * OVERSAMPLENR, 62},
- {860 * OVERSAMPLENR, 60},
- {870 * OVERSAMPLENR, 58},
- {879 * OVERSAMPLENR, 56},
- {888 * OVERSAMPLENR, 54},
- {897 * OVERSAMPLENR, 52},
- {905 * OVERSAMPLENR, 50},
- {924 * OVERSAMPLENR, 45},
- {940 * OVERSAMPLENR, 40},
- {955 * OVERSAMPLENR, 35},
- {967 * OVERSAMPLENR, 30},
- {970 * OVERSAMPLENR, 29},
- {972 * OVERSAMPLENR, 28},
- {974 * OVERSAMPLENR, 27},
- {976 * OVERSAMPLENR, 26},
- {978 * OVERSAMPLENR, 25},
- {980 * OVERSAMPLENR, 24},
- {982 * OVERSAMPLENR, 23},
- {984 * OVERSAMPLENR, 22},
- {985 * OVERSAMPLENR, 21},
- {987 * OVERSAMPLENR, 20},
- {995 * OVERSAMPLENR, 15},
- {1001 * OVERSAMPLENR, 10},
- {1006 * OVERSAMPLENR, 5},
- {1010 * OVERSAMPLENR, 0},
+ { 35 * OVERSAMPLENR, 300 },
+ { 51 * OVERSAMPLENR, 270 },
+ { 54 * OVERSAMPLENR, 265 },
+ { 58 * OVERSAMPLENR, 260 },
+ { 59 * OVERSAMPLENR, 258 },
+ { 61 * OVERSAMPLENR, 256 },
+ { 63 * OVERSAMPLENR, 254 },
+ { 64 * OVERSAMPLENR, 252 },
+ { 66 * OVERSAMPLENR, 250 },
+ { 67 * OVERSAMPLENR, 249 },
+ { 68 * OVERSAMPLENR, 248 },
+ { 69 * OVERSAMPLENR, 247 },
+ { 70 * OVERSAMPLENR, 246 },
+ { 71 * OVERSAMPLENR, 245 },
+ { 72 * OVERSAMPLENR, 244 },
+ { 73 * OVERSAMPLENR, 243 },
+ { 74 * OVERSAMPLENR, 242 },
+ { 75 * OVERSAMPLENR, 241 },
+ { 76 * OVERSAMPLENR, 240 },
+ { 77 * OVERSAMPLENR, 239 },
+ { 78 * OVERSAMPLENR, 238 },
+ { 79 * OVERSAMPLENR, 237 },
+ { 80 * OVERSAMPLENR, 236 },
+ { 81 * OVERSAMPLENR, 235 },
+ { 82 * OVERSAMPLENR, 234 },
+ { 84 * OVERSAMPLENR, 233 },
+ { 85 * OVERSAMPLENR, 232 },
+ { 86 * OVERSAMPLENR, 231 },
+ { 87 * OVERSAMPLENR, 230 },
+ { 89 * OVERSAMPLENR, 229 },
+ { 90 * OVERSAMPLENR, 228 },
+ { 91 * OVERSAMPLENR, 227 },
+ { 92 * OVERSAMPLENR, 226 },
+ { 94 * OVERSAMPLENR, 225 },
+ { 95 * OVERSAMPLENR, 224 },
+ { 97 * OVERSAMPLENR, 223 },
+ { 98 * OVERSAMPLENR, 222 },
+ { 99 * OVERSAMPLENR, 221 },
+ { 101 * OVERSAMPLENR, 220 },
+ { 102 * OVERSAMPLENR, 219 },
+ { 104 * OVERSAMPLENR, 218 },
+ { 106 * OVERSAMPLENR, 217 },
+ { 107 * OVERSAMPLENR, 216 },
+ { 109 * OVERSAMPLENR, 215 },
+ { 110 * OVERSAMPLENR, 214 },
+ { 112 * OVERSAMPLENR, 213 },
+ { 114 * OVERSAMPLENR, 212 },
+ { 115 * OVERSAMPLENR, 211 },
+ { 117 * OVERSAMPLENR, 210 },
+ { 119 * OVERSAMPLENR, 209 },
+ { 121 * OVERSAMPLENR, 208 },
+ { 123 * OVERSAMPLENR, 207 },
+ { 125 * OVERSAMPLENR, 206 },
+ { 126 * OVERSAMPLENR, 205 },
+ { 128 * OVERSAMPLENR, 204 },
+ { 130 * OVERSAMPLENR, 203 },
+ { 132 * OVERSAMPLENR, 202 },
+ { 134 * OVERSAMPLENR, 201 },
+ { 136 * OVERSAMPLENR, 200 },
+ { 139 * OVERSAMPLENR, 199 },
+ { 141 * OVERSAMPLENR, 198 },
+ { 143 * OVERSAMPLENR, 197 },
+ { 145 * OVERSAMPLENR, 196 },
+ { 147 * OVERSAMPLENR, 195 },
+ { 150 * OVERSAMPLENR, 194 },
+ { 152 * OVERSAMPLENR, 193 },
+ { 154 * OVERSAMPLENR, 192 },
+ { 157 * OVERSAMPLENR, 191 },
+ { 159 * OVERSAMPLENR, 190 },
+ { 162 * OVERSAMPLENR, 189 },
+ { 164 * OVERSAMPLENR, 188 },
+ { 167 * OVERSAMPLENR, 187 },
+ { 170 * OVERSAMPLENR, 186 },
+ { 172 * OVERSAMPLENR, 185 },
+ { 175 * OVERSAMPLENR, 184 },
+ { 178 * OVERSAMPLENR, 183 },
+ { 181 * OVERSAMPLENR, 182 },
+ { 184 * OVERSAMPLENR, 181 },
+ { 187 * OVERSAMPLENR, 180 },
+ { 190 * OVERSAMPLENR, 179 },
+ { 193 * OVERSAMPLENR, 178 },
+ { 196 * OVERSAMPLENR, 177 },
+ { 199 * OVERSAMPLENR, 176 },
+ { 202 * OVERSAMPLENR, 175 },
+ { 205 * OVERSAMPLENR, 174 },
+ { 208 * OVERSAMPLENR, 173 },
+ { 212 * OVERSAMPLENR, 172 },
+ { 215 * OVERSAMPLENR, 171 },
+ { 219 * OVERSAMPLENR, 170 },
+ { 237 * OVERSAMPLENR, 165 },
+ { 256 * OVERSAMPLENR, 160 },
+ { 300 * OVERSAMPLENR, 150 },
+ { 351 * OVERSAMPLENR, 140 },
+ { 470 * OVERSAMPLENR, 120 },
+ { 504 * OVERSAMPLENR, 115 },
+ { 538 * OVERSAMPLENR, 110 },
+ { 552 * OVERSAMPLENR, 108 },
+ { 566 * OVERSAMPLENR, 106 },
+ { 580 * OVERSAMPLENR, 104 },
+ { 594 * OVERSAMPLENR, 102 },
+ { 608 * OVERSAMPLENR, 100 },
+ { 622 * OVERSAMPLENR, 98 },
+ { 636 * OVERSAMPLENR, 96 },
+ { 650 * OVERSAMPLENR, 94 },
+ { 664 * OVERSAMPLENR, 92 },
+ { 678 * OVERSAMPLENR, 90 },
+ { 712 * OVERSAMPLENR, 85 },
+ { 745 * OVERSAMPLENR, 80 },
+ { 758 * OVERSAMPLENR, 78 },
+ { 770 * OVERSAMPLENR, 76 },
+ { 783 * OVERSAMPLENR, 74 },
+ { 795 * OVERSAMPLENR, 72 },
+ { 806 * OVERSAMPLENR, 70 },
+ { 818 * OVERSAMPLENR, 68 },
+ { 829 * OVERSAMPLENR, 66 },
+ { 840 * OVERSAMPLENR, 64 },
+ { 850 * OVERSAMPLENR, 62 },
+ { 860 * OVERSAMPLENR, 60 },
+ { 870 * OVERSAMPLENR, 58 },
+ { 879 * OVERSAMPLENR, 56 },
+ { 888 * OVERSAMPLENR, 54 },
+ { 897 * OVERSAMPLENR, 52 },
+ { 905 * OVERSAMPLENR, 50 },
+ { 924 * OVERSAMPLENR, 45 },
+ { 940 * OVERSAMPLENR, 40 },
+ { 955 * OVERSAMPLENR, 35 },
+ { 967 * OVERSAMPLENR, 30 },
+ { 970 * OVERSAMPLENR, 29 },
+ { 972 * OVERSAMPLENR, 28 },
+ { 974 * OVERSAMPLENR, 27 },
+ { 976 * OVERSAMPLENR, 26 },
+ { 978 * OVERSAMPLENR, 25 },
+ { 980 * OVERSAMPLENR, 24 },
+ { 982 * OVERSAMPLENR, 23 },
+ { 984 * OVERSAMPLENR, 22 },
+ { 985 * OVERSAMPLENR, 21 },
+ { 987 * OVERSAMPLENR, 20 },
+ { 995 * OVERSAMPLENR, 15 },
+ { 1001 * OVERSAMPLENR, 10 },
+ { 1006 * OVERSAMPLENR, 5 },
+ { 1010 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 8) || (THERMISTORHEATER_1 == 8) || (THERMISTORHEATER_2 == 8) || (THERMISTORHEATER_3 == 8) || (THERMISTORBED == 8)
+#if ANY_THERMISTOR_IS(8)
// 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
const short temptable_8[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 704},
- {54 * OVERSAMPLENR, 216},
- {107 * OVERSAMPLENR, 175},
- {160 * OVERSAMPLENR, 152},
- {213 * OVERSAMPLENR, 137},
- {266 * OVERSAMPLENR, 125},
- {319 * OVERSAMPLENR, 115},
- {372 * OVERSAMPLENR, 106},
- {425 * OVERSAMPLENR, 99},
- {478 * OVERSAMPLENR, 91},
- {531 * OVERSAMPLENR, 85},
- {584 * OVERSAMPLENR, 78},
- {637 * OVERSAMPLENR, 71},
- {690 * OVERSAMPLENR, 65},
- {743 * OVERSAMPLENR, 58},
- {796 * OVERSAMPLENR, 50},
- {849 * OVERSAMPLENR, 42},
- {902 * OVERSAMPLENR, 31},
- {955 * OVERSAMPLENR, 17},
- {1008 * OVERSAMPLENR, 0}
+ { 1 * OVERSAMPLENR, 704 },
+ { 54 * OVERSAMPLENR, 216 },
+ { 107 * OVERSAMPLENR, 175 },
+ { 160 * OVERSAMPLENR, 152 },
+ { 213 * OVERSAMPLENR, 137 },
+ { 266 * OVERSAMPLENR, 125 },
+ { 319 * OVERSAMPLENR, 115 },
+ { 372 * OVERSAMPLENR, 106 },
+ { 425 * OVERSAMPLENR, 99 },
+ { 478 * OVERSAMPLENR, 91 },
+ { 531 * OVERSAMPLENR, 85 },
+ { 584 * OVERSAMPLENR, 78 },
+ { 637 * OVERSAMPLENR, 71 },
+ { 690 * OVERSAMPLENR, 65 },
+ { 743 * OVERSAMPLENR, 58 },
+ { 796 * OVERSAMPLENR, 50 },
+ { 849 * OVERSAMPLENR, 42 },
+ { 902 * OVERSAMPLENR, 31 },
+ { 955 * OVERSAMPLENR, 17 },
+ { 1008 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 9) || (THERMISTORHEATER_1 == 9) || (THERMISTORHEATER_2 == 9) || (THERMISTORHEATER_3 == 9) || (THERMISTORBED == 9)
+
+#if ANY_THERMISTOR_IS(9)
// 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
const short temptable_9[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 936},
- {36 * OVERSAMPLENR, 300},
- {71 * OVERSAMPLENR, 246},
- {106 * OVERSAMPLENR, 218},
- {141 * OVERSAMPLENR, 199},
- {176 * OVERSAMPLENR, 185},
- {211 * OVERSAMPLENR, 173},
- {246 * OVERSAMPLENR, 163},
- {281 * OVERSAMPLENR, 155},
- {316 * OVERSAMPLENR, 147},
- {351 * OVERSAMPLENR, 140},
- {386 * OVERSAMPLENR, 134},
- {421 * OVERSAMPLENR, 128},
- {456 * OVERSAMPLENR, 122},
- {491 * OVERSAMPLENR, 117},
- {526 * OVERSAMPLENR, 112},
- {561 * OVERSAMPLENR, 107},
- {596 * OVERSAMPLENR, 102},
- {631 * OVERSAMPLENR, 97},
- {666 * OVERSAMPLENR, 92},
- {701 * OVERSAMPLENR, 87},
- {736 * OVERSAMPLENR, 81},
- {771 * OVERSAMPLENR, 76},
- {806 * OVERSAMPLENR, 70},
- {841 * OVERSAMPLENR, 63},
- {876 * OVERSAMPLENR, 56},
- {911 * OVERSAMPLENR, 48},
- {946 * OVERSAMPLENR, 38},
- {981 * OVERSAMPLENR, 23},
- {1005 * OVERSAMPLENR, 5},
- {1016 * OVERSAMPLENR, 0}
+ { 1 * OVERSAMPLENR, 936 },
+ { 36 * OVERSAMPLENR, 300 },
+ { 71 * OVERSAMPLENR, 246 },
+ { 106 * OVERSAMPLENR, 218 },
+ { 141 * OVERSAMPLENR, 199 },
+ { 176 * OVERSAMPLENR, 185 },
+ { 211 * OVERSAMPLENR, 173 },
+ { 246 * OVERSAMPLENR, 163 },
+ { 281 * OVERSAMPLENR, 155 },
+ { 316 * OVERSAMPLENR, 147 },
+ { 351 * OVERSAMPLENR, 140 },
+ { 386 * OVERSAMPLENR, 134 },
+ { 421 * OVERSAMPLENR, 128 },
+ { 456 * OVERSAMPLENR, 122 },
+ { 491 * OVERSAMPLENR, 117 },
+ { 526 * OVERSAMPLENR, 112 },
+ { 561 * OVERSAMPLENR, 107 },
+ { 596 * OVERSAMPLENR, 102 },
+ { 631 * OVERSAMPLENR, 97 },
+ { 666 * OVERSAMPLENR, 92 },
+ { 701 * OVERSAMPLENR, 87 },
+ { 736 * OVERSAMPLENR, 81 },
+ { 771 * OVERSAMPLENR, 76 },
+ { 806 * OVERSAMPLENR, 70 },
+ { 841 * OVERSAMPLENR, 63 },
+ { 876 * OVERSAMPLENR, 56 },
+ { 911 * OVERSAMPLENR, 48 },
+ { 946 * OVERSAMPLENR, 38 },
+ { 981 * OVERSAMPLENR, 23 },
+ { 1005 * OVERSAMPLENR, 5 },
+ { 1016 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 10) || (THERMISTORHEATER_1 == 10) || (THERMISTORHEATER_2 == 10) || (THERMISTORHEATER_3 == 10) || (THERMISTORBED == 10)
+
+#if ANY_THERMISTOR_IS(10)
// 100k RS thermistor 198-961 (4.7k pullup)
const short temptable_10[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 929},
- {36 * OVERSAMPLENR, 299},
- {71 * OVERSAMPLENR, 246},
- {106 * OVERSAMPLENR, 217},
- {141 * OVERSAMPLENR, 198},
- {176 * OVERSAMPLENR, 184},
- {211 * OVERSAMPLENR, 173},
- {246 * OVERSAMPLENR, 163},
- {281 * OVERSAMPLENR, 154},
- {316 * OVERSAMPLENR, 147},
- {351 * OVERSAMPLENR, 140},
- {386 * OVERSAMPLENR, 134},
- {421 * OVERSAMPLENR, 128},
- {456 * OVERSAMPLENR, 122},
- {491 * OVERSAMPLENR, 117},
- {526 * OVERSAMPLENR, 112},
- {561 * OVERSAMPLENR, 107},
- {596 * OVERSAMPLENR, 102},
- {631 * OVERSAMPLENR, 97},
- {666 * OVERSAMPLENR, 91},
- {701 * OVERSAMPLENR, 86},
- {736 * OVERSAMPLENR, 81},
- {771 * OVERSAMPLENR, 76},
- {806 * OVERSAMPLENR, 70},
- {841 * OVERSAMPLENR, 63},
- {876 * OVERSAMPLENR, 56},
- {911 * OVERSAMPLENR, 48},
- {946 * OVERSAMPLENR, 38},
- {981 * OVERSAMPLENR, 23},
- {1005 * OVERSAMPLENR, 5},
- {1016 * OVERSAMPLENR, 0}
+ { 1 * OVERSAMPLENR, 929 },
+ { 36 * OVERSAMPLENR, 299 },
+ { 71 * OVERSAMPLENR, 246 },
+ { 106 * OVERSAMPLENR, 217 },
+ { 141 * OVERSAMPLENR, 198 },
+ { 176 * OVERSAMPLENR, 184 },
+ { 211 * OVERSAMPLENR, 173 },
+ { 246 * OVERSAMPLENR, 163 },
+ { 281 * OVERSAMPLENR, 154 },
+ { 316 * OVERSAMPLENR, 147 },
+ { 351 * OVERSAMPLENR, 140 },
+ { 386 * OVERSAMPLENR, 134 },
+ { 421 * OVERSAMPLENR, 128 },
+ { 456 * OVERSAMPLENR, 122 },
+ { 491 * OVERSAMPLENR, 117 },
+ { 526 * OVERSAMPLENR, 112 },
+ { 561 * OVERSAMPLENR, 107 },
+ { 596 * OVERSAMPLENR, 102 },
+ { 631 * OVERSAMPLENR, 97 },
+ { 666 * OVERSAMPLENR, 91 },
+ { 701 * OVERSAMPLENR, 86 },
+ { 736 * OVERSAMPLENR, 81 },
+ { 771 * OVERSAMPLENR, 76 },
+ { 806 * OVERSAMPLENR, 70 },
+ { 841 * OVERSAMPLENR, 63 },
+ { 876 * OVERSAMPLENR, 56 },
+ { 911 * OVERSAMPLENR, 48 },
+ { 946 * OVERSAMPLENR, 38 },
+ { 981 * OVERSAMPLENR, 23 },
+ { 1005 * OVERSAMPLENR, 5 },
+ { 1016 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 11) || (THERMISTORHEATER_1 == 11) || (THERMISTORHEATER_2 == 11) || (THERMISTORHEATER_3 == 11) || (THERMISTORBED == 11)
+#if ANY_THERMISTOR_IS(11)
// QU-BD silicone bed QWG-104F-3950 thermistor
-
const short temptable_11[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 938},
- {31 * OVERSAMPLENR, 314},
- {41 * OVERSAMPLENR, 290},
- {51 * OVERSAMPLENR, 272},
- {61 * OVERSAMPLENR, 258},
- {71 * OVERSAMPLENR, 247},
- {81 * OVERSAMPLENR, 237},
- {91 * OVERSAMPLENR, 229},
- {101 * OVERSAMPLENR, 221},
- {111 * OVERSAMPLENR, 215},
- {121 * OVERSAMPLENR, 209},
- {131 * OVERSAMPLENR, 204},
- {141 * OVERSAMPLENR, 199},
- {151 * OVERSAMPLENR, 195},
- {161 * OVERSAMPLENR, 190},
- {171 * OVERSAMPLENR, 187},
- {181 * OVERSAMPLENR, 183},
- {191 * OVERSAMPLENR, 179},
- {201 * OVERSAMPLENR, 176},
- {221 * OVERSAMPLENR, 170},
- {241 * OVERSAMPLENR, 165},
- {261 * OVERSAMPLENR, 160},
- {281 * OVERSAMPLENR, 155},
- {301 * OVERSAMPLENR, 150},
- {331 * OVERSAMPLENR, 144},
- {361 * OVERSAMPLENR, 139},
- {391 * OVERSAMPLENR, 133},
- {421 * OVERSAMPLENR, 128},
- {451 * OVERSAMPLENR, 123},
- {491 * OVERSAMPLENR, 117},
- {531 * OVERSAMPLENR, 111},
- {571 * OVERSAMPLENR, 105},
- {611 * OVERSAMPLENR, 100},
- {641 * OVERSAMPLENR, 95},
- {681 * OVERSAMPLENR, 90},
- {711 * OVERSAMPLENR, 85},
- {751 * OVERSAMPLENR, 79},
- {791 * OVERSAMPLENR, 72},
- {811 * OVERSAMPLENR, 69},
- {831 * OVERSAMPLENR, 65},
- {871 * OVERSAMPLENR, 57},
- {881 * OVERSAMPLENR, 55},
- {901 * OVERSAMPLENR, 51},
- {921 * OVERSAMPLENR, 45},
- {941 * OVERSAMPLENR, 39},
- {971 * OVERSAMPLENR, 28},
- {981 * OVERSAMPLENR, 23},
- {991 * OVERSAMPLENR, 17},
- {1001 * OVERSAMPLENR, 9},
- {1021 * OVERSAMPLENR, -27}
+ { 1 * OVERSAMPLENR, 938 },
+ { 31 * OVERSAMPLENR, 314 },
+ { 41 * OVERSAMPLENR, 290 },
+ { 51 * OVERSAMPLENR, 272 },
+ { 61 * OVERSAMPLENR, 258 },
+ { 71 * OVERSAMPLENR, 247 },
+ { 81 * OVERSAMPLENR, 237 },
+ { 91 * OVERSAMPLENR, 229 },
+ { 101 * OVERSAMPLENR, 221 },
+ { 111 * OVERSAMPLENR, 215 },
+ { 121 * OVERSAMPLENR, 209 },
+ { 131 * OVERSAMPLENR, 204 },
+ { 141 * OVERSAMPLENR, 199 },
+ { 151 * OVERSAMPLENR, 195 },
+ { 161 * OVERSAMPLENR, 190 },
+ { 171 * OVERSAMPLENR, 187 },
+ { 181 * OVERSAMPLENR, 183 },
+ { 191 * OVERSAMPLENR, 179 },
+ { 201 * OVERSAMPLENR, 176 },
+ { 221 * OVERSAMPLENR, 170 },
+ { 241 * OVERSAMPLENR, 165 },
+ { 261 * OVERSAMPLENR, 160 },
+ { 281 * OVERSAMPLENR, 155 },
+ { 301 * OVERSAMPLENR, 150 },
+ { 331 * OVERSAMPLENR, 144 },
+ { 361 * OVERSAMPLENR, 139 },
+ { 391 * OVERSAMPLENR, 133 },
+ { 421 * OVERSAMPLENR, 128 },
+ { 451 * OVERSAMPLENR, 123 },
+ { 491 * OVERSAMPLENR, 117 },
+ { 531 * OVERSAMPLENR, 111 },
+ { 571 * OVERSAMPLENR, 105 },
+ { 611 * OVERSAMPLENR, 100 },
+ { 641 * OVERSAMPLENR, 95 },
+ { 681 * OVERSAMPLENR, 90 },
+ { 711 * OVERSAMPLENR, 85 },
+ { 751 * OVERSAMPLENR, 79 },
+ { 791 * OVERSAMPLENR, 72 },
+ { 811 * OVERSAMPLENR, 69 },
+ { 831 * OVERSAMPLENR, 65 },
+ { 871 * OVERSAMPLENR, 57 },
+ { 881 * OVERSAMPLENR, 55 },
+ { 901 * OVERSAMPLENR, 51 },
+ { 921 * OVERSAMPLENR, 45 },
+ { 941 * OVERSAMPLENR, 39 },
+ { 971 * OVERSAMPLENR, 28 },
+ { 981 * OVERSAMPLENR, 23 },
+ { 991 * OVERSAMPLENR, 17 },
+ { 1001 * OVERSAMPLENR, 9 },
+ { 1021 * OVERSAMPLENR, -27 }
};
#endif
-#if (THERMISTORHEATER_0 == 13) || (THERMISTORHEATER_1 == 13) || (THERMISTORHEATER_2 == 13) || (THERMISTORHEATER_3 == 13) || (THERMISTORBED == 13)
+#if ANY_THERMISTOR_IS(13)
// Hisens thermistor B25/50 =3950 +/-1%
-
const short temptable_13[][2] PROGMEM = {
- { 20.04 * OVERSAMPLENR, 300 },
- { 23.19 * OVERSAMPLENR, 290 },
- { 26.71 * OVERSAMPLENR, 280 },
- { 31.23 * OVERSAMPLENR, 270 },
- { 36.52 * OVERSAMPLENR, 260 },
- { 42.75 * OVERSAMPLENR, 250 },
- { 50.68 * OVERSAMPLENR, 240 },
- { 60.22 * OVERSAMPLENR, 230 },
- { 72.03 * OVERSAMPLENR, 220 },
- { 86.84 * OVERSAMPLENR, 210 },
+ { 20.04 * OVERSAMPLENR, 300 },
+ { 23.19 * OVERSAMPLENR, 290 },
+ { 26.71 * OVERSAMPLENR, 280 },
+ { 31.23 * OVERSAMPLENR, 270 },
+ { 36.52 * OVERSAMPLENR, 260 },
+ { 42.75 * OVERSAMPLENR, 250 },
+ { 50.68 * OVERSAMPLENR, 240 },
+ { 60.22 * OVERSAMPLENR, 230 },
+ { 72.03 * OVERSAMPLENR, 220 },
+ { 86.84 * OVERSAMPLENR, 210 },
{ 102.79 * OVERSAMPLENR, 200 },
{ 124.46 * OVERSAMPLENR, 190 },
{ 151.02 * OVERSAMPLENR, 180 },
@@ -666,18 +668,18 @@ const short temptable_13[][2] PROGMEM = {
{ 316.96 * OVERSAMPLENR, 140 },
{ 447.17 * OVERSAMPLENR, 120 },
{ 590.61 * OVERSAMPLENR, 100 },
- { 737.31 * OVERSAMPLENR, 80 },
- { 857.77 * OVERSAMPLENR, 60 },
- { 939.52 * OVERSAMPLENR, 40 },
- { 986.03 * OVERSAMPLENR, 20 },
- { 1008.7 * OVERSAMPLENR, 0}
+ { 737.31 * OVERSAMPLENR, 80 },
+ { 857.77 * OVERSAMPLENR, 60 },
+ { 939.52 * OVERSAMPLENR, 40 },
+ { 986.03 * OVERSAMPLENR, 20 },
+ { 1008.7 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
-/* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
-This does not match the normal thermistor behaviour so we need to set the following defines */
+#if ANY_THERMISTOR_IS(20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
+// The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
+// This does not match the normal thermistor behaviour so we need to set the following defines
#if (THERMISTORHEATER_0 == 20)
#define HEATER_0_RAW_HI_TEMP 16383
#define HEATER_0_RAW_LO_TEMP 0
@@ -699,203 +701,203 @@ This does not match the normal thermistor behaviour so we need to set the follow
#define HEATER_BED_RAW_LO_TEMP 0
#endif
const short temptable_20[][2] PROGMEM = {
- { 0 * OVERSAMPLENR , 0 },
- { 227 * OVERSAMPLENR , 1 },
- { 236 * OVERSAMPLENR , 10 },
- { 245 * OVERSAMPLENR , 20 },
- { 253 * OVERSAMPLENR , 30 },
- { 262 * OVERSAMPLENR , 40 },
- { 270 * OVERSAMPLENR , 50 },
- { 279 * OVERSAMPLENR , 60 },
- { 287 * OVERSAMPLENR , 70 },
- { 295 * OVERSAMPLENR , 80 },
- { 304 * OVERSAMPLENR , 90 },
- { 312 * OVERSAMPLENR , 100 },
- { 320 * OVERSAMPLENR , 110 },
- { 329 * OVERSAMPLENR , 120 },
- { 337 * OVERSAMPLENR , 130 },
- { 345 * OVERSAMPLENR , 140 },
- { 353 * OVERSAMPLENR , 150 },
- { 361 * OVERSAMPLENR , 160 },
- { 369 * OVERSAMPLENR , 170 },
- { 377 * OVERSAMPLENR , 180 },
- { 385 * OVERSAMPLENR , 190 },
- { 393 * OVERSAMPLENR , 200 },
- { 401 * OVERSAMPLENR , 210 },
- { 409 * OVERSAMPLENR , 220 },
- { 417 * OVERSAMPLENR , 230 },
- { 424 * OVERSAMPLENR , 240 },
- { 432 * OVERSAMPLENR , 250 },
- { 440 * OVERSAMPLENR , 260 },
- { 447 * OVERSAMPLENR , 270 },
- { 455 * OVERSAMPLENR , 280 },
- { 463 * OVERSAMPLENR , 290 },
- { 470 * OVERSAMPLENR , 300 },
- { 478 * OVERSAMPLENR , 310 },
- { 485 * OVERSAMPLENR , 320 },
- { 493 * OVERSAMPLENR , 330 },
- { 500 * OVERSAMPLENR , 340 },
- { 507 * OVERSAMPLENR , 350 },
- { 515 * OVERSAMPLENR , 360 },
- { 522 * OVERSAMPLENR , 370 },
- { 529 * OVERSAMPLENR , 380 },
- { 537 * OVERSAMPLENR , 390 },
- { 544 * OVERSAMPLENR , 400 },
- { 614 * OVERSAMPLENR , 500 },
- { 681 * OVERSAMPLENR , 600 },
- { 744 * OVERSAMPLENR , 700 },
- { 805 * OVERSAMPLENR , 800 },
- { 862 * OVERSAMPLENR , 900 },
- { 917 * OVERSAMPLENR , 1000 },
- { 968 * OVERSAMPLENR , 1100 }
+ { 0 * OVERSAMPLENR, 0 },
+ { 227 * OVERSAMPLENR, 1 },
+ { 236 * OVERSAMPLENR, 10 },
+ { 245 * OVERSAMPLENR, 20 },
+ { 253 * OVERSAMPLENR, 30 },
+ { 262 * OVERSAMPLENR, 40 },
+ { 270 * OVERSAMPLENR, 50 },
+ { 279 * OVERSAMPLENR, 60 },
+ { 287 * OVERSAMPLENR, 70 },
+ { 295 * OVERSAMPLENR, 80 },
+ { 304 * OVERSAMPLENR, 90 },
+ { 312 * OVERSAMPLENR, 100 },
+ { 320 * OVERSAMPLENR, 110 },
+ { 329 * OVERSAMPLENR, 120 },
+ { 337 * OVERSAMPLENR, 130 },
+ { 345 * OVERSAMPLENR, 140 },
+ { 353 * OVERSAMPLENR, 150 },
+ { 361 * OVERSAMPLENR, 160 },
+ { 369 * OVERSAMPLENR, 170 },
+ { 377 * OVERSAMPLENR, 180 },
+ { 385 * OVERSAMPLENR, 190 },
+ { 393 * OVERSAMPLENR, 200 },
+ { 401 * OVERSAMPLENR, 210 },
+ { 409 * OVERSAMPLENR, 220 },
+ { 417 * OVERSAMPLENR, 230 },
+ { 424 * OVERSAMPLENR, 240 },
+ { 432 * OVERSAMPLENR, 250 },
+ { 440 * OVERSAMPLENR, 260 },
+ { 447 * OVERSAMPLENR, 270 },
+ { 455 * OVERSAMPLENR, 280 },
+ { 463 * OVERSAMPLENR, 290 },
+ { 470 * OVERSAMPLENR, 300 },
+ { 478 * OVERSAMPLENR, 310 },
+ { 485 * OVERSAMPLENR, 320 },
+ { 493 * OVERSAMPLENR, 330 },
+ { 500 * OVERSAMPLENR, 340 },
+ { 507 * OVERSAMPLENR, 350 },
+ { 515 * OVERSAMPLENR, 360 },
+ { 522 * OVERSAMPLENR, 370 },
+ { 529 * OVERSAMPLENR, 380 },
+ { 537 * OVERSAMPLENR, 390 },
+ { 544 * OVERSAMPLENR, 400 },
+ { 614 * OVERSAMPLENR, 500 },
+ { 681 * OVERSAMPLENR, 600 },
+ { 744 * OVERSAMPLENR, 700 },
+ { 805 * OVERSAMPLENR, 800 },
+ { 862 * OVERSAMPLENR, 900 },
+ { 917 * OVERSAMPLENR, 1000 },
+ { 968 * OVERSAMPLENR, 1100 }
};
#endif
-#if (THERMISTORHEATER_0 == 51) || (THERMISTORHEATER_1 == 51) || (THERMISTORHEATER_2 == 51) || (THERMISTORHEATER_3 == 51) || (THERMISTORBED == 51)
+#if ANY_THERMISTOR_IS(51)
// 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
// Verified by linagee.
// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
// Advantage: Twice the resolution and better linearity from 150C to 200C
const short temptable_51[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 350},
- {190 * OVERSAMPLENR, 250}, //top rating 250C
- {203 * OVERSAMPLENR, 245},
- {217 * OVERSAMPLENR, 240},
- {232 * OVERSAMPLENR, 235},
- {248 * OVERSAMPLENR, 230},
- {265 * OVERSAMPLENR, 225},
- {283 * OVERSAMPLENR, 220},
- {302 * OVERSAMPLENR, 215},
- {322 * OVERSAMPLENR, 210},
- {344 * OVERSAMPLENR, 205},
- {366 * OVERSAMPLENR, 200},
- {390 * OVERSAMPLENR, 195},
- {415 * OVERSAMPLENR, 190},
- {440 * OVERSAMPLENR, 185},
- {467 * OVERSAMPLENR, 180},
- {494 * OVERSAMPLENR, 175},
- {522 * OVERSAMPLENR, 170},
- {551 * OVERSAMPLENR, 165},
- {580 * OVERSAMPLENR, 160},
- {609 * OVERSAMPLENR, 155},
- {638 * OVERSAMPLENR, 150},
- {666 * OVERSAMPLENR, 145},
- {695 * OVERSAMPLENR, 140},
- {722 * OVERSAMPLENR, 135},
- {749 * OVERSAMPLENR, 130},
- {775 * OVERSAMPLENR, 125},
- {800 * OVERSAMPLENR, 120},
- {823 * OVERSAMPLENR, 115},
- {845 * OVERSAMPLENR, 110},
- {865 * OVERSAMPLENR, 105},
- {884 * OVERSAMPLENR, 100},
- {901 * OVERSAMPLENR, 95},
- {917 * OVERSAMPLENR, 90},
- {932 * OVERSAMPLENR, 85},
- {944 * OVERSAMPLENR, 80},
- {956 * OVERSAMPLENR, 75},
- {966 * OVERSAMPLENR, 70},
- {975 * OVERSAMPLENR, 65},
- {982 * OVERSAMPLENR, 60},
- {989 * OVERSAMPLENR, 55},
- {995 * OVERSAMPLENR, 50},
- {1000 * OVERSAMPLENR, 45},
- {1004 * OVERSAMPLENR, 40},
- {1007 * OVERSAMPLENR, 35},
- {1010 * OVERSAMPLENR, 30},
- {1013 * OVERSAMPLENR, 25},
- {1015 * OVERSAMPLENR, 20},
- {1017 * OVERSAMPLENR, 15},
- {1018 * OVERSAMPLENR, 10},
- {1019 * OVERSAMPLENR, 5},
- {1020 * OVERSAMPLENR, 0},
- {1021 * OVERSAMPLENR, -5}
+ { 1 * OVERSAMPLENR, 350 },
+ { 190 * OVERSAMPLENR, 250 }, // top rating 250C
+ { 203 * OVERSAMPLENR, 245 },
+ { 217 * OVERSAMPLENR, 240 },
+ { 232 * OVERSAMPLENR, 235 },
+ { 248 * OVERSAMPLENR, 230 },
+ { 265 * OVERSAMPLENR, 225 },
+ { 283 * OVERSAMPLENR, 220 },
+ { 302 * OVERSAMPLENR, 215 },
+ { 322 * OVERSAMPLENR, 210 },
+ { 344 * OVERSAMPLENR, 205 },
+ { 366 * OVERSAMPLENR, 200 },
+ { 390 * OVERSAMPLENR, 195 },
+ { 415 * OVERSAMPLENR, 190 },
+ { 440 * OVERSAMPLENR, 185 },
+ { 467 * OVERSAMPLENR, 180 },
+ { 494 * OVERSAMPLENR, 175 },
+ { 522 * OVERSAMPLENR, 170 },
+ { 551 * OVERSAMPLENR, 165 },
+ { 580 * OVERSAMPLENR, 160 },
+ { 609 * OVERSAMPLENR, 155 },
+ { 638 * OVERSAMPLENR, 150 },
+ { 666 * OVERSAMPLENR, 145 },
+ { 695 * OVERSAMPLENR, 140 },
+ { 722 * OVERSAMPLENR, 135 },
+ { 749 * OVERSAMPLENR, 130 },
+ { 775 * OVERSAMPLENR, 125 },
+ { 800 * OVERSAMPLENR, 120 },
+ { 823 * OVERSAMPLENR, 115 },
+ { 845 * OVERSAMPLENR, 110 },
+ { 865 * OVERSAMPLENR, 105 },
+ { 884 * OVERSAMPLENR, 100 },
+ { 901 * OVERSAMPLENR, 95 },
+ { 917 * OVERSAMPLENR, 90 },
+ { 932 * OVERSAMPLENR, 85 },
+ { 944 * OVERSAMPLENR, 80 },
+ { 956 * OVERSAMPLENR, 75 },
+ { 966 * OVERSAMPLENR, 70 },
+ { 975 * OVERSAMPLENR, 65 },
+ { 982 * OVERSAMPLENR, 60 },
+ { 989 * OVERSAMPLENR, 55 },
+ { 995 * OVERSAMPLENR, 50 },
+ { 1000 * OVERSAMPLENR, 45 },
+ { 1004 * OVERSAMPLENR, 40 },
+ { 1007 * OVERSAMPLENR, 35 },
+ { 1010 * OVERSAMPLENR, 30 },
+ { 1013 * OVERSAMPLENR, 25 },
+ { 1015 * OVERSAMPLENR, 20 },
+ { 1017 * OVERSAMPLENR, 15 },
+ { 1018 * OVERSAMPLENR, 10 },
+ { 1019 * OVERSAMPLENR, 5 },
+ { 1020 * OVERSAMPLENR, 0 },
+ { 1021 * OVERSAMPLENR, -5 }
};
#endif
-#if (THERMISTORHEATER_0 == 52) || (THERMISTORHEATER_1 == 52) || (THERMISTORHEATER_2 == 52) || (THERMISTORHEATER_3 == 52) || (THERMISTORBED == 52)
+#if ANY_THERMISTOR_IS(52)
// 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
// Advantage: More resolution and better linearity from 150C to 200C
const short temptable_52[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 500},
- {125 * OVERSAMPLENR, 300}, //top rating 300C
- {142 * OVERSAMPLENR, 290},
- {162 * OVERSAMPLENR, 280},
- {185 * OVERSAMPLENR, 270},
- {211 * OVERSAMPLENR, 260},
- {240 * OVERSAMPLENR, 250},
- {274 * OVERSAMPLENR, 240},
- {312 * OVERSAMPLENR, 230},
- {355 * OVERSAMPLENR, 220},
- {401 * OVERSAMPLENR, 210},
- {452 * OVERSAMPLENR, 200},
- {506 * OVERSAMPLENR, 190},
- {563 * OVERSAMPLENR, 180},
- {620 * OVERSAMPLENR, 170},
- {677 * OVERSAMPLENR, 160},
- {732 * OVERSAMPLENR, 150},
- {783 * OVERSAMPLENR, 140},
- {830 * OVERSAMPLENR, 130},
- {871 * OVERSAMPLENR, 120},
- {906 * OVERSAMPLENR, 110},
- {935 * OVERSAMPLENR, 100},
- {958 * OVERSAMPLENR, 90},
- {976 * OVERSAMPLENR, 80},
- {990 * OVERSAMPLENR, 70},
- {1000 * OVERSAMPLENR, 60},
- {1008 * OVERSAMPLENR, 50},
- {1013 * OVERSAMPLENR, 40},
- {1017 * OVERSAMPLENR, 30},
- {1019 * OVERSAMPLENR, 20},
- {1021 * OVERSAMPLENR, 10},
- {1022 * OVERSAMPLENR, 0}
+ { 1 * OVERSAMPLENR, 500 },
+ { 125 * OVERSAMPLENR, 300 }, // top rating 300C
+ { 142 * OVERSAMPLENR, 290 },
+ { 162 * OVERSAMPLENR, 280 },
+ { 185 * OVERSAMPLENR, 270 },
+ { 211 * OVERSAMPLENR, 260 },
+ { 240 * OVERSAMPLENR, 250 },
+ { 274 * OVERSAMPLENR, 240 },
+ { 312 * OVERSAMPLENR, 230 },
+ { 355 * OVERSAMPLENR, 220 },
+ { 401 * OVERSAMPLENR, 210 },
+ { 452 * OVERSAMPLENR, 200 },
+ { 506 * OVERSAMPLENR, 190 },
+ { 563 * OVERSAMPLENR, 180 },
+ { 620 * OVERSAMPLENR, 170 },
+ { 677 * OVERSAMPLENR, 160 },
+ { 732 * OVERSAMPLENR, 150 },
+ { 783 * OVERSAMPLENR, 140 },
+ { 830 * OVERSAMPLENR, 130 },
+ { 871 * OVERSAMPLENR, 120 },
+ { 906 * OVERSAMPLENR, 110 },
+ { 935 * OVERSAMPLENR, 100 },
+ { 958 * OVERSAMPLENR, 90 },
+ { 976 * OVERSAMPLENR, 80 },
+ { 990 * OVERSAMPLENR, 70 },
+ { 1000 * OVERSAMPLENR, 60 },
+ { 1008 * OVERSAMPLENR, 50 },
+ { 1013 * OVERSAMPLENR, 40 },
+ { 1017 * OVERSAMPLENR, 30 },
+ { 1019 * OVERSAMPLENR, 20 },
+ { 1021 * OVERSAMPLENR, 10 },
+ { 1022 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 55) || (THERMISTORHEATER_1 == 55) || (THERMISTORHEATER_2 == 55) || (THERMISTORHEATER_3 == 55) || (THERMISTORBED == 55)
+#if ANY_THERMISTOR_IS(55)
// 100k ATC Semitec 104GT-2 (Used on ParCan) (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
// Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
// Advantage: More resolution and better linearity from 150C to 200C
const short temptable_55[][2] PROGMEM = {
- {1 * OVERSAMPLENR, 500},
- {76 * OVERSAMPLENR, 300},
- {87 * OVERSAMPLENR, 290},
- {100 * OVERSAMPLENR, 280},
- {114 * OVERSAMPLENR, 270},
- {131 * OVERSAMPLENR, 260},
- {152 * OVERSAMPLENR, 250},
- {175 * OVERSAMPLENR, 240},
- {202 * OVERSAMPLENR, 230},
- {234 * OVERSAMPLENR, 220},
- {271 * OVERSAMPLENR, 210},
- {312 * OVERSAMPLENR, 200},
- {359 * OVERSAMPLENR, 190},
- {411 * OVERSAMPLENR, 180},
- {467 * OVERSAMPLENR, 170},
- {527 * OVERSAMPLENR, 160},
- {590 * OVERSAMPLENR, 150},
- {652 * OVERSAMPLENR, 140},
- {713 * OVERSAMPLENR, 130},
- {770 * OVERSAMPLENR, 120},
- {822 * OVERSAMPLENR, 110},
- {867 * OVERSAMPLENR, 100},
- {905 * OVERSAMPLENR, 90},
- {936 * OVERSAMPLENR, 80},
- {961 * OVERSAMPLENR, 70},
- {979 * OVERSAMPLENR, 60},
- {993 * OVERSAMPLENR, 50},
- {1003 * OVERSAMPLENR, 40},
- {1010 * OVERSAMPLENR, 30},
- {1015 * OVERSAMPLENR, 20},
- {1018 * OVERSAMPLENR, 10},
- {1020 * OVERSAMPLENR, 0}
+ { 1 * OVERSAMPLENR, 500 },
+ { 76 * OVERSAMPLENR, 300 },
+ { 87 * OVERSAMPLENR, 290 },
+ { 100 * OVERSAMPLENR, 280 },
+ { 114 * OVERSAMPLENR, 270 },
+ { 131 * OVERSAMPLENR, 260 },
+ { 152 * OVERSAMPLENR, 250 },
+ { 175 * OVERSAMPLENR, 240 },
+ { 202 * OVERSAMPLENR, 230 },
+ { 234 * OVERSAMPLENR, 220 },
+ { 271 * OVERSAMPLENR, 210 },
+ { 312 * OVERSAMPLENR, 200 },
+ { 359 * OVERSAMPLENR, 190 },
+ { 411 * OVERSAMPLENR, 180 },
+ { 467 * OVERSAMPLENR, 170 },
+ { 527 * OVERSAMPLENR, 160 },
+ { 590 * OVERSAMPLENR, 150 },
+ { 652 * OVERSAMPLENR, 140 },
+ { 713 * OVERSAMPLENR, 130 },
+ { 770 * OVERSAMPLENR, 120 },
+ { 822 * OVERSAMPLENR, 110 },
+ { 867 * OVERSAMPLENR, 100 },
+ { 905 * OVERSAMPLENR, 90 },
+ { 936 * OVERSAMPLENR, 80 },
+ { 961 * OVERSAMPLENR, 70 },
+ { 979 * OVERSAMPLENR, 60 },
+ { 993 * OVERSAMPLENR, 50 },
+ { 1003 * OVERSAMPLENR, 40 },
+ { 1010 * OVERSAMPLENR, 30 },
+ { 1015 * OVERSAMPLENR, 20 },
+ { 1018 * OVERSAMPLENR, 10 },
+ { 1020 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 60) || (THERMISTORHEATER_1 == 60) || (THERMISTORHEATER_2 == 60) || (THERMISTORHEATER_3 == 60) || (THERMISTORBED == 60) // Maker's Tool Works Kapton Bed Thermistor
+#if ANY_THERMISTOR_IS(60) // Maker's Tool Works Kapton Bed Thermistor
// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950
// r0: 100000
// t0: 25
@@ -905,179 +907,213 @@ const short temptable_55[][2] PROGMEM = {
// min adc: 1 at 0.0048828125 V
// max adc: 1023 at 4.9951171875 V
const short temptable_60[][2] PROGMEM = {
- {51 * OVERSAMPLENR, 272},
- {61 * OVERSAMPLENR, 258},
- {71 * OVERSAMPLENR, 247},
- {81 * OVERSAMPLENR, 237},
- {91 * OVERSAMPLENR, 229},
- {101 * OVERSAMPLENR, 221},
- {131 * OVERSAMPLENR, 204},
- {161 * OVERSAMPLENR, 190},
- {191 * OVERSAMPLENR, 179},
- {231 * OVERSAMPLENR, 167},
- {271 * OVERSAMPLENR, 157},
- {311 * OVERSAMPLENR, 148},
- {351 * OVERSAMPLENR, 140},
- {381 * OVERSAMPLENR, 135},
- {411 * OVERSAMPLENR, 130},
- {441 * OVERSAMPLENR, 125},
- {451 * OVERSAMPLENR, 123},
- {461 * OVERSAMPLENR, 122},
- {471 * OVERSAMPLENR, 120},
- {481 * OVERSAMPLENR, 119},
- {491 * OVERSAMPLENR, 117},
- {501 * OVERSAMPLENR, 116},
- {511 * OVERSAMPLENR, 114},
- {521 * OVERSAMPLENR, 113},
- {531 * OVERSAMPLENR, 111},
- {541 * OVERSAMPLENR, 110},
- {551 * OVERSAMPLENR, 108},
- {561 * OVERSAMPLENR, 107},
- {571 * OVERSAMPLENR, 105},
- {581 * OVERSAMPLENR, 104},
- {591 * OVERSAMPLENR, 102},
- {601 * OVERSAMPLENR, 101},
- {611 * OVERSAMPLENR, 100},
- {621 * OVERSAMPLENR, 98},
- {631 * OVERSAMPLENR, 97},
- {641 * OVERSAMPLENR, 95},
- {651 * OVERSAMPLENR, 94},
- {661 * OVERSAMPLENR, 92},
- {671 * OVERSAMPLENR, 91},
- {681 * OVERSAMPLENR, 90},
- {691 * OVERSAMPLENR, 88},
- {701 * OVERSAMPLENR, 87},
- {711 * OVERSAMPLENR, 85},
- {721 * OVERSAMPLENR, 84},
- {731 * OVERSAMPLENR, 82},
- {741 * OVERSAMPLENR, 81},
- {751 * OVERSAMPLENR, 79},
- {761 * OVERSAMPLENR, 77},
- {771 * OVERSAMPLENR, 76},
- {781 * OVERSAMPLENR, 74},
- {791 * OVERSAMPLENR, 72},
- {801 * OVERSAMPLENR, 71},
- {811 * OVERSAMPLENR, 69},
- {821 * OVERSAMPLENR, 67},
- {831 * OVERSAMPLENR, 65},
- {841 * OVERSAMPLENR, 63},
- {851 * OVERSAMPLENR, 62},
- {861 * OVERSAMPLENR, 60},
- {871 * OVERSAMPLENR, 57},
- {881 * OVERSAMPLENR, 55},
- {891 * OVERSAMPLENR, 53},
- {901 * OVERSAMPLENR, 51},
- {911 * OVERSAMPLENR, 48},
- {921 * OVERSAMPLENR, 45},
- {931 * OVERSAMPLENR, 42},
- {941 * OVERSAMPLENR, 39},
- {951 * OVERSAMPLENR, 36},
- {961 * OVERSAMPLENR, 32},
- {981 * OVERSAMPLENR, 23},
- {991 * OVERSAMPLENR, 17},
- {1001 * OVERSAMPLENR, 9},
- {1008 * OVERSAMPLENR, 0},
+ { 51 * OVERSAMPLENR, 272 },
+ { 61 * OVERSAMPLENR, 258 },
+ { 71 * OVERSAMPLENR, 247 },
+ { 81 * OVERSAMPLENR, 237 },
+ { 91 * OVERSAMPLENR, 229 },
+ { 101 * OVERSAMPLENR, 221 },
+ { 131 * OVERSAMPLENR, 204 },
+ { 161 * OVERSAMPLENR, 190 },
+ { 191 * OVERSAMPLENR, 179 },
+ { 231 * OVERSAMPLENR, 167 },
+ { 271 * OVERSAMPLENR, 157 },
+ { 311 * OVERSAMPLENR, 148 },
+ { 351 * OVERSAMPLENR, 140 },
+ { 381 * OVERSAMPLENR, 135 },
+ { 411 * OVERSAMPLENR, 130 },
+ { 441 * OVERSAMPLENR, 125 },
+ { 451 * OVERSAMPLENR, 123 },
+ { 461 * OVERSAMPLENR, 122 },
+ { 471 * OVERSAMPLENR, 120 },
+ { 481 * OVERSAMPLENR, 119 },
+ { 491 * OVERSAMPLENR, 117 },
+ { 501 * OVERSAMPLENR, 116 },
+ { 511 * OVERSAMPLENR, 114 },
+ { 521 * OVERSAMPLENR, 113 },
+ { 531 * OVERSAMPLENR, 111 },
+ { 541 * OVERSAMPLENR, 110 },
+ { 551 * OVERSAMPLENR, 108 },
+ { 561 * OVERSAMPLENR, 107 },
+ { 571 * OVERSAMPLENR, 105 },
+ { 581 * OVERSAMPLENR, 104 },
+ { 591 * OVERSAMPLENR, 102 },
+ { 601 * OVERSAMPLENR, 101 },
+ { 611 * OVERSAMPLENR, 100 },
+ { 621 * OVERSAMPLENR, 98 },
+ { 631 * OVERSAMPLENR, 97 },
+ { 641 * OVERSAMPLENR, 95 },
+ { 651 * OVERSAMPLENR, 94 },
+ { 661 * OVERSAMPLENR, 92 },
+ { 671 * OVERSAMPLENR, 91 },
+ { 681 * OVERSAMPLENR, 90 },
+ { 691 * OVERSAMPLENR, 88 },
+ { 701 * OVERSAMPLENR, 87 },
+ { 711 * OVERSAMPLENR, 85 },
+ { 721 * OVERSAMPLENR, 84 },
+ { 731 * OVERSAMPLENR, 82 },
+ { 741 * OVERSAMPLENR, 81 },
+ { 751 * OVERSAMPLENR, 79 },
+ { 761 * OVERSAMPLENR, 77 },
+ { 771 * OVERSAMPLENR, 76 },
+ { 781 * OVERSAMPLENR, 74 },
+ { 791 * OVERSAMPLENR, 72 },
+ { 801 * OVERSAMPLENR, 71 },
+ { 811 * OVERSAMPLENR, 69 },
+ { 821 * OVERSAMPLENR, 67 },
+ { 831 * OVERSAMPLENR, 65 },
+ { 841 * OVERSAMPLENR, 63 },
+ { 851 * OVERSAMPLENR, 62 },
+ { 861 * OVERSAMPLENR, 60 },
+ { 871 * OVERSAMPLENR, 57 },
+ { 881 * OVERSAMPLENR, 55 },
+ { 891 * OVERSAMPLENR, 53 },
+ { 901 * OVERSAMPLENR, 51 },
+ { 911 * OVERSAMPLENR, 48 },
+ { 921 * OVERSAMPLENR, 45 },
+ { 931 * OVERSAMPLENR, 42 },
+ { 941 * OVERSAMPLENR, 39 },
+ { 951 * OVERSAMPLENR, 36 },
+ { 961 * OVERSAMPLENR, 32 },
+ { 981 * OVERSAMPLENR, 23 },
+ { 991 * OVERSAMPLENR, 17 },
+ { 1001 * OVERSAMPLENR, 9 },
+ { 1008 * OVERSAMPLENR, 0 }
};
#endif
-#if (THERMISTORHEATER_0 == 12) || (THERMISTORHEATER_1 == 12) || (THERMISTORHEATER_2 == 12) || (THERMISTORHEATER_3 == 12) || (THERMISTORBED == 12)
-//100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
+
+#if ANY_THERMISTOR_IS(66)
+// DyzeDesign 500°C Thermistor
+const short temptable_66[][2] PROGMEM = {
+ { 17.5 * OVERSAMPLENR, 850 },
+ { 17.9 * OVERSAMPLENR, 500 },
+ { 21.7 * OVERSAMPLENR, 480 },
+ { 26.6 * OVERSAMPLENR, 460 },
+ { 33.1 * OVERSAMPLENR, 440 },
+ { 41.0 * OVERSAMPLENR, 420 },
+ { 52.3 * OVERSAMPLENR, 400 },
+ { 67.7 * OVERSAMPLENR, 380 },
+ { 86.5 * OVERSAMPLENR, 360 },
+ { 112.0 * OVERSAMPLENR, 340 },
+ { 147.2 * OVERSAMPLENR, 320 },
+ { 194.0 * OVERSAMPLENR, 300 },
+ { 254.3 * OVERSAMPLENR, 280 },
+ { 330.2 * OVERSAMPLENR, 260 },
+ { 427.9 * OVERSAMPLENR, 240 },
+ { 533.4 * OVERSAMPLENR, 220 },
+ { 646.5 * OVERSAMPLENR, 200 },
+ { 754.4 * OVERSAMPLENR, 180 },
+ { 844.3 * OVERSAMPLENR, 160 },
+ { 911.7 * OVERSAMPLENR, 140 },
+ { 958.6 * OVERSAMPLENR, 120 },
+ { 988.8 * OVERSAMPLENR, 100 },
+ { 1006.6 * OVERSAMPLENR, 80 },
+ { 1015.8 * OVERSAMPLENR, 60 },
+ { 1021.3 * OVERSAMPLENR, 30 },
+ { 1023 * OVERSAMPLENR - 1, 25},
+ { 1023 * OVERSAMPLENR, 20}
+};
+#endif
+
+#if ANY_THERMISTOR_IS(12)
+// 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
const short temptable_12[][2] PROGMEM = {
- {35 * OVERSAMPLENR, 180}, //top rating 180C
- {211 * OVERSAMPLENR, 140},
- {233 * OVERSAMPLENR, 135},
- {261 * OVERSAMPLENR, 130},
- {290 * OVERSAMPLENR, 125},
- {328 * OVERSAMPLENR, 120},
- {362 * OVERSAMPLENR, 115},
- {406 * OVERSAMPLENR, 110},
- {446 * OVERSAMPLENR, 105},
- {496 * OVERSAMPLENR, 100},
- {539 * OVERSAMPLENR, 95},
- {585 * OVERSAMPLENR, 90},
- {629 * OVERSAMPLENR, 85},
- {675 * OVERSAMPLENR, 80},
- {718 * OVERSAMPLENR, 75},
- {758 * OVERSAMPLENR, 70},
- {793 * OVERSAMPLENR, 65},
- {822 * OVERSAMPLENR, 60},
- {841 * OVERSAMPLENR, 55},
- {875 * OVERSAMPLENR, 50},
- {899 * OVERSAMPLENR, 45},
- {926 * OVERSAMPLENR, 40},
- {946 * OVERSAMPLENR, 35},
- {962 * OVERSAMPLENR, 30},
- {977 * OVERSAMPLENR, 25},
- {987 * OVERSAMPLENR, 20},
- {995 * OVERSAMPLENR, 15},
- {1001 * OVERSAMPLENR, 10},
- {1010 * OVERSAMPLENR, 0},
- {1023 * OVERSAMPLENR, -40},
+ { 35 * OVERSAMPLENR, 180 }, // top rating 180C
+ { 211 * OVERSAMPLENR, 140 },
+ { 233 * OVERSAMPLENR, 135 },
+ { 261 * OVERSAMPLENR, 130 },
+ { 290 * OVERSAMPLENR, 125 },
+ { 328 * OVERSAMPLENR, 120 },
+ { 362 * OVERSAMPLENR, 115 },
+ { 406 * OVERSAMPLENR, 110 },
+ { 446 * OVERSAMPLENR, 105 },
+ { 496 * OVERSAMPLENR, 100 },
+ { 539 * OVERSAMPLENR, 95 },
+ { 585 * OVERSAMPLENR, 90 },
+ { 629 * OVERSAMPLENR, 85 },
+ { 675 * OVERSAMPLENR, 80 },
+ { 718 * OVERSAMPLENR, 75 },
+ { 758 * OVERSAMPLENR, 70 },
+ { 793 * OVERSAMPLENR, 65 },
+ { 822 * OVERSAMPLENR, 60 },
+ { 841 * OVERSAMPLENR, 55 },
+ { 875 * OVERSAMPLENR, 50 },
+ { 899 * OVERSAMPLENR, 45 },
+ { 926 * OVERSAMPLENR, 40 },
+ { 946 * OVERSAMPLENR, 35 },
+ { 962 * OVERSAMPLENR, 30 },
+ { 977 * OVERSAMPLENR, 25 },
+ { 987 * OVERSAMPLENR, 20 },
+ { 995 * OVERSAMPLENR, 15 },
+ { 1001 * OVERSAMPLENR, 10 },
+ { 1010 * OVERSAMPLENR, 0 },
+ { 1023 * OVERSAMPLENR, -40 }
};
#endif
-#if (THERMISTORHEATER_0 == 70) || (THERMISTORHEATER_1 == 70) || (THERMISTORHEATER_2 == 70) || (THERMISTORHEATER_3 == 70) || (THERMISTORBED == 70) // bqh2 stock thermistor
+#if ANY_THERMISTOR_IS(70) // bqh2 stock thermistor
const short temptable_70[][2] PROGMEM = {
- { 22 * OVERSAMPLENR , 300 },
- { 24 * OVERSAMPLENR , 295 },
- { 25 * OVERSAMPLENR , 290 },
- { 27 * OVERSAMPLENR , 285 },
- { 29 * OVERSAMPLENR , 280 },
- { 32 * OVERSAMPLENR , 275 },
- { 34 * OVERSAMPLENR , 270 },
- { 37 * OVERSAMPLENR , 265 },
- { 40 * OVERSAMPLENR , 260 },
- { 43 * OVERSAMPLENR , 255 },
- { 46 * OVERSAMPLENR , 250 },
- { 50 * OVERSAMPLENR , 245 },
- { 54 * OVERSAMPLENR , 240 },
- { 59 * OVERSAMPLENR , 235 },
- { 64 * OVERSAMPLENR , 230 },
- { 70 * OVERSAMPLENR , 225 },
- { 76 * OVERSAMPLENR , 220 },
- { 83 * OVERSAMPLENR , 215 },
- { 90 * OVERSAMPLENR , 210 },
- { 99 * OVERSAMPLENR , 205 },
- { 108 * OVERSAMPLENR , 200 },
- { 118 * OVERSAMPLENR , 195 },
- { 129 * OVERSAMPLENR , 190 },
- { 141 * OVERSAMPLENR , 185 },
- { 154 * OVERSAMPLENR , 180 },
- { 169 * OVERSAMPLENR , 175 },
- { 185 * OVERSAMPLENR , 170 },
- { 203 * OVERSAMPLENR , 165 },
- { 222 * OVERSAMPLENR , 160 },
- { 243 * OVERSAMPLENR , 155 },
- { 266 * OVERSAMPLENR , 150 },
- { 290 * OVERSAMPLENR , 145 },
- { 317 * OVERSAMPLENR , 140 },
- { 346 * OVERSAMPLENR , 135 },
- { 376 * OVERSAMPLENR , 130 },
- { 408 * OVERSAMPLENR , 125 },
- { 442 * OVERSAMPLENR , 120 },
- { 477 * OVERSAMPLENR , 115 },
- { 513 * OVERSAMPLENR , 110 },
- { 551 * OVERSAMPLENR , 105 },
- { 588 * OVERSAMPLENR , 100 },
- { 626 * OVERSAMPLENR , 95 },
- { 663 * OVERSAMPLENR , 90 },
- { 699 * OVERSAMPLENR , 85 },
- { 735 * OVERSAMPLENR , 80 },
- { 768 * OVERSAMPLENR , 75 },
- { 800 * OVERSAMPLENR , 70 },
- { 829 * OVERSAMPLENR , 65 },
- { 856 * OVERSAMPLENR , 60 },
- { 881 * OVERSAMPLENR , 55 },
- { 903 * OVERSAMPLENR , 50 },
- { 922 * OVERSAMPLENR , 45 },
- { 939 * OVERSAMPLENR , 40 },
- { 954 * OVERSAMPLENR , 35 },
- { 966 * OVERSAMPLENR , 30 },
- { 977 * OVERSAMPLENR , 25 },
- { 986 * OVERSAMPLENR , 20 },
- { 994 * OVERSAMPLENR , 15 },
- { 1000 * OVERSAMPLENR , 10 },
- { 1005 * OVERSAMPLENR , 5 },
- { 1009 * OVERSAMPLENR , 0 } //safety
+ { 22 * OVERSAMPLENR, 300 },
+ { 24 * OVERSAMPLENR, 295 },
+ { 25 * OVERSAMPLENR, 290 },
+ { 27 * OVERSAMPLENR, 285 },
+ { 29 * OVERSAMPLENR, 280 },
+ { 32 * OVERSAMPLENR, 275 },
+ { 34 * OVERSAMPLENR, 270 },
+ { 37 * OVERSAMPLENR, 265 },
+ { 40 * OVERSAMPLENR, 260 },
+ { 43 * OVERSAMPLENR, 255 },
+ { 46 * OVERSAMPLENR, 250 },
+ { 50 * OVERSAMPLENR, 245 },
+ { 54 * OVERSAMPLENR, 240 },
+ { 59 * OVERSAMPLENR, 235 },
+ { 64 * OVERSAMPLENR, 230 },
+ { 70 * OVERSAMPLENR, 225 },
+ { 76 * OVERSAMPLENR, 220 },
+ { 83 * OVERSAMPLENR, 215 },
+ { 90 * OVERSAMPLENR, 210 },
+ { 99 * OVERSAMPLENR, 205 },
+ { 108 * OVERSAMPLENR, 200 },
+ { 118 * OVERSAMPLENR, 195 },
+ { 129 * OVERSAMPLENR, 190 },
+ { 141 * OVERSAMPLENR, 185 },
+ { 154 * OVERSAMPLENR, 180 },
+ { 169 * OVERSAMPLENR, 175 },
+ { 185 * OVERSAMPLENR, 170 },
+ { 203 * OVERSAMPLENR, 165 },
+ { 222 * OVERSAMPLENR, 160 },
+ { 243 * OVERSAMPLENR, 155 },
+ { 266 * OVERSAMPLENR, 150 },
+ { 290 * OVERSAMPLENR, 145 },
+ { 317 * OVERSAMPLENR, 140 },
+ { 346 * OVERSAMPLENR, 135 },
+ { 376 * OVERSAMPLENR, 130 },
+ { 408 * OVERSAMPLENR, 125 },
+ { 442 * OVERSAMPLENR, 120 },
+ { 477 * OVERSAMPLENR, 115 },
+ { 513 * OVERSAMPLENR, 110 },
+ { 551 * OVERSAMPLENR, 105 },
+ { 588 * OVERSAMPLENR, 100 },
+ { 626 * OVERSAMPLENR, 95 },
+ { 663 * OVERSAMPLENR, 90 },
+ { 699 * OVERSAMPLENR, 85 },
+ { 735 * OVERSAMPLENR, 80 },
+ { 768 * OVERSAMPLENR, 75 },
+ { 800 * OVERSAMPLENR, 70 },
+ { 829 * OVERSAMPLENR, 65 },
+ { 856 * OVERSAMPLENR, 60 },
+ { 881 * OVERSAMPLENR, 55 },
+ { 903 * OVERSAMPLENR, 50 },
+ { 922 * OVERSAMPLENR, 45 },
+ { 939 * OVERSAMPLENR, 40 },
+ { 954 * OVERSAMPLENR, 35 },
+ { 966 * OVERSAMPLENR, 30 },
+ { 977 * OVERSAMPLENR, 25 },
+ { 986 * OVERSAMPLENR, 20 },
+ { 994 * OVERSAMPLENR, 15 },
+ { 1000 * OVERSAMPLENR, 10 },
+ { 1005 * OVERSAMPLENR, 5 },
+ { 1009 * OVERSAMPLENR, 0 } // safety
};
#endif
@@ -1092,11 +1128,11 @@ const short temptable_70[][2] PROGMEM = {
#define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
#define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T },
-#if (THERMISTORHEATER_0 == 110) || (THERMISTORHEATER_1 == 110) || (THERMISTORHEATER_2 == 110) || (THERMISTORHEATER_3 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup
+#if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup
const short temptable_110[][2] PROGMEM = {
// only few values are needed as the curve is very flat
- PtLine(0, 100, 1000)
- PtLine(50, 100, 1000)
+ PtLine( 0, 100, 1000)
+ PtLine( 50, 100, 1000)
PtLine(100, 100, 1000)
PtLine(150, 100, 1000)
PtLine(200, 100, 1000)
@@ -1104,11 +1140,11 @@ const short temptable_110[][2] PROGMEM = {
PtLine(300, 100, 1000)
};
#endif
-#if (THERMISTORHEATER_0 == 147) || (THERMISTORHEATER_1 == 147) || (THERMISTORHEATER_2 == 147) || (THERMISTORHEATER_3 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup
+#if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup
const short temptable_147[][2] PROGMEM = {
// only few values are needed as the curve is very flat
- PtLine(0, 100, 4700)
- PtLine(50, 100, 4700)
+ PtLine( 0, 100, 4700)
+ PtLine( 50, 100, 4700)
PtLine(100, 100, 4700)
PtLine(150, 100, 4700)
PtLine(200, 100, 4700)
@@ -1116,12 +1152,12 @@ const short temptable_147[][2] PROGMEM = {
PtLine(300, 100, 4700)
};
#endif
-#if (THERMISTORHEATER_0 == 1010) || (THERMISTORHEATER_1 == 1010) || (THERMISTORHEATER_2 == 1010) || (THERMISTORHEATER_3 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup
+#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup
const short temptable_1010[][2] PROGMEM = {
- PtLine(0, 1000, 1000)
- PtLine(25, 1000, 1000)
- PtLine(50, 1000, 1000)
- PtLine(75, 1000, 1000)
+ PtLine( 0, 1000, 1000)
+ PtLine( 25, 1000, 1000)
+ PtLine( 50, 1000, 1000)
+ PtLine( 75, 1000, 1000)
PtLine(100, 1000, 1000)
PtLine(125, 1000, 1000)
PtLine(150, 1000, 1000)
@@ -1133,11 +1169,11 @@ const short temptable_1010[][2] PROGMEM = {
PtLine(300, 1000, 1000)
};
#endif
-#if (THERMISTORHEATER_0 == 1047) || (THERMISTORHEATER_1 == 1047) || (THERMISTORHEATER_2 == 1047) || (THERMISTORHEATER_3 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup
+#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup
const short temptable_1047[][2] PROGMEM = {
// only few values are needed as the curve is very flat
- PtLine(0, 1000, 4700)
- PtLine(50, 1000, 4700)
+ PtLine( 0, 1000, 4700)
+ PtLine( 50, 1000, 4700)
PtLine(100, 1000, 4700)
PtLine(150, 1000, 4700)
PtLine(200, 1000, 4700)
@@ -1146,25 +1182,25 @@ const short temptable_1047[][2] PROGMEM = {
};
#endif
-#if (THERMISTORHEATER_0 == 999) || (THERMISTORHEATER_1 == 999) || (THERMISTORHEATER_2 == 999) || (THERMISTORHEATER_3 == 999) || (THERMISTORBED == 999) //User defined table
+#if ANY_THERMISTOR_IS(999) // User-defined table
// Dummy Thermistor table.. It will ALWAYS read a fixed value.
#ifndef DUMMY_THERMISTOR_999_VALUE
#define DUMMY_THERMISTOR_999_VALUE 25
#endif
const short temptable_999[][2] PROGMEM = {
- {1 * OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE},
- {1023 * OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE}
+ { 1 * OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE },
+ { 1023 * OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE }
};
#endif
-#if (THERMISTORHEATER_0 == 998) || (THERMISTORHEATER_1 == 998) || (THERMISTORHEATER_2 == 998) || (THERMISTORHEATER_3 == 998) || (THERMISTORBED == 998) //User defined table
+#if ANY_THERMISTOR_IS(998) // User-defined table
// Dummy Thermistor table.. It will ALWAYS read a fixed value.
#ifndef DUMMY_THERMISTOR_998_VALUE
#define DUMMY_THERMISTOR_998_VALUE 25
#endif
const short temptable_998[][2] PROGMEM = {
- {1 * OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE},
- {1023 * OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE}
+ { 1 * OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE },
+ { 1023 * OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE }
};
#endif
@@ -1184,12 +1220,12 @@ const short temptable_1047[][2] PROGMEM = {
#endif // HEATER_0_USES_THERMISTOR
#endif
-//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
+// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_0_RAW_HI_TEMP
- #ifdef HEATER_0_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
+ #ifdef HEATER_0_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_0_RAW_HI_TEMP 0
#define HEATER_0_RAW_LO_TEMP 16383
- #else //In case of an thermocouple the highest temperature results in the highest ADC value
+ #else // In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_0_RAW_HI_TEMP 16383
#define HEATER_0_RAW_LO_TEMP 0
#endif
@@ -1207,12 +1243,12 @@ const short temptable_1047[][2] PROGMEM = {
#endif // HEATER_1_USES_THERMISTOR
#endif
-//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
+// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_1_RAW_HI_TEMP
- #ifdef HEATER_1_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
+ #ifdef HEATER_1_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_1_RAW_HI_TEMP 0
#define HEATER_1_RAW_LO_TEMP 16383
- #else //In case of an thermocouple the highest temperature results in the highest ADC value
+ #else // In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_1_RAW_HI_TEMP 16383
#define HEATER_1_RAW_LO_TEMP 0
#endif
@@ -1230,12 +1266,12 @@ const short temptable_1047[][2] PROGMEM = {
#endif // HEATER_2_USES_THERMISTOR
#endif
-//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
+// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_2_RAW_HI_TEMP
- #ifdef HEATER_2_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
+ #ifdef HEATER_2_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_2_RAW_HI_TEMP 0
#define HEATER_2_RAW_LO_TEMP 16383
- #else //In case of an thermocouple the highest temperature results in the highest ADC value
+ #else // In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_2_RAW_HI_TEMP 16383
#define HEATER_2_RAW_LO_TEMP 0
#endif
@@ -1253,12 +1289,12 @@ const short temptable_1047[][2] PROGMEM = {
#endif // HEATER_3_USES_THERMISTOR
#endif
-//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
+// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_3_RAW_HI_TEMP
- #ifdef HEATER_3_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
+ #ifdef HEATER_3_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_3_RAW_HI_TEMP 0
#define HEATER_3_RAW_LO_TEMP 16383
- #else //In case of an thermocouple the highest temperature results in the highest ADC value
+ #else // In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_3_RAW_HI_TEMP 16383
#define HEATER_3_RAW_LO_TEMP 0
#endif
@@ -1273,15 +1309,15 @@ const short temptable_1047[][2] PROGMEM = {
#endif // BED_USES_THERMISTOR
#endif
-//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
+// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_BED_RAW_HI_TEMP
- #ifdef BED_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
+ #ifdef BED_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_BED_RAW_HI_TEMP 0
#define HEATER_BED_RAW_LO_TEMP 16383
- #else //In case of an thermocouple the highest temperature results in the highest ADC value
+ #else // In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_BED_RAW_HI_TEMP 16383
#define HEATER_BED_RAW_LO_TEMP 0
#endif
#endif
-#endif //THERMISTORTABLES_H_
+#endif // THERMISTORTABLES_H_
diff --git a/Marlin/pins_RAMPS_14_EFB.h b/Marlin/types.h
similarity index 85%
rename from Marlin/pins_RAMPS_14_EFB.h
rename to Marlin/types.h
index a43e4d227..8ab7beebe 100644
--- a/Marlin/pins_RAMPS_14_EFB.h
+++ b/Marlin/types.h
@@ -20,12 +20,9 @@
*
*/
-/**
- * Arduino Mega with RAMPS v1.4 pin assignments
- *
- * RAMPS_14_EFB (Extruder, Fan, Bed)
- */
+#ifndef __TYPES_H__
+#define __TYPES_H__
-#define IS_RAMPS_EFB
+typedef unsigned long millis_t;
-#include "pins_RAMPS_14.h"
+#endif
diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp
old mode 100644
new mode 100755
index 1a0071d1b..6eb5eff2d
--- a/Marlin/ultralcd.cpp
+++ b/Marlin/ultralcd.cpp
@@ -29,63 +29,75 @@
#include "stepper.h"
#include "configuration_store.h"
-/**
- * REVERSE_MENU_DIRECTION
- *
- * To reverse the menu direction we need a general way to reverse
- * the direction of the encoder everywhere. So encoderDirection is
- * added to allow the encoder to go the other way.
- *
- * This behavior is limited to scrolling Menus and SD card listings,
- * and is disabled in other contexts.
- */
-#if ENABLED(REVERSE_MENU_DIRECTION)
- int8_t encoderDirection = 1;
- #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1)
- #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1)
-#else
- #define ENCODER_DIRECTION_NORMAL() ;
- #define ENCODER_DIRECTION_MENUS() ;
+#if ENABLED(PRINTCOUNTER)
+ #include "printcounter.h"
+ #include "duration_t.h"
#endif
-int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
-
-bool encoderRateMultiplierEnabled;
-int32_t lastEncoderMovementMillis;
-
-int plaPreheatHotendTemp;
-int plaPreheatHPBTemp;
-int plaPreheatFanSpeed;
-
-int absPreheatHotendTemp;
-int absPreheatHPBTemp;
-int absPreheatFanSpeed;
+int preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1,
+ preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2;
#if ENABLED(FILAMENT_LCD_DISPLAY)
millis_t previous_lcd_status_ms = 0;
#endif
-// Function pointer to menu functions.
-typedef void (*menuFunc_t)();
-
uint8_t lcd_status_message_level;
char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
#if ENABLED(DOGLCD)
- #include "dogm_lcd_implementation.h"
+ #include "ultralcd_impl_DOGM.h"
#else
- #include "ultralcd_implementation_hitachi_HD44780.h"
+ #include "ultralcd_impl_HD44780.h"
#endif
// The main status screen
static void lcd_status_screen();
+millis_t next_lcd_update_ms;
+
+uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
+
#if ENABLED(ULTIPANEL)
+ // place-holders for Ki and Kd edits
+ float raw_Ki, raw_Kd;
+
+ /**
+ * REVERSE_MENU_DIRECTION
+ *
+ * To reverse the menu direction we need a general way to reverse
+ * the direction of the encoder everywhere. So encoderDirection is
+ * added to allow the encoder to go the other way.
+ *
+ * This behavior is limited to scrolling Menus and SD card listings,
+ * and is disabled in other contexts.
+ */
+ #if ENABLED(REVERSE_MENU_DIRECTION)
+ int8_t encoderDirection = 1;
+ #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1)
+ #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1)
+ #else
+ #define ENCODER_DIRECTION_NORMAL() ;
+ #define ENCODER_DIRECTION_MENUS() ;
+ #endif
+
+ int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
+
+ millis_t manual_move_start_time = 0;
+ int8_t manual_move_axis = (int8_t)NO_AXIS;
+ #if EXTRUDERS > 1
+ int8_t manual_move_e_index = 0;
+ #else
+ #define manual_move_e_index 0
+ #endif
+
+ bool encoderRateMultiplierEnabled;
+ int32_t lastEncoderMovementMillis;
+
#if HAS_POWER_SWITCH
extern bool powersupply;
#endif
- const float manual_feedrate[] = MANUAL_FEEDRATE;
+ const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE;
static void lcd_main_menu();
static void lcd_tune_menu();
static void lcd_prepare_menu();
@@ -97,6 +109,25 @@ static void lcd_status_screen();
static void lcd_control_motion_menu();
static void lcd_control_volumetric_menu();
+ #if ENABLED(LCD_INFO_MENU)
+ #if ENABLED(PRINTCOUNTER)
+ static void lcd_info_stats_menu();
+ #endif
+ static void lcd_info_thermistors_menu();
+ static void lcd_info_board_menu();
+ static void lcd_info_menu();
+ #endif // LCD_INFO_MENU
+
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ static void lcd_filament_change_option_menu();
+ static void lcd_filament_change_init_message();
+ static void lcd_filament_change_unload_message();
+ static void lcd_filament_change_insert_message();
+ static void lcd_filament_change_load_message();
+ static void lcd_filament_change_extrude_message();
+ static void lcd_filament_change_resume_message();
+ #endif
+
#if HAS_LCD_CONTRAST
static void lcd_set_contrast();
#endif
@@ -113,11 +144,14 @@ static void lcd_status_screen();
#include "mesh_bed_leveling.h"
#endif
- /* Different types of actions that can be used in menu items. */
+ // Function pointer to menu functions.
+ typedef void (*screenFunc_t)();
+
+ // Different types of actions that can be used in menu items.
static void menu_action_back();
- static void menu_action_submenu(menuFunc_t data);
+ static void menu_action_submenu(screenFunc_t data);
static void menu_action_gcode(const char* pgcode);
- static void menu_action_function(menuFunc_t data);
+ static void menu_action_function(screenFunc_t data);
static void menu_action_setting_edit_bool(const char* pstr, bool* ptr);
static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
static void menu_action_setting_edit_float3(const char* pstr, float* ptr, float minValue, float maxValue);
@@ -127,15 +161,15 @@ static void lcd_status_screen();
static void menu_action_setting_edit_float51(const char* pstr, float* ptr, float minValue, float maxValue);
static void menu_action_setting_edit_float52(const char* pstr, float* ptr, float minValue, float maxValue);
static void menu_action_setting_edit_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue);
- static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callbackFunc);
- static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callbackFunc);
- static void menu_action_setting_edit_callback_float3(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc);
- static void menu_action_setting_edit_callback_float32(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc);
- static void menu_action_setting_edit_callback_float43(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc);
- static void menu_action_setting_edit_callback_float5(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc);
- static void menu_action_setting_edit_callback_float51(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc);
- static void menu_action_setting_edit_callback_float52(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc);
- static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, menuFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, screenFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_float3(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_float32(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_float43(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_float5(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_float51(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_float52(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
+ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, screenFunc_t callbackFunc);
#if ENABLED(SDSUPPORT)
static void lcd_sdcard_menu();
@@ -143,40 +177,67 @@ static void lcd_status_screen();
static void menu_action_sddirectory(const char* filename, char* longFilename);
#endif
- #define ENCODER_FEEDRATE_DEADZONE 10
+ /* Helper macros for menus */
- #if DISABLED(LCD_I2C_VIKI)
- #ifndef ENCODER_STEPS_PER_MENU_ITEM
- #define ENCODER_STEPS_PER_MENU_ITEM 5
- #endif
- #ifndef ENCODER_PULSES_PER_STEP
- #define ENCODER_PULSES_PER_STEP 1
- #endif
- #else
- #ifndef ENCODER_STEPS_PER_MENU_ITEM
- #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
- #endif
- #ifndef ENCODER_PULSES_PER_STEP
- #define ENCODER_PULSES_PER_STEP 1
- #endif
+ #ifndef ENCODER_FEEDRATE_DEADZONE
+ #define ENCODER_FEEDRATE_DEADZONE 10
+ #endif
+ #ifndef ENCODER_STEPS_PER_MENU_ITEM
+ #define ENCODER_STEPS_PER_MENU_ITEM 5
+ #endif
+ #ifndef ENCODER_PULSES_PER_STEP
+ #define ENCODER_PULSES_PER_STEP 1
#endif
-
-
- /* Helper macros for menus */
/**
- * START_MENU generates the init code for a menu function
+ * START_SCREEN_OR_MENU generates init code for a screen or menu
+ *
+ * encoderLine is the position based on the encoder
+ * encoderTopLine is the top menu line to display
+ * _lcdLineNr is the index of the LCD line (e.g., 0-3)
+ * _menuLineNr is the menu item to draw and process
+ * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM
+ * _countedItems is the total number of items in the menu (after one call)
*/
- #define START_MENU() do { \
+ #define START_SCREEN_OR_MENU(LIMIT) \
ENCODER_DIRECTION_MENUS(); \
encoderRateMultiplierEnabled = false; \
if (encoderPosition > 0x8000) encoderPosition = 0; \
- uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
- NOMORE(currentMenuViewOffset, encoderLine); \
- uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
- bool wasClicked = LCD_CLICKED, itemSelected; \
- for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
- _menuItemNr = 0;
+ static int8_t _countedItems = 0; \
+ int8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
+ if (_countedItems > 0 && encoderLine >= _countedItems - LIMIT) { \
+ encoderLine = _countedItems - LIMIT; \
+ encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \
+ }
+
+ #define SCREEN_OR_MENU_LOOP() \
+ int8_t _menuLineNr = encoderTopLine, _thisItemNr; \
+ for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \
+ _thisItemNr = 0
+
+ /**
+ * START_SCREEN Opening code for a screen having only static items.
+ * Do simplified scrolling of the entire screen.
+ *
+ * START_MENU Opening code for a screen with menu items.
+ * Scroll as-needed to keep the selected line in view.
+ * 'wasClicked' indicates the controller was clicked.
+ */
+ #define START_SCREEN() \
+ START_SCREEN_OR_MENU(LCD_HEIGHT); \
+ encoderTopLine = encoderLine; \
+ bool _skipStatic = false; \
+ SCREEN_OR_MENU_LOOP()
+
+ #define START_MENU() \
+ START_SCREEN_OR_MENU(1); \
+ NOMORE(encoderTopLine, encoderLine); \
+ if (encoderLine >= encoderTopLine + LCD_HEIGHT) { \
+ encoderTopLine = encoderLine - (LCD_HEIGHT - 1); \
+ } \
+ bool wasClicked = LCD_CLICKED; \
+ bool _skipStatic = true; \
+ SCREEN_OR_MENU_LOOP()
/**
* MENU_ITEM generates draw & handler code for a menu item, potentially calling:
@@ -193,32 +254,53 @@ static void lcd_status_screen();
* lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause)
* menu_action_function(lcd_sdcard_pause)
*
- * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999)
- * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
- * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
- * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
+ * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
+ * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
+ * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
+ * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
*
*/
- #define _MENU_ITEM_PART_1(type, label, args...) \
- if (_menuItemNr == _lineNr) { \
- itemSelected = encoderLine == _menuItemNr; \
+ #define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \
+ if (_menuLineNr == _thisItemNr) { \
if (lcdDrawUpdate) \
- lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \
- if (wasClicked && itemSelected) { \
+ lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## ARGS); \
+ if (wasClicked && encoderLine == _thisItemNr) { \
lcd_quick_feedback()
- #define _MENU_ITEM_PART_2(type, args...) \
- menu_action_ ## type(args); \
+ #define _MENU_ITEM_PART_2(TYPE, ARGS...) \
+ menu_action_ ## TYPE(ARGS); \
return; \
} \
} \
- _menuItemNr++
+ ++_thisItemNr
- #define MENU_ITEM(type, label, args...) do { \
- _MENU_ITEM_PART_1(type, label, ## args); \
- _MENU_ITEM_PART_2(type, ## args); \
+ #define MENU_ITEM(TYPE, LABEL, ARGS...) do { \
+ _skipStatic = false; \
+ _MENU_ITEM_PART_1(TYPE, LABEL, ## ARGS); \
+ _MENU_ITEM_PART_2(TYPE, ## ARGS); \
} while(0)
+ // Used to print static text with no visible cursor.
+ #define STATIC_ITEM(LABEL, ARGS...) \
+ if (_menuLineNr == _thisItemNr) { \
+ if (_skipStatic && encoderLine <= _thisItemNr) { \
+ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
+ lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
+ } \
+ if (lcdDrawUpdate) \
+ lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## ARGS); \
+ } \
+ ++_thisItemNr
+
+ #define END_SCREEN() \
+ } \
+ _countedItems = _thisItemNr
+
+ #define END_MENU() \
+ } \
+ _countedItems = _thisItemNr; \
+ UNUSED(_skipStatic)
+
#if ENABLED(ENCODER_RATE_MULTIPLIER)
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
@@ -235,7 +317,7 @@ static void lcd_status_screen();
#endif //ENCODER_RATE_MULTIPLIER
- #define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0)
+ #define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0)
#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
#define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
#if ENABLED(ENCODER_RATE_MULTIPLIER)
@@ -245,10 +327,6 @@ static void lcd_status_screen();
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
#endif //!ENCODER_RATE_MULTIPLIER
- #define END_MENU() \
- if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; encoderLine = _menuItemNr - 1; }\
- if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
- } } while(0)
/** Used variables to keep track of the menu */
volatile uint8_t buttons; //the last checked buttons in a bit array.
@@ -259,7 +337,7 @@ static void lcd_status_screen();
#if ENABLED(LCD_HAS_SLOW_BUTTONS)
volatile uint8_t slow_buttons; // Bits of the pressed buttons.
#endif
- uint8_t currentMenuViewOffset; /* scroll offset in the current menu */
+ int8_t encoderTopLine; /* scroll offset in the current menu */
millis_t next_button_update_ms;
uint8_t lastEncoderBits;
uint32_t encoderPosition;
@@ -267,91 +345,76 @@ static void lcd_status_screen();
uint8_t lcd_sd_status;
#endif
-#endif // ULTIPANEL
-
-typedef struct {
- menuFunc_t menu_function;
- #if ENABLED(ULTIPANEL)
+ typedef struct {
+ screenFunc_t menu_function;
uint32_t encoder_position;
- #endif
-} menuPosition;
-
-menuFunc_t currentMenu = lcd_status_screen; // pointer to the currently active menu handler
+ } menuPosition;
-menuPosition menu_history[10];
-uint8_t menu_history_depth = 0;
-
-millis_t next_lcd_update_ms;
-bool ignore_click = false;
-bool wait_for_unclick;
-bool defer_return_to_status = false;
-
-enum LCDViewAction {
- LCDVIEW_NONE,
- LCDVIEW_REDRAW_NOW,
- LCDVIEW_CALL_REDRAW_NEXT,
- LCDVIEW_CLEAR_CALL_REDRAW,
- LCDVIEW_CALL_NO_REDRAW
-};
+ screenFunc_t currentScreen = lcd_status_screen; // pointer to the currently active menu handler
-uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
+ menuPosition screen_history[10];
+ uint8_t screen_history_depth = 0;
-// Variables used when editing values.
-const char* editLabel;
-void* editValue;
-int32_t minEditValue, maxEditValue;
-menuFunc_t callbackFunc; // call this after editing
+ bool ignore_click = false;
+ bool wait_for_unclick;
+ bool defer_return_to_status = false;
-// place-holders for Ki and Kd edits
-float raw_Ki, raw_Kd;
+ // Variables used when editing values.
+ const char* editLabel;
+ void* editValue;
+ int32_t minEditValue, maxEditValue;
+ screenFunc_t callbackFunc; // call this after editing
-/**
- * General function to go directly to a menu
- * Remembers the previous position
- */
-static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const uint32_t encoder = 0) {
- if (currentMenu != menu) {
- currentMenu = menu;
- lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
- #if ENABLED(NEWPANEL)
+ /**
+ * General function to go directly to a menu
+ * Remembers the previous position
+ */
+ static void lcd_goto_screen(screenFunc_t screen, const bool feedback = false, const uint32_t encoder = 0) {
+ if (currentScreen != screen) {
+ currentScreen = screen;
+ lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
encoderPosition = encoder;
if (feedback) lcd_quick_feedback();
- #endif
- if (menu == lcd_status_screen) {
- defer_return_to_status = false;
- menu_history_depth = 0;
+ if (screen == lcd_status_screen) {
+ defer_return_to_status = false;
+ screen_history_depth = 0;
+ }
+ #if ENABLED(LCD_PROGRESS_BAR)
+ // For LCD_PROGRESS_BAR re-initialize custom characters
+ lcd_set_custom_characters(screen == lcd_status_screen);
+ #endif
}
- #if ENABLED(LCD_PROGRESS_BAR)
- // For LCD_PROGRESS_BAR re-initialize custom characters
- lcd_set_custom_characters(menu == lcd_status_screen);
- #endif
}
-}
-static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
+ static void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
-inline void lcd_save_previous_menu() {
- if (menu_history_depth < COUNT(menu_history)) {
- menu_history[menu_history_depth].menu_function = currentMenu;
- #if ENABLED(ULTIPANEL)
- menu_history[menu_history_depth].encoder_position = encoderPosition;
- #endif
- ++menu_history_depth;
+ inline void lcd_save_previous_menu() {
+ if (screen_history_depth < COUNT(screen_history)) {
+ screen_history[screen_history_depth].menu_function = currentScreen;
+ screen_history[screen_history_depth].encoder_position = encoderPosition;
+ ++screen_history_depth;
+ }
}
-}
-static void lcd_goto_previous_menu(bool feedback=false) {
- if (menu_history_depth > 0) {
- --menu_history_depth;
- lcd_goto_menu(menu_history[menu_history_depth].menu_function, feedback
- #if ENABLED(ULTIPANEL)
- , menu_history[menu_history_depth].encoder_position
- #endif
- );
+ static void lcd_goto_previous_menu(bool feedback=false) {
+ if (screen_history_depth > 0) {
+ --screen_history_depth;
+ lcd_goto_screen(
+ screen_history[screen_history_depth].menu_function,
+ feedback,
+ screen_history[screen_history_depth].encoder_position
+ );
+ }
+ else
+ lcd_return_to_status();
}
- else
- lcd_return_to_status();
-}
+
+ void lcd_ignore_click(bool b) {
+ ignore_click = b;
+ wait_for_unclick = false;
+ }
+
+#endif // ULTIPANEL
/**
*
@@ -361,8 +424,11 @@ static void lcd_goto_previous_menu(bool feedback=false) {
*/
static void lcd_status_screen() {
- ENCODER_DIRECTION_NORMAL();
- encoderRateMultiplierEnabled = false;
+
+ #if ENABLED(ULTIPANEL)
+ ENCODER_DIRECTION_NORMAL();
+ encoderRateMultiplierEnabled = false;
+ #endif
#if ENABLED(LCD_PROGRESS_BAR)
millis_t ms = millis();
@@ -418,10 +484,10 @@ static void lcd_status_screen() {
}
if (current_click) {
- lcd_goto_menu(lcd_main_menu, true);
+ lcd_goto_screen(lcd_main_menu, true);
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
- #if ENABLED(LCD_PROGRESS_BAR)
- currentMenu == lcd_status_screen
+ #if ENABLED(LCD_PROGRESS_BAR) && ENABLED(ULTIPANEL)
+ currentScreen == lcd_status_screen
#endif
);
#if ENABLED(FILAMENT_LCD_DISPLAY)
@@ -430,1586 +496,1885 @@ static void lcd_status_screen() {
}
#if ENABLED(ULTIPANEL_FEEDMULTIPLY)
- int new_frm = feedrate_multiplier + (int32_t)encoderPosition;
+ int new_frm = feedrate_percentage + (int32_t)encoderPosition;
// Dead zone at 100% feedrate
- if ((feedrate_multiplier < 100 && new_frm > 100) || (feedrate_multiplier > 100 && new_frm < 100)) {
- feedrate_multiplier = 100;
+ if ((feedrate_percentage < 100 && new_frm > 100) || (feedrate_percentage > 100 && new_frm < 100)) {
+ feedrate_percentage = 100;
encoderPosition = 0;
}
- else if (feedrate_multiplier == 100) {
+ else if (feedrate_percentage == 100) {
if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) {
- feedrate_multiplier += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE);
+ feedrate_percentage += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE);
encoderPosition = 0;
}
else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) {
- feedrate_multiplier += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE;
+ feedrate_percentage += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE;
encoderPosition = 0;
}
}
else {
- feedrate_multiplier = new_frm;
+ feedrate_percentage = new_frm;
encoderPosition = 0;
}
#endif // ULTIPANEL_FEEDMULTIPLY
- feedrate_multiplier = constrain(feedrate_multiplier, 10, 999);
+ feedrate_percentage = constrain(feedrate_percentage, 10, 999);
#endif //ULTIPANEL
}
-#if ENABLED(ULTIPANEL)
-
-inline void line_to_current(AxisEnum axis) {
- #if ENABLED(DELTA)
- calculate_delta(current_position);
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
+/**
+ *
+ * draw the kill screen
+ *
+ */
+void kill_screen(const char* lcd_msg) {
+ lcd_init();
+ lcd_setalertstatuspgm(lcd_msg);
+ #if ENABLED(DOGLCD)
+ u8g.firstPage();
+ do {
+ lcd_kill_screen();
+ } while (u8g.nextPage());
#else
- planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
+ lcd_kill_screen();
#endif
}
-#if ENABLED(SDSUPPORT)
+#if ENABLED(ULTIPANEL)
- static void lcd_sdcard_pause() {
- card.pauseSDPrint();
- print_job_timer.pause();
+ inline void line_to_current(AxisEnum axis) {
+ #if ENABLED(DELTA)
+ inverse_kinematics(current_position);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder);
+ #else // !DELTA
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder);
+ #endif // !DELTA
}
- static void lcd_sdcard_resume() {
- card.startFileprint();
- print_job_timer.start();
- }
+ #if ENABLED(SDSUPPORT)
- static void lcd_sdcard_stop() {
- stepper.quick_stop();
- #if DISABLED(DELTA) && DISABLED(SCARA)
- set_current_position_from_planner();
- #endif
- clear_command_queue();
- card.sdprinting = false;
- card.closefile();
- print_job_timer.stop();
- thermalManager.autotempShutdown();
- cancel_heatup = true;
- lcd_setstatus(MSG_PRINT_ABORTED, true);
- }
+ static void lcd_sdcard_pause() {
+ card.pauseSDPrint();
+ print_job_timer.pause();
+ }
-#endif //SDSUPPORT
+ static void lcd_sdcard_resume() {
+ card.startFileprint();
+ print_job_timer.start();
+ }
-/**
- *
- * "Main" menu
- *
- */
+ static void lcd_sdcard_stop() {
+ card.stopSDPrint();
+ clear_command_queue();
+ quickstop_stepper();
+ print_job_timer.stop();
+ thermalManager.autotempShutdown();
+ wait_for_heatup = false;
+ lcd_setstatus(MSG_PRINT_ABORTED, true);
+ }
-static void lcd_main_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_WATCH);
- if (planner.movesplanned() || IS_SD_PRINTING) {
- MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu);
- }
- else {
- MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
- #if ENABLED(DELTA_CALIBRATION_MENU)
- MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu);
- #endif
- }
- MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu);
+ #endif //SDSUPPORT
- #if ENABLED(SDSUPPORT)
- if (card.cardOK) {
- if (card.isFileOpen()) {
- if (card.sdprinting)
- MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
- else
- MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
- MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop);
+ /**
+ *
+ * "Main" menu
+ *
+ */
+
+ static void lcd_main_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_WATCH);
+ if (planner.movesplanned() || IS_SD_PRINTING) {
+ MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu);
+ }
+ else {
+ MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
+ #if ENABLED(DELTA_CALIBRATION_MENU)
+ MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu);
+ #endif
+ }
+ MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu);
+
+ #if ENABLED(SDSUPPORT)
+ if (card.cardOK) {
+ if (card.isFileOpen()) {
+ if (card.sdprinting)
+ MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
+ else
+ MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
+ MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop);
+ }
+ else {
+ MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu);
+ #if !PIN_EXISTS(SD_DETECT)
+ MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user
+ #endif
+ }
}
else {
- MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu);
+ MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu);
#if !PIN_EXISTS(SD_DETECT)
- MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user
+ MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
#endif
}
- }
- else {
- MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu);
- #if !PIN_EXISTS(SD_DETECT)
- MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
- #endif
- }
- #endif //SDSUPPORT
-
- END_MENU();
-}
-
-/**
- *
- * "Tune" submenu items
- *
- */
+ #endif //SDSUPPORT
-/**
- * Set the home offset based on the current_position
- */
-void lcd_set_home_offsets() {
- // M428 Command
- enqueue_and_echo_commands_P(PSTR("M428"));
- lcd_return_to_status();
-}
-
-#if ENABLED(BABYSTEPPING)
-
- int babysteps_done = 0;
+ #if ENABLED(LCD_INFO_MENU)
+ MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu);
+ #endif
- static void _lcd_babystep(const AxisEnum axis, const char* msg) {
- ENCODER_DIRECTION_NORMAL();
- if (encoderPosition) {
- int distance = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
- encoderPosition = 0;
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
- thermalManager.babystep_axis(axis, distance);
- babysteps_done += distance;
- }
- if (lcdDrawUpdate) lcd_implementation_drawedit(msg, itostr3sign(babysteps_done));
- if (LCD_CLICKED) lcd_goto_previous_menu(true);
+ END_MENU();
}
- #if ENABLED(BABYSTEP_XY)
- static void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); }
- static void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); }
- static void lcd_babystep_x() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_x); }
- static void lcd_babystep_y() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_y); }
- #endif
- static void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); }
- static void lcd_babystep_z() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_z); }
-
-#endif //BABYSTEPPING
+ /**
+ *
+ * "Tune" submenu items
+ *
+ */
-/**
- * Watch temperature callbacks
- */
-#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
- #if TEMP_SENSOR_0 != 0
- void watch_temp_callback_E0() { thermalManager.start_watching_heater(0); }
- #endif
- #if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0
- void watch_temp_callback_E1() { thermalManager.start_watching_heater(1); }
- #endif // EXTRUDERS > 1
- #if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0
- void watch_temp_callback_E2() { thermalManager.start_watching_heater(2); }
- #endif // EXTRUDERS > 2
- #if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0
- void watch_temp_callback_E3() { thermalManager.start_watching_heater(3); }
- #endif // EXTRUDERS > 3
-#else
- #if TEMP_SENSOR_0 != 0
- void watch_temp_callback_E0() {}
- #endif
- #if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0
- void watch_temp_callback_E1() {}
- #endif // EXTRUDERS > 1
- #if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0
- void watch_temp_callback_E2() {}
- #endif // EXTRUDERS > 2
- #if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0
- void watch_temp_callback_E3() {}
- #endif // EXTRUDERS > 3
-#endif
+ /**
+ * Set the home offset based on the current_position
+ */
+ void lcd_set_home_offsets() {
+ // M428 Command
+ enqueue_and_echo_commands_P(PSTR("M428"));
+ lcd_return_to_status();
+ }
-#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
- #if TEMP_SENSOR_BED != 0
- void watch_temp_callback_bed() { thermalManager.start_watching_bed(); }
- #endif
-#else
- #if TEMP_SENSOR_BED != 0
- void watch_temp_callback_bed() {}
- #endif
-#endif
+ #if ENABLED(BABYSTEPPING)
-/**
- *
- * "Tune" submenu
- *
- */
-static void lcd_tune_menu() {
- START_MENU();
+ long babysteps_done = 0;
- //
- // ^ Main
- //
- MENU_ITEM(back, MSG_MAIN);
+ static void _lcd_babystep(const AxisEnum axis, const char* msg) {
+ if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
+ ENCODER_DIRECTION_NORMAL();
+ if (encoderPosition) {
+ int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
+ encoderPosition = 0;
+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
+ thermalManager.babystep_axis(axis, babystep_increment);
+ babysteps_done += babystep_increment;
+ }
+ if (lcdDrawUpdate)
+ lcd_implementation_drawedit(msg, ftostr43sign(
+ ((1000 * babysteps_done) * planner.steps_to_mm[axis]) * 0.001f
+ ));
+ }
- //
- // Speed:
- //
- MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999);
+ #if ENABLED(BABYSTEP_XY)
+ static void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); }
+ static void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); }
+ static void lcd_babystep_x() { babysteps_done = 0; lcd_goto_screen(_lcd_babystep_x); }
+ static void lcd_babystep_y() { babysteps_done = 0; lcd_goto_screen(_lcd_babystep_y); }
+ #endif
+ static void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); }
+ static void lcd_babystep_z() { babysteps_done = 0; lcd_goto_screen(_lcd_babystep_z); }
- // Manual bed leveling, Bed Z:
- #if ENABLED(MANUAL_BED_LEVELING)
- MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
- #endif
+ #endif //BABYSTEPPING
- //
- // Nozzle:
- // Nozzle [1-4]:
- //
- #if EXTRUDERS == 1
+ /**
+ * Watch temperature callbacks
+ */
+ #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
#if TEMP_SENSOR_0 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
+ void watch_temp_callback_E0() { thermalManager.start_watching_heater(0); }
#endif
- #else //EXTRUDERS > 1
+ #if HOTENDS > 1 && TEMP_SENSOR_1 != 0
+ void watch_temp_callback_E1() { thermalManager.start_watching_heater(1); }
+ #endif // HOTENDS > 1
+ #if HOTENDS > 2 && TEMP_SENSOR_2 != 0
+ void watch_temp_callback_E2() { thermalManager.start_watching_heater(2); }
+ #endif // HOTENDS > 2
+ #if HOTENDS > 3 && TEMP_SENSOR_3 != 0
+ void watch_temp_callback_E3() { thermalManager.start_watching_heater(3); }
+ #endif // HOTENDS > 3
+ #else
#if TEMP_SENSOR_0 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
+ void watch_temp_callback_E0() {}
#endif
- #if TEMP_SENSOR_1 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1);
+ #if HOTENDS > 1 && TEMP_SENSOR_1 != 0
+ void watch_temp_callback_E1() {}
+ #endif // HOTENDS > 1
+ #if HOTENDS > 2 && TEMP_SENSOR_2 != 0
+ void watch_temp_callback_E2() {}
+ #endif // HOTENDS > 2
+ #if HOTENDS > 3 && TEMP_SENSOR_3 != 0
+ void watch_temp_callback_E3() {}
+ #endif // HOTENDS > 3
+ #endif
+
+ #if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0
+ #if TEMP_SENSOR_BED != 0
+ void watch_temp_callback_bed() { thermalManager.start_watching_bed(); }
+ #endif
+ #else
+ #if TEMP_SENSOR_BED != 0
+ void watch_temp_callback_bed() {}
#endif
- #if EXTRUDERS > 2
- #if TEMP_SENSOR_2 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2);
- #endif
- #if EXTRUDERS > 3
- #if TEMP_SENSOR_3 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3);
- #endif
- #endif // EXTRUDERS > 3
- #endif // EXTRUDERS > 2
- #endif // EXTRUDERS > 1
-
- //
- // Bed:
- //
- #if TEMP_SENSOR_BED != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
#endif
- //
- // Fan Speed:
- //
- #if FAN_COUNT > 0
- #if HAS_FAN0
- #if FAN_COUNT > 1
- #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED " 1"
- #else
- #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED
- #endif
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_1ST_FAN_SPEED, &fanSpeeds[0], 0, 255);
- #endif
- #if HAS_FAN1
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255);
- #endif
- #if HAS_FAN2
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255);
- #endif
- #endif // FAN_COUNT > 0
-
- //
- // Flow:
- // Flow 1:
- // Flow 2:
- // Flow 3:
- // Flow 4:
- //
- #if EXTRUDERS == 1
- MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[0], 10, 999);
- #else // EXTRUDERS > 1
- MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[active_extruder], 10, 999);
- MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N1, &extruder_multiplier[0], 10, 999);
- MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N2, &extruder_multiplier[1], 10, 999);
- #if EXTRUDERS > 2
- MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N3, &extruder_multiplier[2], 10, 999);
- #if EXTRUDERS > 3
- MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N4, &extruder_multiplier[3], 10, 999);
- #endif //EXTRUDERS > 3
- #endif //EXTRUDERS > 2
- #endif //EXTRUDERS > 1
-
- //
- // Babystep X:
- // Babystep Y:
- // Babystep Z:
- //
- #if ENABLED(BABYSTEPPING)
- #if ENABLED(BABYSTEP_XY)
- MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x);
- MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y);
- #endif //BABYSTEP_XY
- MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z);
- #endif
+ /**
+ *
+ * "Tune" submenu
+ *
+ */
+ static void lcd_tune_menu() {
+ START_MENU();
- //
- // Change filament
- //
- #if ENABLED(FILAMENTCHANGEENABLE)
- MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600"));
- #endif
+ //
+ // ^ Main
+ //
+ MENU_ITEM(back, MSG_MAIN);
- END_MENU();
-}
+ //
+ // Speed:
+ //
+ MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999);
-/**
- *
- * "Prepare" submenu items
- *
- */
-void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) {
- if (temph > 0) thermalManager.setTargetHotend(temph, endnum);
- #if TEMP_SENSOR_BED != 0
- thermalManager.setTargetBed(tempb);
- #else
- UNUSED(tempb);
- #endif
- #if FAN_COUNT > 0
- #if FAN_COUNT > 1
- fanSpeeds[active_extruder < FAN_COUNT ? active_extruder : 0] = fan;
- #else
- fanSpeeds[0] = fan;
+ // Manual bed leveling, Bed Z:
+ #if ENABLED(MANUAL_BED_LEVELING)
+ MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
#endif
- #else
- UNUSED(fan);
- #endif
- lcd_return_to_status();
-}
-#if TEMP_SENSOR_0 != 0
- void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
- void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
-#endif
+ //
+ // Nozzle:
+ // Nozzle [1-4]:
+ //
+ #if HOTENDS == 1
+ #if TEMP_SENSOR_0 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
+ #endif
+ #else //HOTENDS > 1
+ #if TEMP_SENSOR_0 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
+ #endif
+ #if TEMP_SENSOR_1 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1);
+ #endif
+ #if HOTENDS > 2
+ #if TEMP_SENSOR_2 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2);
+ #endif
+ #if HOTENDS > 3
+ #if TEMP_SENSOR_3 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3);
+ #endif
+ #endif // HOTENDS > 3
+ #endif // HOTENDS > 2
+ #endif // HOTENDS > 1
-#if EXTRUDERS > 1
- void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
- void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
- #if EXTRUDERS > 2
- void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
- void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
- #if EXTRUDERS > 3
- void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
- void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
+ //
+ // Bed:
+ //
+ #if TEMP_SENSOR_BED != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
#endif
- #endif
- void lcd_preheat_pla0123() {
- #if EXTRUDERS > 1
- thermalManager.setTargetHotend(plaPreheatHotendTemp, 1);
- #if EXTRUDERS > 2
- thermalManager.setTargetHotend(plaPreheatHotendTemp, 2);
- #if EXTRUDERS > 3
- thermalManager.setTargetHotend(plaPreheatHotendTemp, 3);
+ //
+ // Fan Speed:
+ //
+ #if FAN_COUNT > 0
+ #if HAS_FAN0
+ #if FAN_COUNT > 1
+ #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED " 1"
+ #else
+ #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED
#endif
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_1ST_FAN_SPEED, &fanSpeeds[0], 0, 255);
#endif
- #endif
- lcd_preheat_pla0();
- }
- void lcd_preheat_abs0123() {
- #if EXTRUDERS > 1
- thermalManager.setTargetHotend(absPreheatHotendTemp, 1);
+ #if HAS_FAN1
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255);
+ #endif
+ #if HAS_FAN2
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255);
+ #endif
+ #endif // FAN_COUNT > 0
+
+ //
+ // Flow:
+ // Flow 1:
+ // Flow 2:
+ // Flow 3:
+ // Flow 4:
+ //
+ #if EXTRUDERS == 1
+ MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[0], 10, 999);
+ #else // EXTRUDERS > 1
+ MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[active_extruder], 10, 999);
+ MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N1, &extruder_multiplier[0], 10, 999);
+ MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N2, &extruder_multiplier[1], 10, 999);
#if EXTRUDERS > 2
- thermalManager.setTargetHotend(absPreheatHotendTemp, 2);
+ MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N3, &extruder_multiplier[2], 10, 999);
#if EXTRUDERS > 3
- thermalManager.setTargetHotend(absPreheatHotendTemp, 3);
- #endif
- #endif
- #endif
- lcd_preheat_abs0();
- }
+ MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N4, &extruder_multiplier[3], 10, 999);
+ #endif //EXTRUDERS > 3
+ #endif //EXTRUDERS > 2
+ #endif //EXTRUDERS > 1
-#endif // EXTRUDERS > 1
+ //
+ // Babystep X:
+ // Babystep Y:
+ // Babystep Z:
+ //
+ #if ENABLED(BABYSTEPPING)
+ #if ENABLED(BABYSTEP_XY)
+ MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x);
+ MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y);
+ #endif //BABYSTEP_XY
+ MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z);
+ #endif
-#if TEMP_SENSOR_BED != 0
- void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); }
- void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, absPreheatHPBTemp, absPreheatFanSpeed); }
-#endif
+ //
+ // Change filament
+ //
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600"));
+ #endif
-#if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0)
+ END_MENU();
+ }
- static void lcd_preheat_pla_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_PREPARE);
- #if EXTRUDERS == 1
- MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0);
+ /**
+ *
+ * "Prepare" submenu items
+ *
+ */
+ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) {
+ if (temph > 0) thermalManager.setTargetHotend(temph, endnum);
+ #if TEMP_SENSOR_BED != 0
+ thermalManager.setTargetBed(tempb);
#else
- MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0);
- MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1);
- #if EXTRUDERS > 2
- MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2);
- #if EXTRUDERS > 3
- MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3);
- #endif
- #endif
- MENU_ITEM(function, MSG_PREHEAT_PLA_ALL, lcd_preheat_pla0123);
+ UNUSED(tempb);
#endif
- #if TEMP_SENSOR_BED != 0
- MENU_ITEM(function, MSG_PREHEAT_PLA_BEDONLY, lcd_preheat_pla_bedonly);
+ #if FAN_COUNT > 0
+ #if FAN_COUNT > 1
+ fanSpeeds[active_extruder < FAN_COUNT ? active_extruder : 0] = fan;
+ #else
+ fanSpeeds[0] = fan;
+ #endif
+ #else
+ UNUSED(fan);
#endif
- END_MENU();
+ lcd_return_to_status();
}
- static void lcd_preheat_abs_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_PREPARE);
- #if EXTRUDERS == 1
- MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0);
- #else
- MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0);
- MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1);
- #if EXTRUDERS > 2
- MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2);
- #if EXTRUDERS > 3
- MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3);
- #endif
+ #if TEMP_SENSOR_0 != 0
+ void lcd_preheat_pla0() { _lcd_preheat(0, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); }
+ void lcd_preheat_abs0() { _lcd_preheat(0, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); }
+ #endif
+
+ #if HOTENDS > 1
+ void lcd_preheat_pla1() { _lcd_preheat(1, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); }
+ void lcd_preheat_abs1() { _lcd_preheat(1, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); }
+ #if HOTENDS > 2
+ void lcd_preheat_pla2() { _lcd_preheat(2, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); }
+ void lcd_preheat_abs2() { _lcd_preheat(2, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); }
+ #if HOTENDS > 3
+ void lcd_preheat_pla3() { _lcd_preheat(3, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); }
+ void lcd_preheat_abs3() { _lcd_preheat(3, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); }
#endif
- MENU_ITEM(function, MSG_PREHEAT_ABS_ALL, lcd_preheat_abs0123);
- #endif
- #if TEMP_SENSOR_BED != 0
- MENU_ITEM(function, MSG_PREHEAT_ABS_BEDONLY, lcd_preheat_abs_bedonly);
#endif
- END_MENU();
- }
-#endif // TEMP_SENSOR_0 && (TEMP_SENSOR_1 || TEMP_SENSOR_2 || TEMP_SENSOR_3 || TEMP_SENSOR_BED)
+ void lcd_preheat_pla0123() {
+ #if HOTENDS > 1
+ thermalManager.setTargetHotend(preheatHotendTemp1, 1);
+ #if HOTENDS > 2
+ thermalManager.setTargetHotend(preheatHotendTemp1, 2);
+ #if HOTENDS > 3
+ thermalManager.setTargetHotend(preheatHotendTemp1, 3);
+ #endif
+ #endif
+ #endif
+ lcd_preheat_pla0();
+ }
+ void lcd_preheat_abs0123() {
+ #if HOTENDS > 1
+ thermalManager.setTargetHotend(preheatHotendTemp2, 1);
+ #if HOTENDS > 2
+ thermalManager.setTargetHotend(preheatHotendTemp2, 2);
+ #if HOTENDS > 3
+ thermalManager.setTargetHotend(preheatHotendTemp2, 3);
+ #endif
+ #endif
+ #endif
+ lcd_preheat_abs0();
+ }
+
+ #endif // HOTENDS > 1
-void lcd_cooldown() {
- #if FAN_COUNT > 0
- for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
+ #if TEMP_SENSOR_BED != 0
+ void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, preheatBedTemp1, preheatFanSpeed1); }
+ void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, preheatBedTemp2, preheatFanSpeed2); }
#endif
- thermalManager.disable_all_heaters();
- lcd_return_to_status();
-}
-#if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART)
+ #if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0)
+
+ static void lcd_preheat_pla_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_PREPARE);
+ #if HOTENDS == 1
+ MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_pla0);
+ #else
+ MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_pla0);
+ MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_pla1);
+ #if HOTENDS > 2
+ MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_pla2);
+ #if HOTENDS > 3
+ MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_pla3);
+ #endif
+ #endif
+ MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_pla0123);
+ #endif
+ #if TEMP_SENSOR_BED != 0
+ MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_pla_bedonly);
+ #endif
+ END_MENU();
+ }
+
+ static void lcd_preheat_abs_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_PREPARE);
+ #if HOTENDS == 1
+ MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_abs0);
+ #else
+ MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_abs0);
+ MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_abs1);
+ #if HOTENDS > 2
+ MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_abs2);
+ #if HOTENDS > 3
+ MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_abs3);
+ #endif
+ #endif
+ MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_abs0123);
+ #endif
+ #if TEMP_SENSOR_BED != 0
+ MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_abs_bedonly);
+ #endif
+ END_MENU();
+ }
+
+ #endif // TEMP_SENSOR_0 && (TEMP_SENSOR_1 || TEMP_SENSOR_2 || TEMP_SENSOR_3 || TEMP_SENSOR_BED)
- static void lcd_autostart_sd() {
- card.autostart_index = 0;
- card.setroot();
- card.checkautostart(true);
+ void lcd_cooldown() {
+ #if FAN_COUNT > 0
+ for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
+ #endif
+ thermalManager.disable_all_heaters();
+ lcd_return_to_status();
}
-#endif
+ #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART)
-#if ENABLED(MANUAL_BED_LEVELING)
+ static void lcd_autostart_sd() {
+ card.autostart_index = 0;
+ card.setroot();
+ card.checkautostart(true);
+ }
- /**
- *
- * "Prepare" > "Bed Leveling" handlers
- *
- */
+ #endif
- static uint8_t _lcd_level_bed_position;
+ #if ENABLED(MANUAL_BED_LEVELING)
- // Utility to go to the next mesh point
- // A raise is added between points if MIN_Z_HEIGHT_FOR_HOMING is in use
- // Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z
- // Z position will be restored with the final action, a G28
- inline void _mbl_goto_xy(float x, float y) {
- current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
- #if MIN_Z_HEIGHT_FOR_HOMING > 0
- + MIN_Z_HEIGHT_FOR_HOMING
- #endif
- ;
- line_to_current(Z_AXIS);
- current_position[X_AXIS] = x + home_offset[X_AXIS];
- current_position[Y_AXIS] = y + home_offset[Y_AXIS];
- line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
- #if MIN_Z_HEIGHT_FOR_HOMING > 0
- current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
- line_to_current(Z_AXIS);
- #endif
- stepper.synchronize();
- }
+ /**
+ *
+ * "Prepare" > "Bed Leveling" handlers
+ *
+ */
- static void _lcd_level_goto_next_point();
+ static uint8_t _lcd_level_bed_position;
- static void _lcd_level_bed_done() {
- if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE));
- lcdDrawUpdate =
- #if ENABLED(DOGLCD)
- LCDVIEW_CALL_REDRAW_NEXT
- #else
- LCDVIEW_CALL_NO_REDRAW
+ // Utility to go to the next mesh point
+ // A raise is added between points if MIN_Z_HEIGHT_FOR_HOMING is in use
+ // Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z
+ // Z position will be restored with the final action, a G28
+ inline void _mbl_goto_xy(float x, float y) {
+ current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + MIN_Z_HEIGHT_FOR_HOMING;
+ line_to_current(Z_AXIS);
+ current_position[X_AXIS] = x + home_offset[X_AXIS];
+ current_position[Y_AXIS] = y + home_offset[Y_AXIS];
+ line_to_current(manual_feedrate_mm_m[X_AXIS] <= manual_feedrate_mm_m[Y_AXIS] ? X_AXIS : Y_AXIS);
+ #if MIN_Z_HEIGHT_FOR_HOMING > 0
+ current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; // How do condition and action match?
+ line_to_current(Z_AXIS);
#endif
- ;
- }
+ stepper.synchronize();
+ }
- /**
- * Step 7: Get the Z coordinate, then goto next point or exit
- */
- static void _lcd_level_bed_get_z() {
- ENCODER_DIRECTION_NORMAL();
+ static void _lcd_level_goto_next_point();
- // Encoder wheel adjusts the Z position
- if (encoderPosition && planner.movesplanned() <= 3) {
- refresh_cmd_timeout();
- current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP);
- NOLESS(current_position[Z_AXIS], 0);
- NOMORE(current_position[Z_AXIS], MESH_HOME_SEARCH_Z * 2);
- line_to_current(Z_AXIS);
+ static void _lcd_level_bed_done() {
+ if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE));
lcdDrawUpdate =
#if ENABLED(DOGLCD)
LCDVIEW_CALL_REDRAW_NEXT
#else
- LCDVIEW_REDRAW_NOW
+ LCDVIEW_CALL_NO_REDRAW
#endif
;
}
- encoderPosition = 0;
- static bool debounce_click = false;
- if (LCD_CLICKED) {
- if (!debounce_click) {
- debounce_click = true; // ignore multiple "clicks" in a row
- mbl.set_zigzag_z(_lcd_level_bed_position++, current_position[Z_AXIS]);
- if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
- lcd_goto_menu(_lcd_level_bed_done, true);
+ /**
+ * Step 7: Get the Z coordinate, then goto next point or exit
+ */
+ static void _lcd_level_bed_get_z() {
+ ENCODER_DIRECTION_NORMAL();
+
+ // Encoder wheel adjusts the Z position
+ if (encoderPosition) {
+ refresh_cmd_timeout();
+ current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP);
+ NOLESS(current_position[Z_AXIS], 0);
+ NOMORE(current_position[Z_AXIS], MESH_HOME_SEARCH_Z * 2);
+ line_to_current(Z_AXIS);
+ lcdDrawUpdate =
+ #if ENABLED(DOGLCD)
+ LCDVIEW_CALL_REDRAW_NEXT
+ #else
+ LCDVIEW_REDRAW_NOW
+ #endif
+ ;
+ encoderPosition = 0;
+ }
- current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
- #if MIN_Z_HEIGHT_FOR_HOMING > 0
- + MIN_Z_HEIGHT_FOR_HOMING
+ static bool debounce_click = false;
+ if (LCD_CLICKED) {
+ if (!debounce_click) {
+ debounce_click = true; // ignore multiple "clicks" in a row
+ mbl.set_zigzag_z(_lcd_level_bed_position++, current_position[Z_AXIS]);
+ if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
+ lcd_goto_screen(_lcd_level_bed_done, true);
+
+ current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + MIN_Z_HEIGHT_FOR_HOMING;
+ line_to_current(Z_AXIS);
+ stepper.synchronize();
+
+ mbl.set_has_mesh(true);
+ enqueue_and_echo_commands_P(PSTR("G28"));
+ lcd_return_to_status();
+ //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE);
+ #if HAS_BUZZER
+ lcd_buzz(200, 659);
+ lcd_buzz(200, 698);
#endif
- ;
- line_to_current(Z_AXIS);
- stepper.synchronize();
+ }
+ else {
+ lcd_goto_screen(_lcd_level_goto_next_point, true);
+ }
+ }
+ }
+ else {
+ debounce_click = false;
+ }
- mbl.active = true;
- enqueue_and_echo_commands_P(PSTR("G28"));
- lcd_return_to_status();
- //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE);
- #if HAS_BUZZER
- buzz(200, 659);
- buzz(200, 698);
+ // Update on first display, then only on updates to Z position
+ // Show message above on clicks instead
+ if (lcdDrawUpdate) {
+ float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z;
+ lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+'));
+ }
+
+ }
+
+ /**
+ * Step 6: Display "Next point: 1 / 9" while waiting for move to finish
+ */
+ static void _lcd_level_bed_moving() {
+ if (lcdDrawUpdate) {
+ char msg[10];
+ sprintf_P(msg, PSTR("%i / %u"), (int)(_lcd_level_bed_position + 1), (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS));
+ lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg);
+ }
+
+ lcdDrawUpdate =
+ #if ENABLED(DOGLCD)
+ LCDVIEW_CALL_REDRAW_NEXT
+ #else
+ LCDVIEW_CALL_NO_REDRAW
+ #endif
+ ;
+ }
+
+ /**
+ * Step 5: Initiate a move to the next point
+ */
+ static void _lcd_level_goto_next_point() {
+ // Set the menu to display ahead of blocking call
+ lcd_goto_screen(_lcd_level_bed_moving);
+
+ // _mbl_goto_xy runs the menu loop until the move is done
+ int8_t px, py;
+ mbl.zigzag(_lcd_level_bed_position, px, py);
+ _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
+
+ // After the blocking function returns, change menus
+ lcd_goto_screen(_lcd_level_bed_get_z);
+ }
+
+ /**
+ * Step 4: Display "Click to Begin", wait for click
+ * Move to the first probe position
+ */
+ static void _lcd_level_bed_homing_done() {
+ if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING));
+ if (LCD_CLICKED) {
+ _lcd_level_bed_position = 0;
+ current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
+ #if Z_HOME_DIR > 0
+ + Z_MAX_POS
#endif
- }
- else {
- lcd_goto_menu(_lcd_level_goto_next_point, true);
- }
+ ;
+ planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
+ lcd_goto_screen(_lcd_level_goto_next_point, true);
}
}
- else {
- debounce_click = false;
+
+ /**
+ * Step 3: Display "Homing XYZ" - Wait for homing to finish
+ */
+ static void _lcd_level_bed_homing() {
+ if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
+ lcdDrawUpdate =
+ #if ENABLED(DOGLCD)
+ LCDVIEW_CALL_REDRAW_NEXT
+ #else
+ LCDVIEW_CALL_NO_REDRAW
+ #endif
+ ;
+ if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
+ lcd_goto_screen(_lcd_level_bed_homing_done);
}
- // Update on first display, then only on updates to Z position
- // Show message above on clicks instead
- if (lcdDrawUpdate) {
- float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z;
- lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43(v + (v < 0 ? -0.0001 : 0.0001), '+'));
+ /**
+ * Step 2: Continue Bed Leveling...
+ */
+ static void _lcd_level_bed_continue() {
+ defer_return_to_status = true;
+ axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false;
+ mbl.reset();
+ enqueue_and_echo_commands_P(PSTR("G28"));
+ lcd_goto_screen(_lcd_level_bed_homing);
}
- }
+ /**
+ * Step 1: MBL entry-point: "Cancel" or "Level Bed"
+ */
+ static void lcd_level_bed() {
+ START_MENU();
+ MENU_ITEM(back, MSG_LEVEL_BED_CANCEL);
+ MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
+ END_MENU();
+ }
+
+ #endif // MANUAL_BED_LEVELING
/**
- * Step 6: Display "Next point: 1 / 9" while waiting for move to finish
+ *
+ * "Prepare" submenu
+ *
*/
- static void _lcd_level_bed_moving() {
- if (lcdDrawUpdate) {
- char msg[10];
- sprintf_P(msg, PSTR("%i / %u"), (int)(_lcd_level_bed_position + 1), (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS));
- lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg);
- }
- lcdDrawUpdate =
- #if ENABLED(DOGLCD)
- LCDVIEW_CALL_REDRAW_NEXT
+ static void lcd_prepare_menu() {
+ START_MENU();
+
+ //
+ // ^ Main
+ //
+ MENU_ITEM(back, MSG_MAIN);
+
+ //
+ // Auto Home
+ //
+ MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
+ #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
+ MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X"));
+ MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y"));
+ MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z"));
+ #endif
+
+ //
+ // Set Home Offsets
+ //
+ MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
+ //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
+
+ //
+ // Level Bed
+ //
+ #if ENABLED(AUTO_BED_LEVELING_FEATURE)
+ MENU_ITEM(gcode, MSG_LEVEL_BED,
+ axis_homed[X_AXIS] && axis_homed[Y_AXIS] ? PSTR("G29") : PSTR("G28\nG29")
+ );
+ #elif ENABLED(MANUAL_BED_LEVELING)
+ MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
+ #endif
+
+ //
+ // Move Axis
+ //
+ MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
+
+ //
+ // Disable Steppers
+ //
+ MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
+
+ //
+ // Preheat PLA
+ // Preheat ABS
+ //
+ #if TEMP_SENSOR_0 != 0
+ #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
+ MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_pla_menu);
+ MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_abs_menu);
#else
- LCDVIEW_CALL_NO_REDRAW
+ MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_pla0);
+ MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_abs0);
#endif
- ;
- }
+ #endif
- /**
- * Step 5: Initiate a move to the next point
- */
- static void _lcd_level_goto_next_point() {
- // Set the menu to display ahead of blocking call
- lcd_goto_menu(_lcd_level_bed_moving);
+ //
+ // Cooldown
+ //
+ MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
+
+ //
+ // Switch power on/off
+ //
+ #if HAS_POWER_SWITCH
+ if (powersupply)
+ MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
+ else
+ MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
+ #endif
- // _mbl_goto_xy runs the menu loop until the move is done
- int8_t px, py;
- mbl.zigzag(_lcd_level_bed_position, px, py);
- _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py));
+ //
+ // Autostart
+ //
+ #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART)
+ MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
+ #endif
- // After the blocking function returns, change menus
- lcd_goto_menu(_lcd_level_bed_get_z);
+ END_MENU();
}
- /**
- * Step 4: Display "Click to Begin", wait for click
- * Move to the first probe position
- */
- static void _lcd_level_bed_homing_done() {
- if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING));
- if (LCD_CLICKED) {
- _lcd_level_bed_position = 0;
- current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
- planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
- lcd_goto_menu(_lcd_level_goto_next_point, true);
+ #if ENABLED(DELTA_CALIBRATION_MENU)
+
+ static void lcd_delta_calibrate_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_MAIN);
+ MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
+ MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_X, PSTR("G0 F8000 X-77.94 Y-45 Z0"));
+ MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Y, PSTR("G0 F8000 X77.94 Y-45 Z0"));
+ MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Z, PSTR("G0 F8000 X0 Y90 Z0"));
+ MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G0 F8000 X0 Y0 Z0"));
+ END_MENU();
}
- }
+
+ #endif // DELTA_CALIBRATION_MENU
+
+ float move_menu_scale;
/**
- * Step 3: Display "Homing XYZ" - Wait for homing to finish
+ * If the most recent manual move hasn't been fed to the planner yet,
+ * and the planner can accept one, send immediately
*/
- static void _lcd_level_bed_homing() {
- if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
- lcdDrawUpdate =
- #if ENABLED(DOGLCD)
- LCDVIEW_CALL_REDRAW_NEXT
+ inline void manage_manual_move() {
+ if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) {
+ #if ENABLED(DELTA)
+ inverse_kinematics(current_position);
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index);
#else
- LCDVIEW_CALL_NO_REDRAW
+ planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index);
#endif
- ;
- if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
- lcd_goto_menu(_lcd_level_bed_homing_done);
+ manual_move_axis = (int8_t)NO_AXIS;
+ }
}
/**
- * Step 2: Continue Bed Leveling...
+ * Set a flag that lcd_update() should start a move
+ * to "current_position" after a short delay.
*/
- static void _lcd_level_bed_continue() {
- defer_return_to_status = true;
- axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false;
- mbl.reset();
- enqueue_and_echo_commands_P(PSTR("G28"));
- lcd_goto_menu(_lcd_level_bed_homing);
+ inline void manual_move_to_current(AxisEnum axis
+ #if E_MANUAL > 1
+ , int8_t eindex=-1
+ #endif
+ ) {
+ #if E_MANUAL > 1
+ if (axis == E_AXIS) manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
+ #endif
+ manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves
+ manual_move_axis = (int8_t)axis;
}
/**
- * Step 1: MBL entry-point: "Cancel" or "Level Bed"
+ *
+ * "Prepare" > "Move Axis" submenu
+ *
*/
- static void lcd_level_bed() {
- START_MENU();
- MENU_ITEM(back, MSG_LEVEL_BED_CANCEL);
- MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
- END_MENU();
- }
-#endif // MANUAL_BED_LEVELING
-
-/**
- *
- * "Prepare" submenu
- *
- */
-
-static void lcd_prepare_menu() {
- START_MENU();
-
- //
- // ^ Main
- //
- MENU_ITEM(back, MSG_MAIN);
-
- //
- // Auto Home
- //
- MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
- #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
- MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X"));
- MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y"));
- MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z"));
- #endif
-
- //
- // Set Home Offsets
- //
- MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
- //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
-
- //
- // Level Bed
- //
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- MENU_ITEM(gcode, MSG_LEVEL_BED,
- axis_homed[X_AXIS] && axis_homed[Y_AXIS] ? PSTR("G29") : PSTR("G28\nG29")
- );
- #elif ENABLED(MANUAL_BED_LEVELING)
- MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
+ static void _lcd_move_xyz(const char* name, AxisEnum axis, float min, float max) {
+ if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
+ ENCODER_DIRECTION_NORMAL();
+ if (encoderPosition) {
+ refresh_cmd_timeout();
+ current_position[axis] += float((int32_t)encoderPosition) * move_menu_scale;
+ if (min_software_endstops) NOLESS(current_position[axis], min);
+ if (max_software_endstops) NOMORE(current_position[axis], max);
+ encoderPosition = 0;
+ manual_move_to_current(axis);
+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
+ }
+ if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr41sign(current_position[axis]));
+ }
+ #if ENABLED(DELTA)
+ static float delta_clip_radius_2 = (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS);
+ static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - sq(a)); }
+ static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS, max(sw_endstop_min[X_AXIS], -clip), min(sw_endstop_max[X_AXIS], clip)); }
+ static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS, max(sw_endstop_min[Y_AXIS], -clip), min(sw_endstop_max[Y_AXIS], clip)); }
+ #else
+ static void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS, sw_endstop_min[X_AXIS], sw_endstop_max[X_AXIS]); }
+ static void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS, sw_endstop_min[Y_AXIS], sw_endstop_max[Y_AXIS]); }
#endif
+ static void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); }
+ static void _lcd_move_e(
+ #if E_MANUAL > 1
+ int8_t eindex=-1
+ #endif
+ ) {
+ if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
+ ENCODER_DIRECTION_NORMAL();
+ if (encoderPosition) {
+ current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
+ encoderPosition = 0;
+ manual_move_to_current(E_AXIS
+ #if E_MANUAL > 1
+ , eindex
+ #endif
+ );
+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
+ }
+ if (lcdDrawUpdate) {
+ PGM_P pos_label;
+ #if E_MANUAL == 1
+ pos_label = PSTR(MSG_MOVE_E);
+ #else
+ switch (eindex) {
+ default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
+ case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
+ #if E_MANUAL > 2
+ case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
+ #if E_MANUAL > 3
+ case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
+ #endif
+ #endif
+ }
+ #endif
+ lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS]));
+ }
+ }
- //
- // Move Axis
- //
- MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
-
- //
- // Disable Steppers
- //
- MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
-
- //
- // Preheat PLA
- // Preheat ABS
- //
- #if TEMP_SENSOR_0 != 0
- #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
- MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu);
- MENU_ITEM(submenu, MSG_PREHEAT_ABS, lcd_preheat_abs_menu);
- #else
- MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0);
- MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0);
+ static void lcd_move_e() { _lcd_move_e(); }
+ #if E_MANUAL > 1
+ static void lcd_move_e0() { _lcd_move_e(0); }
+ static void lcd_move_e1() { _lcd_move_e(1); }
+ #if E_MANUAL > 2
+ static void lcd_move_e2() { _lcd_move_e(2); }
+ #if E_MANUAL > 3
+ static void lcd_move_e3() { _lcd_move_e(3); }
+ #endif
#endif
#endif
- //
- // Cooldown
- //
- MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
+ /**
+ *
+ * "Prepare" > "Move Xmm" > "Move XYZ" submenu
+ *
+ */
- //
- // Switch power on/off
- //
- #if HAS_POWER_SWITCH
- if (powersupply)
- MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
- else
- MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
+ #if ENABLED(DELTA) || ENABLED(SCARA)
+ #define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
+ #else
+ #define _MOVE_XYZ_ALLOWED true
#endif
- //
- // Autostart
- //
- #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART)
- MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
- #endif
+ static void _lcd_move_menu_axis() {
+ START_MENU();
+ MENU_ITEM(back, MSG_MOVE_AXIS);
- END_MENU();
-}
+ if (_MOVE_XYZ_ALLOWED) {
+ MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
+ MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y);
+ }
-#if ENABLED(DELTA_CALIBRATION_MENU)
+ if (move_menu_scale < 10.0) {
+ if (_MOVE_XYZ_ALLOWED) MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z);
- static void lcd_delta_calibrate_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_MAIN);
- MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
- MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_X, PSTR("G0 F8000 X-77.94 Y-45 Z0"));
- MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Y, PSTR("G0 F8000 X77.94 Y-45 Z0"));
- MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Z, PSTR("G0 F8000 X0 Y90 Z0"));
- MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G0 F8000 X0 Y0 Z0"));
+ #if ENABLED(SWITCHING_EXTRUDER)
+ if (active_extruder)
+ MENU_ITEM(gcode, MSG_SELECT MSG_E1, PSTR("T0"));
+ else
+ MENU_ITEM(gcode, MSG_SELECT MSG_E2, PSTR("T1"));
+ #endif
+
+ MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e);
+ #if E_MANUAL > 1
+ MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0);
+ MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1);
+ #if E_MANUAL > 2
+ MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_e2);
+ #if E_MANUAL > 3
+ MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_e3);
+ #endif
+ #endif
+ #endif
+ }
END_MENU();
}
-#endif // DELTA_CALIBRATION_MENU
+ static void lcd_move_menu_10mm() {
+ move_menu_scale = 10.0;
+ _lcd_move_menu_axis();
+ }
+ static void lcd_move_menu_1mm() {
+ move_menu_scale = 1.0;
+ _lcd_move_menu_axis();
+ }
+ static void lcd_move_menu_01mm() {
+ move_menu_scale = 0.1;
+ _lcd_move_menu_axis();
+ }
-/**
- *
- * "Prepare" > "Move Axis" submenu
- *
- */
+ /**
+ *
+ * "Prepare" > "Move Axis" submenu
+ *
+ */
-float move_menu_scale;
-
-static void _lcd_move(const char* name, AxisEnum axis, float min, float max) {
- ENCODER_DIRECTION_NORMAL();
- if (encoderPosition && planner.movesplanned() <= 3) {
- refresh_cmd_timeout();
- current_position[axis] += float((int32_t)encoderPosition) * move_menu_scale;
- if (min_software_endstops) NOLESS(current_position[axis], min);
- if (max_software_endstops) NOMORE(current_position[axis], max);
- line_to_current(axis);
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
- }
- encoderPosition = 0;
- if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
- if (LCD_CLICKED) lcd_goto_previous_menu(true);
-}
-#if ENABLED(DELTA)
- static float delta_clip_radius_2 = (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS);
- static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); }
- static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(sw_endstop_min[X_AXIS], -clip), min(sw_endstop_max[X_AXIS], clip)); }
- static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, max(sw_endstop_min[Y_AXIS], -clip), min(sw_endstop_max[Y_AXIS], clip)); }
-#else
- static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, sw_endstop_min[X_AXIS], sw_endstop_max[X_AXIS]); }
- static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, sw_endstop_min[Y_AXIS], sw_endstop_max[Y_AXIS]); }
-#endif
-static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); }
-static void lcd_move_e(
- #if EXTRUDERS > 1
- uint8_t e
- #endif
-) {
- ENCODER_DIRECTION_NORMAL();
- #if EXTRUDERS > 1
- unsigned short original_active_extruder = active_extruder;
- active_extruder = e;
- #endif
- if (encoderPosition && planner.movesplanned() <= 3) {
- current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
- line_to_current(E_AXIS);
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
- }
- encoderPosition = 0;
- if (lcdDrawUpdate) {
- PGM_P pos_label;
- #if EXTRUDERS == 1
- pos_label = PSTR(MSG_MOVE_E);
- #else
- switch (e) {
- case 0: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break;
- case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break;
- #if EXTRUDERS > 2
- case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break;
- #if EXTRUDERS > 3
- case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break;
- #endif //EXTRUDERS > 3
- #endif //EXTRUDERS > 2
- }
- #endif //EXTRUDERS > 1
- lcd_implementation_drawedit(pos_label, ftostr31(current_position[E_AXIS]));
+ static void lcd_move_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_PREPARE);
+
+ if (_MOVE_XYZ_ALLOWED)
+ MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
+
+ MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm);
+ MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
+ //TODO:X,Y,Z,E
+ END_MENU();
}
- if (LCD_CLICKED) lcd_goto_previous_menu(true);
- #if EXTRUDERS > 1
- active_extruder = original_active_extruder;
- #endif
-}
-#if EXTRUDERS > 1
- static void lcd_move_e0() { lcd_move_e(0); }
- static void lcd_move_e1() { lcd_move_e(1); }
- #if EXTRUDERS > 2
- static void lcd_move_e2() { lcd_move_e(2); }
- #if EXTRUDERS > 3
- static void lcd_move_e3() { lcd_move_e(3); }
+ /**
+ *
+ * "Control" submenu
+ *
+ */
+
+ static void lcd_control_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_MAIN);
+ MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
+ MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
+ MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
+
+ #if HAS_LCD_CONTRAST
+ //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
+ MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
#endif
- #endif
-#endif // EXTRUDERS > 1
+ #if ENABLED(FWRETRACT)
+ MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
+ #endif
+ #if ENABLED(EEPROM_SETTINGS)
+ MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
+ MENU_ITEM(function, MSG_LOAD_EPROM, Config_RetrieveSettings);
+ #endif
+ MENU_ITEM(function, MSG_RESTORE_FAILSAFE, Config_ResetDefault);
+ END_MENU();
+ }
-/**
- *
- * "Prepare" > "Move Xmm" > "Move XYZ" submenu
- *
- */
+ /**
+ *
+ * "Temperature" submenu
+ *
+ */
-#if ENABLED(DELTA) || ENABLED(SCARA)
- #define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
-#else
- #define _MOVE_XYZ_ALLOWED true
-#endif
+ #if ENABLED(PID_AUTOTUNE_MENU)
-static void _lcd_move_menu_axis() {
- START_MENU();
- MENU_ITEM(back, MSG_MOVE_AXIS);
+ #if ENABLED(PIDTEMP)
+ int autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150);
+ const int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP);
+ #endif
- if (_MOVE_XYZ_ALLOWED) {
- MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
- MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y);
- }
- if (move_menu_scale < 10.0) {
- if (_MOVE_XYZ_ALLOWED) MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z);
- #if EXTRUDERS == 1
- MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e);
- #else
- MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0);
- MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1);
- #if EXTRUDERS > 2
- MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_e2);
- #if EXTRUDERS > 3
- MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_e3);
+ #if ENABLED(PIDTEMPBED)
+ int autotune_temp_bed = 70;
+ #endif
+
+ static void _lcd_autotune(int e) {
+ char cmd[30];
+ sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e,
+ #if HAS_PID_FOR_BOTH
+ e < 0 ? autotune_temp_bed : autotune_temp[e]
+ #elif ENABLED(PIDTEMPBED)
+ autotune_temp_bed
+ #else
+ autotune_temp[e]
#endif
- #endif
- #endif // EXTRUDERS > 1
- }
- END_MENU();
-}
+ );
+ enqueue_and_echo_command(cmd);
+ }
-static void lcd_move_menu_10mm() {
- move_menu_scale = 10.0;
- _lcd_move_menu_axis();
-}
-static void lcd_move_menu_1mm() {
- move_menu_scale = 1.0;
- _lcd_move_menu_axis();
-}
-static void lcd_move_menu_01mm() {
- move_menu_scale = 0.1;
- _lcd_move_menu_axis();
-}
+ #endif //PID_AUTOTUNE_MENU
-/**
- *
- * "Prepare" > "Move Axis" submenu
- *
- */
+ #if ENABLED(PIDTEMP)
-static void lcd_move_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_PREPARE);
+ // Helpers for editing PID Ki & Kd values
+ // grab the PID value out of the temp variable; scale it; then update the PID driver
+ void copy_and_scalePID_i(int e) {
+ #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1
+ UNUSED(e);
+ #endif
+ PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
+ thermalManager.updatePID();
+ }
+ void copy_and_scalePID_d(int e) {
+ #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1
+ UNUSED(e);
+ #endif
+ PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
+ thermalManager.updatePID();
+ }
+ #define _PIDTEMP_BASE_FUNCTIONS(eindex) \
+ void copy_and_scalePID_i_E ## eindex() { copy_and_scalePID_i(eindex); } \
+ void copy_and_scalePID_d_E ## eindex() { copy_and_scalePID_d(eindex); }
- if (_MOVE_XYZ_ALLOWED)
- MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
+ #if ENABLED(PID_AUTOTUNE_MENU)
+ #define _PIDTEMP_FUNCTIONS(eindex) \
+ _PIDTEMP_BASE_FUNCTIONS(eindex); \
+ void lcd_autotune_callback_E ## eindex() { _lcd_autotune(eindex); }
+ #else
+ #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex)
+ #endif
- MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm);
- MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
- //TODO:X,Y,Z,E
- END_MENU();
-}
+ _PIDTEMP_FUNCTIONS(0);
+ #if ENABLED(PID_PARAMS_PER_HOTEND)
+ #if HOTENDS > 1
+ _PIDTEMP_FUNCTIONS(1);
+ #if HOTENDS > 2
+ _PIDTEMP_FUNCTIONS(2);
+ #if HOTENDS > 3
+ _PIDTEMP_FUNCTIONS(3);
+ #endif //HOTENDS > 3
+ #endif //HOTENDS > 2
+ #endif //HOTENDS > 1
+ #endif //PID_PARAMS_PER_HOTEND
-/**
- *
- * "Control" submenu
- *
- */
-
-static void lcd_control_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_MAIN);
- MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
- MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
- MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
+ #endif //PIDTEMP
- #if HAS_LCD_CONTRAST
- //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
- MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
- #endif
- #if ENABLED(FWRETRACT)
- MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
- #endif
- #if ENABLED(EEPROM_SETTINGS)
- MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
- MENU_ITEM(function, MSG_LOAD_EPROM, Config_RetrieveSettings);
- #endif
- MENU_ITEM(function, MSG_RESTORE_FAILSAFE, Config_ResetDefault);
- END_MENU();
-}
+ /**
+ *
+ * "Control" > "Temperature" submenu
+ *
+ */
+ static void lcd_control_temperature_menu() {
+ START_MENU();
-/**
- *
- * "Temperature" submenu
- *
- */
+ //
+ // ^ Control
+ //
+ MENU_ITEM(back, MSG_CONTROL);
-#if ENABLED(PID_AUTOTUNE_MENU)
+ //
+ // Nozzle:
+ // Nozzle [1-4]:
+ //
+ #if HOTENDS == 1
+ #if TEMP_SENSOR_0 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
+ #endif
+ #else //HOTENDS > 1
+ #if TEMP_SENSOR_0 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
+ #endif
+ #if TEMP_SENSOR_1 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1);
+ #endif
+ #if HOTENDS > 2
+ #if TEMP_SENSOR_2 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2);
+ #endif
+ #if HOTENDS > 3
+ #if TEMP_SENSOR_3 != 0
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3);
+ #endif
+ #endif // HOTENDS > 3
+ #endif // HOTENDS > 2
+ #endif // HOTENDS > 1
- #if ENABLED(PIDTEMP)
- int autotune_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(150);
- const int heater_maxtemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP);
- #endif
+ //
+ // Bed:
+ //
+ #if TEMP_SENSOR_BED != 0
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15);
+ #endif
- #if ENABLED(PIDTEMPBED)
- int autotune_temp_bed = 70;
- #endif
+ //
+ // Fan Speed:
+ //
+ #if FAN_COUNT > 0
+ #if HAS_FAN0
+ #if FAN_COUNT > 1
+ #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED " 1"
+ #else
+ #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED
+ #endif
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_1ST_FAN_SPEED, &fanSpeeds[0], 0, 255);
+ #endif
+ #if HAS_FAN1
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255);
+ #endif
+ #if HAS_FAN2
+ MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255);
+ #endif
+ #endif // FAN_COUNT > 0
+
+ //
+ // Autotemp, Min, Max, Fact
+ //
+ #if ENABLED(AUTOTEMP) && (TEMP_SENSOR_0 != 0)
+ MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled);
+ MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15);
+ MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, HEATER_0_MAXTEMP - 15);
+ MENU_ITEM_EDIT(float32, MSG_FACTOR, &planner.autotemp_factor, 0.0, 1.0);
+ #endif
- static void _lcd_autotune(int e) {
- char cmd[30];
- sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e,
- #if HAS_PID_FOR_BOTH
- e < 0 ? autotune_temp_bed : autotune_temp[e]
- #elif ENABLED(PIDTEMPBED)
- autotune_temp_bed
+ //
+ // PID-P, PID-I, PID-D, PID-C, PID Autotune
+ // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1
+ // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2
+ // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3
+ // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4
+ //
+ #if ENABLED(PIDTEMP)
+
+ #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \
+ raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \
+ raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \
+ MENU_ITEM_EDIT(float52, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex)
+
+ #if ENABLED(PID_EXTRUSION_SCALING)
+ #define _PID_MENU_ITEMS(ELABEL, eindex) \
+ _PID_BASE_MENU_ITEMS(ELABEL, eindex); \
+ MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990)
#else
- autotune_temp[e]
+ #define _PID_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex)
#endif
- );
- enqueue_and_echo_command(cmd);
- }
-#endif //PID_AUTOTUNE_MENU
+ #if ENABLED(PID_AUTOTUNE_MENU)
+ #define PID_MENU_ITEMS(ELABEL, eindex) \
+ _PID_MENU_ITEMS(ELABEL, eindex); \
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex)
+ #else
+ #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex)
+ #endif
-#if ENABLED(PIDTEMP)
+ #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
+ PID_MENU_ITEMS(MSG_E1, 0);
+ PID_MENU_ITEMS(MSG_E2, 1);
+ #if HOTENDS > 2
+ PID_MENU_ITEMS(MSG_E3, 2);
+ #if HOTENDS > 3
+ PID_MENU_ITEMS(MSG_E4, 3);
+ #endif //HOTENDS > 3
+ #endif //HOTENDS > 2
+ #else //!PID_PARAMS_PER_HOTEND || HOTENDS == 1
+ PID_MENU_ITEMS("", 0);
+ #endif //!PID_PARAMS_PER_HOTEND || HOTENDS == 1
+
+ #endif //PIDTEMP
+
+ //
+ // Preheat PLA conf
+ //
+ MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu);
+
+ //
+ // Preheat ABS conf
+ //
+ MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu);
+ END_MENU();
+ }
- // Helpers for editing PID Ki & Kd values
- // grab the PID value out of the temp variable; scale it; then update the PID driver
- void copy_and_scalePID_i(int e) {
- #if DISABLED(PID_PARAMS_PER_EXTRUDER)
- UNUSED(e);
+ /**
+ *
+ * "Temperature" > "Preheat PLA conf" submenu
+ *
+ */
+ static void lcd_control_temperature_preheat_pla_settings_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_TEMPERATURE);
+ MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed1, 0, 255);
+ #if TEMP_SENSOR_0 != 0
+ MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp1, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
#endif
- PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
- thermalManager.updatePID();
- }
- void copy_and_scalePID_d(int e) {
- #if DISABLED(PID_PARAMS_PER_EXTRUDER)
- UNUSED(e);
+ #if TEMP_SENSOR_BED != 0
+ MENU_ITEM_EDIT(int3, MSG_BED, &preheatBedTemp1, BED_MINTEMP, BED_MAXTEMP - 15);
#endif
- PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
- thermalManager.updatePID();
+ #if ENABLED(EEPROM_SETTINGS)
+ MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
+ #endif
+ END_MENU();
}
- #define _PIDTEMP_BASE_FUNCTIONS(eindex) \
- void copy_and_scalePID_i_E ## eindex() { copy_and_scalePID_i(eindex); } \
- void copy_and_scalePID_d_E ## eindex() { copy_and_scalePID_d(eindex); }
-
- #if ENABLED(PID_AUTOTUNE_MENU)
- #define _PIDTEMP_FUNCTIONS(eindex) \
- _PIDTEMP_BASE_FUNCTIONS(eindex); \
- void lcd_autotune_callback_E ## eindex() { _lcd_autotune(eindex); }
- #else
- #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex)
- #endif
- _PIDTEMP_FUNCTIONS(0);
- #if ENABLED(PID_PARAMS_PER_EXTRUDER)
- #if EXTRUDERS > 1
- _PIDTEMP_FUNCTIONS(1);
- #if EXTRUDERS > 2
- _PIDTEMP_FUNCTIONS(2);
- #if EXTRUDERS > 3
- _PIDTEMP_FUNCTIONS(3);
- #endif //EXTRUDERS > 3
- #endif //EXTRUDERS > 2
- #endif //EXTRUDERS > 1
- #endif //PID_PARAMS_PER_EXTRUDER
-
-#endif //PIDTEMP
-
-/**
- *
- * "Control" > "Temperature" submenu
- *
- */
-static void lcd_control_temperature_menu() {
- START_MENU();
-
- //
- // ^ Control
- //
- MENU_ITEM(back, MSG_CONTROL);
-
- //
- // Nozzle:
- // Nozzle [1-4]:
- //
- #if EXTRUDERS == 1
+ /**
+ *
+ * "Temperature" > "Preheat ABS conf" submenu
+ *
+ */
+ static void lcd_control_temperature_preheat_abs_settings_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_TEMPERATURE);
+ MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed2, 0, 255);
#if TEMP_SENSOR_0 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
+ MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp2, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
#endif
- #else //EXTRUDERS > 1
- #if TEMP_SENSOR_0 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
+ #if TEMP_SENSOR_BED != 0
+ MENU_ITEM_EDIT(int3, MSG_BED, &preheatBedTemp2, BED_MINTEMP, BED_MAXTEMP - 15);
#endif
- #if TEMP_SENSOR_1 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1);
+ #if ENABLED(EEPROM_SETTINGS)
+ MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
#endif
- #if EXTRUDERS > 2
- #if TEMP_SENSOR_2 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2);
- #endif
- #if EXTRUDERS > 3
- #if TEMP_SENSOR_3 != 0
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3);
- #endif
- #endif // EXTRUDERS > 3
- #endif // EXTRUDERS > 2
- #endif // EXTRUDERS > 1
+ END_MENU();
+ }
- //
- // Bed:
- //
- #if TEMP_SENSOR_BED != 0
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15);
- #endif
+ static void _reset_acceleration_rates() { planner.reset_acceleration_rates(); }
+ static void _planner_refresh_positioning() { planner.refresh_positioning(); }
- //
- // Fan Speed:
- //
- #if FAN_COUNT > 0
- #if HAS_FAN0
- #if FAN_COUNT > 1
- #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED " 1"
- #else
- #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED
- #endif
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_1ST_FAN_SPEED, &fanSpeeds[0], 0, 255);
+ /**
+ *
+ * "Control" > "Motion" submenu
+ *
+ */
+ static void lcd_control_motion_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_CONTROL);
+ #if HAS_BED_PROBE
+ MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
+ #endif
+ // Manual bed leveling, Bed Z:
+ #if ENABLED(MANUAL_BED_LEVELING)
+ MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
#endif
- #if HAS_FAN1
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255);
+ MENU_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000);
+ MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &planner.max_xy_jerk, 1, 990);
+ #if ENABLED(DELTA)
+ MENU_ITEM_EDIT(float3, MSG_VZ_JERK, &planner.max_z_jerk, 1, 990);
+ #else
+ MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990);
+ #endif
+ MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990);
+ MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate_mm_s[X_AXIS], 1, 999);
+ MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate_mm_s[Y_AXIS], 1, 999);
+ MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate_mm_s[Z_AXIS], 1, 999);
+ MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999);
+ MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999);
+ MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999);
+ MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates);
+ MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates);
+ MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates);
+ MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates);
+ MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000);
+ MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000);
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999, _planner_refresh_positioning);
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999, _planner_refresh_positioning);
+ #if ENABLED(DELTA)
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999, _planner_refresh_positioning);
+ #else
+ MENU_ITEM_EDIT_CALLBACK(float51, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999, _planner_refresh_positioning);
#endif
- #if HAS_FAN2
- MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255);
+ MENU_ITEM_EDIT_CALLBACK(float51, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning);
+ #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
+ MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit);
#endif
- #endif // FAN_COUNT > 0
+ #if ENABLED(SCARA)
+ MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS], 0.5, 2);
+ MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS], 0.5, 2);
+ #endif
+ END_MENU();
+ }
- //
- // Autotemp, Min, Max, Fact
- //
- #if ENABLED(AUTOTEMP) && (TEMP_SENSOR_0 != 0)
- MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled);
- MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15);
- MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, HEATER_0_MAXTEMP - 15);
- MENU_ITEM_EDIT(float32, MSG_FACTOR, &planner.autotemp_factor, 0.0, 1.0);
- #endif
+ /**
+ *
+ * "Control" > "Filament" submenu
+ *
+ */
+ static void lcd_control_volumetric_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_CONTROL);
- //
- // PID-P, PID-I, PID-D, PID-C, PID Autotune
- // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1
- // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2
- // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3
- // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4
- //
- #if ENABLED(PIDTEMP)
+ MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
- #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \
- raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \
- raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \
- MENU_ITEM_EDIT(float52, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \
- MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \
- MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex)
-
- #if ENABLED(PID_ADD_EXTRUSION_RATE)
- #define _PID_MENU_ITEMS(ELABEL, eindex) \
- _PID_BASE_MENU_ITEMS(ELABEL, eindex); \
- MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990)
- #else
- #define _PID_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex)
- #endif
+ if (volumetric_enabled) {
+ #if EXTRUDERS == 1
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
+ #else //EXTRUDERS > 1
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers);
+ #if EXTRUDERS > 2
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers);
+ #if EXTRUDERS > 3
+ MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers);
+ #endif //EXTRUDERS > 3
+ #endif //EXTRUDERS > 2
+ #endif //EXTRUDERS > 1
+ }
- #if ENABLED(PID_AUTOTUNE_MENU)
- #define PID_MENU_ITEMS(ELABEL, eindex) \
- _PID_MENU_ITEMS(ELABEL, eindex); \
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex)
- #else
- #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex)
+ END_MENU();
+ }
+
+ /**
+ *
+ * "Control" > "Contrast" submenu
+ *
+ */
+ #if HAS_LCD_CONTRAST
+ static void lcd_set_contrast() {
+ if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
+ ENCODER_DIRECTION_NORMAL();
+ if (encoderPosition) {
+ set_lcd_contrast(lcd_contrast + encoderPosition);
+ encoderPosition = 0;
+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
+ }
+ if (lcdDrawUpdate) {
+ lcd_implementation_drawedit(PSTR(MSG_CONTRAST),
+ #if LCD_CONTRAST_MAX >= 100
+ itostr3(lcd_contrast)
+ #else
+ itostr2(lcd_contrast)
+ #endif
+ );
+ }
+ }
+ #endif // HAS_LCD_CONTRAST
+
+ /**
+ *
+ * "Control" > "Retract" submenu
+ *
+ */
+ #if ENABLED(FWRETRACT)
+ static void lcd_control_retract_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_CONTROL);
+ MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
+ MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100);
+ #if EXTRUDERS > 1
+ MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100);
+ #endif
+ MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate_mm_s, 1, 999);
+ MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999);
+ MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100);
+ #if EXTRUDERS > 1
+ MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
+ #endif
+ MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate_mm_s, 1, 999);
+ END_MENU();
+ }
+ #endif // FWRETRACT
+
+ #if ENABLED(SDSUPPORT)
+
+ #if !PIN_EXISTS(SD_DETECT)
+ static void lcd_sd_refresh() {
+ card.initsd();
+ encoderTopLine = 0;
+ }
#endif
- #if ENABLED(PID_PARAMS_PER_EXTRUDER) && EXTRUDERS > 1
- PID_MENU_ITEMS(MSG_E1, 0);
- PID_MENU_ITEMS(MSG_E2, 1);
- #if EXTRUDERS > 2
- PID_MENU_ITEMS(MSG_E3, 2);
- #if EXTRUDERS > 3
- PID_MENU_ITEMS(MSG_E4, 3);
- #endif //EXTRUDERS > 3
- #endif //EXTRUDERS > 2
- #else //!PID_PARAMS_PER_EXTRUDER || EXTRUDERS == 1
- PID_MENU_ITEMS("", 0);
- #endif //!PID_PARAMS_PER_EXTRUDER || EXTRUDERS == 1
+ static void lcd_sd_updir() {
+ card.updir();
+ encoderTopLine = 0;
+ }
- #endif //PIDTEMP
+ /**
+ *
+ * "Print from SD" submenu
+ *
+ */
+ void lcd_sdcard_menu() {
+ ENCODER_DIRECTION_MENUS();
+ if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
+ uint16_t fileCnt = card.getnrfilenames();
+ START_MENU();
+ MENU_ITEM(back, MSG_MAIN);
+ card.getWorkDirName();
+ if (card.filename[0] == '/') {
+ #if !PIN_EXISTS(SD_DETECT)
+ MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);
+ #endif
+ }
+ else {
+ MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
+ }
- //
- // Preheat PLA conf
- //
- MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu);
+ for (uint16_t i = 0; i < fileCnt; i++) {
+ if (_menuLineNr == _thisItemNr) {
+ card.getfilename(
+ #if ENABLED(SDCARD_RATHERRECENTFIRST)
+ fileCnt-1 -
+ #endif
+ i
+ );
+
+ if (card.filenameIsDir)
+ MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
+ else
+ MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
+ }
+ else {
+ MENU_ITEM_DUMMY();
+ }
+ }
+ END_MENU();
+ }
- //
- // Preheat ABS conf
- //
- MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu);
- END_MENU();
-}
+ #endif //SDSUPPORT
-/**
- *
- * "Temperature" > "Preheat PLA conf" submenu
- *
- */
-static void lcd_control_temperature_preheat_pla_settings_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_TEMPERATURE);
- MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255);
- #if TEMP_SENSOR_0 != 0
- MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
- #endif
- #if TEMP_SENSOR_BED != 0
- MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15);
- #endif
- #if ENABLED(EEPROM_SETTINGS)
- MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
- #endif
- END_MENU();
-}
+ #if ENABLED(LCD_INFO_MENU)
-/**
- *
- * "Temperature" > "Preheat ABS conf" submenu
- *
- */
-static void lcd_control_temperature_preheat_abs_settings_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_TEMPERATURE);
- MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255);
- #if TEMP_SENSOR_0 != 0
- MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
- #endif
- #if TEMP_SENSOR_BED != 0
- MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15);
- #endif
- #if ENABLED(EEPROM_SETTINGS)
- MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
- #endif
- END_MENU();
-}
+ #if ENABLED(PRINTCOUNTER)
+ /**
+ *
+ * About Printer > Statistics submenu
+ *
+ */
+ static void lcd_info_stats_menu() {
+ if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
-static void _reset_acceleration_rates() { planner.reset_acceleration_rates(); }
+ char buffer[21];
+ printStatistics stats = print_job_timer.getStats();
-/**
- *
- * "Control" > "Motion" submenu
- *
- */
-static void lcd_control_motion_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_CONTROL);
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
- MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
- #endif
- // Manual bed leveling, Bed Z:
- #if ENABLED(MANUAL_BED_LEVELING)
- MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
- #endif
- MENU_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000);
- MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &planner.max_xy_jerk, 1, 990);
- #if ENABLED(DELTA)
- MENU_ITEM_EDIT(float3, MSG_VZ_JERK, &planner.max_z_jerk, 1, 990);
- #else
- MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990);
- #endif
- MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990);
- MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate[X_AXIS], 1, 999);
- MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate[Y_AXIS], 1, 999);
- MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate[Z_AXIS], 1, 999);
- MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate[E_AXIS], 1, 999);
- MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate, 0, 999);
- MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate, 0, 999);
- MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_units_per_sq_second[X_AXIS], 100, 99000, _reset_acceleration_rates);
- MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_units_per_sq_second[Y_AXIS], 100, 99000, _reset_acceleration_rates);
- MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_units_per_sq_second[Z_AXIS], 10, 99000, _reset_acceleration_rates);
- MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, _reset_acceleration_rates);
- MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000);
- MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000);
- MENU_ITEM_EDIT(float52, MSG_XSTEPS, &planner.axis_steps_per_unit[X_AXIS], 5, 9999);
- MENU_ITEM_EDIT(float52, MSG_YSTEPS, &planner.axis_steps_per_unit[Y_AXIS], 5, 9999);
- #if ENABLED(DELTA)
- MENU_ITEM_EDIT(float52, MSG_ZSTEPS, &planner.axis_steps_per_unit[Z_AXIS], 5, 9999);
- #else
- MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &planner.axis_steps_per_unit[Z_AXIS], 5, 9999);
- #endif
- MENU_ITEM_EDIT(float51, MSG_ESTEPS, &planner.axis_steps_per_unit[E_AXIS], 5, 9999);
- #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
- MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit);
- #endif
- #if ENABLED(SCARA)
- MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS], 0.5, 2);
- MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS], 0.5, 2);
- #endif
- END_MENU();
-}
+ START_SCREEN(); // 12345678901234567890
+ STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999
+ STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS" : ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666
-/**
- *
- * "Control" > "Filament" submenu
- *
- */
-static void lcd_control_volumetric_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_CONTROL);
+ duration_t elapsed = stats.printTime;
+ elapsed.toString(buffer);
- MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
+ STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total print Time:
+ STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s
- if (volumetric_enabled) {
- #if EXTRUDERS == 1
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
- #else //EXTRUDERS > 1
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers);
- #if EXTRUDERS > 2
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers);
- #if EXTRUDERS > 3
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers);
- #endif //EXTRUDERS > 3
- #endif //EXTRUDERS > 2
- #endif //EXTRUDERS > 1
- }
+ elapsed = stats.longestPrint;
+ elapsed.toString(buffer);
- END_MENU();
-}
+ STATIC_ITEM(MSG_INFO_PRINT_LONGEST ": ", false, false); // Longest job time:
+ STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s
-/**
- *
- * "Control" > "Contrast" submenu
- *
- */
-#if HAS_LCD_CONTRAST
- static void lcd_set_contrast() {
- ENCODER_DIRECTION_NORMAL();
- if (encoderPosition) {
- #if ENABLED(U8GLIB_LM6059_AF)
- lcd_contrast += encoderPosition;
- lcd_contrast &= 0xFF;
- #else
- lcd_contrast -= encoderPosition;
- lcd_contrast &= 0x3F;
+ sprintf_P(buffer, PSTR("%im"), stats.filamentUsed / 1000);
+ STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ": ", false, false); // Extruded total:
+ STATIC_ITEM("", false, false, buffer); // 125m
+ END_SCREEN();
+ }
+ #endif // PRINTCOUNTER
+
+ /**
+ *
+ * About Printer > Thermistors
+ *
+ */
+ static void lcd_info_thermistors_menu() {
+ if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
+ START_SCREEN();
+ #define THERMISTOR_ID TEMP_SENSOR_0
+ #include "thermistornames.h"
+ STATIC_ITEM("T0: " THERMISTOR_NAME, false, true);
+ STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP), false);
+ STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP), false);
+
+ #if TEMP_SENSOR_1 != 0
+ #undef THERMISTOR_ID
+ #define THERMISTOR_ID TEMP_SENSOR_1
+ #include "thermistornames.h"
+ STATIC_ITEM("T1: " THERMISTOR_NAME, false, true);
+ STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP), false);
+ STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP), false);
+ #endif
+
+ #if TEMP_SENSOR_2 != 0
+ #undef THERMISTOR_ID
+ #define THERMISTOR_ID TEMP_SENSOR_2
+ #include "thermistornames.h"
+ STATIC_ITEM("T2: " THERMISTOR_NAME, false, true);
+ STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP), false);
+ STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP), false);
+ #endif
+
+ #if TEMP_SENSOR_3 != 0
+ #undef THERMISTOR_ID
+ #define THERMISTOR_ID TEMP_SENSOR_3
+ #include "thermistornames.h"
+ STATIC_ITEM("T3: " THERMISTOR_NAME, false, true);
+ STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP), false);
+ STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP), false);
+ #endif
+
+ #if TEMP_SENSOR_BED != 0
+ #undef THERMISTOR_ID
+ #define THERMISTOR_ID TEMP_SENSOR_BED
+ #include "thermistornames.h"
+ STATIC_ITEM("TBed:" THERMISTOR_NAME, false, true);
+ STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP), false);
+ STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP), false);
+ #endif
+ END_SCREEN();
+ }
+
+ /**
+ *
+ * About Printer > Board Info
+ *
+ */
+ static void lcd_info_board_menu() {
+ if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
+ START_SCREEN();
+ STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController
+ STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE)); // Baud: 250000
+ STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION); // Protocol: 1.0
+ #ifdef POWER_SUPPLY
+ #if (POWER_SUPPLY == 1)
+ STATIC_ITEM(MSG_INFO_PSU ": ATX"); // Power Supply: ATX
+ #elif (POWER_SUPPLY == 2)
+ STATIC_ITEM(MSG_INFO_PSU ": XBox"); // Power Supply: XBox
+ #endif
+ #endif // POWER_SUPPLY
+ END_SCREEN();
+ }
+
+ /**
+ *
+ * About Printer > Printer Info
+ *
+ */
+ static void lcd_info_printer_menu() {
+ if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
+ START_SCREEN();
+ STATIC_ITEM(MSG_MARLIN, true, true); // Marlin
+ STATIC_ITEM(SHORT_BUILD_VERSION); // x.x.x-Branch
+ STATIC_ITEM(STRING_DISTRIBUTION_DATE); // YYYY-MM-DD HH:MM
+ STATIC_ITEM(MACHINE_NAME); // My3DPrinter
+ STATIC_ITEM(WEBSITE_URL); // www.my3dprinter.com
+ STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS)); // Extruders: 2
+ END_SCREEN();
+ }
+
+ /**
+ *
+ * "About Printer" submenu
+ *
+ */
+ static void lcd_info_menu() {
+ START_MENU();
+ MENU_ITEM(back, MSG_MAIN);
+ MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, lcd_info_printer_menu); // Printer Info >
+ MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu); // Board Info >
+ MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors >
+ #if ENABLED(PRINTCOUNTER)
+ MENU_ITEM(submenu, MSG_INFO_STATS_MENU, lcd_info_stats_menu); // Printer Statistics >
+ #endif
+ END_MENU();
+ }
+ #endif // LCD_INFO_MENU
+
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+
+ static void lcd_filament_change_resume_print() {
+ filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_RESUME_PRINT;
+ lcdDrawUpdate = 2;
+ lcd_goto_screen(lcd_status_screen);
+ }
+
+ static void lcd_filament_change_extrude_more() {
+ filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE;
+ }
+
+ static void lcd_filament_change_option_menu() {
+ START_MENU();
+ #if LCD_HEIGHT > 2
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false);
+ #endif
+ MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_filament_change_resume_print);
+ MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_EXTRUDE, lcd_filament_change_extrude_more);
+ END_MENU();
+ }
+
+ static void lcd_filament_change_init_message() {
+ START_SCREEN();
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1);
+ #ifdef MSG_FILAMENT_CHANGE_INIT_2
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2);
+ #endif
+ #ifdef MSG_FILAMENT_CHANGE_INIT_3
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3);
+ #endif
+ END_SCREEN();
+ }
+
+ static void lcd_filament_change_unload_message() {
+ START_SCREEN();
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1);
+ #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2);
+ #endif
+ #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3);
+ #endif
+ END_SCREEN();
+ }
+
+ static void lcd_filament_change_insert_message() {
+ START_SCREEN();
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1);
+ #ifdef MSG_FILAMENT_CHANGE_INSERT_2
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2);
+ #endif
+ #ifdef MSG_FILAMENT_CHANGE_INSERT_3
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3);
#endif
- encoderPosition = 0;
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
- u8g.setContrast(lcd_contrast);
+ END_SCREEN();
}
- if (lcdDrawUpdate) {
- #if ENABLED(U8GLIB_LM6059_AF)
- lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr3(lcd_contrast));
- #else
- lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
+
+ static void lcd_filament_change_load_message() {
+ START_SCREEN();
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1);
+ #ifdef MSG_FILAMENT_CHANGE_LOAD_2
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2);
+ #endif
+ #ifdef MSG_FILAMENT_CHANGE_LOAD_3
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3);
#endif
+ END_SCREEN();
}
- if (LCD_CLICKED) lcd_goto_previous_menu(true);
- }
-#endif // HAS_LCD_CONTRAST
-/**
- *
- * "Control" > "Retract" submenu
- *
- */
-#if ENABLED(FWRETRACT)
- static void lcd_control_retract_menu() {
- START_MENU();
- MENU_ITEM(back, MSG_CONTROL);
- MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
- MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100);
- #if EXTRUDERS > 1
- MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100);
- #endif
- MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999);
- MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999);
- MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100);
- #if EXTRUDERS > 1
- MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100);
- #endif
- MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
- END_MENU();
- }
-#endif // FWRETRACT
+ static void lcd_filament_change_extrude_message() {
+ START_SCREEN();
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_1);
+ #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_2
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_2);
+ #endif
+ #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_3
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_3);
+ #endif
+ END_SCREEN();
+ }
-#if ENABLED(SDSUPPORT)
+ static void lcd_filament_change_resume_message() {
+ START_SCREEN();
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1);
+ #ifdef MSG_FILAMENT_CHANGE_RESUME_2
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_2);
+ #endif
+ #ifdef MSG_FILAMENT_CHANGE_RESUME_3
+ STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_3);
+ #endif
+ END_SCREEN();
+ }
- #if !PIN_EXISTS(SD_DETECT)
- static void lcd_sd_refresh() {
- card.initsd();
- currentMenuViewOffset = 0;
+ void lcd_filament_change_show_message(FilamentChangeMessage message) {
+ switch (message) {
+ case FILAMENT_CHANGE_MESSAGE_INIT:
+ defer_return_to_status = true;
+ lcd_goto_screen(lcd_filament_change_init_message);
+ break;
+ case FILAMENT_CHANGE_MESSAGE_UNLOAD:
+ lcd_goto_screen(lcd_filament_change_unload_message);
+ break;
+ case FILAMENT_CHANGE_MESSAGE_INSERT:
+ lcd_goto_screen(lcd_filament_change_insert_message);
+ break;
+ case FILAMENT_CHANGE_MESSAGE_LOAD:
+ lcd_goto_screen(lcd_filament_change_load_message);
+ break;
+ case FILAMENT_CHANGE_MESSAGE_EXTRUDE:
+ lcd_goto_screen(lcd_filament_change_extrude_message);
+ break;
+ case FILAMENT_CHANGE_MESSAGE_OPTION:
+ filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_WAIT_FOR;
+ lcd_goto_screen(lcd_filament_change_option_menu);
+ break;
+ case FILAMENT_CHANGE_MESSAGE_RESUME:
+ lcd_goto_screen(lcd_filament_change_resume_message);
+ break;
+ case FILAMENT_CHANGE_MESSAGE_STATUS:
+ lcd_return_to_status();
+ break;
+ }
}
- #endif
- static void lcd_sd_updir() {
- card.updir();
- currentMenuViewOffset = 0;
- }
+ #endif // FILAMENT_CHANGE_FEATURE
/**
*
- * "Print from SD" submenu
+ * Functions for editing single values
+ *
+ * The "menu_edit_type" macro generates the functions needed to edit a numerical value.
+ *
+ * For example, menu_edit_type(int, int3, itostr3, 1) expands into these functions:
+ *
+ * bool _menu_edit_int3();
+ * void menu_edit_int3(); // edit int (interactively)
+ * void menu_edit_callback_int3(); // edit int (interactively) with callback on completion
+ * static void _menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
+ * static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
+ * static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, screenFunc_t callback); // edit int with callback
+ *
+ * You can then use one of the menu macros to present the edit interface:
+ * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
+ *
+ * This expands into a more primitive menu item:
+ * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
+ *
+ *
+ * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK
*
+ * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
*/
- void lcd_sdcard_menu() {
- ENCODER_DIRECTION_MENUS();
- if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
- uint16_t fileCnt = card.getnrfilenames();
- START_MENU();
- MENU_ITEM(back, MSG_MAIN);
- card.getWorkDirName();
- if (card.filename[0] == '/') {
- #if !PIN_EXISTS(SD_DETECT)
- MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);
- #endif
- }
- else {
- MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
+ #define menu_edit_type(_type, _name, _strFunc, scale) \
+ bool _menu_edit_ ## _name () { \
+ ENCODER_DIRECTION_NORMAL(); \
+ bool isClicked = LCD_CLICKED; \
+ if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
+ if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
+ if (lcdDrawUpdate) \
+ lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
+ if (isClicked) { \
+ *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
+ lcd_goto_previous_menu(true); \
+ } \
+ return isClicked; \
+ } \
+ void menu_edit_ ## _name () { _menu_edit_ ## _name(); } \
+ void menu_edit_callback_ ## _name () { if (_menu_edit_ ## _name ()) (*callbackFunc)(); } \
+ static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
+ lcd_save_previous_menu(); \
+ \
+ lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; \
+ \
+ editLabel = pstr; \
+ editValue = ptr; \
+ minEditValue = minValue * scale; \
+ maxEditValue = maxValue * scale - minEditValue; \
+ encoderPosition = (*ptr) * scale - minEditValue; \
+ } \
+ static void menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
+ _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
+ currentScreen = menu_edit_ ## _name; \
+ }\
+ static void menu_action_setting_edit_callback_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue, screenFunc_t callback) { \
+ _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
+ currentScreen = menu_edit_callback_ ## _name; \
+ callbackFunc = callback; \
}
- for (uint16_t i = 0; i < fileCnt; i++) {
- if (_menuItemNr == _lineNr) {
- card.getfilename(
- #if ENABLED(SDCARD_RATHERRECENTFIRST)
- fileCnt-1 -
- #endif
- i
- );
+ menu_edit_type(int, int3, itostr3, 1);
+ menu_edit_type(float, float3, ftostr3, 1);
+ menu_edit_type(float, float32, ftostr32, 100);
+ menu_edit_type(float, float43, ftostr43sign, 1000);
+ menu_edit_type(float, float5, ftostr5rj, 0.01);
+ menu_edit_type(float, float51, ftostr51sign, 10);
+ menu_edit_type(float, float52, ftostr52sign, 100);
+ menu_edit_type(unsigned long, long5, ftostr5rj, 0.01);
- if (card.filenameIsDir)
- MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
- else
- MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
- }
- else {
- MENU_ITEM_DUMMY();
+ /**
+ *
+ * Handlers for RepRap World Keypad input
+ *
+ */
+ #if ENABLED(REPRAPWORLD_KEYPAD)
+ static void _reprapworld_keypad_move(AxisEnum axis, int dir) {
+ move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
+ encoderPosition = dir;
+ switch (axis) {
+ case X_AXIS: lcd_move_x(); break;
+ case Y_AXIS: lcd_move_y(); break;
+ case Z_AXIS: lcd_move_z();
}
}
- END_MENU();
- }
-
-#endif //SDSUPPORT
-
-/**
- *
- * Functions for editing single values
- *
- * The "menu_edit_type" macro generates the functions needed to edit a numerical value.
- *
- * For example, menu_edit_type(int, int3, itostr3, 1) expands into these functions:
- *
- * bool _menu_edit_int3();
- * void menu_edit_int3(); // edit int (interactively)
- * void menu_edit_callback_int3(); // edit int (interactively) with callback on completion
- * static void _menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
- * static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
- * static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callback); // edit int with callback
- *
- * You can then use one of the menu macros to present the edit interface:
- * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999)
- *
- * This expands into a more primitive menu item:
- * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
- *
- *
- * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK
- *
- * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
- */
-#define menu_edit_type(_type, _name, _strFunc, scale) \
- bool _menu_edit_ ## _name () { \
- ENCODER_DIRECTION_NORMAL(); \
- bool isClicked = LCD_CLICKED; \
- if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
- if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
- if (lcdDrawUpdate) \
- lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
- if (isClicked) { \
- *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
- lcd_goto_previous_menu(true); \
- } \
- return isClicked; \
- } \
- void menu_edit_ ## _name () { _menu_edit_ ## _name(); } \
- void menu_edit_callback_ ## _name () { if (_menu_edit_ ## _name ()) (*callbackFunc)(); } \
- static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
- lcd_save_previous_menu(); \
- \
- lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; \
- \
- editLabel = pstr; \
- editValue = ptr; \
- minEditValue = minValue * scale; \
- maxEditValue = maxValue * scale - minEditValue; \
- encoderPosition = (*ptr) * scale - minEditValue; \
- } \
- static void menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
- _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
- currentMenu = menu_edit_ ## _name; \
- }\
- static void menu_action_setting_edit_callback_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue, menuFunc_t callback) { \
- _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
- currentMenu = menu_edit_callback_ ## _name; \
- callbackFunc = callback; \
- }
-menu_edit_type(int, int3, itostr3, 1);
-menu_edit_type(float, float3, ftostr3, 1);
-menu_edit_type(float, float32, ftostr32, 100);
-menu_edit_type(float, float43, ftostr43, 1000);
-menu_edit_type(float, float5, ftostr5, 0.01);
-menu_edit_type(float, float51, ftostr51, 10);
-menu_edit_type(float, float52, ftostr52, 100);
-menu_edit_type(unsigned long, long5, ftostr5, 0.01);
+ static void reprapworld_keypad_move_z_up() { _reprapworld_keypad_move(Z_AXIS, 1); }
+ static void reprapworld_keypad_move_z_down() { _reprapworld_keypad_move(Z_AXIS, -1); }
+ static void reprapworld_keypad_move_x_left() { _reprapworld_keypad_move(X_AXIS, -1); }
+ static void reprapworld_keypad_move_x_right() { _reprapworld_keypad_move(X_AXIS, 1); }
+ static void reprapworld_keypad_move_y_up() { _reprapworld_keypad_move(Y_AXIS, -1); }
+ static void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); }
+ static void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait
+ static void reprapworld_keypad_move_menu() { lcd_goto_screen(lcd_move_menu); }
+ #endif // REPRAPWORLD_KEYPAD
-/**
- *
- * Handlers for RepRap World Keypad input
- *
- */
-#if ENABLED(REPRAPWORLD_KEYPAD)
- static void reprapworld_keypad_move_z_up() {
- encoderPosition = 1;
- move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
- lcd_move_z();
- }
- static void reprapworld_keypad_move_z_down() {
- encoderPosition = -1;
- move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
- lcd_move_z();
- }
- static void reprapworld_keypad_move_x_left() {
- encoderPosition = -1;
- move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
- lcd_move_x();
- }
- static void reprapworld_keypad_move_x_right() {
- encoderPosition = 1;
- move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
- lcd_move_x();
- }
- static void reprapworld_keypad_move_y_down() {
- encoderPosition = 1;
- move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
- lcd_move_y();
- }
- static void reprapworld_keypad_move_y_up() {
- encoderPosition = -1;
- move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
- lcd_move_y();
- }
- static void reprapworld_keypad_move_home() {
- enqueue_and_echo_commands_P(PSTR("G28")); // move all axes home
+ /**
+ *
+ * Audio feedback for controller clicks
+ *
+ */
+ void lcd_buzz(long duration, uint16_t freq) {
+ #if ENABLED(LCD_USE_I2C_BUZZER)
+ lcd.buzz(duration, freq);
+ #elif PIN_EXISTS(BEEPER)
+ buzzer.tone(duration, freq);
+ #endif
}
-#endif // REPRAPWORLD_KEYPAD
-
-
-/**
- *
- * Audio feedback for controller clicks
- *
- */
-#if ENABLED(LCD_USE_I2C_BUZZER)
- void lcd_buzz(long duration, uint16_t freq) { // called from buzz() in Marlin_main.cpp where lcd is unknown
- lcd.buzz(duration, freq);
+ void lcd_quick_feedback() {
+ lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
+ next_button_update_ms = millis() + 500;
+
+ // Buzz and wait. The delay is needed for buttons to settle!
+ lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
+ #if ENABLED(LCD_USE_I2C_BUZZER)
+ delay(10);
+ #elif PIN_EXISTS(BEEPER)
+ for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); }
+ #endif
}
-#endif
-void lcd_quick_feedback() {
- lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
- next_button_update_ms = millis() + 500;
+ /**
+ *
+ * Menu actions
+ *
+ */
+ static void menu_action_back() { lcd_goto_previous_menu(); }
+ static void menu_action_submenu(screenFunc_t func) { lcd_save_previous_menu(); lcd_goto_screen(func); }
+ static void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); }
+ static void menu_action_function(screenFunc_t func) { (*func)(); }
- #if ENABLED(LCD_USE_I2C_BUZZER)
- #ifndef LCD_FEEDBACK_FREQUENCY_HZ
- #define LCD_FEEDBACK_FREQUENCY_HZ 100
- #endif
- #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
- #define LCD_FEEDBACK_FREQUENCY_DURATION_MS (1000/6)
- #endif
- lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
- #elif PIN_EXISTS(BEEPER)
- #ifndef LCD_FEEDBACK_FREQUENCY_HZ
- #define LCD_FEEDBACK_FREQUENCY_HZ 5000
- #endif
- #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
- #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
- #endif
- buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
- #else
- #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
- #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
- #endif
- delay(LCD_FEEDBACK_FREQUENCY_DURATION_MS);
- #endif
-}
+ #if ENABLED(SDSUPPORT)
-/**
- *
- * Menu actions
- *
- */
-static void menu_action_back() { lcd_goto_previous_menu(); }
-static void menu_action_submenu(menuFunc_t func) { lcd_save_previous_menu(); lcd_goto_menu(func); }
-static void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); }
-static void menu_action_function(menuFunc_t func) { (*func)(); }
+ static void menu_action_sdfile(const char* filename, char* longFilename) {
+ UNUSED(longFilename);
+ card.openAndPrintFile(filename);
+ lcd_return_to_status();
+ }
-#if ENABLED(SDSUPPORT)
+ static void menu_action_sddirectory(const char* filename, char* longFilename) {
+ UNUSED(longFilename);
+ card.chdir(filename);
+ encoderPosition = 0;
+ }
- static void menu_action_sdfile(const char* filename, char* longFilename) {
- UNUSED(longFilename);
- card.openAndPrintFile(filename);
- lcd_return_to_status();
- }
+ #endif //SDSUPPORT
- static void menu_action_sddirectory(const char* filename, char* longFilename) {
- UNUSED(longFilename);
- card.chdir(filename);
- encoderPosition = 0;
+ static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); }
+ static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callback) {
+ menu_action_setting_edit_bool(pstr, ptr);
+ (*callback)();
}
-#endif //SDSUPPORT
-
-static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); }
-static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) {
- menu_action_setting_edit_bool(pstr, ptr);
- (*callback)();
-}
-
#endif //ULTIPANEL
/** LCD API **/
@@ -2054,7 +2419,7 @@ void lcd_init() {
SET_INPUT(BTN_RT);
#endif
- #else // Not NEWPANEL
+ #else // !NEWPANEL
#if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
pinMode(SR_DATA_PIN, OUTPUT);
@@ -2069,7 +2434,7 @@ void lcd_init() {
WRITE(SHIFT_EN, LOW);
#endif // SR_LCD_2W_NL
- #endif//!NEWPANEL
+ #endif // !NEWPANEL
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
SET_INPUT(SD_DETECT_PIN);
@@ -2091,7 +2456,11 @@ void lcd_init() {
int lcd_strlen(const char* s) {
int i = 0, j = 0;
while (s[i]) {
- if ((s[i] & 0xc0) != 0x80) j++;
+ #if ENABLED(MAPPER_NON)
+ j++;
+ #else
+ if ((s[i] & 0xC0u) != 0x80u) j++;
+ #endif
i++;
}
return j;
@@ -2100,7 +2469,11 @@ int lcd_strlen(const char* s) {
int lcd_strlen_P(const char* s) {
int j = 0;
while (pgm_read_byte(s)) {
- if ((pgm_read_byte(s) & 0xc0) != 0x80) j++;
+ #if ENABLED(MAPPER_NON)
+ j++;
+ #else
+ if ((pgm_read_byte(s) & 0xC0u) != 0x80u) j++;
+ #endif
s++;
}
return j;
@@ -2150,8 +2523,10 @@ bool lcd_blink() {
* No worries. This function is only called from the main thread.
*/
void lcd_update() {
+
#if ENABLED(ULTIPANEL)
static millis_t return_to_status_ms = 0;
+ manage_manual_move();
#endif
lcd_buttons_update();
@@ -2162,8 +2537,8 @@ void lcd_update() {
if (sd_status != lcd_sd_status && lcd_detected()) {
lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
- #if ENABLED(LCD_PROGRESS_BAR)
- currentMenu == lcd_status_screen
+ #if ENABLED(LCD_PROGRESS_BAR) && ENABLED(ULTIPANEL)
+ currentScreen == lcd_status_screen
#endif
);
@@ -2198,22 +2573,35 @@ void lcd_update() {
#if ENABLED(REPRAPWORLD_KEYPAD)
- #if ENABLED(DELTA) || ENABLED(SCARA)
- #define _KEYPAD_MOVE_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
- #else
- #define _KEYPAD_MOVE_ALLOWED true
- #endif
+ static uint8_t keypad_debounce = 0;
- if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home();
- if (_KEYPAD_MOVE_ALLOWED) {
- if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
- if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down();
- if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left();
- if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right();
- if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down();
- if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up();
+ if (!REPRAPWORLD_KEYPAD_PRESSED) {
+ if (keypad_debounce > 0) keypad_debounce--;
}
- #endif
+ else if (!keypad_debounce) {
+ keypad_debounce = 2;
+
+ if (REPRAPWORLD_KEYPAD_MOVE_MENU) reprapworld_keypad_move_menu();
+
+ #if DISABLED(DELTA) && Z_HOME_DIR == -1
+ if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
+ #endif
+
+ if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
+ #if ENABLED(DELTA) || Z_HOME_DIR != -1
+ if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
+ #endif
+ if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down();
+ if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left();
+ if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right();
+ if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down();
+ if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up();
+ }
+ else {
+ if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home();
+ }
+ }
+ #endif // REPRAPWORLD_KEYPAD
bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
if (encoderPastThreshold || LCD_CLICKED) {
@@ -2235,14 +2623,11 @@ void lcd_update() {
#if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG)
SERIAL_ECHO_START;
- SERIAL_ECHO("Enc Step Rate: ");
- SERIAL_ECHO(encoderStepRate);
- SERIAL_ECHO(" Multiplier: ");
- SERIAL_ECHO(encoderMultiplier);
- SERIAL_ECHO(" ENCODER_10X_STEPS_PER_SEC: ");
- SERIAL_ECHO(ENCODER_10X_STEPS_PER_SEC);
- SERIAL_ECHO(" ENCODER_100X_STEPS_PER_SEC: ");
- SERIAL_ECHOLN(ENCODER_100X_STEPS_PER_SEC);
+ SERIAL_ECHOPAIR("Enc Step Rate: ", encoderStepRate);
+ SERIAL_ECHOPAIR(" Multiplier: ", encoderMultiplier);
+ SERIAL_ECHOPAIR(" ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC);
+ SERIAL_ECHOPAIR(" ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC);
+ SERIAL_EOL;
#endif //ENCODER_RATE_MULTIPLIER_DEBUG
}
@@ -2256,12 +2641,16 @@ void lcd_update() {
return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
}
- #endif //ULTIPANEL
+ #endif // ULTIPANEL
// We arrive here every ~100ms when idling often enough.
// Instead of tracking the changes simply redraw the Info Screen ~1 time a second.
static int8_t lcd_status_update_delay = 1; // first update one loop delayed
- if (currentMenu == lcd_status_screen && !lcd_status_update_delay--) {
+ if (
+ #if ENABLED(ULTIPANEL)
+ currentScreen == lcd_status_screen &&
+ #endif
+ !lcd_status_update_delay--) {
lcd_status_update_delay = 9;
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
}
@@ -2290,17 +2679,19 @@ void lcd_update() {
u8g.setColorIndex(dot_color); // Set color for the alive dot
u8g.drawPixel(127, 63); // draw alive dot
u8g.setColorIndex(1); // black on white
- (*currentMenu)();
+ (*currentScreen)();
} while (u8g.nextPage());
+ #elif ENABLED(ULTIPANEL)
+ (*currentScreen)();
#else
- (*currentMenu)();
+ lcd_status_screen();
#endif
}
#if ENABLED(ULTIPANEL)
// Return to Status Screen after a timeout
- if (currentMenu == lcd_status_screen || defer_return_to_status)
+ if (currentScreen == lcd_status_screen || defer_return_to_status)
return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
else if (ELAPSED(ms, return_to_status_ms))
lcd_return_to_status();
@@ -2323,12 +2714,22 @@ void lcd_update() {
}
}
-void lcd_ignore_click(bool b) {
- ignore_click = b;
- wait_for_unclick = false;
+void set_utf_strlen(char* s, uint8_t n) {
+ uint8_t i = 0, j = 0;
+ while (s[i] && (j < n)) {
+ #if ENABLED(MAPPER_NON)
+ j++;
+ #else
+ if ((s[i] & 0xC0u) != 0x80u) j++;
+ #endif
+ i++;
+ }
+ while (j++ < n) s[i++] = ' ';
+ s[i] = '\0';
}
void lcd_finishstatus(bool persist=false) {
+ set_utf_strlen(lcd_status_message, LCD_WIDTH);
#if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
UNUSED(persist);
#endif
@@ -2350,32 +2751,19 @@ void lcd_finishstatus(bool persist=false) {
void dontExpireStatus() { expire_status_ms = 0; }
#endif
-void set_utf_strlen(char* s, uint8_t n) {
- uint8_t i = 0, j = 0;
- while (s[i] && (j < n)) {
- if ((s[i] & 0xc0u) != 0x80u) j++;
- i++;
- }
- while (j++ < n) s[i++] = ' ';
- s[i] = 0;
-}
-
bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
void lcd_setstatus(const char* message, bool persist) {
if (lcd_status_message_level > 0) return;
strncpy(lcd_status_message, message, 3 * (LCD_WIDTH));
- set_utf_strlen(lcd_status_message, LCD_WIDTH);
lcd_finishstatus(persist);
}
void lcd_setstatuspgm(const char* message, uint8_t level) {
- if (level >= lcd_status_message_level) {
- strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
- set_utf_strlen(lcd_status_message, LCD_WIDTH);
- lcd_status_message_level = level;
- lcd_finishstatus(level > 0);
- }
+ if (level < lcd_status_message_level) return;
+ lcd_status_message_level = level;
+ strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
+ lcd_finishstatus(level > 0);
}
void lcd_setalertstatuspgm(const char* message) {
@@ -2388,8 +2776,8 @@ void lcd_setalertstatuspgm(const char* message) {
void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#if HAS_LCD_CONTRAST
- void lcd_setcontrast(uint8_t value) {
- lcd_contrast = value & 0x3F;
+ void set_lcd_contrast(int value) {
+ lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX);
u8g.setContrast(lcd_contrast);
}
#endif
@@ -2485,6 +2873,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
GET_BUTTON_STATES(buttons);
#endif //!NEWPANEL
+ // Manage encoder rotation
#if ENABLED(REVERSE_MENU_DIRECTION) && ENABLED(REVERSE_ENCODER_DIRECTION)
#define ENCODER_DIFF_CW (encoderDiff -= encoderDirection)
#define ENCODER_DIFF_CCW (encoderDiff += encoderDirection)
@@ -2500,7 +2889,6 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#endif
#define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: ENCODER_DIFF_CW; break; case _E2: ENCODER_DIFF_CCW; }
- //manage encoder rotation
uint8_t enc = 0;
if (buttons & EN_A) enc |= B01;
if (buttons & EN_B) enc |= B10;
@@ -2531,6 +2919,9 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
/** Number to string conversion **/
/*********************************/
+#define DIGIT(n) ('0' + (n))
+#define DIGIMOD(n) DIGIT((n) % 10)
+
char conv[8];
// Convert float to rj string with 123 or -12 format
@@ -2541,54 +2932,41 @@ char *ftostr4sign(const float& x) { return itostr4sign((int)x); }
// Convert unsigned int to string with 12 format
char* itostr2(const uint8_t& x) {
- //sprintf(conv,"%5.1f",x);
int xx = x;
- conv[0] = (xx / 10) % 10 + '0';
- conv[1] = xx % 10 + '0';
- conv[2] = 0;
+ conv[0] = DIGIMOD(xx / 10);
+ conv[1] = DIGIMOD(xx);
+ conv[2] = '\0';
return conv;
}
// Convert float to string with +123.4 / -123.4 format
-char* ftostr31(const float& x) {
- int xx = abs(x * 10);
- conv[0] = (x >= 0) ? '+' : '-';
- conv[1] = (xx / 1000) % 10 + '0';
- conv[2] = (xx / 100) % 10 + '0';
- conv[3] = (xx / 10) % 10 + '0';
+char* ftostr41sign(const float& x) {
+ int xx = int(abs(x * 10)) % 10000;
+ conv[0] = x >= 0 ? '+' : '-';
+ conv[1] = DIGIMOD(xx / 1000);
+ conv[2] = DIGIMOD(xx / 100);
+ conv[3] = DIGIMOD(xx / 10);
conv[4] = '.';
- conv[5] = xx % 10 + '0';
- conv[6] = 0;
- return conv;
-}
-
-// Convert unsigned float to string with 123.4 format, dropping sign
-char* ftostr31ns(const float& x) {
- int xx = abs(x * 10);
- conv[0] = (xx / 1000) % 10 + '0';
- conv[1] = (xx / 100) % 10 + '0';
- conv[2] = (xx / 10) % 10 + '0';
- conv[3] = '.';
- conv[4] = xx % 10 + '0';
- conv[5] = 0;
+ conv[5] = DIGIMOD(xx);
+ conv[6] = '\0';
return conv;
}
// Convert signed float to string with 023.45 / -23.45 format
char *ftostr32(const float& x) {
long xx = abs(x * 100);
- conv[0] = x >= 0 ? (xx / 10000) % 10 + '0' : '-';
- conv[1] = (xx / 1000) % 10 + '0';
- conv[2] = (xx / 100) % 10 + '0';
+ conv[0] = x >= 0 ? DIGIMOD(xx / 10000) : '-';
+ conv[1] = DIGIMOD(xx / 1000);
+ conv[2] = DIGIMOD(xx / 100);
conv[3] = '.';
- conv[4] = (xx / 10) % 10 + '0';
- conv[5] = xx % 10 + '0';
- conv[6] = 0;
+ conv[4] = DIGIMOD(xx / 10);
+ conv[5] = DIGIMOD(xx);
+ conv[6] = '\0';
return conv;
}
// Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
-char* ftostr43(const float& x, char plus/*=' '*/) {
+char* ftostr43sign(const float& x, char plus/*=' '*/) {
long xx = x * 1000;
if (xx == 0)
conv[0] = ' ';
@@ -2598,12 +2976,12 @@ char* ftostr43(const float& x, char plus/*=' '*/) {
xx = -xx;
conv[0] = '-';
}
- conv[1] = (xx / 1000) % 10 + '0';
+ conv[1] = DIGIMOD(xx / 1000);
conv[2] = '.';
- conv[3] = (xx / 100) % 10 + '0';
- conv[4] = (xx / 10) % 10 + '0';
- conv[5] = (xx) % 10 + '0';
- conv[6] = 0;
+ conv[3] = DIGIMOD(xx / 100);
+ conv[4] = DIGIMOD(xx / 10);
+ conv[5] = DIGIMOD(xx);
+ conv[6] = '\0';
return conv;
}
@@ -2611,57 +2989,11 @@ char* ftostr43(const float& x, char plus/*=' '*/) {
char* ftostr12ns(const float& x) {
long xx = x * 100;
xx = abs(xx);
- conv[0] = (xx / 100) % 10 + '0';
+ conv[0] = DIGIMOD(xx / 100);
conv[1] = '.';
- conv[2] = (xx / 10) % 10 + '0';
- conv[3] = (xx) % 10 + '0';
- conv[4] = 0;
- return conv;
-}
-
-// Convert signed float to space-padded string with -_23.4_ format
-char* ftostr32sp(const float& x) {
- long xx = x * 100;
- uint8_t dig;
- if (xx < 0) { // negative val = -_0
- xx = -xx;
- conv[0] = '-';
- dig = (xx / 1000) % 10;
- conv[1] = dig ? '0' + dig : ' ';
- }
- else { // positive val = __0
- dig = (xx / 10000) % 10;
- if (dig) {
- conv[0] = '0' + dig;
- conv[1] = '0' + (xx / 1000) % 10;
- }
- else {
- conv[0] = ' ';
- dig = (xx / 1000) % 10;
- conv[1] = dig ? '0' + dig : ' ';
- }
- }
-
- conv[2] = '0' + (xx / 100) % 10; // lsd always
-
- dig = xx % 10;
- if (dig) { // 2 decimal places
- conv[5] = '0' + dig;
- conv[4] = '0' + (xx / 10) % 10;
- conv[3] = '.';
- }
- else { // 1 or 0 decimal place
- dig = (xx / 10) % 10;
- if (dig) {
- conv[4] = '0' + dig;
- conv[3] = '.';
- }
- else {
- conv[3] = conv[4] = ' ';
- }
- conv[5] = ' ';
- }
- conv[6] = '\0';
+ conv[2] = DIGIMOD(xx / 10);
+ conv[3] = DIGIMOD(xx);
+ conv[4] = '\0';
return conv;
}
@@ -2676,12 +3008,12 @@ char* itostr3sign(const int& x) {
conv[0] = '-';
xx = -x;
}
- conv[1] = (xx / 100) % 10 + '0';
- conv[2] = (xx / 10) % 10 + '0';
- conv[3] = xx % 10 + '0';
+ conv[1] = DIGIMOD(xx / 100);
+ conv[2] = DIGIMOD(xx / 10);
+ conv[3] = DIGIMOD(xx);
conv[4] = '.';
conv[5] = '0';
- conv[6] = 0;
+ conv[6] = '\0';
return conv;
}
@@ -2693,56 +3025,46 @@ char* itostr3(const int& x) {
xx = -xx;
}
else
- conv[0] = xx >= 100 ? (xx / 100) % 10 + '0' : ' ';
+ conv[0] = xx >= 100 ? DIGIMOD(xx / 100) : ' ';
- conv[1] = xx >= 10 ? (xx / 10) % 10 + '0' : ' ';
- conv[2] = xx % 10 + '0';
- conv[3] = 0;
+ conv[1] = xx >= 10 ? DIGIMOD(xx / 10) : ' ';
+ conv[2] = DIGIMOD(xx);
+ conv[3] = '\0';
return conv;
}
// Convert unsigned int to lj string with 123 format
-char* itostr3left(const int& x) {
- if (x >= 100) {
- conv[0] = (x / 100) % 10 + '0';
- conv[1] = (x / 10) % 10 + '0';
- conv[2] = x % 10 + '0';
- conv[3] = 0;
+char* itostr3left(const int& xx) {
+ if (xx >= 100) {
+ conv[0] = DIGIMOD(xx / 100);
+ conv[1] = DIGIMOD(xx / 10);
+ conv[2] = DIGIMOD(xx);
+ conv[3] = '\0';
}
- else if (x >= 10) {
- conv[0] = (x / 10) % 10 + '0';
- conv[1] = x % 10 + '0';
- conv[2] = 0;
+ else if (xx >= 10) {
+ conv[0] = DIGIMOD(xx / 10);
+ conv[1] = DIGIMOD(xx);
+ conv[2] = '\0';
}
else {
- conv[0] = x % 10 + '0';
- conv[1] = 0;
+ conv[0] = DIGIMOD(xx);
+ conv[1] = '\0';
}
return conv;
}
-// Convert unsigned int to rj string with 1234 format
-char* itostr4(const int& x) {
- conv[0] = x >= 1000 ? (x / 1000) % 10 + '0' : ' ';
- conv[1] = x >= 100 ? (x / 100) % 10 + '0' : ' ';
- conv[2] = x >= 10 ? (x / 10) % 10 + '0' : ' ';
- conv[3] = x % 10 + '0';
- conv[4] = 0;
- return conv;
-}
-
// Convert signed int to rj string with _123, -123, _-12, or __-1 format
char *itostr4sign(const int& x) {
int xx = abs(x);
int sign = 0;
if (xx >= 100) {
- conv[1] = (xx / 100) % 10 + '0';
- conv[2] = (xx / 10) % 10 + '0';
+ conv[1] = DIGIMOD(xx / 100);
+ conv[2] = DIGIMOD(xx / 10);
}
else if (xx >= 10) {
conv[0] = ' ';
sign = 1;
- conv[2] = (xx / 10) % 10 + '0';
+ conv[2] = DIGIMOD(xx / 10);
}
else {
conv[0] = ' ';
@@ -2750,48 +3072,94 @@ char *itostr4sign(const int& x) {
sign = 2;
}
conv[sign] = x < 0 ? '-' : ' ';
- conv[3] = xx % 10 + '0';
- conv[4] = 0;
+ conv[3] = DIGIMOD(xx);
+ conv[4] = '\0';
return conv;
}
// Convert unsigned float to rj string with 12345 format
-char* ftostr5(const float& x) {
+char* ftostr5rj(const float& x) {
long xx = abs(x);
- conv[0] = xx >= 10000 ? (xx / 10000) % 10 + '0' : ' ';
- conv[1] = xx >= 1000 ? (xx / 1000) % 10 + '0' : ' ';
- conv[2] = xx >= 100 ? (xx / 100) % 10 + '0' : ' ';
- conv[3] = xx >= 10 ? (xx / 10) % 10 + '0' : ' ';
- conv[4] = xx % 10 + '0';
- conv[5] = 0;
+ conv[0] = xx >= 10000 ? DIGIMOD(xx / 10000) : ' ';
+ conv[1] = xx >= 1000 ? DIGIMOD(xx / 1000) : ' ';
+ conv[2] = xx >= 100 ? DIGIMOD(xx / 100) : ' ';
+ conv[3] = xx >= 10 ? DIGIMOD(xx / 10) : ' ';
+ conv[4] = DIGIMOD(xx);
+ conv[5] = '\0';
return conv;
}
// Convert signed float to string with +1234.5 format
-char* ftostr51(const float& x) {
+char* ftostr51sign(const float& x) {
long xx = abs(x * 10);
conv[0] = (x >= 0) ? '+' : '-';
- conv[1] = (xx / 10000) % 10 + '0';
- conv[2] = (xx / 1000) % 10 + '0';
- conv[3] = (xx / 100) % 10 + '0';
- conv[4] = (xx / 10) % 10 + '0';
+ conv[1] = DIGIMOD(xx / 10000);
+ conv[2] = DIGIMOD(xx / 1000);
+ conv[3] = DIGIMOD(xx / 100);
+ conv[4] = DIGIMOD(xx / 10);
conv[5] = '.';
- conv[6] = xx % 10 + '0';
- conv[7] = 0;
+ conv[6] = DIGIMOD(xx);
+ conv[7] = '\0';
return conv;
}
// Convert signed float to string with +123.45 format
-char* ftostr52(const float& x) {
- conv[0] = (x >= 0) ? '+' : '-';
+char* ftostr52sign(const float& x) {
long xx = abs(x * 100);
- conv[1] = (xx / 10000) % 10 + '0';
- conv[2] = (xx / 1000) % 10 + '0';
- conv[3] = (xx / 100) % 10 + '0';
+ conv[0] = (x >= 0) ? '+' : '-';
+ conv[1] = DIGIMOD(xx / 10000);
+ conv[2] = DIGIMOD(xx / 1000);
+ conv[3] = DIGIMOD(xx / 100);
conv[4] = '.';
- conv[5] = (xx / 10) % 10 + '0';
- conv[6] = xx % 10 + '0';
- conv[7] = 0;
+ conv[5] = DIGIMOD(xx / 10);
+ conv[6] = DIGIMOD(xx);
+ conv[7] = '\0';
+ return conv;
+}
+
+// Convert signed float to space-padded string with -_23.4_ format
+char* ftostr52sp(const float& x) {
+ long xx = x * 100;
+ uint8_t dig;
+ if (xx < 0) { // negative val = -_0
+ xx = -xx;
+ conv[0] = '-';
+ dig = (xx / 1000) % 10;
+ conv[1] = dig ? DIGIT(dig) : ' ';
+ }
+ else { // positive val = __0
+ dig = (xx / 10000) % 10;
+ if (dig) {
+ conv[0] = DIGIT(dig);
+ conv[1] = DIGIMOD(xx / 1000);
+ }
+ else {
+ conv[0] = ' ';
+ dig = (xx / 1000) % 10;
+ conv[1] = dig ? DIGIT(dig) : ' ';
+ }
+ }
+
+ conv[2] = DIGIMOD(xx / 100); // lsd always
+
+ dig = xx % 10;
+ if (dig) { // 2 decimal places
+ conv[5] = DIGIT(dig);
+ conv[4] = DIGIMOD(xx / 10);
+ conv[3] = '.';
+ }
+ else { // 1 or 0 decimal place
+ dig = (xx / 10) % 10;
+ if (dig) {
+ conv[4] = DIGIT(dig);
+ conv[3] = '.';
+ }
+ else {
+ conv[3] = conv[4] = ' ';
+ }
+ conv[5] = ' ';
+ }
+ conv[6] = '\0';
return conv;
}
diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h
index e20f5cc33..4cc8334ec 100644
--- a/Marlin/ultralcd.h
+++ b/Marlin/ultralcd.h
@@ -27,8 +27,6 @@
#if ENABLED(ULTRA_LCD)
- #include "buzzer.h"
-
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
#define BUTTON_PRESSED(BN) !READ(BTN_## BN)
@@ -42,8 +40,10 @@
void lcd_setalertstatuspgm(const char* message);
void lcd_reset_alert_level();
bool lcd_detected(void);
+ void lcd_kill_screen();
+ void kill_screen(const char* lcd_msg);
- #if ENABLED(LCD_USE_I2C_BUZZER)
+ #if HAS_BUZZER
void lcd_buzz(long duration, uint16_t freq);
#endif
@@ -53,7 +53,9 @@
#if ENABLED(DOGLCD)
extern int lcd_contrast;
- void lcd_setcontrast(uint8_t value);
+ void set_lcd_contrast(int value);
+ #elif ENABLED(SHOW_BOOTSCREEN)
+ void bootscreen();
#endif
#define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
@@ -63,30 +65,47 @@
#define LCD_TIMEOUT_TO_STATUS 15000
#if ENABLED(ULTIPANEL)
- void lcd_buttons_update();
extern volatile uint8_t buttons; //the last checked buttons in a bit array.
+ void lcd_buttons_update();
+ void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
+ bool lcd_clicked();
+ void lcd_ignore_click(bool b=true);
+
+ #if ENABLED(FILAMENT_CHANGE_FEATURE)
+ void lcd_filament_change_show_message(FilamentChangeMessage message);
+ #endif // FILAMENT_CHANGE_FEATURE
+
#else
FORCE_INLINE void lcd_buttons_update() {}
#endif
- extern int plaPreheatHotendTemp;
- extern int plaPreheatHPBTemp;
- extern int plaPreheatFanSpeed;
- extern int absPreheatHotendTemp;
- extern int absPreheatHPBTemp;
- extern int absPreheatFanSpeed;
-
- extern bool cancel_heatup;
+ extern int preheatHotendTemp1;
+ extern int preheatBedTemp1;
+ extern int preheatFanSpeed1;
+ extern int preheatHotendTemp2;
+ extern int preheatBedTemp2;
+ extern int preheatFanSpeed2;
#if ENABLED(FILAMENT_LCD_DISPLAY)
extern millis_t previous_lcd_status_ms;
#endif
- void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
- bool lcd_clicked();
- void lcd_ignore_click(bool b=true);
+
bool lcd_blink();
- #if ENABLED(ULTIPANEL) && ENABLED(REPRAPWORLD_KEYPAD)
+ #if ENABLED(ULTIPANEL)
+ #define BLEN_A 0
+ #define BLEN_B 1
+ // Encoder click is directly connected
+ #if BUTTON_EXISTS(ENC)
+ #define BLEN_C 2
+ #define EN_C (_BV(BLEN_C))
+ #endif
+ #define EN_A (_BV(BLEN_A))
+ #define EN_B (_BV(BLEN_B))
+ #define EN_C (_BV(BLEN_C))
+ #endif
+
+ #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL
#define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values
@@ -110,41 +129,28 @@
#define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3)
#define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2)
+ #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1)
#define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN)
#define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT)
#define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE)
#define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP)
#define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT)
- #endif //ULTIPANEL && REPRAPWORLD_KEYPAD
-
- #if ENABLED(NEWPANEL)
-
- #define EN_C (_BV(BLEN_C))
- #define EN_B (_BV(BLEN_B))
- #define EN_A (_BV(BLEN_A))
-
- #if ENABLED(REPRAPWORLD_KEYPAD)
- #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
- #else
- #define LCD_CLICKED (buttons&EN_C)
- #endif
-
- #else //!NEWPANEL
-
- //atomic, do not change
- #define B_LE (_BV(BL_LE))
- #define B_UP (_BV(BL_UP))
- #define B_MI (_BV(BL_MI))
- #define B_DW (_BV(BL_DW))
- #define B_RI (_BV(BL_RI))
- #define B_ST (_BV(BL_ST))
- #define EN_B (_BV(BLEN_B))
- #define EN_A (_BV(BLEN_A))
-
- #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
-
- #endif //!NEWPANEL
+ #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \
+ EN_REPRAPWORLD_KEYPAD_F3 | \
+ EN_REPRAPWORLD_KEYPAD_F2 | \
+ EN_REPRAPWORLD_KEYPAD_F1 | \
+ EN_REPRAPWORLD_KEYPAD_DOWN | \
+ EN_REPRAPWORLD_KEYPAD_RIGHT | \
+ EN_REPRAPWORLD_KEYPAD_MIDDLE | \
+ EN_REPRAPWORLD_KEYPAD_UP | \
+ EN_REPRAPWORLD_KEYPAD_LEFT) \
+ )
+
+ #define LCD_CLICKED ((buttons & EN_C) || (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1))
+ #elif ENABLED(NEWPANEL)
+ #define LCD_CLICKED (buttons & EN_C)
+ #endif
#else //no LCD
FORCE_INLINE void lcd_update() {}
@@ -165,19 +171,17 @@ char* itostr2(const uint8_t& x);
char* itostr3sign(const int& x);
char* itostr3(const int& x);
char* itostr3left(const int& x);
-char* itostr4(const int& x);
char* itostr4sign(const int& x);
char* ftostr3(const float& x);
char* ftostr4sign(const float& x);
-char* ftostr31ns(const float& x); // float to string without sign character
-char* ftostr31(const float& x);
+char* ftostr41sign(const float& x);
char* ftostr32(const float& x);
-char* ftostr43(const float& x, char plus=' ');
+char* ftostr43sign(const float& x, char plus=' ');
char* ftostr12ns(const float& x);
-char* ftostr32sp(const float& x); // remove zero-padding from ftostr32
-char* ftostr5(const float& x);
-char* ftostr51(const float& x);
-char* ftostr52(const float& x);
+char* ftostr5rj(const float& x);
+char* ftostr51sign(const float& x);
+char* ftostr52sign(const float& x);
+char* ftostr52sp(const float& x); // remove zero-padding from ftostr32
#endif //ULTRALCD_H
diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/ultralcd_impl_DOGM.h
similarity index 84%
rename from Marlin/dogm_lcd_implementation.h
rename to Marlin/ultralcd_impl_DOGM.h
index fda1f53ab..f8ffd4db0 100644
--- a/Marlin/dogm_lcd_implementation.h
+++ b/Marlin/ultralcd_impl_DOGM.h
@@ -21,7 +21,7 @@
*/
/**
- * dogm_lcd_implementation.h
+ * ultralcd_impl_DOGM.h
*
* Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin
* Demonstrator: http://www.reprap.org/wiki/STB_Electronics
@@ -33,36 +33,30 @@
* License: http://opensource.org/licenses/BSD-3-Clause
*/
-#ifndef DOGM_LCD_IMPLEMENTATION_H
-#define DOGM_LCD_IMPLEMENTATION_H
+#ifndef ULTRALCD_IMPL_DOGM_H
+#define ULTRALCD_IMPL_DOGM_H
+
+#include "MarlinConfig.h"
/**
* Implementation of the LCD display routines for a DOGM128 graphic display.
* These are common LCD 128x64 pixel graphic displays.
*/
-
-#if ENABLED(ULTIPANEL)
- #define BLEN_A 0
- #define BLEN_B 1
- #define BLEN_C 2
- #define EN_A (_BV(BLEN_A))
- #define EN_B (_BV(BLEN_B))
- #define EN_C (_BV(BLEN_C))
- #define LCD_CLICKED (buttons&EN_C)
-#endif
+#include "ultralcd.h"
+#include "ultralcd_st7920_u8glib_rrd.h"
+#include "dogm_bitmaps.h"
+#include "duration_t.h"
#include
-#include "dogm_bitmaps.h"
-#include "ultralcd.h"
-#include "ultralcd_st7920_u8glib_rrd.h"
-#include "Configuration.h"
+#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN)
+ #include "_Bootscreen.h"
+#endif
#if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT)
#undef USE_BIG_EDIT_FONT
#endif
-
#if ENABLED(USE_SMALL_INFOFONT)
#include "dogm_font_data_6x9_marlin.h"
#define FONT_STATUSMENU_NAME u8g_font_6x9
@@ -83,6 +77,9 @@
#elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
#include "dogm_font_data_ISO10646_Kana.h"
#define FONT_MENU_NAME ISO10646_Kana_5x7
+ #elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK)
+ #include "dogm_font_data_ISO10646_Greek.h"
+ #define FONT_MENU_NAME ISO10646_Greek_5x7
#elif ENABLED(DISPLAY_CHARSET_ISO10646_CN)
#include "dogm_font_data_ISO10646_CN.h"
#define FONT_MENU_NAME ISO10646_CN
@@ -133,12 +130,22 @@
#define TALL_FONT_CORRECTION 0
#endif
-#define START_ROW 0
+#define START_COL 0
// LCD selection
-#if ENABLED(U8GLIB_ST7920)
+#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
+ U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_RS);
+#elif ENABLED(U8GLIB_ST7920)
//U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
U8GLIB_ST7920_128X64_RRD u8g(0);
+#elif ENABLED(CARTESIO_UI)
+ // The CartesioUI display
+ #if DOGLCD_MOSI != -1 && DOGLCD_SCK != -1
+ // using SW-SPI
+ U8GLIB_DOGM128 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0);
+ #else
+ U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);
+ #endif
#elif ENABLED(U8GLIB_LM6059_AF)
// Based on the Adafruit ST7565 (http://www.adafruit.com/products/250)
U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0);
@@ -212,10 +219,6 @@ char lcd_printPGM(const char* str) {
return n;
}
-#if ENABLED(SHOW_BOOTSCREEN)
- static bool show_bootscreen = true;
-#endif
-
/* Warning: This function is called from interrupt context */
static void lcd_implementation_init() {
@@ -233,11 +236,6 @@ static void lcd_implementation_init() {
u8g.setContrast(lcd_contrast);
#endif
- // FIXME: remove this workaround
- // Uncomment this if you have the first generation (V1.10) of STBs board
- // pinMode(17, OUTPUT); // Enable LCD backlight
- // digitalWrite(17, HIGH);
-
#if ENABLED(LCD_SCREEN_ROT_90)
u8g.setRot90(); // Rotate screen by 90°
#elif ENABLED(LCD_SCREEN_ROT_180)
@@ -247,7 +245,23 @@ static void lcd_implementation_init() {
#endif
#if ENABLED(SHOW_BOOTSCREEN)
+ static bool show_bootscreen = true;
+
+ #if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
+ if (show_bootscreen) {
+ u8g.firstPage();
+ do {
+ u8g.drawBitmapP(
+ (128 - (CUSTOM_BOOTSCREEN_BMPWIDTH)) /2,
+ ( 64 - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) /2,
+ CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8), CUSTOM_BOOTSCREEN_BMPHEIGHT, custom_start_bmp);
+ } while (u8g.nextPage());
+ safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT);
+ }
+ #endif // SHOW_CUSTOM_BOOTSCREEN
+
int offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2;
+
#if ENABLED(START_BMPHIGH)
int offy = 0;
#else
@@ -256,9 +270,9 @@ static void lcd_implementation_init() {
int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2;
- u8g.firstPage();
- do {
- if (show_bootscreen) {
+ if (show_bootscreen) {
+ u8g.firstPage();
+ do {
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
lcd_setFont(FONT_MENU);
#ifndef STRING_SPLASH_LINE2
@@ -268,14 +282,22 @@ static void lcd_implementation_init() {
u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 3 / 2, STRING_SPLASH_LINE1);
u8g.drawStr(txt2X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 1 / 2, STRING_SPLASH_LINE2);
#endif
- }
- } while (u8g.nextPage());
-
- if (show_bootscreen) {
- delay(1000);
- show_bootscreen = false;
+ } while (u8g.nextPage());
}
- #endif
+
+ show_bootscreen = false;
+
+ #endif // SHOW_BOOTSCREEN
+}
+
+void lcd_kill_screen() {
+ lcd_setFont(FONT_MENU);
+ u8g.setPrintPos(0, u8g.getHeight()/4*1);
+ lcd_print(lcd_status_message);
+ u8g.setPrintPos(0, u8g.getHeight()/4*2);
+ lcd_printPGM(PSTR(MSG_HALTED));
+ u8g.setPrintPos(0, u8g.getHeight()/4*3);
+ lcd_printPGM(PSTR(MSG_PLEASE_RESET));
}
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
@@ -357,23 +379,23 @@ static void lcd_implementation_status_screen() {
// SD Card Progress bar and clock
if (IS_SD_PRINTING) {
// Progress bar solid part
- u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - (TALL_FONT_CORRECTION));
+ u8g.drawBox(55, 50, (unsigned int)(71 * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION));
}
u8g.setPrintPos(80,48);
- uint16_t time = print_job_timer.duration() / 60;
- if (time != 0) {
- lcd_print(itostr2(time/60));
- lcd_print(':');
- lcd_print(itostr2(time%60));
- }
+
+ char buffer[10];
+ duration_t elapsed = print_job_timer.duration();
+ elapsed.toDigital(buffer);
+ lcd_print(buffer);
+
#endif
// Extruders
- for (int i = 0; i < EXTRUDERS; i++) _draw_heater_status(5 + i * 25, i);
+ HOTEND_LOOP() _draw_heater_status(5 + e * 25, e);
// Heated bed
- #if EXTRUDERS < 4 && HAS_TEMP_BED
+ #if HOTENDS < 4 && HAS_TEMP_BED
_draw_heater_status(81, -1);
#endif
@@ -413,7 +435,7 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(83, XYZ_BASELINE);
_draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
u8g.setPrintPos(91, XYZ_BASELINE);
- lcd_print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
+ lcd_print(ftostr52sp(current_position[Z_AXIS] + 0.00001));
u8g.setColorIndex(1); // black on white
@@ -424,7 +446,7 @@ static void lcd_implementation_status_screen() {
lcd_setFont(FONT_STATUSMENU);
u8g.setPrintPos(12, 49);
- lcd_print(itostr3(feedrate_multiplier));
+ lcd_print(itostr3(feedrate_percentage));
lcd_print('%');
// Status line
@@ -458,12 +480,40 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
else {
u8g.setColorIndex(1); // unmarked text is black on white
}
- u8g.setPrintPos((START_ROW) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
+ u8g.setPrintPos((START_COL) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
}
+#if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
+
+ static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) {
+
+ lcd_implementation_mark_as_selected(row, invert);
+
+ char c;
+ int8_t n = LCD_WIDTH - (START_COL);
+
+ if (center && !valstr) {
+ int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2;
+ while (--pad >= 0) { lcd_print(' '); n--; }
+ }
+ while (n > 0 && (c = pgm_read_byte(pstr))) {
+ n -= lcd_print(c);
+ pstr++;
+ }
+ if (valstr) while (n > 0 && (c = *valstr)) {
+ n -= lcd_print(c);
+ valstr++;
+ }
+ while (n-- > 0) lcd_print(' ');
+ }
+
+#endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
+
static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
+ UNUSED(pre_char);
+
char c;
- uint8_t n = LCD_WIDTH - 2;
+ uint8_t n = LCD_WIDTH - (START_COL) - 2;
lcd_implementation_mark_as_selected(row, isSelected);
@@ -480,7 +530,7 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co
static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
char c;
uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
- uint8_t n = LCD_WIDTH - 2 - vallen;
+ uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen;
lcd_implementation_mark_as_selected(row, isSelected);
@@ -500,27 +550,27 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c
#define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
#define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
#define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
//Add version for callback functions
#define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
#define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
#define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
#define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
uint8_t rows = 1;
- uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH;
+ uint8_t lcd_width = LCD_WIDTH - (START_COL), char_width = DOG_CHAR_WIDTH;
uint8_t vallen = lcd_strlen(value);
#if ENABLED(USE_BIG_EDIT_FONT)
@@ -552,8 +602,9 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
#if ENABLED(SDSUPPORT)
static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char* const longFilename, bool isDir) {
+ UNUSED(pstr);
char c;
- uint8_t n = LCD_WIDTH - 1;
+ uint8_t n = LCD_WIDTH - (START_COL) - 1;
if (longFilename[0]) {
filename = longFilename;
@@ -580,4 +631,4 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
-#endif //__DOGM_LCD_IMPLEMENTATION_H
+#endif //__ULTRALCD_IMPL_DOGM_H
diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_impl_HD44780.h
similarity index 90%
rename from Marlin/ultralcd_implementation_hitachi_HD44780.h
rename to Marlin/ultralcd_impl_HD44780.h
index 05afe59a3..ab120c2ca 100644
--- a/Marlin/ultralcd_implementation_hitachi_HD44780.h
+++ b/Marlin/ultralcd_impl_HD44780.h
@@ -20,13 +20,15 @@
*
*/
-#ifndef ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H
-#define ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H
+#ifndef ULTRALCD_IMPL_HD44780_H
+#define ULTRALCD_IMPL_HD44780_H
/**
* Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays.
**/
+#include "duration_t.h"
+
extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array.
////////////////////////////////////
@@ -37,18 +39,6 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt
// via a shift/i2c register.
#if ENABLED(ULTIPANEL)
- // All UltiPanels might have an encoder - so this is always be mapped onto first two bits
- #define BLEN_B 1
- #define BLEN_A 0
-
- #define EN_B (_BV(BLEN_B)) // The two encoder pins are connected through BTN_EN1 and BTN_EN2
- #define EN_A (_BV(BLEN_A))
-
- #if BUTTON_EXISTS(ENC)
- // encoder click is directly connected
- #define BLEN_C 2
- #define EN_C (_BV(BLEN_C))
- #endif
//
// Setup other button mappings of each panel
@@ -78,51 +68,35 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt
#elif ENABLED(LCD_I2C_PANELOLU2)
- #if BUTTON_EXISTS(ENC)
-
- #undef LCD_CLICKED
- #define LCD_CLICKED (buttons&EN_C)
-
- #else // Read through I2C if not directly connected to a pin
+ #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
#define B_MI (PANELOLU2_ENCODER_C< 0
@@ -394,10 +363,6 @@ static void lcd_implementation_init(
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif
- #if ENABLED(SHOW_BOOTSCREEN)
- if (show_bootscreen) bootscreen();
- #endif
-
lcd_set_custom_characters(
#if ENABLED(LCD_PROGRESS_BAR)
progress_bar_set
@@ -452,8 +417,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" )); lcd.print('\x03');
}
- static void bootscreen() {
- show_bootscreen = false;
+ void bootscreen() {
byte top_left[8] = {
B00000,
B00000,
@@ -508,7 +472,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
if (strlen(STRING) <= LCD_WIDTH) { \
lcd.setCursor((LCD_WIDTH - lcd_strlen_P(PSTR(STRING))) / 2, 3); \
lcd_printPGM(PSTR(STRING)); \
- delay(DELAY); \
+ safe_delay(DELAY); \
} \
else { \
lcd_scroll(0, 3, PSTR(STRING), LCD_WIDTH, DELAY); \
@@ -526,7 +490,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
#ifdef STRING_SPLASH_LINE2
CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000);
#else
- delay(2000);
+ safe_delay(2000);
#endif
}
else {
@@ -551,7 +515,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
//
if (LCD_EXTRA_SPACE >= strlen(STRING_SPLASH_LINE2) + 1) {
logo_lines(PSTR(" " STRING_SPLASH_LINE2));
- delay(2000);
+ safe_delay(2000);
}
else {
logo_lines(PSTR(""));
@@ -562,13 +526,30 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
// Show only the Marlin logo
//
logo_lines(PSTR(""));
- delay(2000);
+ safe_delay(2000);
#endif
-
+ lcd_set_custom_characters(
+ #if ENABLED(LCD_PROGRESS_BAR)
+ false
+ #endif
+ );
}
#endif // SHOW_BOOTSCREEN
+void lcd_kill_screen() {
+ lcd.setCursor(0, 0);
+ lcd_print(lcd_status_message);
+ #if LCD_HEIGHT < 4
+ lcd.setCursor(0, 2);
+ #else
+ lcd.setCursor(0, 2);
+ lcd_printPGM(PSTR(MSG_HALTED));
+ lcd.setCursor(0, 3);
+ #endif
+ lcd_printPGM(PSTR(MSG_PLEASE_RESET));
+}
+
FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
if (blink)
lcd_printPGM(pstr);
@@ -638,10 +619,10 @@ static void lcd_implementation_status_screen() {
//
// Hotend 1 or Bed Temperature
//
- #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+ #if HOTENDS > 1 || TEMP_SENSOR_BED != 0
lcd.setCursor(8, 0);
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
lcd.print(LCD_STR_THERMOMETER[0]);
LCD_TEMP_ONLY(thermalManager.degHotend(1), thermalManager.degTargetHotend(1));
#else
@@ -649,7 +630,7 @@ static void lcd_implementation_status_screen() {
LCD_TEMP_ONLY(thermalManager.degBed(), thermalManager.degTargetBed());
#endif
- #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+ #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0
#else // LCD_WIDTH >= 20
@@ -661,15 +642,15 @@ static void lcd_implementation_status_screen() {
//
// Hotend 1 or Bed Temperature
//
- #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+ #if HOTENDS > 1 || TEMP_SENSOR_BED != 0
lcd.setCursor(10, 0);
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
LCD_TEMP(thermalManager.degHotend(1), thermalManager.degTargetHotend(1), LCD_STR_THERMOMETER[0]);
#else
LCD_TEMP(thermalManager.degBed(), thermalManager.degTargetBed(), LCD_STR_BEDTEMP[0]);
#endif
- #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+ #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0
#endif // LCD_WIDTH >= 20
@@ -697,7 +678,7 @@ static void lcd_implementation_status_screen() {
lcd.setCursor(0, 1);
- #if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0
+ #if HOTENDS > 1 && TEMP_SENSOR_BED != 0
// If we both have a 2nd extruder and a heated bed,
// show the heated bed temp on the left,
@@ -717,13 +698,13 @@ static void lcd_implementation_status_screen() {
_draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink);
lcd.print(ftostr4sign(current_position[Y_AXIS]));
- #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+ #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0
#endif // LCD_WIDTH >= 20
lcd.setCursor(LCD_WIDTH - 8, 1);
_draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
- lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
+ lcd.print(ftostr52sp(current_position[Z_AXIS] + 0.00001));
#endif // LCD_HEIGHT > 2
@@ -735,7 +716,7 @@ static void lcd_implementation_status_screen() {
lcd.setCursor(0, 2);
lcd.print(LCD_STR_FEEDRATE[0]);
- lcd.print(itostr3(feedrate_multiplier));
+ lcd.print(itostr3(feedrate_percentage));
lcd.print('%');
#if LCD_WIDTH > 19 && ENABLED(SDSUPPORT)
@@ -753,15 +734,10 @@ static void lcd_implementation_status_screen() {
lcd.setCursor(LCD_WIDTH - 6, 2);
lcd.print(LCD_STR_CLOCK[0]);
- uint16_t time = print_job_timer.duration() / 60;
- if (time != 0) {
- lcd.print(itostr2(time / 60));
- lcd.print(':');
- lcd.print(itostr2(time % 60));
- }
- else {
- lcd_printPGM(PSTR("--:--"));
- }
+ char buffer[10];
+ duration_t elapsed = print_job_timer.duration();
+ elapsed.toDigital(buffer);
+ lcd_print(buffer);
#endif // LCD_HEIGHT > 3
@@ -812,6 +788,30 @@ static void lcd_implementation_status_screen() {
lcd_print(lcd_status_message);
}
+#if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
+
+ static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char *valstr=NULL) {
+ UNUSED(invert);
+ char c;
+ int8_t n = LCD_WIDTH;
+ lcd.setCursor(0, row);
+ if (center && !valstr) {
+ int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2;
+ while (--pad >= 0) { lcd.print(' '); n--; }
+ }
+ while (n > 0 && (c = pgm_read_byte(pstr))) {
+ n -= lcd_print(c);
+ pstr++;
+ }
+ if (valstr) while (n > 0 && (c = *valstr)) {
+ n -= lcd_print(c);
+ valstr++;
+ }
+ while (n-- > 0) lcd.print(' ');
+ }
+
+#endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
+
static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
char c;
uint8_t n = LCD_WIDTH - 2;
@@ -855,22 +855,22 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t
#define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', itostr3(*(data)))
#define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr3(*(data)))
#define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr32(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
//Add version for callback functions
#define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', itostr3(*(data)))
#define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr3(*(data)))
#define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr32(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51(*(data)))
-#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51sign(*(data)))
+#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
#define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
@@ -943,7 +943,7 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
) leds |= LED_C;
#endif // FAN_COUNT > 0
- #if EXTRUDERS > 1
+ #if HOTENDS > 1
if (thermalManager.degTargetHotend(1) > 0) leds |= LED_C;
#endif
@@ -975,4 +975,4 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
#endif // LCD_HAS_SLOW_BUTTONS
-#endif // ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H
+#endif // ULTRALCD_IMPL_HD44780_H
diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h
index 9aa53ceab..7226f55c9 100644
--- a/Marlin/ultralcd_st7920_u8glib_rrd.h
+++ b/Marlin/ultralcd_st7920_u8glib_rrd.h
@@ -27,9 +27,6 @@
#if ENABLED(U8GLIB_ST7920)
-//set optimization so ARDUINO optimizes this file
-#pragma GCC optimize (3)
-
#define ST7920_CLK_PIN LCD_PINS_D4
#define ST7920_DAT_PIN LCD_PINS_ENABLE
#define ST7920_CS_PIN LCD_PINS_RS
@@ -43,20 +40,70 @@
#include
+//set optimization so ARDUINO optimizes this file
+#pragma GCC optimize (3)
+
+#define DELAY_0_NOP NOOP
+#define DELAY_1_NOP __asm__("nop\n\t")
+#define DELAY_2_NOP __asm__("nop\n\t" "nop\n\t")
+#define DELAY_3_NOP __asm__("nop\n\t" "nop\n\t" "nop\n\t")
+#define DELAY_4_NOP __asm__("nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t")
+
+
+// If you want you can define your own set of delays in Configuration.h
+//#define ST7920_DELAY_1 DELAY_0_NOP
+//#define ST7920_DELAY_2 DELAY_0_NOP
+//#define ST7920_DELAY_3 DELAY_0_NOP
+
+#if F_CPU >= 20000000
+ #define CPU_ST7920_DELAY_1 DELAY_0_NOP
+ #define CPU_ST7920_DELAY_2 DELAY_0_NOP
+ #define CPU_ST7920_DELAY_3 DELAY_1_NOP
+#elif (MOTHERBOARD == BOARD_3DRAG) || (MOTHERBOARD == BOARD_K8200) || (MOTHERBOARD == BOARD_K8400)
+ #define CPU_ST7920_DELAY_1 DELAY_0_NOP
+ #define CPU_ST7920_DELAY_2 DELAY_3_NOP
+ #define CPU_ST7920_DELAY_3 DELAY_0_NOP
+#elif (MOTHERBOARD == BOARD_MINIRAMBO)
+ #define CPU_ST7920_DELAY_1 DELAY_0_NOP
+ #define CPU_ST7920_DELAY_2 DELAY_4_NOP
+ #define CPU_ST7920_DELAY_3 DELAY_0_NOP
+#elif (MOTHERBOARD == BOARD_RAMBO)
+ #define CPU_ST7920_DELAY_1 DELAY_0_NOP
+ #define CPU_ST7920_DELAY_2 DELAY_0_NOP
+ #define CPU_ST7920_DELAY_3 DELAY_0_NOP
+#elif F_CPU == 16000000
+ #define CPU_ST7920_DELAY_1 DELAY_0_NOP
+ #define CPU_ST7920_DELAY_2 DELAY_0_NOP
+ #define CPU_ST7920_DELAY_3 DELAY_1_NOP
+#else
+ #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd.h'"
+#endif
+
+#ifndef ST7920_DELAY_1
+ #define ST7920_DELAY_1 CPU_ST7920_DELAY_1
+#endif
+#ifndef ST7920_DELAY_2
+ #define ST7920_DELAY_2 CPU_ST7920_DELAY_2
+#endif
+#ifndef ST7920_DELAY_3
+ #define ST7920_DELAY_3 CPU_ST7920_DELAY_3
+#endif
+
+#define ST7920_SND_BIT \
+ WRITE(ST7920_CLK_PIN, LOW); ST7920_DELAY_1; \
+ WRITE(ST7920_DAT_PIN, val & 0x80); ST7920_DELAY_2; \
+ WRITE(ST7920_CLK_PIN, HIGH); ST7920_DELAY_3; \
+ val <<= 1
+
static void ST7920_SWSPI_SND_8BIT(uint8_t val) {
- uint8_t i;
- for (i = 0; i < 8; i++) {
- WRITE(ST7920_CLK_PIN,0);
- #if F_CPU == 20000000
- __asm__("nop\n\t");
- #endif
- WRITE(ST7920_DAT_PIN,val&0x80);
- val<<=1;
- WRITE(ST7920_CLK_PIN,1);
- #if F_CPU == 20000000
- __asm__("nop\n\t""nop\n\t");
- #endif
- }
+ ST7920_SND_BIT; // 1
+ ST7920_SND_BIT; // 2
+ ST7920_SND_BIT; // 3
+ ST7920_SND_BIT; // 4
+ ST7920_SND_BIT; // 5
+ ST7920_SND_BIT; // 6
+ ST7920_SND_BIT; // 7
+ ST7920_SND_BIT; // 8
}
#define ST7920_CS() {WRITE(ST7920_CS_PIN,1);u8g_10MicroDelay();}
@@ -135,9 +182,10 @@ u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g
class U8GLIB_ST7920_128X64_RRD : public U8GLIB {
public:
- U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) {}
+ U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) { UNUSED(dummy); }
};
+#pragma GCC reset_options
#endif //U8GLIB_ST7920
#endif //ULCDST7920_H
diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h
index ae599af6b..bba85e180 100644
--- a/Marlin/utf_mapper.h
+++ b/Marlin/utf_mapper.h
@@ -38,6 +38,8 @@
#define MAPPER_ONE_TO_ONE
#elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
#define MAPPER_ONE_TO_ONE
+ #elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK)
+ #define MAPPER_ONE_TO_ONE
#endif
#else // SIMULATE_ROMFONT
#if DISPLAY_CHARSET_HD44780 == JAPANESE
@@ -144,26 +146,50 @@
#endif // DISPLAY_CHARSET_HD44780
#endif // SIMULATE_ROMFONT
-#if ENABLED(MAPPER_NON)
+#if ENABLED(MAPPER_C2C3)
char charset_mapper(char c) {
- HARDWARE_CHAR_OUT( c );
+ static uint8_t utf_hi_char; // UTF-8 high part
+ static bool seen_c2 = false;
+ uint8_t d = c;
+ if ( d >= 0x80u ) { // UTF-8 handling
+ if ( (d >= 0xc0u) && (!seen_c2) ) {
+ utf_hi_char = d - 0xc2u;
+ seen_c2 = true;
+ return 0;
+ }
+ else if (seen_c2) {
+ d &= 0x3fu;
+ #ifndef MAPPER_ONE_TO_ONE
+ HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
+ #else
+ HARDWARE_CHAR_OUT((char)(0x80u + (utf_hi_char << 6) + d)) ;
+ #endif
+ }
+ else {
+ HARDWARE_CHAR_OUT('?');
+ }
+ }
+ else {
+ HARDWARE_CHAR_OUT((char) c );
+ }
+ seen_c2 = false;
return 1;
}
-#elif ENABLED(MAPPER_C2C3)
+#elif ENABLED(MAPPER_CECF)
char charset_mapper(char c) {
static uint8_t utf_hi_char; // UTF-8 high part
- static bool seen_c2 = false;
+ static bool seen_ce = false;
uint8_t d = c;
if ( d >= 0x80 ) { // UTF-8 handling
- if ( (d >= 0xc0) && (!seen_c2) ) {
- utf_hi_char = d - 0xc2;
- seen_c2 = true;
+ if ( (d >= 0xc0) && (!seen_ce) ) {
+ utf_hi_char = d - 0xce;
+ seen_ce = true;
return 0;
}
- else if (seen_c2) {
+ else if (seen_ce) {
d &= 0x3f;
#ifndef MAPPER_ONE_TO_ONE
HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
@@ -178,7 +204,38 @@
else {
HARDWARE_CHAR_OUT((char) c );
}
- seen_c2 = false;
+ seen_ce = false;
+ return 1;
+ }
+
+#elif ENABLED(MAPPER_CECF)
+
+ char charset_mapper(char c) {
+ static uint8_t utf_hi_char; // UTF-8 high part
+ static bool seen_ce = false;
+ uint8_t d = c;
+ if ( d >= 0x80 ) { // UTF-8 handling
+ if ( (d >= 0xc0) && (!seen_ce) ) {
+ utf_hi_char = d - 0xce;
+ seen_ce = true;
+ return 0;
+ }
+ else if (seen_ce) {
+ d &= 0x3f;
+ #ifndef MAPPER_ONE_TO_ONE
+ HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
+ #else
+ HARDWARE_CHAR_OUT((char)(0x80 + (utf_hi_char << 6) + d)) ;
+ #endif
+ }
+ else {
+ HARDWARE_CHAR_OUT('?');
+ }
+ }
+ else {
+ HARDWARE_CHAR_OUT((char) c );
+ }
+ seen_ce = false;
return 1;
}
@@ -289,8 +346,13 @@
#else
- #error "You have to define one of the DISPLAY_INPUT_CODE_MAPPERs in your language_xx.h file" // should not occur because (en) will set.
+ #define MAPPER_NON
+
+ char charset_mapper(char c) {
+ HARDWARE_CHAR_OUT( c );
+ return 1;
+ }
-#endif // code mappers
+ #endif // code mappers
#endif // UTF_MAPPER_H
diff --git a/Marlin/utility.cpp b/Marlin/utility.cpp
new file mode 100644
index 000000000..0285219c4
--- /dev/null
+++ b/Marlin/utility.cpp
@@ -0,0 +1,34 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include "Marlin.h"
+#include "utility.h"
+#include "temperature.h"
+
+void safe_delay(millis_t ms) {
+ while (ms > 50) {
+ ms -= 50;
+ delay(50);
+ thermalManager.manage_heater();
+ }
+ delay(ms);
+}
diff --git a/Marlin/pins_RAMPS_13_EFB.h b/Marlin/utility.h
similarity index 85%
rename from Marlin/pins_RAMPS_13_EFB.h
rename to Marlin/utility.h
index e0bea37e7..8ca70dbf8 100644
--- a/Marlin/pins_RAMPS_13_EFB.h
+++ b/Marlin/utility.h
@@ -20,12 +20,9 @@
*
*/
-/**
- * Arduino Mega with RAMPS v1.3 pin assignments
- *
- * RAMPS_13_EFB (Extruder, Fan, Bed)
- */
+#ifndef __UTILITY_H__
+#define __UTILITY_H__
-#define IS_RAMPS_13
+void safe_delay(millis_t ms);
-#include "pins_RAMPS_14_EFB.h"
+#endif
diff --git a/README.md b/README.md
index d9341bc59..112b0eadc 100644
--- a/README.md
+++ b/README.md
@@ -5,28 +5,49 @@
-Additional documentation can be found in [The Marlin Wiki](https://github.com/MarlinFirmware/Marlin/wiki).
+Additional documentation can be found at [The Marlin Documentation Project](https://www.marlinfw.org/).
Please test this firmware and inform us if it misbehaves in any way, volunteers are standing by!
-## Release Candidate -- Marlin 1.1.0-RCBugFix - 27 April 2016
+## Release Candidate -- Marlin 1.1.0-RCBugFix - 26 July 2016
__Not for production use – use with caution!__
You can download earlier versions of Marlin on the [Releases page](https://github.com/MarlinFirmware/Marlin/releases). (The latest "stable" release of Marlin is 1.0.2-1.)
-You'll always find the latest Release Candidate in the ["RC" branch](https://github.com/MarlinFirmware/Marlin/tree/RC). Bugs that we find in the current Release Candidate are patched in the ["RCBugFix" branch](https://github.com/MarlinFirmware/Marlin/tree/RC), so during beta testing this is where you can always find the latest code on its way towards release.
-
-Future development (Marlin 1.2 and beyond) takes place in the [MarlinDev repository](https://github.com/MarlinFirmware/MarlinDev/).
+The latest Release Candidate lives in the ["RC" branch](https://github.com/MarlinFirmware/Marlin/tree/RC). Bugs that we find in the current Release Candidate are patched in the ["RCBugFix" branch](https://github.com/MarlinFirmware/Marlin/tree/RCBugFix), so during beta testing this is where you can always find the latest code on its way towards release.
## Recent Changes
- RCBugFix
+- RC7 - 26 Jul 2016
+ - Add Print Job Timer and Print Counter (`PRINTCOUNTER`)
+ - New `M600` Filament Change (`FILAMENT_CHANGE_FEATURE`)
+ - New `G12` Nozzle Clean (`NOZZLE_CLEAN_FEATURE`)
+ - New `G27` Nozzle Park (`NOZZLE_PARK_FEATURE`)
+ - Add support for `COREYZ`
+ - Add a new Advance Extrusion algorithm (`LIN_ADVANCE`)
+ - Add support for inches, Fahrenheit, Kelvin units (`INCH_MODE_SUPPORT`, `TEMPERATURE_UNITS_SUPPORT`)
+ - Better handling of `G92` shifting of the coordinate space
+ - Add Greek and Croatian languages
+ - Improve the Manual (Mesh) Bed Leveling user interface
+ - Add support for more boards, controllers, and probes:
+ - Vellemann K8400 (`BOARD_K8400`)
+ - RigidBot V2 (`BOARD_RIGIDBOARD_V2`)
+ - Cartesio UI (`BOARD_CNCONTROLS_12`)
+ - BLTouch probe sensor (`BLTOUCH`)
+ - Viki 2 with RAMPS and MKS boards
+ - Improve support for `DELTA` and other kinematics
+ - Improve thermal management, add `WATCH_BED_TEMP_PERIOD`
+ - Better handling of toolchange, multiple tools
+ - Add support for two X steppers `X_DUAL_STEPPER_DRIVERS`
+ - Add support for `SINGLENOZZLE`, `MIXING_EXTRUDER`, and `SWITCHING_EXTRUDER`
+ - Simplified probe configuration, allow usage without bed leveling
+ - And much more… See the [1.1.0-RC7 Change Log](https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC7) for the complete list of changes.
+
- RC6 - 24 Apr 2016
- - Completed support for CoreXY / CoreXZ in planner
- - Changes to positioning behavior
- - Various issues fixed. More details pending.
- - Throw error if compiling with older versions (<1.60) of Arduino due to serious problems with outdated Arduino versions
- - Please upgrade your IDE at least to Arduino 1.6.0. Thanks.
+ - Marlin now requires Arduino version 1.6.0 or later
+ - Completed support for CoreXY / CoreXZ
+ - See the [1.1.0-RC6 Change Log](https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC6) for all the changes.
- RC5 - 01 Apr 2016
- Warn if compiling with older versions (<1.50) of Arduino
@@ -39,7 +60,7 @@ Future development (Marlin 1.2 and beyond) takes place in the [MarlinDev reposit
- Rename FILAMENT_SENSOR to FILAMENT_WIDTH_SENSOR
- Fix SD card bugs
- and a lot more
- - see https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC5 for details
+ - See the [1.1.0-RC5 Change Log](https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC5) for more!
- RC4 - 24 Mar 2016
- Many lingering bugs and nagging issues addressed
diff --git a/buildroot/bin/opt_disable b/buildroot/bin/opt_disable
index 4e2d853fb..35ad1aad4 100755
--- a/buildroot/bin/opt_disable
+++ b/buildroot/bin/opt_disable
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
for opt in "$@" ; do
- eval "sed -i 's/\(\/\/ *\)*\(\#define +$opt[^a-zA-Z0-9_]\)/\/\/\2/g' Marlin/Configuration.h"
+ eval "sed -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration.h"
done
diff --git a/buildroot/bin/opt_disable_adv b/buildroot/bin/opt_disable_adv
new file mode 100644
index 000000000..80d83183e
--- /dev/null
+++ b/buildroot/bin/opt_disable_adv
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+for opt in "$@" ; do
+ eval "sed -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h"
+done
diff --git a/buildroot/bin/opt_enable b/buildroot/bin/opt_enable
index cc9a3e007..7b119fa15 100755
--- a/buildroot/bin/opt_enable
+++ b/buildroot/bin/opt_enable
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
for opt in "$@" ; do
- eval "sed -i 's/\/\/ *\(#define +$opt[^a-zA-Z0-9_]\)/\1/g' Marlin/Configuration.h"
+ eval "sed -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration.h"
done
diff --git a/buildroot/bin/opt_enable_adv b/buildroot/bin/opt_enable_adv
index a557dc3f7..a34e56f12 100755
--- a/buildroot/bin/opt_enable_adv
+++ b/buildroot/bin/opt_enable_adv
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
for opt in "$@" ; do
- eval "sed -i 's/\/\/ *\(#define +$opt[^a-zA-Z0-9_]\)/\1/g' Marlin/Configuration_adv.h"
+ eval "sed -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration_adv.h"
done
diff --git a/buildroot/bin/opt_set b/buildroot/bin/opt_set
index 2646bc103..cf8c0d850 100755
--- a/buildroot/bin/opt_set
+++ b/buildroot/bin/opt_set
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
-eval "sed -i 's/\(#define +$1 +\)[^ ]*$/\1 $2/g' Marlin/Configuration.h"
+eval "sed -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration.h"
diff --git a/buildroot/bin/opt_set_adv b/buildroot/bin/opt_set_adv
index 63a18d436..54076a0bc 100755
--- a/buildroot/bin/opt_set_adv
+++ b/buildroot/bin/opt_set_adv
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
-eval "sed -i 's/\(#define +$1 +\)[^ ]*$/\1 $2/g' Marlin/Configuration_adv.h"
+eval "sed -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration_adv.h"
diff --git a/buildroot/bin/pins_set b/buildroot/bin/pins_set
index bd14586be..ae6549fb3 100755
--- a/buildroot/bin/pins_set
+++ b/buildroot/bin/pins_set
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
-eval "sed -i 's/\(#define +$2 +\)[^ ]*$/\1 $3/g' Marlin/pins_$1.h"
+eval "sed -i 's/\(#define \b${2}\b\).*$/\1 ${3}/g' Marlin/pins_${1}.h"
diff --git a/buildroot/bin/restore_configs b/buildroot/bin/restore_configs
index ca77e556a..ba7a72cd8 100755
--- a/buildroot/bin/restore_configs
+++ b/buildroot/bin/restore_configs
@@ -3,3 +3,7 @@
cp Marlin/Configuration.h.backup Marlin/Configuration.h
cp Marlin/Configuration_adv.h.backup Marlin/Configuration_adv.h
cp Marlin/pins_RAMPS_14.h.backup Marlin/pins_RAMPS_14.h
+
+if [ -f Marlin/_Bootscreen.h ]; then
+ rm Marlin/_Bootscreen.h
+fi
diff --git a/buildroot/bin/use_example_configs b/buildroot/bin/use_example_configs
index d1e6e468f..9f55c52e1 100755
--- a/buildroot/bin/use_example_configs
+++ b/buildroot/bin/use_example_configs
@@ -1,3 +1,7 @@
#!/usr/bin/env bash
-eval "cp Marlin/example_configurations/$1/Configuration* Marlin/"
+eval "cp Marlin/example_configurations/${1}/Configuration* Marlin/"
+
+if [ -f "Marlin/example_configurations/${1}/_Bootscreen.h" ]; then
+ cp "Marlin/example_configurations/${1}/_Bootscreen.h" Marlin/
+fi
diff --git a/Marlin/fonts/HD44780_C.fon b/buildroot/share/fonts/HD44780_C.fon
similarity index 100%
rename from Marlin/fonts/HD44780_C.fon
rename to buildroot/share/fonts/HD44780_C.fon
diff --git a/Marlin/fonts/HD44780_J.fon b/buildroot/share/fonts/HD44780_J.fon
similarity index 100%
rename from Marlin/fonts/HD44780_J.fon
rename to buildroot/share/fonts/HD44780_J.fon
diff --git a/Marlin/fonts/HD44780_W.fon b/buildroot/share/fonts/HD44780_W.fon
similarity index 100%
rename from Marlin/fonts/HD44780_W.fon
rename to buildroot/share/fonts/HD44780_W.fon
diff --git a/Marlin/fonts/ISO10646-1.fon b/buildroot/share/fonts/ISO10646-1.fon
similarity index 100%
rename from Marlin/fonts/ISO10646-1.fon
rename to buildroot/share/fonts/ISO10646-1.fon
diff --git a/buildroot/share/fonts/ISO10646-4_Greek.fon b/buildroot/share/fonts/ISO10646-4_Greek.fon
new file mode 100644
index 000000000..021078e00
Binary files /dev/null and b/buildroot/share/fonts/ISO10646-4_Greek.fon differ
diff --git a/Marlin/fonts/ISO10646-5_Cyrillic.fon b/buildroot/share/fonts/ISO10646-5_Cyrillic.fon
similarity index 100%
rename from Marlin/fonts/ISO10646-5_Cyrillic.fon
rename to buildroot/share/fonts/ISO10646-5_Cyrillic.fon
diff --git a/Marlin/fonts/ISO10646_CN.fon b/buildroot/share/fonts/ISO10646_CN.fon
similarity index 100%
rename from Marlin/fonts/ISO10646_CN.fon
rename to buildroot/share/fonts/ISO10646_CN.fon
diff --git a/Marlin/fonts/ISO10646_Kana.fon b/buildroot/share/fonts/ISO10646_Kana.fon
similarity index 100%
rename from Marlin/fonts/ISO10646_Kana.fon
rename to buildroot/share/fonts/ISO10646_Kana.fon
diff --git a/Marlin/fonts/Marlin_symbols.fon b/buildroot/share/fonts/Marlin_symbols.fon
similarity index 100%
rename from Marlin/fonts/Marlin_symbols.fon
rename to buildroot/share/fonts/Marlin_symbols.fon
diff --git a/buildroot/share/fonts/README.md b/buildroot/share/fonts/README.md
new file mode 100644
index 000000000..ee9d8e00b
--- /dev/null
+++ b/buildroot/share/fonts/README.md
@@ -0,0 +1,23 @@
+# Marlin fonts
+
+
+## Author and license
+The original author of the following font files is [A. Hardtung](https://github.com/AnHardt).
+
+Any copyright is dedicated to the Public Domain.
+http://creativecommons.org/publicdomain/zero/1.0/
+
+ - HD44780_C.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a))
+ - HD44780_J.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a))
+ - HD44780_W.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a))
+ - ISO10646-1.fon ([be79235](https://github.com/MarlinFirmware/Marlin/commit/be79235ef255a5c42fd385820447ec351f23b9b1))
+ - ISO10646_5_Cyrillic.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a))
+ - ISO10646_CN.fon ([6b1b718](https://github.com/MarlinFirmware/Marlin/commit/6b1b71837c98ceab55db7433357a13cd829d1ede))
+ - ISO10646_Kana.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a))
+ - Marlin_symbols.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a))
+
+Additional changes to the original font files being distritubted with Marlin are copyrighted under the terms of the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt) license.
+
+
+## Documentation
+For detailed information about [adding new fonts](http://www.marlinfw.org/docs/development/fonts.html) to Marlin visit our documentation website.
diff --git a/Marlin/fonts/make_fonts.bat b/buildroot/share/fonts/make_fonts.bat
similarity index 87%
rename from Marlin/fonts/make_fonts.bat
rename to buildroot/share/fonts/make_fonts.bat
index 5ab975bf4..c4df633e4 100644
--- a/Marlin/fonts/make_fonts.bat
+++ b/buildroot/share/fonts/make_fonts.bat
@@ -6,3 +6,4 @@
.\bdf2u8g.exe -b 32 -e 255 ISO10646_5_Cyrillic.bdf ISO10646_5_Cyrillic_5x7 dogm_font_data_ISO10646_5_Cyrillic.h
.\bdf2u8g.exe -b 32 -e 255 ISO10646_Kana.bdf ISO10646_Kana_5x7 dogm_font_data_ISO10646_Kana.h
.\bdf2u8g.exe -b 32 -e 255 ISO10646_CN.bdf ISO10646_CN dogm_font_data_ISO10646_CN.h
+.\bdf2u8g.exe -b 32 -e 255 ISO10646_4_Greek.bdf ISO10646_Greek_5x7 dogm_font_data_ISO10646_Greek.h
diff --git a/buildroot/share/git/ghtp b/buildroot/share/git/ghtp
new file mode 100755
index 000000000..83f461ef1
--- /dev/null
+++ b/buildroot/share/git/ghtp
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+#
+# ghtp (GitHub Transport Protocol)
+#
+# Set all remotes in the current repo to HTTPS or SSH connection.
+# Useful when switching environments, using public wifi, etc.
+#
+
+GH_SSH="git@github\.com:"
+GH_HTTPS="https:\/\/github\.com\/"
+
+case "$1" in
+ -[Hh]) TYPE=HTTPS ; MATCH="git@" ; FORMULA="$GH_SSH/$GH_HTTPS" ;;
+ -[Ss]) TYPE=SSH ; MATCH="https:" ; FORMULA="$GH_HTTPS/$GH_SSH" ;;
+ *)
+ echo "Usage: `basename $0` -h | -s" 1>&2
+ echo -e " \e[0;92m-h\e[0m to switch to HTTPS" 1>&2
+ echo -e " \e[0;92m-s\e[0m to switch to SSH" 1>&2
+ exit 1
+ ;;
+esac
+
+REMOTES=$(git remote -v | egrep "\t$MATCH" | gawk '{print $1 " " $2}' | sort -u | sed "s/$FORMULA/")
+
+if [[ -z $REMOTES ]]; then
+ echo "Nothing to do." ; exit
+fi
+
+echo "$REMOTES" | xargs -n2 git remote set-url
+
+echo -n "Remotes set to $TYPE: "
+echo "$REMOTES" | gawk '{printf "%s ", $1}'
+echo
diff --git a/buildroot/share/git/mfinit b/buildroot/share/git/mfinit
new file mode 100755
index 000000000..5e2cbc0d8
--- /dev/null
+++ b/buildroot/share/git/mfinit
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+#
+# mfinit
+#
+# Create the upstream repository for Marlin
+#
+
+git remote add upstream git@github.com:MarlinFirmware/Marlin.git
diff --git a/buildroot/share/scripts/createTemperatureLookupMarlin.py b/buildroot/share/scripts/createTemperatureLookupMarlin.py
index 3a3ed91a3..9859caaaa 100755
--- a/buildroot/share/scripts/createTemperatureLookupMarlin.py
+++ b/buildroot/share/scripts/createTemperatureLookupMarlin.py
@@ -5,7 +5,7 @@ Generates lookup to temperature values for use in a microcontroller in C format
http://en.wikipedia.org/wiki/Steinhart-Hart_equation
The main use is for Arduino programs that read data from the circuit board described here:
-http://make.rrrf.org/ts-1.0
+http://reprap.org/wiki/Temperature_Sensor_v2.0
Usage: python createTemperatureLookup.py [options]